cleaned all trailing white space from source files.
authorRejean Loyer <redj@ecere.com>
Wed, 16 Oct 2013 05:05:43 +0000 (01:05 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 30 Oct 2013 06:58:42 +0000 (02:58 -0400)
338 files changed:
compiler/ecc/ecc.ec
compiler/ecp/ecp.ec
compiler/ecs/ecs.ec
compiler/libec/src/ast.ec
compiler/libec/src/copy.ec
compiler/libec/src/dbpass.ec
compiler/libec/src/ecdefs.ec
compiler/libec/src/expression.ec
compiler/libec/src/firstPass.ec
compiler/libec/src/freeAst.ec
compiler/libec/src/grammar.ec
compiler/libec/src/lexer.ec
compiler/libec/src/loadSymbols.ec
compiler/libec/src/output.ec
compiler/libec/src/pass0.ec
compiler/libec/src/pass1.ec
compiler/libec/src/pass15.ec
compiler/libec/src/pass16.ec
compiler/libec/src/pass2.ec
compiler/libec/src/pass3.ec
compiler/libec/src/shortcuts.ec
compiler/libec/src/type.ec
documentor/src/Documentor.ec
documentor/src/SettingsDialog.ec
ear/cmd/ear.ec
ear/extract/extract.ec
ecere/src/com/BTNode.ec
ecere/src/com/BinaryTree.ec
ecere/src/com/OldList.ec
ecere/src/com/String.ec
ecere/src/com/containers/Array.ec
ecere/src/com/containers/BuiltInContainer.ec
ecere/src/com/containers/Container.ec
ecere/src/com/containers/CustomAVLTree.ec
ecere/src/com/containers/LinkList.ec
ecere/src/com/containers/List.ec
ecere/src/com/containers/Map.ec
ecere/src/com/dataTypes.ec
ecere/src/com/instance.c
ecere/src/com/instance.ec
ecere/src/gfx/3D/Camera.ec
ecere/src/gfx/3D/Matrix.ec
ecere/src/gfx/3D/Mesh.ec
ecere/src/gfx/3D/Object.ec
ecere/src/gfx/3D/Plane.ec
ecere/src/gfx/3D/Quaternion.ec
ecere/src/gfx/3D/Vector3D.ec
ecere/src/gfx/3D/meshes/Cube.ec
ecere/src/gfx/3D/meshes/SkyBox.ec
ecere/src/gfx/3D/meshes/Sphere.ec
ecere/src/gfx/3D/models/Object3DSFormat.ec
ecere/src/gfx/Bitmap.ec
ecere/src/gfx/BitmapResource.ec
ecere/src/gfx/Color.ec
ecere/src/gfx/Display.ec
ecere/src/gfx/DisplaySystem.ec
ecere/src/gfx/Surface.ec
ecere/src/gfx/bitmaps/BMPFormat.ec
ecere/src/gfx/bitmaps/GIFFormat.ec
ecere/src/gfx/bitmaps/JPEGFormat.ec
ecere/src/gfx/bitmaps/PCXFormat.ec
ecere/src/gfx/bitmaps/PNGFormat.ec
ecere/src/gfx/drivers/CocoaOpenGLDisplayDriver.ec
ecere/src/gfx/drivers/Direct3D8DisplayDriver.ec
ecere/src/gfx/drivers/Direct3D9DisplayDriver.ec
ecere/src/gfx/drivers/DirectDrawDisplayDriver.ec
ecere/src/gfx/drivers/GDIDisplayDriver.ec
ecere/src/gfx/drivers/LFBDisplayDriver.ec
ecere/src/gfx/drivers/NCursesDisplayDriver.ec
ecere/src/gfx/drivers/OpenGLDisplayDriver.ec
ecere/src/gfx/drivers/Win32BitmapPrinterDisplayDriver.ec
ecere/src/gfx/drivers/Win32ConsoleDisplayDriver.ec
ecere/src/gfx/drivers/Win32PrinterDisplayDriver.ec
ecere/src/gfx/drivers/XDisplayDriver.ec
ecere/src/gfx/drivers/lfbBlit.ec
ecere/src/gfx/drivers/lfbConvert.ec
ecere/src/gui/Anchor.ec
ecere/src/gui/Desktop3D.ec
ecere/src/gui/FormDesigner.ec
ecere/src/gui/GuiApplication.ec
ecere/src/gui/Interface.ec
ecere/src/gui/Key.ec
ecere/src/gui/Window.ec
ecere/src/gui/controls/Button.ec
ecere/src/gui/controls/CalendarControl.ec
ecere/src/gui/controls/DataBox.ec
ecere/src/gui/controls/DropBox.ec
ecere/src/gui/controls/EditBox.ec
ecere/src/gui/controls/Label.ec
ecere/src/gui/controls/ListBox.ec
ecere/src/gui/controls/Menu.ec
ecere/src/gui/controls/PaneSplitter.ec
ecere/src/gui/controls/PathBox.ec
ecere/src/gui/controls/Picture.ec
ecere/src/gui/controls/ProgressBar.ec
ecere/src/gui/controls/ScrollBar.ec
ecere/src/gui/controls/SelectorBar.ec
ecere/src/gui/controls/StatusBar.ec
ecere/src/gui/controls/TabControl.ec
ecere/src/gui/controls/ToolTip.ec
ecere/src/gui/dialogs/ColorPicker.ec
ecere/src/gui/dialogs/FileDialog.ec
ecere/src/gui/dialogs/FindDialog.ec
ecere/src/gui/dialogs/GoToDialog.ec
ecere/src/gui/dialogs/MessageBox.ec
ecere/src/gui/dialogs/ReplaceDialog.ec
ecere/src/gui/dialogs/WindowList.ec
ecere/src/gui/drivers/AndroidInterface.ec
ecere/src/gui/drivers/NCursesInterface.ec
ecere/src/gui/drivers/Win32ConsoleInterface.ec
ecere/src/gui/drivers/Win32Interface.ec
ecere/src/gui/drivers/XInterface.ec
ecere/src/gui/drivers/cocoa/CocoaEcereBridge.m
ecere/src/gui/drivers/cocoa/CocoaInterface.ec
ecere/src/gui/drivers/cocoa/EcereView.h
ecere/src/gui/drivers/cocoa/EcereView.m
ecere/src/gui/skins/AquaSkin.ec
ecere/src/gui/skins/TVisionSkin.ec
ecere/src/gui/skins/WindowsSkin.ec
ecere/src/gui/typeEdit.ec
ecere/src/net/HTTPFile.ec
ecere/src/net/NetworkClientFile.ec
ecere/src/net/SSLSocket.ec
ecere/src/net/Service.ec
ecere/src/net/Socket.ec
ecere/src/net/dcom.ec
ecere/src/net/network.ec
ecere/src/sys/BufferedFile.ec
ecere/src/sys/Date.ec
ecere/src/sys/DualPipe.c
ecere/src/sys/DualPipe.ec
ecere/src/sys/EARArchive.ec
ecere/src/sys/File.c
ecere/src/sys/File.ec
ecere/src/sys/FileMonitor.ec
ecere/src/sys/GlobalAppSettings.ec
ecere/src/sys/JSON.ec
ecere/src/sys/Semaphore.ec
ecere/src/sys/System.c
ecere/src/sys/System.ec
ecere/src/sys/TempFile.ec
ecere/src/sys/Thread.ec
ecere/src/sys/Time.ec
ecere/src/sys/i18n.ec
ecere/src/sys/memory.ec
ecere/src/sys/unicode.ec
ecere/src/sys/units.ec
eda/drivers/MySQL.ec
eda/drivers/PostgreSQL.ec
eda/drivers/oracle/EDAOracle.ec
eda/drivers/sqlite/EDASQLite.ec
eda/drivers/sqliteCipher/EDASQLiteCipher.ec
eda/libeda/src/EDA.ec
eda/libeda/src/EDB.ec
eda/libeda/src/MemoryEDB.ec
eda/libeda/src/ers.ec
eda/libeda/src/gui.ec
eda/libeda/src/gui/TableEditor.ec
eda/libeda/src/gui/controls/FieldBox.ec
eda/libeda/src/idList.ec
epj2make/epj2make.ec
extras/CSVDataParser.ec
extras/EnvironmentVariables.ec
extras/FileSystemIterator.ec
extras/Regex.ec
extras/SMTPSocket.ec
extras/XMLParser.ec
extras/audio/alsa.ec
extras/audio/dsound.ec
extras/audio/mixer.ec
extras/base64.ec
extras/fli.ec
extras/fliPlay.ec
extras/gui/IconBag.ec
extras/gui/RoundedSquare.ec
extras/gui/controls/CheckListBox.ec
extras/gui/controls/StringsBox.ec
extras/gui/skins/SimSkin.ec
extras/html/HTMLView.ec
extras/html/htmlParser.ec
extras/html/lines.ec
extras/html/tables.ec
extras/md5.ec
extras/sha256.ec
extras/tiles/astar.ec
extras/tiles/sequence.ec
extras/tiles/sprite.ec
extras/tiles/tiles.ec
extras/timeTools.ec
extras/types/CountryCode.ec
extras/types/Currency.ec
extras/wia.ec
ide/src/IDESettings.ec
ide/src/OldIDESettings.ec
ide/src/ProjectSettings.ec
ide/src/about.ec
ide/src/debugger/Debugger.ec
ide/src/debugger/GDBDialog.ec
ide/src/debugger/debugFindCtx.ec
ide/src/debugger/debugTools.ec
ide/src/debugger/process.ec
ide/src/designer/CodeEditor.ec
ide/src/designer/CodeObject.ec
ide/src/designer/Designer.ec
ide/src/designer/Sheet.ec
ide/src/designer/ToolBox.ec
ide/src/designer/findCtx.ec
ide/src/designer/findExp.ec
ide/src/designer/findParams.ec
ide/src/dialogs/ActiveCompilerDialog.ec
ide/src/dialogs/CompilersDetectionDialog.ec
ide/src/dialogs/FindInFilesDialog.ec
ide/src/dialogs/GlobalSettingsDialog.ec
ide/src/dialogs/NewProjectDialog.ec
ide/src/dialogs/NodeProperties.ec
ide/src/dialogs/ProjectActiveConfig.ec
ide/src/dialogs/ProjectTabSettings.ec
ide/src/documents/ModelView.ec
ide/src/documents/PictureEdit.ec
ide/src/ide.ec
ide/src/panels/BreakpointsView.ec
ide/src/panels/CallStackView.ec
ide/src/panels/OutputView.ec
ide/src/panels/ThreadsView.ec
ide/src/panels/WatchesView.ec
ide/src/project/Project.ec
ide/src/project/ProjectConfig.ec
ide/src/project/ProjectNode.ec
ide/src/project/ProjectView.ec
ide/src/project/Workspace.ec
ide/src/project/vsSupport.ec
installer/coursework/Chapter 3 - Operators/Lab3/lab3.ec
installer/coursework/Chapter 4 - Flow Control/Lab4/lab4.ec
installer/coursework/Chapter 5 - Structures and Enumerations/Lab5/colors/lab5colors.ec
installer/coursework/Chapter 5 - Structures and Enumerations/Lab5/vectors/lab5vectors.ec
installer/coursework/Chapter 6 - Classes, Methods and Instances/Lab6/lab6.ec
installer/src/installer.ec
samples/3D/Animate3DS/Animate3DS.ec
samples/3D/ColorSpheres/colorSpheres.ec
samples/3D/HiraganaCube/hiraganaCube.ec
samples/3D/ModelViewer/eModel.ec
samples/3D/ModelViewer/engineSettings.ec
samples/3D/OpenGL/glEcereCamera.ec
samples/3D/OpenGL/glSnippet.ec
samples/3D/Test3D/Test3D.ec
samples/3D/TransCube/transCube.ec
samples/3D/VertexColorTest/VertexColorTest.ec
samples/3D/cube2/cube2.ec
samples/3D/hello3D/hello3D.ec
samples/3D/orbitWithMouse/orbitWithMouse.ec
samples/3D/rayTracedMandelbulb/mandelbulb.ec
samples/3D/spriteBalls/balls.ec
samples/3D/terrainCameraDemo/demo.ec
samples/3D/terrainCameraDemo/dna.ec
samples/3D/terrainCameraDemo/dted.ec
samples/3D/terrainCameraDemo/terrain.ec
samples/audio/Piano/Piano.ec
samples/audio/S3MPlayer/S3MPlayer.ec
samples/db/EDATest/EDATest.ec
samples/db/MedDB/mainForm.ec
samples/db/MedDB/med.ec
samples/db/MovieCollection/allMoviesReport.ec
samples/db/MovieCollection/borrowerReport.ec
samples/db/MovieCollection/reports.ec
samples/eC/FindPrime/findPrime.ec
samples/eC/ampheck/main.ec
samples/eC/ecas/ecas.ec
samples/eC/ecas/expression.ec
samples/eC/ecas/misc.ec
samples/eC/neural/neural.ec
samples/games/blokus/blokus.ec
samples/games/bomb/bomb.ec
samples/games/brainstonz/brainstonz.ec
samples/games/brainstonz/game.ec
samples/games/cards/poker/bet.ec
samples/games/cards/poker/player.ec
samples/games/cards/poker/poker.ec
samples/games/cards/poker/pokerUtils.ec
samples/games/cards/poker/widow.ec
samples/games/cards/ruff/src/ai.ec
samples/games/cards/ruff/src/bet.ec
samples/games/cards/ruff/src/communication.ec
samples/games/cards/ruff/src/ruff.ec
samples/games/cards/ruff/src/scores.ec
samples/games/cards/ruff/src/server.ec
samples/games/cards/ruff/src/setup.ec
samples/games/cards/ruff/src/trump.ec
samples/games/cards/tongIts/tongits.ec
samples/games/othello/othello.ec
samples/games/scrabble/ScrabbleServer.ec
samples/games/scrabble/scrabble.ec
samples/games/tetris/tetris.ec
samples/guiAndGfx/DataControls/DataControls.ec
samples/guiAndGfx/HelloForm/helloForm.ec
samples/guiAndGfx/bitmapsAndKB/Bitmap/bitmap.ec
samples/guiAndGfx/bitmapsAndKB/KBController/controller.ec
samples/guiAndGfx/bitmapsAndKB/KBOnKeyHit/OnKeyHit.ec
samples/guiAndGfx/bitmapsAndKB/KBState/KBState.ec
samples/guiAndGfx/bitmapsAndKB/Objects/objects.ec
samples/guiAndGfx/childWindows/ex1.ec
samples/guiAndGfx/clock/clock.ec
samples/guiAndGfx/curvyweb/curvyweb.ec
samples/guiAndGfx/dataBoxes/dataBoxes.ec
samples/guiAndGfx/disablingMovingControls/form2.ec
samples/guiAndGfx/eNotepad/eNotepad.ec
samples/guiAndGfx/fliPlay/FliPlayApp.ec
samples/guiAndGfx/floodFill/floodFill.ec
samples/guiAndGfx/openrider/form1.ec
samples/guiAndGfx/openrider/game.ec
samples/guiAndGfx/openrider/math.ec
samples/guiAndGfx/pictureRotateAlpha/rotate1.ec
samples/guiAndGfx/reminder/Reminder.ec
samples/guiAndGfx/replace/replace.ec
samples/guiAndGfx/skinning/AcovelSkin.ec
samples/guiAndGfx/skinning/MySkin.ec
samples/guiAndGfx/skinning/SimSkin.ec
samples/guiAndGfx/slideShow/eShow.ec
samples/guiAndGfx/snow/snow.ec
samples/guiAndGfx/stacker/stackerTest.ec
samples/guiAndGfx/textScroller/textScroller.ec
samples/guiAndGfx/toolTips/toolTips.ec
samples/net/DCOMSample/main.ec
samples/net/SocketRx/socketRx.ec
samples/net/SocketSample/socketSample.ec
samples/net/SocketTx/socketTX.ec
samples/net/UDPSample/udptest.ec
samples/net/XMLSample/xmlSample.ec
samples/net/browser/browser.ec
samples/net/eCom/connection.ec
samples/net/eCom/mainPanel.ec
samples/net/eirc/console.ec
samples/net/eirc/eIRC.ec
samples/net/httpserver/http.ec
samples/net/networkFile/NetworkClient/client.ec
samples/net/networkFile/NetworkServer/server.ec
samples/net/smtp/smtp.ec
samples/scanning/wiaTest/wiaTest.ec
samples/threads/threadsAndListBoxes/blank.ec

index 63d34d7..ae7dbd0 100644 (file)
@@ -12,7 +12,7 @@ import "ec"
 static Context globalContext { };
 static Module privateModule;
 static ModuleImport mainModule;
-static OldList _excludedSymbols { offset = (uint)&((Symbol)0).left }; 
+static OldList _excludedSymbols { offset = (uint)&((Symbol)0).left };
 static OldList defines, imports;
 static NameSpace globalData
 {
@@ -142,7 +142,7 @@ static void TestTypes()
    count++, succeeded += TestType("void (*[10])()", null);
    count++, succeeded += TestType("void (* converters_table[10])()", null);
    count++, succeeded += TestType("int (* f[8])[10]", null);
-   
+
    count++, succeeded += TestType("int f[8][10]", null);
    count++, succeeded += TestType("int f[10]", null);
    count++, succeeded += TestType("void *", null);
@@ -163,7 +163,7 @@ static void TestTypes()
    count++, succeeded += TestType("int * const *", null);
    count++, succeeded += TestType("int * const", null);
    count++, succeeded += TestType("const int *", null);
-   
+
    count++, succeeded += TestType("char * const (* (* const bar)[5])(int)", null);
    count++, succeeded += TestType("char * const (* (* (* const bar)[5][6])(int))[2]", null);
    count++, succeeded += TestType("int * * a", null);
@@ -171,7 +171,7 @@ static void TestTypes()
    count++, succeeded += TestType("char * const (* bar)()", null);
 
    count++, succeeded += TestType("char * const (* const (* const bar)[5])(int)", null);
-   
+
    count++, succeeded += TestType("char * (* const (* bar)[5])(int)", null);
    count++, succeeded += TestType("void (* * const bar[5])()", null);
    count++, succeeded += TestType("void (* * const bar)()", null);
@@ -500,7 +500,7 @@ class CompilerApp : Application
 
 #if 0
             // TEMP: UNTIL WE CAN HAVE PER SOURCE FILE PREPROCESSOR DEFINITIONS...
-            if(GetBuildingEcereCom() && 
+            if(GetBuildingEcereCom() &&
                !(strcmpi(mainModuleName, "instance.ec") && strcmpi(mainModuleName, "BinaryTree.ec") &&
                strcmpi(mainModuleName, "dataTypes.ec") && strcmpi(mainModuleName, "OldList.ec") &&
                strcmpi(mainModuleName, "String.ec") && strcmpi(mainModuleName, "BTNode.ec") &&
@@ -510,14 +510,14 @@ class CompilerApp : Application
                strcmpi(mainModuleName, "List.ec") && strcmpi(mainModuleName, "Map.ec") &&
                strcmpi(mainModuleName, "Mutex.ec")))
                SetBuildingEcereComModule(true);
-            if(GetBuildingEcereCom() && 
+            if(GetBuildingEcereCom() &&
                !(strcmpi(mainModuleName, "instance.ec") && strcmpi(mainModuleName, "BinaryTree.ec") &&
                /*strcmpi(mainModuleName, "dataTypes.ec") && strcmpi(mainModuleName, "OldList.ec") &&*/
                /*strcmpi(mainModuleName, "String.ec") && */strcmpi(mainModuleName, "BTNode.ec") &&
                strcmpi(mainModuleName, "Mutex.ec") && strcmpi(mainModuleName, "Thread.ec")))
             //if(GetBuildingEcereCom() && !strcmpi(mainModuleName, "instance.ec"))
                SetMemoryGuard(false);
-#endif            
+#endif
 
             StripExtension(mainModuleName);
             module = ImportedModule { name = CopyString(mainModuleName), type = moduleDefinition };
@@ -550,10 +550,10 @@ class CompilerApp : Application
 
                strcpy(symLocation, GetSymbolsDir());
                PathCat(symLocation, symFile);
-               
+
                // LoadSymbols(symLocation, normalImport, true);
                LoadSymbols(symLocation, preDeclImport, false);
-               
+
                for(module = ::defines.first; module; module = next)
                {
                   next = module.next;
@@ -596,7 +596,7 @@ class CompilerApp : Application
                // For classes defined in this module...
                ComputeModuleClasses(privateModule);
 
-               
+
                // *** PASS 1 - Turn the class functions into functions               ***
                // *** Write the RegisterModule (Register classes)                    ***
                ProcessClassDefinitions();
index f2b3e33..933d9b9 100644 (file)
@@ -15,7 +15,7 @@ import "ec"
 
 // #include <stdarg.h>
 
-// WARNING: PropertyDefine, ClassDefine and DataMemberDefine must remain compatible 
+// WARNING: PropertyDefine, ClassDefine and DataMemberDefine must remain compatible
 struct ClassDefine : Definition
 {
    char * base;
@@ -53,7 +53,7 @@ class MethodDefine : struct
    bool isVirtual;
 };
 
-// WARNING: PropertyDefine, ClassDefine and DataMemberDefine must remain compatible 
+// WARNING: PropertyDefine, ClassDefine and DataMemberDefine must remain compatible
 class PropertyDefine : struct
 {
    PropertyDefine prev, next;
@@ -67,7 +67,7 @@ class PropertyDefine : struct
    bool hasSet, hasGet;
 };
 
-// WARNING: PropertyDefine, ClassDefine and DataMemberDefine must remain compatible 
+// WARNING: PropertyDefine, ClassDefine and DataMemberDefine must remain compatible
 class DataMemberDefine : struct
 {
    DataMemberDefine prev, next;
@@ -155,7 +155,7 @@ static void AddDefinitions(ClassDefine classDefine, DataMemberDefine parentMembe
             if(decl.type == structDeclaration)
             {
                Declarator d;
-               
+
                if(decl.declarators)
                {
                   for(d = decl.declarators->first; d; d = d.next)
@@ -164,7 +164,7 @@ static void AddDefinitions(ClassDefine classDefine, DataMemberDefine parentMembe
                      //if(d.type != DeclaratorFunction)
                      if(declId)
                      {
-                        dataMemberDefine = DataMemberDefine 
+                        dataMemberDefine = DataMemberDefine
                         {
                            isProperty = MemberType::dataMember;
                            memberType = normalMember;
@@ -194,7 +194,7 @@ static void AddDefinitions(ClassDefine classDefine, DataMemberDefine parentMembe
                               if(posExp.isConstant)
                                  bitPos = strtol(posExp.constant, null, 0);
                               FreeExpression(posExp);
-                     
+
                            }
 
                            d.structDecl.exp = null;
@@ -228,10 +228,10 @@ static void AddDefinitions(ClassDefine classDefine, DataMemberDefine parentMembe
                               PrintType(dataType, typeString, false, true);
 
                               if(member)
-                                 dataMember = eMember_AddDataMember(member, declId.string, 
+                                 dataMember = eMember_AddDataMember(member, declId.string,
                                     typeString, /*ComputeTypeSize(dataType)*/ 0, 0, def.memberAccess);
                               else
-                                 dataMember = eClass_AddDataMember(regClass, declId.string, 
+                                 dataMember = eClass_AddDataMember(regClass, declId.string,
                                     typeString, /*ComputeTypeSize(dataType)*/ 0, 0, def.memberAccess);
                               if(dataMember)
                                  dataMember.dataType = dataType;
@@ -261,7 +261,7 @@ static void AddDefinitions(ClassDefine classDefine, DataMemberDefine parentMembe
                               memberType = (spec.type == SpecifierType::unionSpecifier) ? unionMember : structMember;
                            };
                            parentMemberDefine.dataMembers.Add(dataMemberDefine);
-                           
+
                            AddDefinitions(null, dataMemberDefine, null, dataMember, spec.definitions);
 
                            if(member)
@@ -284,10 +284,10 @@ static void AddDefinitions(ClassDefine classDefine, DataMemberDefine parentMembe
                               PrintType(dataType, typeString, false, true);
 
                               if(member)
-                                 dataMember = eMember_AddDataMember(member, id.string, 
+                                 dataMember = eMember_AddDataMember(member, id.string,
                                     typeString, /*ComputeTypeSize(dataType)*/ 0, 0, def.memberAccess);
                               else
-                                 dataMember = eClass_AddDataMember(regClass, id.string, 
+                                 dataMember = eClass_AddDataMember(regClass, id.string,
                                     typeString, /*ComputeTypeSize(dataType)*/ 0, 0, def.memberAccess);
 
                               //delete dataTypeString;
@@ -364,7 +364,7 @@ static void AddDefinitions(ClassDefine classDefine, DataMemberDefine parentMembe
                if(prop)
                {
                   prop.symbol = Symbol
-                  { 
+                  {
                      string = CopyString(propertyDef.symbol.string);
                      id = propertyDef.symbol.id;
                      type = propertyDef.symbol.type;
@@ -452,7 +452,7 @@ static void AddDefinitions(ClassDefine classDefine, DataMemberDefine parentMembe
 
                member = eClass_AddDataMember(regClass, def.id.string, null, 0, 0, def.memberAccess);
 
-               dataMemberDefine = DataMemberDefine 
+               dataMemberDefine = DataMemberDefine
                {
                   isProperty = dataMember;
                   memberType = normalMember;
@@ -498,12 +498,12 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
             }
          }
       }
-      else if(baseType.kind == structType || baseType.kind == unionType) 
+      else if(baseType.kind == structType || baseType.kind == unionType)
       {
          classType = noHeadClass;
          baseName[0] = '\0';
       }
-      else 
+      else
          unitType = true;
       FreeType(baseType);
 
@@ -575,7 +575,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
       unionDefine = DataMemberDefine
       {
          isProperty = dataMember;
-         memberType = DataMemberType::unionMember;      
+         memberType = DataMemberType::unionMember;
       };
       classDefine.propertiesAndMembers.Add(unionDefine);
 
@@ -673,7 +673,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
             switch(param.type)
             {
                case type:
-                  defaultArg.dataTypeString = 
+                  defaultArg.dataTypeString =
                      StringFromSpecDecl(param.defaultArgument.templateDatatype.specifiers, param.defaultArgument.templateDatatype.decl);
                   break;
                case identifier:
@@ -688,7 +688,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      else
                         strcpy(memberString, param.defaultArgument.identifier._class.name);
                   }
-                  
+
                   if(memberString[0])
                   {
                      strcat(memberString, "::");
@@ -730,7 +730,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
             char * typeString = param.dataType ? StringFromSpecDecl(param.dataType.specifiers, param.dataType.decl) : null;
             eClass_AddTemplateParameter(regClass, param.identifier.string, param.type, typeString, defaultArg);
 
-            /*eClass_AddTemplateParameter(regClass, param.identifier.string, param.type, 
+            /*eClass_AddTemplateParameter(regClass, param.identifier.string, param.type,
                (param.type == type) ? eSystem_FindClass(regClass.module, typeString) : CopyString(typeString), defaultArg);*/
             // delete typeString;
          }
@@ -755,7 +755,7 @@ static void ProcessClassEnumValues(ClassType classType, OldList definitions, Sym
                refCount = 1;
             };
             e.exp.destType = destType;
-            
+
             // Set parsingType to avoid producing errors
             SetParsingType(true);
             ProcessExpressionType(e.exp);
@@ -788,7 +788,7 @@ static void ProcessClassEnumValues(ClassType classType, OldList definitions, Sym
             }
             else
                // Sort of an error
-               eEnum_AddValue(regClass, e.id.string);                        
+               eEnum_AddValue(regClass, e.id.string);
          }
          else
             eEnum_AddValue(regClass, e.id.string);
@@ -827,7 +827,7 @@ void PreCompPreProcessClassDefinitions()
                   Specifier specifier;
                   for(specifier = declaration.specifiers->first; specifier; specifier = specifier.next)
                   {
-                     if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string && 
+                     if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string &&
                         (declaration.declMode || specifier.baseSpecs || (specifier.type == enumSpecifier && specifier.definitions)))
                      {
                         Symbol symbol = FindClass(specifier.id.string);
@@ -920,7 +920,7 @@ void PreCompPreProcessClassDefinitions()
          typeString[0] = '\0';
          PrintType(function.declarator.symbol.type, typeString, true, true);
          functionDefine = FunctionDefine
-         { 
+         {
             type = functionDefinition;
             name = CopyString(function.declarator.symbol.string);
             dataType = CopyString(typeString);
@@ -951,7 +951,7 @@ void PreCompPreProcessClassDefinitions()
                Specifier specifier;
                for(specifier = declaration.specifiers->first; specifier; specifier = specifier.next)
                {
-                  if((specifier.type == enumSpecifier) && specifier.id && specifier.id.string && 
+                  if((specifier.type == enumSpecifier) && specifier.id && specifier.id.string &&
                      (declaration.declMode || specifier.baseSpecs || (specifier.type == enumSpecifier && specifier.definitions)))
                   {
                      Symbol symbol = FindClass(specifier.id.string);
@@ -1208,7 +1208,7 @@ static void OutputSymbols(char * fileName)
                }
                f.Printf("         .\n");
             }
-            
+
             if(!classDefine.isStatic)
             {
                if(classDefine.methods.first)
@@ -1275,7 +1275,7 @@ static void OutputSymbols(char * fileName)
       }
       f.Printf("   .\n");
       delete f;
-   }   
+   }
 }
 
 class PrecompApp : Application
@@ -1484,7 +1484,7 @@ class PrecompApp : Application
          globalContext.types.Add((BTNode)Symbol { string = CopyString("uintptr_t"), type = ProcessTypeString("uintptr", false) });
          globalContext.types.Add((BTNode)Symbol { string = CopyString("ssize_t"), type = ProcessTypeString("intsize", false) });
          globalContext.types.Add((BTNode)Symbol { string = CopyString("size_t"), type = ProcessTypeString("uintsize", false) });
-         
+
          {
             char * outputFilePath = GetOutputFile();
             if(FileExists(outputFilePath))
index a509c9e..864f924 100644 (file)
@@ -62,7 +62,7 @@ static void LoadImports(char * fileName)
                   {
                      ClassImport _class = null;
                      FunctionImport function = null;
-                     
+
                      if(!strcmp(line, "[This]"))
                      {
                         if((mainModule = GetMainModule()))
@@ -161,7 +161,7 @@ static void LoadImports(char * fileName)
                               if(!(_class = module.classes.FindName(line, false)))
                               {
                                  _class = ClassImport { name = CopyString(line) };
-                                 module.classes.AddName(_class); 
+                                 module.classes.AddName(_class);
                               }
                            }
                         }
@@ -234,7 +234,7 @@ class ModuleInfo : struct
 static bool SeardchModuleName(Module searchIn, char * name)
 {
    SubModule subModule;
-   
+
    if(searchIn.name && !strcmp(searchIn.name, name))
       return true;
 
@@ -255,7 +255,7 @@ static void WriteMain(char * fileName)
       ModuleInfo defModule;
       bool nonInst = false, anyMethod = false, anyProp = false, anyFunction = false;
       ImportedModule importedModule;
-      
+
       GetLastDirectory(fileName, mainModuleName);
       StripExtension(mainModuleName);
       if(!projectName[0])
@@ -347,7 +347,7 @@ static void WriteMain(char * fileName)
                      else if(module.name && module.importType != staticImport && (!meth || !meth.dataType.dllExport))
                      {
                         /*char name[4096];
-                        
+
                         Type type
                         {
                            kind = TypePointer,
@@ -560,12 +560,12 @@ static void WriteMain(char * fileName)
                   char className[1024] = "";
                   FullClassNameCat(className, _class.name, true);
                   MangleClassName(className);
-            
+
                   if(_class.itself)
                      sprintf(classID, "__ecereClass_%s", className);
                   else
                      strcpy(classID, "_class");
-            
+
                   if(isDynamicLibrary && !isStaticLibrary)
                      f.Printf("   %s = eSystem_FindClass(__currentModule, \"%s\");\n", classID, _class.name);
                   else
@@ -578,7 +578,7 @@ static void WriteMain(char * fileName)
                      {
                         if(method.isVirtual || (module.name && module.importType != staticImport))
                         {
-                           f.Printf("   method = eClass_FindMethod(%s, \"%s\", module);\n", 
+                           f.Printf("   method = eClass_FindMethod(%s, \"%s\", module);\n",
                               classID, method.name);
                            if(method.isVirtual)
                               f.Printf("   if(method) __ecereVMethodID_%s_%s = method.vid;\n", className, method.name);
@@ -596,7 +596,7 @@ static void WriteMain(char * fileName)
                      // strcpy(propName, prop.name);
                      MangleClassName(propName);
 
-                     f.Printf("   __ecereProp_%s_%s = _property = eClass_FindProperty(%s, \"%s\", module);\n", 
+                     f.Printf("   __ecereProp_%s_%s = _property = eClass_FindProperty(%s, \"%s\", module);\n",
                         className, propName, classID, prop.name);
 
                      if(module.name && module.importType != staticImport)
@@ -972,7 +972,7 @@ static void BindDCOMClient()
 
                         // f.Printf("this.instance.%s(", method.name);
                         f.Printf("%s(", method.name);
-                        
+
                         for(param = method.dataType.params.first; param; param = param.next)
                         {
                            if(param.prev)
@@ -1002,13 +1002,13 @@ static void BindDCOMClient()
 
                         for(param = method.dataType.params.first; param; param = param.next)
                         {
-                           if(param.kind == classType && strcmp(param._class.string, "String") && param._class.registered && 
+                           if(param.kind == classType && strcmp(param._class.string, "String") && param._class.registered &&
                               (param._class.registered.type == normalClass || param._class.registered.type == noHeadClass))
                            {
                               f.Printf("            delete %s;\n", param.name);
                            }
                         }
-                        if(method.dataType.returnType.kind == classType && strcmp(method.dataType.returnType._class.string, "String") && method.dataType.returnType._class.registered && 
+                        if(method.dataType.returnType.kind == classType && strcmp(method.dataType.returnType._class.string, "String") && method.dataType.returnType._class.registered &&
                               (method.dataType.returnType._class.registered.type == normalClass || method.dataType.returnType._class.registered.type == noHeadClass))
                         {
                            f.Printf("            delete __ecereResult;\n");
@@ -1023,7 +1023,7 @@ static void BindDCOMClient()
             f.Printf("      }\n");
             f.Printf("   }\n");
             f.Printf("\n");
-         } 
+         }
 
          doVirtual = true;
          id = 0;
@@ -1139,7 +1139,7 @@ static void BindDCOMClient()
                   }
                   DeclareMethod(
                      eClass_FindMethod(
-                        eSystem_FindClass(privateModule, "ecere::net::DCOMClientObject"), "CallMethod", privateModule), 
+                        eSystem_FindClass(privateModule, "ecere::net::DCOMClientObject"), "CallMethod", privateModule),
                      "__ecereMethod___ecereNameSpace__ecere__net__DCOMClientObject_CallMethod");
 
                   f.Printf("      if(DCOMClientObject::CallMethod(%d))\n", id++);
@@ -1193,13 +1193,13 @@ static void BindDCOMClient()
                   next = (Method)_class.methods.first;
                }
             }
-            
-            if(next) 
+
+            if(next)
                f.Printf("\n");
          }
 
          f.Printf("}\n");
-         if(deriv.next) 
+         if(deriv.next)
             f.Printf("\n");
       }
    }
@@ -1360,7 +1360,7 @@ static void BindDCOMServer()
 
                      // f.Printf("this.instance.%s(", method.name);
                      f.Printf("((%s)instance).%s(", _class.fullName, method.name);
-                     
+
                      for(param = method.dataType.params.first; param; param = param.next)
                      {
                         if(param.prev)
@@ -1390,13 +1390,13 @@ static void BindDCOMServer()
 
                      for(param = method.dataType.params.first; param; param = param.next)
                      {
-                        if(param.kind == classType && strcmp(param._class.string, "String") && param._class.registered && 
+                        if(param.kind == classType && strcmp(param._class.string, "String") && param._class.registered &&
                            (param._class.registered.type == normalClass || param._class.registered.type == noHeadClass))
                         {
                            f.Printf("            delete %s;\n", param.name);
                         }
                      }
-                     if(method.dataType.returnType.kind == classType && strcmp(method.dataType.returnType._class.string, "String") && method.dataType.returnType._class.registered && 
+                     if(method.dataType.returnType.kind == classType && strcmp(method.dataType.returnType._class.string, "String") && method.dataType.returnType._class.registered &&
                            (method.dataType.returnType._class.registered.type == normalClass || method.dataType.returnType._class.registered.type == noHeadClass))
                      {
                         f.Printf("            delete __ecereResult;\n");
@@ -1427,11 +1427,11 @@ static void BindDCOMServer()
                      DeclareClass(FindClass("ecere::sys::Mutex"), "__ecereClass___ecereNameSpace__ecere__sys__Mutex");
                      DeclareMethod(
                         eClass_FindMethod(
-                           eSystem_FindClass(privateModule, "ecere::sys::Mutex"), "Wait", privateModule), 
+                           eSystem_FindClass(privateModule, "ecere::sys::Mutex"), "Wait", privateModule),
                               "__ecereMethod___ecereNameSpace__ecere__sys__Mutex_Wait");
                      DeclareMethod(
                         eClass_FindMethod(
-                           eSystem_FindClass(privateModule, "ecere::sys::Mutex"), "Release", privateModule), 
+                           eSystem_FindClass(privateModule, "ecere::sys::Mutex"), "Release", privateModule),
                               "__ecereMethod___ecereNameSpace__ecere__sys__Mutex_Release");
                      mutexDeclared = true;
                   }
@@ -1486,7 +1486,7 @@ static void BindDCOMServer()
                               f.Printf(" = 0");
                            f.Printf(";\n\n");
                         }
-                        
+
                         f.Printf("      incref __ecereObject;\n");
                         f.Printf("      __ecereMethod___ecereNameSpace__ecere__sys__Mutex_Wait(__ecereObject.mutex);\n");
 
@@ -1521,7 +1521,7 @@ static void BindDCOMServer()
 
                         DeclareMethod(
                            eClass_FindMethod(
-                              eSystem_FindClass(privateModule, "ecere::net::DCOMServerObject"), "CallVirtualMethod", privateModule), 
+                              eSystem_FindClass(privateModule, "ecere::net::DCOMServerObject"), "CallVirtualMethod", privateModule),
                            "__ecereMethod___ecereNameSpace__ecere__net__DCOMServerObject_CallVirtualMethod");
 
                         // Check if this method needs to return anything (hasReturnValue)
@@ -1586,7 +1586,7 @@ static void BindDCOMServer()
                      }
 
                      f.Printf("   }\n");
-                     /*if(vid < _class.vTblSize) 
+                     /*if(vid < _class.vTblSize)
                         f.Printf("\n");*/
                   }
                }
@@ -1715,7 +1715,7 @@ class SymbolgenApp : Application
       }
       if(!output)
          valid = false;
-     
+
       if(!valid)
       {
          printf($"Syntax:\n   ecs [-t <target platform>] <input>[, <input>]* -o <output>\n");
@@ -1727,7 +1727,7 @@ class SymbolgenApp : Application
          char symbolModule[MAX_FILENAME];
          GetExtension(output, ext);
          GetLastDirectory(output, symbolModule);
-         
+
          SetDefines(&::_defines);
          SetImports(&_imports);
          SetGlobalData(&globalData);
@@ -1811,8 +1811,8 @@ class SymbolgenApp : Application
                      GetLastDirectory(file, fileName);
 
                      module.name = CopyString(fileName);
-                     
-                     StripExtension(module.name);                     
+
+                     StripExtension(module.name);
 
                      for(importedModule = ::_defines.first; importedModule; importedModule = importedModule.next)
                      {
@@ -1986,7 +1986,7 @@ class SymbolgenApp : Application
          ::_defines.Free(FreeModuleDefine);
          _imports.Free(FreeModuleImport);
 
-         //precompDefines.Free(FreeDefinition);   
+         //precompDefines.Free(FreeDefinition);
 
          FreeTypeData(privateModule);
          FreeIncludeFiles();
index be76300..724a029 100644 (file)
@@ -55,7 +55,7 @@ public Identifier MkIdentifier(char * string)
 {
    Identifier id { };
    int c;
-   
+
    id._class = null; // Default class...
 
    if(string)
@@ -119,7 +119,7 @@ public Identifier MkIdentifier(char * string)
                else
                   id.string = CopyString(string);
             }
-         }         
+         }
       }
       else if(gotColon)
       {
@@ -441,7 +441,7 @@ Specifier MkSpecifierExtended(ExtDecl extDecl)
 
 Specifier MkEnum(Identifier id, OldList list)
 {
-   Specifier spec 
+   Specifier spec
    {
       type = enumSpecifier;
       id = id;
@@ -798,7 +798,7 @@ Declaration MkDeclaration(OldList specifiers, OldList initDeclarators)
 {
    Declaration decl { type = initDeclaration, declarators = initDeclarators, specifiers = specifiers, loc = yylloc };
    bool variable = true;
-   
+
    if(specifiers != null)
    {
       bool gotType = false;
@@ -811,7 +811,7 @@ Declaration MkDeclaration(OldList specifiers, OldList initDeclarators)
             if(initDeclarators != null)
             {
                InitDeclarator d;
-         
+
                for(d = initDeclarators.first; d; d = d.next)
                {
                   if(GetDeclId(d.declarator).string)
@@ -863,7 +863,7 @@ Declaration MkDeclaration(OldList specifiers, OldList initDeclarators)
             variable = false;
             break;
          }
-         else if(spec.type == baseSpecifier && 
+         else if(spec.type == baseSpecifier &&
             (spec.specifier == STRUCT || spec.specifier == UNION))
             variable = false;
          else
@@ -930,7 +930,7 @@ Declaration MkDeclaration(OldList specifiers, OldList initDeclarators)
                   delete id.string;
                   id.string = CopyString(name);
                }
-               
+
                // Avoid memory leaks on duplicated symbols (BinaryTree::Add Would Fail)
                symbol = (Symbol)(curContext.templateTypesOnly ? curContext.parent : curContext).symbols.FindString(id.string);
                if(!symbol)
@@ -1360,7 +1360,7 @@ void SetClassTemplateArgs(Specifier spec, OldList templateArgs)
                   fileInput = backFileInput;
                   if(fileInput)
                   {
-                     fileInput.Seek(yylloc.start.pos, start); 
+                     fileInput.Seek(yylloc.start.pos, start);
                      resetScannerPos(&yylloc.start);
                      yychar = -2;
                   }
@@ -1453,7 +1453,7 @@ Specifier _MkSpecifierName(char * name, Symbol symbol, OldList templateArgs)
          }
       }
       else if(symbol)
-         spec.name = CopyString(symbol.string);   
+         spec.name = CopyString(symbol.string);
       else
          spec.name = CopyString(name);
       spec.symbol = symbol;
@@ -1540,7 +1540,7 @@ void ProcessClassFunctionBody(ClassFunction func, Statement body)
 
       symbol = Symbol
       {
-         
+
       };
 
       {
@@ -1642,7 +1642,7 @@ Instantiation MkInstantiationNamed(OldList specs, Expression exp, OldList member
          }
 
       FreeList(specs, FreeSpecifier);
-         
+
       if(!spec)
       {
          Compiler_Error($"Expecting class specifier\n");
@@ -1767,7 +1767,7 @@ Symbol _DeclClass(int symbolID, char * name)
       for(classContext = curContext; classContext && !classContext.classDef; classContext = classContext.parent);
       if(classContext)
       {
-         
+
       }
       */
       if(name[0] == ':' && name[1] == ':')
@@ -1810,7 +1810,7 @@ void SetupBaseSpecs(Symbol symbol, OldList baseSpecs)
       strcpy(name, ((Specifier)baseSpecs.first).name);
       tpl = strchr(name, '<');
       if(tpl) *tpl = 0;
-      
+
       baseClass = FindClass(name);
       if(baseClass && baseClass.ctx)
       {
@@ -1841,7 +1841,7 @@ void SetupBaseSpecs(Symbol symbol, OldList baseSpecs)
                   {
                      p.param = param = TemplateParameter
                      {
-                        identifier = MkIdentifier(p.name), type = p.type, 
+                        identifier = MkIdentifier(p.name), type = p.type,
                         dataTypeString = p.dataTypeString /*, dataType = { specs, decl }*/
                      };
                   }
@@ -2027,7 +2027,7 @@ TemplatedType FindTemplateTypeParameter(Context ctx, char * name)
 bool ModuleAccess(Module searchIn, Module searchFor)
 {
    SubModule subModule;
-   
+
    if(searchFor == searchIn)
       return true;
 
@@ -2052,8 +2052,8 @@ ModuleImport FindModule(Module moduleToFind)
          break;
    if(!module)
    {
-      module = ModuleImport 
-      { 
+      module = ModuleImport
+      {
          name = CopyString(moduleToFind.name), importType = moduleToFind.importType,
          importAccess = ModuleAccess(privateModule, moduleToFind) ? publicAccess : privateAccess
       };
@@ -2070,7 +2070,7 @@ static void GetFullClassNameSpace(NameSpace * ns, char * name)
    {
       GetFullClassNameSpace(ns->parent, name);
       strcat(name, ns->name);
-      strcat(name, "::");      
+      strcat(name, "::");
    }
 }
 
@@ -2154,7 +2154,7 @@ public Symbol FindClass(char * name)
          }
          */
          if(cl.shortName && !strcmp(cl.shortName, name))
-            break;            
+            break;
       }
 #ifdef _TIMINGS
       findClassIgnoreNSTotalTime += GetTime() - startTime;
@@ -2309,10 +2309,10 @@ static Type ProcessTypeSpecs(OldList specs, bool assumeEllipsis, bool keepTypeNa
             else if(spec.specifier == INT) { if(specType.kind != shortType && specType.kind != longType && !isLong) specType.kind = intType; }
             else if(spec.specifier == UINT) { if(specType.kind != shortType && specType.kind != longType) specType.kind = intType; specType.isSigned = false; }
             else if(spec.specifier == INT64) specType.kind = int64Type;
-            else if(spec.specifier == VALIST) 
+            else if(spec.specifier == VALIST)
                specType.kind = vaListType;
             else if(spec.specifier == SHORT) specType.kind = shortType;
-            else if(spec.specifier == LONG) 
+            else if(spec.specifier == LONG)
             {
                if(isLong || (targetBits == 64 && targetPlatform != win32))
                   specType.kind = int64Type;
@@ -2327,7 +2327,7 @@ static Type ProcessTypeSpecs(OldList specs, bool assumeEllipsis, bool keepTypeNa
             else if(spec.specifier == CONST)
                specType.constant = true;
             else if(spec.specifier == TYPED_OBJECT || spec.specifier == ANY_OBJECT || spec.specifier == CLASS)
-            { 
+            {
                switch(spec.specifier)
                {
                   case TYPED_OBJECT:   specType.classObjectType = typedObject;   break;
@@ -2418,7 +2418,7 @@ static Type ProcessTypeSpecs(OldList specs, bool assumeEllipsis, bool keepTypeNa
                specType.kind = unionType;
             if(spec.id)
             {
-               // TESTING THIS HERE... Had 0 type size 
+               // TESTING THIS HERE... Had 0 type size
                if(!spec.definitions && !isTypedef)
                {
                   Symbol symbol = spec.id.string ? FindSymbol(spec.id.string, curContext, globalContext, true, false) : null;
@@ -2509,7 +2509,7 @@ static Type ProcessTypeSpecs(OldList specs, bool assumeEllipsis, bool keepTypeNa
    }
    else if(assumeEllipsis)
       specType.kind = ellipsisType;
-   return specType;     
+   return specType;
 }
 
 static Type ProcessTypeDecls(OldList specs, Declarator decl, Type parentType)
@@ -2595,7 +2595,7 @@ static Type ProcessTypeDecls(OldList specs, Declarator decl, Type parentType)
          {
             type = { refCount = 1, kind = arrayType, arraySizeExp = CopyExpression(decl.array.exp), freeExp = true, type = type, dllExport = type.dllExport, attrStdcall = type.attrStdcall };
             if(decl.array.enumClass)
-               type.enumClass = decl.array.enumClass.symbol; 
+               type.enumClass = decl.array.enumClass.symbol;
             break;
          }
          case pointerDeclarator:
@@ -2753,8 +2753,8 @@ AsmField MkAsmField(char * command, Expression expression)
 
 Statement MkAsmStmt(Specifier spec, char * statements, OldList inputFields, OldList outputFields, OldList clobberedFields)
 {
-   return { type = asmStmt, asmStmt.spec = spec, asmStmt.statements = statements, 
-      asmStmt.inputFields = inputFields, asmStmt.outputFields = outputFields, 
+   return { type = asmStmt, asmStmt.spec = spec, asmStmt.statements = statements,
+      asmStmt.inputFields = inputFields, asmStmt.outputFields = outputFields,
       asmStmt.clobberedFields = clobberedFields };
 }
 
@@ -2882,7 +2882,7 @@ Expression GetTemplateArgExpByName(char * paramName, Class curClass, TemplatePar
          char idString[32];
          char className[1024];
          Expression classExp;
-         
+
          sprintf(idString, "%d", id);
          strcpy(className, "__ecereClass_");
          FullClassNameCat(className, _class.fullName, true);
@@ -2890,11 +2890,11 @@ Expression GetTemplateArgExpByName(char * paramName, Class curClass, TemplatePar
          DeclareClass(FindClass(_class.fullName), className);
 
          argExp = MkExpIndex((/*pointer ? MkExpPointer : */MkExpMember)
-               (MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class")) /*MkExpIdentifier(MkIdentifier(className))*/, 
+               (MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class")) /*MkExpIdentifier(MkIdentifier(className))*/,
                MkIdentifier("templateArgs")), MkListOne(MkExpConstant(idString)));
       }
    }
-   return argExp; 
+   return argExp;
 }
 
 Expression GetTemplateArgExp(TemplateParameter param, Class curClass, bool pointer)
index c6450f8..8a5d1c7 100644 (file)
@@ -68,7 +68,7 @@ static MembersInit CopyMembersInit(MembersInit members)
 
             for(member = members.dataMembers->first; member; member = member.next)
                ListAdd(list, CopyMemberInit(member));
-            
+
          }
       }
    }
@@ -158,13 +158,13 @@ static Instantiation CopyInstantiation(Instantiation inst)
             break;
          }
          case memberExp:
-            result = MkExpMember(CopyExpression(exp.member.exp), 
+            result = MkExpMember(CopyExpression(exp.member.exp),
                CopyIdentifier(exp.member.member));
             result.member.memberType = exp.member.memberType;
             result.member.thisPtr = exp.member.thisPtr;
             break;
          case pointerExp:
-            result = MkExpPointer(CopyExpression(exp.member.exp), 
+            result = MkExpPointer(CopyExpression(exp.member.exp),
                CopyIdentifier(exp.member.member));
             break;
          case typeSizeExp:
@@ -182,7 +182,7 @@ static Instantiation CopyInstantiation(Instantiation inst)
             Expression e;
             for(e = exp.cond.exp->first; e; e = e.next)
                ListAdd(list, CopyExpression(e));
-            result = MkExpCondition(CopyExpression(exp.cond.cond), list, 
+            result = MkExpCondition(CopyExpression(exp.cond.cond), list,
                CopyExpression(exp.cond.elseExp));
             break;
          }
@@ -203,7 +203,7 @@ static Instantiation CopyInstantiation(Instantiation inst)
       result.isConstant = exp.isConstant;
       result.byReference = exp.byReference;
    }
-   
+
    return result;
 }
 
@@ -211,7 +211,7 @@ static Instantiation CopyInstantiation(Instantiation inst)
 static Statement CopyStatement(Statement stmt)
 {
    Statement result = null;
-   if(stmt) 
+   if(stmt)
    {
       switch(stmt.type)
       {
@@ -246,7 +246,7 @@ ClassDef CopyClassDef(ClassDef def)
       case functionClassDef:
          return null; //return MkClassDefFunction(CopyClassFunction(def.function));
       case defaultPropertiesClassDef:
-         return null; //return MkClassDefDefaultProperty(CopyList(def.defProperties, CopyDefaultProperty)); 
+         return null; //return MkClassDefDefaultProperty(CopyList(def.defProperties, CopyDefaultProperty));
       case declarationClassDef:
          return MkClassDefDeclaration(CopyDeclaration(def.decl));
       case propertyClassDef:
@@ -317,7 +317,7 @@ TypeName CopyTypeName(TypeName typeName)
 {
    OldList * list = null;
    TypeName copy;
-   
+
    if(typeName.qualifiers)
    {
       Specifier spec;
@@ -366,7 +366,7 @@ Declarator CopyDeclarator(Declarator declarator)
       {
          case structDeclarator:
          {
-            Declarator decl = MkStructDeclarator(CopyDeclarator(declarator.declarator), 
+            Declarator decl = MkStructDeclarator(CopyDeclarator(declarator.declarator),
                CopyExpression(declarator.structDecl.exp));
             if(declarator.structDecl.attrib)
                decl.structDecl.attrib = CopyAttrib(declarator.structDecl.attrib);
@@ -378,10 +378,10 @@ Declarator CopyDeclarator(Declarator declarator)
             return MkDeclaratorBrackets(CopyDeclarator(declarator.declarator));
          case arrayDeclarator:
             if(declarator.array.enumClass)
-               return MkDeclaratorEnumArray(CopyDeclarator(declarator.declarator), 
+               return MkDeclaratorEnumArray(CopyDeclarator(declarator.declarator),
                   CopySpecifier(declarator.array.enumClass));
             else
-               return MkDeclaratorArray(CopyDeclarator(declarator.declarator), 
+               return MkDeclaratorArray(CopyDeclarator(declarator.declarator),
                   CopyExpression(declarator.array.exp));
          case functionDeclarator:
          {
index 2b76996..3dd8940 100644 (file)
@@ -111,7 +111,7 @@ static void ProcessExpression(Expression exp)
       {
          Expression expression;
          ProcessExpression(exp.index.exp);
-         
+
          for(expression = exp.index.index->first; expression; expression = expression.next)
          {
             ProcessExpression(expression);
@@ -121,7 +121,7 @@ static void ProcessExpression(Expression exp)
       case callExp:
       {
          ProcessExpression(exp.call.exp);
-         
+
          if(exp.call.arguments)
          {
             Expression expression;
@@ -169,7 +169,7 @@ static void ProcessExpression(Expression exp)
          sprintf(name, "__ecereDBField_%s_%s", tableName, exp.db.id.string);
          FreeExpContents(exp);
          exp.type = identifierExp;
-         exp.identifier = MkIdentifier(name);                          
+         exp.identifier = MkIdentifier(name);
          break;
       }
       case dbtableExp:
@@ -183,7 +183,7 @@ static void ProcessExpression(Expression exp)
          sprintf(name, "__ecereDBTable_%s", tableName);
          FreeExpContents(exp);
          exp.type = identifierExp;
-         exp.identifier = MkIdentifier(name);                          
+         exp.identifier = MkIdentifier(name);
          break;
       }
       case dbindexExp:
@@ -197,7 +197,7 @@ static void ProcessExpression(Expression exp)
          sprintf(name, "__ecereDBIndex_%s_%s", tableName, exp.db.id.string);
          FreeExpContents(exp);
          exp.type = identifierExp;
-         exp.identifier = MkIdentifier(name);                          
+         exp.identifier = MkIdentifier(name);
          break;
       }
       case dbopenExp:
@@ -212,18 +212,18 @@ static void ProcessExpression(Expression exp)
 
             databaseOpenStmt.compound.context = Context { parent = curContext };
 
-            databaseOpenStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("Database")), 
+            databaseOpenStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("Database")),
                MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("db")), null))));
 
             // bool createNow = false;
-            databaseOpenStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("bool")), 
+            databaseOpenStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("bool")),
                MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("createNow")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));
 
             // static bool initialized = false;
             args = MkList();
             args->Add(MkSpecifier(STATIC));
             args->Add(MkSpecifierName("bool"));
-            databaseOpenStmt.compound.declarations->Add(MkDeclaration(args, 
+            databaseOpenStmt.compound.declarations->Add(MkDeclaration(args,
                MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("initialized")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("false")))))));
 
             // Assuming we're in a function where we can return 0 (Typically a DataBase InitSchema() or an Application constructor)
@@ -237,49 +237,49 @@ static void ProcessExpression(Expression exp)
             args = MkList();
             args->Add(CopyExpression(exp.dbopen.name));
             args->Add(MkExpIdentifier(MkIdentifier("no")));
-            databaseOpenStmt.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=', 
+            databaseOpenStmt.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=',
                MkExpCall(MkExpMember(CopyExpression(exp.dbopen.ds), MkIdentifier("OpenDatabase")), args)))));
-            
+
             /*if(!db)
             {
                db = ds.OpenDatabase("med", create);
                createNow = true;
             }
             */
-            databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpOp(null, '!', MkExpIdentifier(MkIdentifier("db")))), 
+            databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpOp(null, '!', MkExpIdentifier(MkIdentifier("db")))),
                compound = MkCompoundStmt(null, MkList()), null));
             compound.compound.context = Context { parent = databaseOpenStmt.compound.context };
-            
+
             args = MkList();
             args->Add(exp.dbopen.name);
             args->Add(MkExpIdentifier(MkIdentifier("create")));
-            compound.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=', 
+            compound.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("db")), '=',
                MkExpCall(MkExpMember(exp.dbopen.ds, MkIdentifier("OpenDatabase")), args)))));
-            compound.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("createNow")), '=', 
+            compound.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("createNow")), '=',
                MkExpIdentifier(MkIdentifier("true"))))));
 
             exp.dbopen.name = null;
             exp.dbopen.ds = null;
 
             // if(db)
-            databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("db"))), 
+            databaseOpenStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("db"))),
                ifDBStmt = MkCompoundStmt(MkList(), MkList()), null));
 
             ifDBStmt.compound.context = Context { parent = databaseOpenStmt.compound.context };
 
             // FieldIndex indexes[numIndexes] = { null };
             sprintf(numIndexesString, "%d", numIndexes);
-            ifDBStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("FieldIndex")), MkListOne(MkInitDeclarator(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("indexes")), 
+            ifDBStmt.compound.declarations->Add(MkDeclaration(MkListOne(MkSpecifierName("FieldIndex")), MkListOne(MkInitDeclarator(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("indexes")),
                MkExpConstant(numIndexesString)), MkInitializerList(MkListOne(MkInitializerList(MkListOne(MkInitializerAssignment(MkExpIdentifier(MkIdentifier("null")))))))))));
-            
+
             // db.Begin();
             ifDBStmt.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("Begin")), MkList()))));
 
             ifDBStmt.compound.statements->Add(compound = MkCompoundStmt(null, tableStatements));
             compound.compound.context = Context { parent = ifDBStmt.compound.context };
             /*
-            ifDBStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("createNow"))), 
-               (compound = MkCompoundStmt(null, addFieldStatements), compound.compound.context = Context { parent = ifDBStmt.compound.context }, compound), 
+            ifDBStmt.compound.statements->Add(MkIfStmt(MkListOne(MkExpIdentifier(MkIdentifier("createNow"))),
+               (compound = MkCompoundStmt(null, addFieldStatements), compound.compound.context = Context { parent = ifDBStmt.compound.context }, compound),
                (compound2 = MkCompoundStmt(null, findFieldStatements), compound2.compound.context = Context { parent = ifDBStmt.compound.context }, compound2)));
             */
             ifDBStmt.compound.statements->Add(
@@ -432,12 +432,12 @@ static void ProcessStatement(Statement stmt)
          {
             ProcessStatement(stmt.forStmt.init);
          }
-         
+
          if(stmt.forStmt.check)
          {
             ProcessStatement(stmt.forStmt.check);
          }
-         
+
          if(stmt.forStmt.increment)
          {
             for(exp = stmt.forStmt.increment->first; exp; exp = exp.next)
@@ -460,7 +460,7 @@ static void ProcessStatement(Statement stmt)
          if(stmt.expressions)
          {
             Expression exp;
-            
+
             for(exp = stmt.expressions->first; exp; exp = exp.next)
             {
                ProcessExpression(exp);
@@ -521,7 +521,7 @@ static void ProcessInitializer(Initializer initializer)
       case listInitializer:
       {
          Initializer init;
-         
+
          for(init = initializer.list->first; init; init = init.next)
          {
             ProcessInitializer(init);
@@ -575,7 +575,7 @@ static void ProcessDeclaration(Declaration decl)
             for(d = decl.declarators->first; d; d = d.next)
             {
                ProcessInitDeclarator(d);
-            }   
+            }
          }
          break;
       }
@@ -608,7 +608,7 @@ static void ProcessInstance(Instantiation inst)
       MembersInit init;
       MemberInit memberInit;
       for(init = inst.members->first; init; init = init.next)
-      {         
+      {
          if(init.type == dataMembersInit && init.dataMembers)
          {
             for(memberInit = init.dataMembers->first; memberInit; memberInit = memberInit.next)
@@ -717,7 +717,7 @@ static void ProcessDBTable(DBTableDef table)
 
    sprintf(rowClassName, "Row%s", tableName);
    ChangeCh(rowClassName, ' ', '_');
-      
+
    if(!tableStatements)
    {
       tableStatements = MkList();
@@ -734,7 +734,7 @@ static void ProcessDBTable(DBTableDef table)
          MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(tableID)), null))));
       external.declaration.declMode = table.declMode;
       ast->Insert(addAfter, external);
-  
+
       // tClasses          = db.OpenTable("Classes",        { tableRows, create });
       args = MkList();
       tableStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(tableID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("db")), MkIdentifier("OpenTable")),
@@ -805,7 +805,7 @@ static void ProcessDBTable(DBTableDef table)
                      curContext = rowSet.compound.context = Context { parent = globalContext };
 
                      // Find(fieldSECid, middle, nil, value);
-                     rowSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("Find")), 
+                     rowSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("Find")),
                         args = MkList()))));
                      args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
                      args->Add(MkExpIdentifier(MkIdentifier("middle")));
@@ -815,7 +815,7 @@ static void ProcessDBTable(DBTableDef table)
                      curContext = globalContext;
 
                      def = MkClassDefProperty(MkProperty(
-                        CopyList(entry.dataType.qualifiers, CopySpecifier), CopyDeclarator(entry.dataType.declarator), 
+                        CopyList(entry.dataType.qualifiers, CopySpecifier), CopyDeclarator(entry.dataType.declarator),
                            MkIdentifier(name), rowSet, null));
                      def.propertyDef.symbol.id = def.propertyDef.symbol.idCode = symbolID;
                      def.memberAccess = publicAccess;
@@ -826,7 +826,7 @@ static void ProcessDBTable(DBTableDef table)
                {
                   Statement rowSet = MkCompoundStmt(MkList(), MkList()), rowGet = MkCompoundStmt(MkList(), MkList());
                   ClassDef def;
-                  
+
                   curContext = rowGet.compound.context = Context { parent = globalContext };
 
                   // *** GET ***
@@ -838,13 +838,13 @@ static void ProcessDBTable(DBTableDef table)
                   else
                   {
                      Expression exp;
-                     rowGet.compound.declarations->Add(MkDeclaration(CopyList(entry.dataType.qualifiers, CopySpecifier), 
+                     rowGet.compound.declarations->Add(MkDeclaration(CopyList(entry.dataType.qualifiers, CopySpecifier),
                         MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("d")), MkInitializerAssignment(exp = MkExpConstant("0"))))));
                      exp.destType = Type { kind = intType, refCount = 1 };
                   }
 
                   // GetData(fieldCNTid, d);
-                  rowGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("GetData")), 
+                  rowGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("GetData")),
                      args = MkList()))));
                   args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
                   /*if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
@@ -855,7 +855,7 @@ static void ProcessDBTable(DBTableDef table)
                   // return d;
                   if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
                   {
-                     rowGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', 
+                     rowGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=',
                         MkExpIdentifier(MkIdentifier("d"))))));
                   }
                   else
@@ -863,9 +863,9 @@ static void ProcessDBTable(DBTableDef table)
 
                   // *** SET ***
                   curContext = rowSet.compound.context = Context { parent = globalContext };
-                  
+
                   // SetData(fieldCNTid, value);
-                  rowSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("SetData")), 
+                  rowSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("SetData")),
                      args = MkList()))));
                   args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
                   args->Add(MkExpIdentifier(MkIdentifier("value")));
@@ -884,7 +884,7 @@ static void ProcessDBTable(DBTableDef table)
                      MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(fieldID)), null))));
                   ast->Add(external);
                   external.declaration.declMode = table.declMode;
-               
+
                   // fieldCLSname      = tClasses.AddField("name", class(String), 0 );
                   args = MkList();
                   addFieldStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("FindField")),
@@ -893,7 +893,7 @@ static void ProcessDBTable(DBTableDef table)
 
                   args = MkList();
                   addFieldStatements->Add(
-                     MkIfStmt(MkListOne(MkExpOp(null, '!', MkExpIdentifier(MkIdentifier(fieldID)))), 
+                     MkIfStmt(MkListOne(MkExpOp(null, '!', MkExpIdentifier(MkIdentifier(fieldID)))),
                         MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(fieldID)), '=', MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier(tableID)), MkIdentifier("AddField")),
                      args)))), null));
                   args->Add(MkExpString(entry.name));
@@ -911,11 +911,11 @@ static void ProcessDBTable(DBTableDef table)
                if(isIndex)
                {
                   // indexes[0].field = fieldCLSid;
-                  indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), 
+                  indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
                      MkListOne(MkExpConstant("0"))), MkIdentifier("field")),  '=', MkExpIdentifier(MkIdentifier(fieldID))))));
 
                   // indexes[0].order = ascending;
-                  indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), 
+                  indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
                      MkListOne(MkExpConstant("0"))), MkIdentifier("order")),  '=', MkExpIdentifier(MkIdentifier("ascending"))))));
 
                   // tClasses.Index(1, indexes);
@@ -955,7 +955,7 @@ static void ProcessDBTable(DBTableDef table)
          def = MkClassDefClassPropertyValue(MkIdentifier("nameField"), MkInitializerAssignment(exp = MkExpOp(null, '&', MkExpDBField(CopyString(table.name), MkIdentifier(nameField)))));
          ProcessExpression(exp);
          idClassDefs->Add(def);
-      }      
+      }
       // indexed = true;
    }
 
@@ -984,9 +984,9 @@ static void ProcessDBTable(DBTableDef table)
 
                   // *** GET ***
                   // RowContacts r { this };
-                  idGet.compound.declarations->Add(MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")), 
+                  idGet.compound.declarations->Add(MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")),
                      MkListOne(MkMembersInitList(MkListOne(MkMemberInit(null, MkInitializerAssignment(MkExpIdentifier(MkIdentifier("this"))))))))));
-                  
+
                   // Contact d = null;
                   if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
                   {
@@ -995,13 +995,13 @@ static void ProcessDBTable(DBTableDef table)
                   else
                   {
                      Expression exp;
-                     idGet.compound.declarations->Add(MkDeclaration(CopyList(entry.dataType.qualifiers, CopySpecifier), 
+                     idGet.compound.declarations->Add(MkDeclaration(CopyList(entry.dataType.qualifiers, CopySpecifier),
                         MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("d")), MkInitializerAssignment(exp = MkExpConstant("0"))))));
                      exp.destType = Type { kind = intType, refCount = 1 };
                   }
 
                   // r.GetData(fieldCNTid, d);
-                  idGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("GetData")), 
+                  idGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("GetData")),
                      args = MkList()))));
                   args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
                   /*if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
@@ -1015,7 +1015,7 @@ static void ProcessDBTable(DBTableDef table)
                   // return d;
                   if(spec.type == nameSpecifier && spec.symbol && spec.symbol.registered && spec.symbol.registered.type == structClass)
                   {
-                     idGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=', 
+                     idGet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier("value")), '=',
                         MkExpIdentifier(MkIdentifier("d"))))));
                   }
                   else
@@ -1023,14 +1023,14 @@ static void ProcessDBTable(DBTableDef table)
 
                   // *** SET ***
                   curContext = idSet.compound.context = Context { parent = globalContext };
-                  
+
                   // RowContacts r { this };
 
-                  idSet.compound.declarations->Add(MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")), 
+                  idSet.compound.declarations->Add(MkDeclarationInst(MkInstantiation(MkSpecifierName(rowClassName), MkExpIdentifier(MkIdentifier("r")),
                      MkListOne(MkMembersInitList(MkListOne(MkMemberInit(null, MkInitializerAssignment(MkExpIdentifier(MkIdentifier("this"))))))))));
 
                   // r.SetData(fieldCNTid, value);
-                  idSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("SetData")), 
+                  idSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("r")), MkIdentifier("SetData")),
                      args = MkList()))));
                   args->Add(MkExpIdentifier(MkIdentifier(fieldID)));
                   args->Add(MkExpIdentifier(MkIdentifier("value")));
@@ -1039,9 +1039,9 @@ static void ProcessDBTable(DBTableDef table)
                   idSet.compound.statements->Add(MkExpressionStmt(MkListOne(MkExpOp(null, DELETE, MkExpIdentifier(MkIdentifier("r"))))));
 
                   curContext = globalContext;
-                  
+
                   def = MkClassDefProperty(MkProperty(
-                     CopyList(entry.dataType.qualifiers, CopySpecifier), CopyDeclarator(entry.dataType.declarator), 
+                     CopyList(entry.dataType.qualifiers, CopySpecifier), CopyDeclarator(entry.dataType.declarator),
                         CopyIdentifier(entry.id), idSet, idGet));
                   def.propertyDef.symbol.id = def.propertyDef.symbol.idCode = symbolID;
                   def.memberAccess = publicAccess;
@@ -1094,9 +1094,9 @@ static void ProcessDBTable(DBTableDef table)
                      sprintf(num, "%d", c);
                      sprintf(fieldID, "__ecereDBField_%s_%s", tableName, item.id.string);
 
-                     indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), 
+                     indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
                         MkListOne(MkExpConstant(num))), MkIdentifier("field")),  '=', MkExpIdentifier(MkIdentifier(fieldID))))));
-                     indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")), 
+                     indexStatements->Add(MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIndex(MkExpIdentifier(MkIdentifier("indexes")),
                         MkListOne(MkExpConstant(num))), MkIdentifier("order")),  '=', MkExpIdentifier(MkIdentifier((item.order == ascending) ? "ascending" : "descending"))))));
                   }
                   sprintf(num, "%d", c);
@@ -1164,13 +1164,13 @@ public void ProcessDBTableDefinitions()
 
          switch(external.type)
          {
-            case functionExternal: 
+            case functionExternal:
                ProcessFunction(external.function);
                break;
-            case declarationExternal: 
+            case declarationExternal:
                ProcessDeclaration(external.declaration);
                break;
-            case classExternal: 
+            case classExternal:
                ProcessClass(external._class);
                break;
          }
index 380a73f..e101b9f 100644 (file)
@@ -28,7 +28,7 @@ public class DBTableDef : struct
 public:
    char * name;
    Symbol symbol;
-   OldList * definitions;   
+   OldList * definitions;
    AccessMode declMode;
 }
 
@@ -74,7 +74,7 @@ public void SetMainModule(ModuleImport moduleImport) { mainModule = moduleImport
 File fileInput;
 public void SetFileInput(File file) { fileInput = file; }
 char * symbolsDir = null;
-public void SetSymbolsDir(char * s) { 
+public void SetSymbolsDir(char * s) {
    delete symbolsDir;
    symbolsDir = CopyString(s);
 } public char * GetSymbolsDir() { return symbolsDir ? symbolsDir : ""; }
@@ -190,7 +190,7 @@ public:
             if(line - 1 > end.y)
                line -= end.y - start.y;
             // Location is the last touched line
-            else 
+            else
             {
                if(charPos - 1 >= end.x)
                {
@@ -221,7 +221,7 @@ public:
             if(charPos - 1 > start.x || (charPos - 1 == start.x /*&& (numLines ? true : false)*/))
             {
                line += numLines;
-               //charPos - 1 += numLines ? end.x : (end.x - start.x);            
+               //charPos - 1 += numLines ? end.x : (end.x - start.x);
                charPos += end.x - start.x;
             }
          }
@@ -236,7 +236,7 @@ public:
 
    bool Inside(int line, int charPos)
    {
-      return (start.line < line || (start.line == line && start.charPos <= charPos)) && 
+      return (start.line < line || (start.line == line && start.charPos <= charPos)) &&
              (end.line > line || (end.line == line && end.charPos >= charPos));
    }
 };
@@ -276,7 +276,7 @@ public:
 };
 
 public enum ExpressionType
-{ 
+{
    identifierExp, instanceExp, constantExp, stringExp, opExp,
    bracketsExp, indexExp, callExp, memberExp, pointerExp, typeSizeExp,
    castExp, conditionExp, newExp, renewExp, classSizeExp,
@@ -304,7 +304,7 @@ public class TemplateParameter : struct
 public:
    TemplateParameter prev, next;
    Location loc;
-   
+
    TemplateParameterType type;
    Identifier identifier;
    union
@@ -313,7 +313,7 @@ public:
       TemplateMemberType memberType;   // For identifier
    };
    TemplateArgument defaultArgument;
-    
+
    // For type parameters
    char * dataTypeString;
    Type baseType;
@@ -331,7 +331,7 @@ public class TemplateArgument : struct
 public:
    TemplateArgument prev, next;
    Location loc;
-   
+
    Identifier name;
    TemplateParameterType type;
    union
@@ -568,7 +568,7 @@ class Pointer : struct
 
 public enum DeclaratorType
 {
-   structDeclarator, identifierDeclarator, bracketsDeclarator, arrayDeclarator, 
+   structDeclarator, identifierDeclarator, bracketsDeclarator, arrayDeclarator,
    functionDeclarator, pointerDeclarator, extendedDeclarator, extendedDeclaratorEnd
 };
 
@@ -664,7 +664,7 @@ class AsmField : struct
 };
 
 public enum StmtType { labeledStmt, caseStmt, compoundStmt,
-               expressionStmt, ifStmt, switchStmt, whileStmt, doWhileStmt, 
+               expressionStmt, ifStmt, switchStmt, whileStmt, doWhileStmt,
                forStmt, gotoStmt, continueStmt, breakStmt, returnStmt, asmStmt, badDeclarationStmt,
                fireWatchersStmt, stopWatchingStmt, watchStmt, forEachStmt
              };
@@ -699,7 +699,7 @@ public:
       {
          OldList * exp;
          Statement stmt;
-         Statement elseStmt;                  
+         Statement elseStmt;
       } ifStmt;
       struct
       {
@@ -828,7 +828,7 @@ public:
    Class _class;
    OldList attached;    // For IDE
    AccessMode declMode;
-   
+
    // COMPILING DATA
    Type type;
    Symbol propSet;
@@ -897,7 +897,7 @@ public:
 };
 
 public enum ClassDefType
-{ 
+{
    functionClassDef, defaultPropertiesClassDef, declarationClassDef, propertyClassDef,
    propertyWatchClassDef, classDesignerClassDef, classNoExpansionClassDef, classFixedClassDef,
    designerDefaultPropertyClassDef, classDataClassDef, classPropertyClassDef, classPropertyValueClassDef,
@@ -1031,7 +1031,7 @@ public:
    char * constructorName, * structName, * className, * destructorName;
 
    ModuleImport module;
-   ClassImport _import;  
+   ClassImport _import;
    Location nameLoc;
    bool isParam;
    bool isRemote;
@@ -1097,7 +1097,7 @@ public:
 
 // For the .sym file:
 public enum TypeKind
-{ 
+{
    voidType, charType, shortType, intType, int64Type, longType, floatType,
    doubleType, classType, structType, unionType, functionType, arrayType, pointerType,
    ellipsisType, enumType, methodType, vaListType, /*typedObjectType, anyObjectType, classPointerType, */ dummyType,
@@ -1183,9 +1183,9 @@ public:
 
    void OnFree()
    {
-      
+
    }
-};            
+};
 
 public struct Operand
 {
@@ -1221,14 +1221,14 @@ public:
    bool (* Mul)(Expression, Operand, Operand);
    bool (* Div)(Expression, Operand, Operand);
    bool (* Mod)(Expression, Operand, Operand);
-   
+
    // unary arithmetic
    bool (* Neg)(Expression, Operand);
-   
+
    // unary arithmetic increment and decrement
    bool (* Inc)(Expression, Operand);
    bool (* Dec)(Expression, Operand);
-   
+
    // binary arithmetic assignment
    bool (* Asign)(Expression, Operand, Operand);
    bool (* AddAsign)(Expression, Operand, Operand);
@@ -1236,7 +1236,7 @@ public:
    bool (* MulAsign)(Expression, Operand, Operand);
    bool (* DivAsign)(Expression, Operand, Operand);
    bool (* ModAsign)(Expression, Operand, Operand);
-   
+
    // binary bitwise
    bool (* BitAnd)(Expression, Operand, Operand);
    bool (* BitOr)(Expression, Operand, Operand);
@@ -1244,31 +1244,31 @@ public:
    bool (* LShift)(Expression, Operand, Operand);
    bool (* RShift)(Expression, Operand, Operand);
    bool (* BitNot)(Expression, Operand);
-   
+
    // binary bitwise assignment
    bool (* AndAsign)(Expression, Operand, Operand);
    bool (* OrAsign)(Expression, Operand, Operand);
    bool (* XorAsign)(Expression, Operand, Operand);
    bool (* LShiftAsign)(Expression, Operand, Operand);
    bool (* RShiftAsign)(Expression, Operand, Operand);
-   
+
    // unary logical negation
    bool (* Not)(Expression, Operand);
-   
+
    // binary logical equality
    bool (* Equ)(Expression, Operand, Operand);
    bool (* Nqu)(Expression, Operand, Operand);
-   
+
    // binary logical
    bool (* And)(Expression, Operand, Operand);
    bool (* Or)(Expression, Operand, Operand);
-   
+
    // binary logical relational
    bool (* Grt)(Expression, Operand, Operand);
    bool (* Sma)(Expression, Operand, Operand);
    bool (* GrtEqu)(Expression, Operand, Operand);
    bool (* SmaEqu)(Expression, Operand, Operand);
-   
+
    bool (* Cond)(Expression, Operand, Operand, Operand);
 };
 
@@ -1345,7 +1345,7 @@ void Compiler_Warning(char * format, ...)
          GetWorkingDir(string, sizeof(string));
          PathCat(string, sourceFile);
       }
-      
+
       printf(string);
 
       //printf("(%d, %d) : warning: ", yylloc.start.line, yylloc.start.charPos);
index 0f952d5..6e1b5c2 100644 (file)
@@ -2,20 +2,20 @@
 /* A Bison parser, made by GNU Bison 2.4.2.  */
 
 /* Skeleton implementation for Bison's Yacc-like parsers in C
-   
+
       Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
    Foundation, Inc.
-   
+
    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 3 of the License, or
    (at your option) any later version.
-   
+
    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.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -28,7 +28,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -3081,7 +3081,7 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-\f
+
 
 #if YYERROR_VERBOSE
 
@@ -3292,7 +3292,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
     }
 }
 #endif /* YYERROR_VERBOSE */
-\f
+
 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
@@ -6712,16 +6712,16 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 954 "expression.y"
-    { 
-         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (4)].list)); 
-         (yyval.initializer).loc = (yyloc); 
+    {
+         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (4)].list));
+         (yyval.initializer).loc = (yyloc);
 
          {
             Expression exp = MkExpDummy();
             Initializer init = MkInitializerAssignment(exp);
             init.loc = (yylsp[(3) - (4)]);
             exp.loc = (yylsp[(3) - (4)]);
-            ListAdd((yyvsp[(2) - (4)].list), init); 
+            ListAdd((yyvsp[(2) - (4)].list), init);
          }
       ;}
     break;
@@ -6842,11 +6842,11 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 1040 "expression.y"
-    { 
-      (yyval.stmt) = MkCompoundStmt(null, null); 
-      (yyval.stmt).compound.context = PushContext(); 
+    {
+      (yyval.stmt) = MkCompoundStmt(null, null);
+      (yyval.stmt).compound.context = PushContext();
       PopContext((yyval.stmt).compound.context);
-      (yyval.stmt).loc = (yyloc); 
+      (yyval.stmt).loc = (yyloc);
    ;}
     break;
 
index f060187..be84b94 100644 (file)
@@ -33,7 +33,7 @@ static void AddDefinitions(Class regClass, DataMember member, OldList definition
                            Expression posExp = (d.type == structDeclarator) ? d.structDecl.posExp : null;
                            int bitSize = 0, bitPos = -1;
                            char dataTypeString[1024] = "";
-                        
+
                            if(sizeExp)
                            {
                               // Should this be processed/computed later?
@@ -95,14 +95,14 @@ static void AddDefinitions(Class regClass, DataMember member, OldList definition
 
                               if(member)
                               {
-                                 dataMember = eMember_AddDataMember(member, declId.string, 
+                                 dataMember = eMember_AddDataMember(member, declId.string,
                                     typeString, 0, 0 /*ComputeTypeSize(dataType)*/, def.memberAccess);
                                  if(!dataMember)
                                     Compiler_Error($"Member with same name already exists %s in member %s\n", declId.string, member.name);
                               }
                               else if(regClass)
                               {
-                                 dataMember = eClass_AddDataMember(regClass, declId.string, 
+                                 dataMember = eClass_AddDataMember(regClass, declId.string,
                                     typeString, 0, 0 /*ComputeTypeSize(dataType)*/, def.memberAccess);
                                  if(!dataMember)
                                     Compiler_Error($"Member with same name already exists %s in class %s\n", declId.string, regClass.name);
@@ -129,7 +129,7 @@ static void AddDefinitions(Class regClass, DataMember member, OldList definition
                         if(spec.definitions && !spec.id)
                         {
                            DataMember dataMember = eMember_New((spec.type == unionSpecifier) ? unionMember : structMember, def.memberAccess);
-                           
+
                            AddDefinitions(null, dataMember, spec.definitions);
 
                            if(member)
@@ -156,14 +156,14 @@ static void AddDefinitions(Class regClass, DataMember member, OldList definition
 
                               if(member)
                               {
-                                 dataMember = eMember_AddDataMember(member, id.string, 
+                                 dataMember = eMember_AddDataMember(member, id.string,
                                     typeString, 0, 0 /*ComputeTypeSize(dataType)*/, def.memberAccess);
                                  if(!dataMember)
                                     Compiler_Error($"Member with same name already exists %s in member %s\n", id.string, member.name);
                               }
                               else
                               {
-                                 dataMember = eClass_AddDataMember(regClass, id.string, 
+                                 dataMember = eClass_AddDataMember(regClass, id.string,
                                     typeString, 0, 0 /*ComputeTypeSize(dataType)*/, def.memberAccess);
                                  if(!dataMember)
                                     Compiler_Error($"Member with same name already exists %s in class %s\n", id.string, regClass.name);
@@ -226,7 +226,7 @@ static void AddDefinitions(Class regClass, DataMember member, OldList definition
 
             // Register the property in the list
             // MOVED THIS UP HERE BEFORE NEXT BLOCK BECAUSE WE NULL OUT SPECIFIERS/DECLARATORS... OK?
-            
+
             char * dataTypeString = StringFromSpecDecl(propertyDef.specifiers, propertyDef.declarator);
             prop = eClass_AddProperty(regClass, propertyDef.conversion ? null : propertyDef.id.string,
                dataTypeString,
@@ -237,7 +237,7 @@ static void AddDefinitions(Class regClass, DataMember member, OldList definition
                if(inCompiler) prop.IsSet = (void *)propertyDef.issetStmt;
 
                prop.compiled = false;
-               
+
                // prop.symbol = propertyDef.symbol;
                prop.symbol = Symbol
                {
@@ -246,7 +246,7 @@ static void AddDefinitions(Class regClass, DataMember member, OldList definition
                   type = propertyDef.symbol.type;
                };
 
-               /*if(propertyDef.category) 
+               /*if(propertyDef.category)
                {
                   char temp[1024];
                   ReadString(temp, propertyDef.category);
@@ -278,7 +278,7 @@ static void AddDefinitions(Class regClass, DataMember member, OldList definition
 
             // Register the property in the list
             // MOVED THIS UP HERE BEFORE NEXT BLOCK BECAUSE WE NULL OUT SPECIFIERS/DECLARATORS... OK?
-            
+
             char * dataTypeString = StringFromSpecDecl(propertyDef.specifiers, propertyDef.declarator);
             prop = eClass_AddClassProperty(regClass, propertyDef.id.string, dataTypeString,
                inCompiler ? propertyDef.setStmt : null, inCompiler ? propertyDef.getStmt : null);
@@ -339,12 +339,12 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                }
             }
          }
-         else if(baseType.kind == structType || baseType.kind == unionType) 
+         else if(baseType.kind == structType || baseType.kind == unionType)
          {
             classType = noHeadClass;
             baseName[0] = '\0';
          }
-         else 
+         else
             unitType = true;
          FreeType(baseType);
 
@@ -430,7 +430,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                Declarator funcDecl = GetFuncDecl(func.declarator);
                Identifier id = GetDeclId(funcDecl);
                Method method;
-                        
+
                if(func.isVirtual)
                {
                   char * typeString = StringFromSpecDecl(func.specifiers, func.declarator);
@@ -440,7 +440,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                else
                {
                   char * typeString = StringFromSpecDecl(func.specifiers, func.declarator);
-                  method = eClass_AddMethod(regClass, id.string, typeString, 
+                  method = eClass_AddMethod(regClass, id.string, typeString,
                      inCompiler ? func.declarator.symbol : null, def.memberAccess);
                   if(!method)
                      Compiler_Error($"Redefinition of method %s in class %s\n", id.string, regClass.name);
@@ -494,7 +494,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
             switch(param.type)
             {
                case type:
-                  defaultArg.dataTypeString = 
+                  defaultArg.dataTypeString =
                      StringFromSpecDecl(param.defaultArgument.templateDatatype.specifiers, param.defaultArgument.templateDatatype.decl);
                   break;
                case identifier:
@@ -515,7 +515,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                            strcpy(memberString, param.defaultArgument.identifier._class.name);
                      }
                   }
-                  
+
                   if(memberString[0])
                   {
                      strcat(memberString, "::");
@@ -587,7 +587,7 @@ public void PrePreProcessClassDefinitions()
                   Specifier specifier;
                   for(specifier = declaration.specifiers->first; specifier; specifier = specifier.next)
                   {
-                     if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string && 
+                     if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string &&
                         (declaration.declMode || specifier.baseSpecs || (specifier.type == enumSpecifier && specifier.definitions)))
                      {
                         Symbol type = FindType(globalContext, specifier.id.string);
@@ -653,7 +653,7 @@ public void PrePreProcessClassDefinitions()
                      Specifier specifier;
                      for(specifier = declaration.specifiers->first; specifier; specifier = specifier.next)
                      {
-                        if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string && 
+                        if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string &&
                            (declaration.declMode || specifier.baseSpecs || (specifier.type == enumSpecifier && specifier.definitions)))
                         {
                            Symbol type = FindType(globalContext, specifier.id.string);
@@ -676,7 +676,7 @@ public void PrePreProcessClassDefinitions()
                   }
                }
             }
-         } 
+         }
       }
    }
 }
index 8a0d69b..03c66fa 100644 (file)
@@ -399,7 +399,7 @@ static void _FreeExpression(Expression exp, bool freePointer)
       {
          if(exp.index.exp)
             FreeExpression(exp.index.exp);
-         if(exp.index.index) 
+         if(exp.index.index)
             FreeList(exp.index.index, FreeExpression);
          break;
       }
@@ -693,10 +693,10 @@ void FreeStatement(Statement stmt)
       {
          if(stmt.forStmt.init)
             FreeStatement(stmt.forStmt.init);
-         
+
          if(stmt.forStmt.check)
             FreeStatement(stmt.forStmt.check);
-         
+
          if(stmt.forStmt.increment)
             FreeList(stmt.forStmt.increment, FreeExpression);
          if(stmt.forStmt.stmt)
@@ -888,7 +888,7 @@ void FreeInstance(Instantiation inst)
 
    if(inst._class)
       FreeSpecifier(inst._class);
-   
+
    // Free symbol?
    // Free data;
 
@@ -936,7 +936,7 @@ void FreeProperty(PropertyDef def)
       FreeStatement(def.issetStmt);
    if(def.category)
       FreeExpression(def.category);
-   
+
    /*
    if(def.getFunction)
       FreeFunction(def.getFunction);
@@ -1071,15 +1071,15 @@ void FreeExternal(External external)
 {
    switch(external.type)
    {
-      case functionExternal: 
+      case functionExternal:
          if(external.function)
             FreeFunction(external.function);
          break;
-      case declarationExternal: 
+      case declarationExternal:
          if(external.declaration)
             FreeDeclaration(external.declaration);
          break;
-      case classExternal: 
+      case classExternal:
          if(external._class)
             FreeClass(external._class);
          break;
@@ -1132,7 +1132,7 @@ void FreeModuleData(Module module)
 {
    Class _class;
    GlobalFunction function;
-   
+
    // Unload classes
    for(_class = module.classes.first; _class; _class = _class.next)
    {
@@ -1202,12 +1202,12 @@ void FreeModuleData(Module module)
          }
       }
    }
-   
+
    for(function = module.functions.first; function; function = function.next)
    {
-      if(function.dataType) 
+      if(function.dataType)
          FreeType(function.dataType);
-      if(function.symbol) 
+      if(function.symbol)
          FreeSymbol(function.symbol);
    }
 
index 82a44fc..dfe4737 100644 (file)
@@ -2,20 +2,20 @@
 /* A Bison parser, made by GNU Bison 2.4.2.  */
 
 /* Skeleton implementation for Bison's Yacc-like parsers in C
-   
+
       Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
    Foundation, Inc.
-   
+
    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 3 of the License, or
    (at your option) any later version.
-   
+
    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.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -28,7 +28,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -288,7 +288,7 @@ typedef union YYSTYPE
    TemplateParameter templateParameter;
    TemplateArgument templateArgument;
    TemplateDatatype templateDatatype;
-   
+
    DBTableEntry dbtableEntry;
    DBIndexItem dbindexItem;
    DBTableDef dbtableDef;
@@ -10495,7 +10495,7 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-\f
+
 
 #if YYERROR_VERBOSE
 
@@ -10706,7 +10706,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
     }
 }
 #endif /* YYERROR_VERBOSE */
-\f
+
 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
@@ -12909,7 +12909,7 @@ yyreduce:
 
       FreeIdentifier((yyvsp[(1) - (2)].id));
 
-      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start); 
+      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start);
       resetScannerPos(&(yylsp[(1) - (2)]).start);
       yyclearin;
 
@@ -12944,7 +12944,7 @@ yyreduce:
 
       FreeIdentifier((yyvsp[(1) - (2)].id));
 
-      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start); 
+      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start);
       resetScannerPos(&(yylsp[(1) - (2)]).start);
       yyclearin;
 
@@ -12986,7 +12986,7 @@ yyreduce:
       FreeIdentifier((yyvsp[(1) - (2)].id));
       FreeIdentifier((yyvsp[(2) - (2)].id));
 
-      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start); 
+      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start);
       resetScannerPos(&(yylsp[(1) - (2)]).start);
       yyclearin;
 
@@ -12998,8 +12998,8 @@ yyreduce:
       YY_STACK_PRINT (yyss, yyssp);
       goto yysetstate;
    #else
-      Location tmpLoc = yylloc; (yyval.specifier) = (yyvsp[(2) - (2)].id); yylloc = (yylsp[(1) - (2)]); 
-      Compiler_Error($"Not a type: %s\n", (yyvsp[(1) - (2)].id).string);      
+      Location tmpLoc = yylloc; (yyval.specifier) = (yyvsp[(2) - (2)].id); yylloc = (yylsp[(1) - (2)]);
+      Compiler_Error($"Not a type: %s\n", (yyvsp[(1) - (2)].id).string);
       yylloc = tmpLoc; (yyvsp[(2) - (2)].id).badID = (yyvsp[(1) - (2)].id);
    #endif
    ;}
@@ -13036,7 +13036,7 @@ yyreduce:
       (yyval.specifier).loc = (yyloc);
 
       (yylsp[(4) - (4)]).end.pos--;
-      fileInput.Seek((yylsp[(4) - (4)]).end.pos, start); 
+      fileInput.Seek((yylsp[(4) - (4)]).end.pos, start);
       resetScannerPos(&(yylsp[(4) - (4)]).end);
       yyclearin;
     ;}
@@ -13263,11 +13263,11 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 627 "grammar.y"
-    { 
+    {
          (yyval.memberInit) = MkMemberInitExp((yyvsp[(1) - (3)].exp), MkInitializerAssignment(MkExpDummy()));
-         (yyval.memberInit).loc = (yyloc); (yyval.memberInit).realLoc = (yyloc); (yyval.memberInit).initializer.loc.start = (yyval.memberInit).initializer.loc.end = (yylsp[(2) - (3)]).end; 
+         (yyval.memberInit).loc = (yyloc); (yyval.memberInit).realLoc = (yyloc); (yyval.memberInit).initializer.loc.start = (yyval.memberInit).initializer.loc.end = (yylsp[(2) - (3)]).end;
 
-         fileInput.Seek((yylsp[(2) - (3)]).end.pos, start); 
+         fileInput.Seek((yylsp[(2) - (3)]).end.pos, start);
          yyclearin;
          resetScannerPos(&(yylsp[(2) - (3)]).end);
          (yyloc).start = (yylsp[(1) - (3)]).start;
@@ -13328,13 +13328,13 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 656 "grammar.y"
-    { ((MemberInit)(yyvsp[(1) - (3)].list)->last).loc.end = (yylsp[(2) - (3)]).end; 
-         { 
-            Initializer dummy = MkInitializerAssignment(MkExpDummy()); 
-            MemberInit memberInit = MkMemberInit(null, dummy); 
-            memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = (yylsp[(2) - (3)]).end; 
-            memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = (yylsp[(2) - (3)]).end; 
-            ListAdd((yyvsp[(1) - (3)].list), memberInit); 
+    { ((MemberInit)(yyvsp[(1) - (3)].list)->last).loc.end = (yylsp[(2) - (3)]).end;
+         {
+            Initializer dummy = MkInitializerAssignment(MkExpDummy());
+            MemberInit memberInit = MkMemberInit(null, dummy);
+            memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = (yylsp[(2) - (3)]).end;
+            memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = (yylsp[(2) - (3)]).end;
+            ListAdd((yyvsp[(1) - (3)].list), memberInit);
           }
           (yyval.list) = (yyvsp[(1) - (3)].list);
        ;}
@@ -13344,13 +13344,13 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 668 "grammar.y"
-    { ((MemberInit)(yyvsp[(1) - (3)].list)->last).loc.end = (yylsp[(2) - (3)]).end; 
-         { 
-            Initializer dummy = MkInitializerAssignment(MkExpDummy()); 
-            MemberInit memberInit = MkMemberInit(null, dummy); 
-            memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = (yylsp[(2) - (3)]).end; 
-            memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = (yylsp[(2) - (3)]).end; 
-            ListAdd((yyvsp[(1) - (3)].list), memberInit); 
+    { ((MemberInit)(yyvsp[(1) - (3)].list)->last).loc.end = (yylsp[(2) - (3)]).end;
+         {
+            Initializer dummy = MkInitializerAssignment(MkExpDummy());
+            MemberInit memberInit = MkMemberInit(null, dummy);
+            memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = (yylsp[(2) - (3)]).end;
+            memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = (yylsp[(2) - (3)]).end;
+            ListAdd((yyvsp[(1) - (3)].list), memberInit);
           }
           (yyval.list) = (yyvsp[(1) - (3)].list);
        ;}
@@ -13362,18 +13362,18 @@ yyreduce:
 #line 679 "grammar.y"
     {
          Initializer dummy = MkInitializerAssignment(MkExpDummy());
-         MemberInit memberInit = MkMemberInit(null, dummy); 
-         memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = (yylsp[(1) - (1)]).start; 
-         memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = (yylsp[(1) - (1)]).start; 
+         MemberInit memberInit = MkMemberInit(null, dummy);
+         memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = (yylsp[(1) - (1)]).start;
+         memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = (yylsp[(1) - (1)]).start;
 
          (yyval.list) = MkList();
-         ListAdd((yyval.list), memberInit); 
+         ListAdd((yyval.list), memberInit);
 
-         dummy = MkInitializerAssignment(MkExpDummy()); 
-         memberInit = MkMemberInit(null, dummy); 
-         memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = (yylsp[(1) - (1)]).end; 
-         memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = (yylsp[(1) - (1)]).end; 
-         ListAdd((yyval.list), memberInit); 
+         dummy = MkInitializerAssignment(MkExpDummy());
+         memberInit = MkMemberInit(null, dummy);
+         memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = (yylsp[(1) - (1)]).end;
+         memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = (yylsp[(1) - (1)]).end;
+         ListAdd((yyval.list), memberInit);
       ;}
     break;
 
@@ -13661,7 +13661,7 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 841 "grammar.y"
-    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (3)]); 
+    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (3)]);
       yylloc = tmpLoc;  (yyval.instance) = MkInstantiation(MkSpecifierName((yyvsp[(1) - (3)].id).string), null, (yyvsp[(3) - (3)].list));  (yyval.instance).loc = (yyloc); (yyval.instance).insideLoc.start = (yylsp[(2) - (3)]).end; (yyval.instance).insideLoc.end = (yylsp[(3) - (3)]).end; FreeIdentifier((yyvsp[(1) - (3)].id)); ;}
     break;
 
@@ -13697,7 +13697,7 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 856 "grammar.y"
-    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (3)]); 
+    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (3)]);
       yylloc = tmpLoc;  (yyval.instance) = MkInstantiation(MkSpecifierName((yyvsp[(1) - (3)].id).string), null, (yyvsp[(3) - (3)].list));  (yyval.instance).loc = (yyloc); (yyval.instance).insideLoc.start = (yylsp[(2) - (3)]).end; (yyval.instance).insideLoc.end = (yylsp[(3) - (3)]).end;  (yyval.instance).loc.end.charPos++; (yyval.instance).loc.end.pos++; FreeIdentifier((yyvsp[(1) - (3)].id)); ;}
     break;
 
@@ -13705,7 +13705,7 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 859 "grammar.y"
-    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (2)]); 
+    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (2)]);
       yylloc = tmpLoc;  (yyval.instance) = MkInstantiation(MkSpecifierName((yyvsp[(1) - (2)].id).string), null, null);  (yyval.instance).loc = (yyloc); (yyval.instance).insideLoc.start = (yylsp[(2) - (2)]).end; (yyval.instance).insideLoc.end = (yylsp[(2) - (2)]).end;  (yyval.instance).loc.end.charPos++; (yyval.instance).loc.end.pos++; FreeIdentifier((yyvsp[(1) - (2)].id)); ;}
     break;
 
@@ -13713,7 +13713,7 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 862 "grammar.y"
-    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (4)]); 
+    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (4)]);
       yylloc = tmpLoc;  (yyval.instance) = MkInstantiation(MkSpecifierName((yyvsp[(1) - (4)].id).string), null, (yyvsp[(3) - (4)].list));  (yyval.instance).loc = (yyloc); (yyval.instance).insideLoc.start = (yylsp[(2) - (4)]).end; (yyval.instance).insideLoc.end = (yylsp[(3) - (4)]).end;  (yyval.instance).loc.end.charPos++; (yyval.instance).loc.end.pos++; FreeIdentifier((yyvsp[(1) - (4)].id)); ;}
     break;
 
@@ -13721,7 +13721,7 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 865 "grammar.y"
-    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (3)]); 
+    { Location tmpLoc = yylloc; yylloc = (yylsp[(1) - (3)]);
       yylloc = tmpLoc;  (yyval.instance) = MkInstantiation(MkSpecifierName((yyvsp[(1) - (3)].id).string), null, null);  (yyval.instance).loc = (yyloc); (yyval.instance).insideLoc.start = (yylsp[(2) - (3)]).end; (yyval.instance).insideLoc.end = (yylsp[(2) - (3)]).end; (yyval.instance).loc.end.charPos++; (yyval.instance).loc.end.pos++; FreeIdentifier((yyvsp[(1) - (3)].id)); ;}
     break;
 
@@ -14580,10 +14580,10 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 1305 "grammar.y"
-    { 
-      (yyvsp[(1) - (2)].context); (yyval.symbol) = DeclClass(globalContext.nextID++, (yyvsp[(2) - (2)].specifier).name); 
-      (yyval.symbol).nameLoc = (yylsp[(2) - (2)]); 
-      FreeSpecifier((yyvsp[(2) - (2)].specifier)); 
+    {
+      (yyvsp[(1) - (2)].context); (yyval.symbol) = DeclClass(globalContext.nextID++, (yyvsp[(2) - (2)].specifier).name);
+      (yyval.symbol).nameLoc = (yylsp[(2) - (2)]);
+      FreeSpecifier((yyvsp[(2) - (2)].specifier));
       ++defaultMemberAccess;
       memberAccessStack[defaultMemberAccess] = privateAccess;
    ;}
@@ -14614,11 +14614,11 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 1317 "grammar.y"
-    { 
+    {
       (yyvsp[(1) - (5)].context); (yyval.symbol) = DeclClass(globalContext.nextID++, (yyvsp[(2) - (5)].specifier).name);
-      (yyval.symbol).templateParams = (yyvsp[(4) - (5)].list); 
-      (yyval.symbol).nameLoc = (yylsp[(2) - (5)]); 
-      FreeSpecifier((yyvsp[(2) - (5)].specifier)); 
+      (yyval.symbol).templateParams = (yyvsp[(4) - (5)].list);
+      (yyval.symbol).nameLoc = (yylsp[(2) - (5)]);
+      FreeSpecifier((yyvsp[(2) - (5)].specifier));
       ++defaultMemberAccess;
       memberAccessStack[defaultMemberAccess] = privateAccess;
    ;}
@@ -14644,7 +14644,7 @@ yyreduce:
 #line 1332 "grammar.y"
     {
          (yyval._class).loc = (yyloc);
-         (yyval._class) = (yyvsp[(1) - (2)]._class); 
+         (yyval._class) = (yyvsp[(1) - (2)]._class);
       ;}
     break;
 
@@ -16455,8 +16455,8 @@ yyreduce:
 
          FreeExpression((yyvsp[(1) - (2)].exp));
          FreeExpression((yyvsp[(2) - (2)].exp));
-         
-         fileInput.Seek((yylsp[(1) - (2)]).start.pos, start); 
+
+         fileInput.Seek((yylsp[(1) - (2)]).start.pos, start);
          resetScannerPos(&(yylsp[(1) - (2)]).start);
          yyclearin;
 
@@ -16467,7 +16467,7 @@ yyreduce:
          YYPOPSTACK(1);
          yystate = *yyssp;
          YY_STACK_PRINT (yyss, yyssp);
-/*         
+/*
          YYPOPSTACK(1);
          yystate = *yyssp;
          YY_STACK_PRINT (yyss, yyssp);
@@ -16484,7 +16484,7 @@ yyreduce:
       {
          (yyval.exp) = MkExpOp((yyvsp[(1) - (2)].exp), '<', (yyvsp[(2) - (2)].exp));
          (yyval.exp).loc = (yyloc);
-      } 
+      }
       skipErrors = false;
    ;}
     break;
@@ -16878,11 +16878,11 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 2022 "grammar.y"
-    { 
-         (yyval.exp) = MkExpCondition((yyvsp[(1) - (3)].exp), MkListOne(MkExpDummy()), MkExpDummy()); 
-         (yyval.exp).loc = (yyloc); 
-         ((Expression)(yyval.exp).cond.exp->last).loc = (yylsp[(2) - (3)]); 
-         (yyval.exp).cond.elseExp.loc = (yylsp[(3) - (3)]); 
+    {
+         (yyval.exp) = MkExpCondition((yyvsp[(1) - (3)].exp), MkListOne(MkExpDummy()), MkExpDummy());
+         (yyval.exp).loc = (yyloc);
+         ((Expression)(yyval.exp).cond.exp->last).loc = (yylsp[(2) - (3)]);
+         (yyval.exp).cond.elseExp.loc = (yylsp[(3) - (3)]);
       ;}
     break;
 
@@ -19180,8 +19180,8 @@ yyreduce:
 /* Line 1464 of yacc.c  */
 #line 2783 "grammar.y"
     {
-         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (2)].declarator), (yyvsp[(2) - (2)].list)); 
-         fileInput.Seek((yylsp[(1) - (2)]).end.pos, start); 
+         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (2)].declarator), (yyvsp[(2) - (2)].list));
+         fileInput.Seek((yylsp[(1) - (2)]).end.pos, start);
          yyclearin;
          resetScannerPos(&(yylsp[(1) - (2)]).end);
          (yyloc).start = (yylsp[(1) - (2)]).start;
@@ -19193,9 +19193,9 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 2792 "grammar.y"
-    { 
-         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (2)].declarator), null); 
-         fileInput.Seek((yylsp[(1) - (2)]).end.pos, start); 
+    {
+         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (2)].declarator), null);
+         fileInput.Seek((yylsp[(1) - (2)]).end.pos, start);
          yyclearin;
          resetScannerPos(&(yylsp[(1) - (2)]).end);
          (yyloc).start = (yylsp[(1) - (2)]).start;
@@ -19207,9 +19207,9 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 2801 "grammar.y"
-    { 
-         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (3)].declarator), (yyvsp[(2) - (3)].list)); 
-         fileInput.Seek((yylsp[(1) - (3)]).end.pos, start); 
+    {
+         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (3)].declarator), (yyvsp[(2) - (3)].list));
+         fileInput.Seek((yylsp[(1) - (3)]).end.pos, start);
          yyclearin;
          resetScannerPos(&(yylsp[(1) - (3)]).end);
          (yyloc).start = (yylsp[(1) - (3)]).start;
@@ -19221,9 +19221,9 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 2810 "grammar.y"
-    { 
-         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (4)].declarator), null); 
-         fileInput.Seek((yylsp[(1) - (4)]).end.pos, start); 
+    {
+         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (4)].declarator), null);
+         fileInput.Seek((yylsp[(1) - (4)]).end.pos, start);
          yyclearin;
          resetScannerPos(&(yylsp[(1) - (4)]).end);
          (yyloc).start = (yylsp[(1) - (4)]).start;
@@ -19273,8 +19273,8 @@ yyreduce:
 /* Line 1464 of yacc.c  */
 #line 2843 "grammar.y"
     {
-         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (2)].declarator), (yyvsp[(2) - (2)].list)); 
-         fileInput.Seek((yylsp[(1) - (2)]).end.pos, start); 
+         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (2)].declarator), (yyvsp[(2) - (2)].list));
+         fileInput.Seek((yylsp[(1) - (2)]).end.pos, start);
          yyclearin;
          resetScannerPos(&(yylsp[(1) - (2)]).end);
          (yyloc).start = (yylsp[(1) - (2)]).start;
@@ -19286,9 +19286,9 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 2852 "grammar.y"
-    { 
-         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (2)].declarator), null); 
-         fileInput.Seek((yylsp[(1) - (2)]).end.pos, start); 
+    {
+         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (2)].declarator), null);
+         fileInput.Seek((yylsp[(1) - (2)]).end.pos, start);
          yyclearin;
          resetScannerPos(&(yylsp[(1) - (2)]).end);
          (yyloc).start = (yylsp[(1) - (2)]).start;
@@ -19300,9 +19300,9 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 2861 "grammar.y"
-    { 
-         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (3)].declarator), (yyvsp[(2) - (3)].list)); 
-         fileInput.Seek((yylsp[(1) - (3)]).end.pos, start); 
+    {
+         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (3)].declarator), (yyvsp[(2) - (3)].list));
+         fileInput.Seek((yylsp[(1) - (3)]).end.pos, start);
          yyclearin;
          resetScannerPos(&(yylsp[(1) - (3)]).end);
          (yyloc).start = (yylsp[(1) - (3)]).start;
@@ -19314,9 +19314,9 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 2870 "grammar.y"
-    { 
-         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (4)].declarator), null); 
-         fileInput.Seek((yylsp[(1) - (4)]).end.pos, start); 
+    {
+         (yyval.declarator) = MkDeclaratorFunction((yyvsp[(1) - (4)].declarator), null);
+         fileInput.Seek((yylsp[(1) - (4)]).end.pos, start);
          yyclearin;
          resetScannerPos(&(yylsp[(1) - (4)]).end);
          (yyloc).start = (yylsp[(1) - (4)]).start;
@@ -19890,16 +19890,16 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 3092 "grammar.y"
-    { 
-         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (4)].list)); 
-         (yyval.initializer).loc = (yyloc); 
+    {
+         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (4)].list));
+         (yyval.initializer).loc = (yyloc);
 
          {
             Expression exp = MkExpDummy();
             Initializer init = MkInitializerAssignment(exp);
             init.loc = (yylsp[(3) - (4)]);
             exp.loc = (yylsp[(3) - (4)]);
-            ListAdd((yyvsp[(2) - (4)].list), init); 
+            ListAdd((yyvsp[(2) - (4)].list), init);
          }
       ;}
     break;
@@ -19929,8 +19929,8 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 3111 "grammar.y"
-    { 
-         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (5)].list)); 
+    {
+         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (5)].list));
          (yyval.initializer).loc = (yyloc);
 
          {
@@ -19938,7 +19938,7 @@ yyreduce:
             Initializer init = MkInitializerAssignment(exp);
             init.loc = (yylsp[(3) - (5)]);
             exp.loc = (yylsp[(3) - (5)]);
-            ListAdd((yyvsp[(2) - (5)].list), init); 
+            ListAdd((yyvsp[(2) - (5)].list), init);
          }
       ;}
     break;
@@ -19947,8 +19947,8 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 3124 "grammar.y"
-    { 
-         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (3)].list)); 
+    {
+         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (3)].list));
          (yyval.initializer).loc = (yyloc);
 
          {
@@ -19956,7 +19956,7 @@ yyreduce:
             Initializer init = MkInitializerAssignment(exp);
             init.loc = (yylsp[(3) - (3)]);
             exp.loc = (yylsp[(3) - (3)]);
-            ListAdd((yyvsp[(2) - (3)].list), init); 
+            ListAdd((yyvsp[(2) - (3)].list), init);
          }
       ;}
     break;
@@ -21512,7 +21512,7 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 3578 "grammar.y"
-    { 
+    {
       int len1 = strlen((yyvsp[(1) - (2)].string));
       int len2 = strlen(yytext);
       (yyval.string) = new byte[len1-1 + len2-1 + 1];
@@ -21570,11 +21570,11 @@ yyreduce:
 #line 3601 "grammar.y"
     {
       bool isRemote = !strcmp((yyvsp[(2) - (3)].id).string, "remote");
-      (yyval.external) = MkExternalImport((yyvsp[(3) - (3)].string), isRemote ? remoteImport : normalImport, (declMode != defaultAccess) ? declMode : privateAccess); 
+      (yyval.external) = MkExternalImport((yyvsp[(3) - (3)].string), isRemote ? remoteImport : normalImport, (declMode != defaultAccess) ? declMode : privateAccess);
       (yyval.external).loc = (yyloc);
       FreeIdentifier((yyvsp[(2) - (3)].id));
       if(!isRemote)
-         yyerror(); 
+         yyerror();
    ;}
     break;
 
@@ -21631,7 +21631,7 @@ yyreduce:
       FreeIdentifier((yyvsp[(3) - (4)].id));
       declMode = defaultDeclMode;
       if(!isRemote)
-         yyerror();  
+         yyerror();
    ;}
     break;
 
index 583c82a..4255564 100644 (file)
@@ -1282,9 +1282,9 @@ YY_DECL
 
 
 
-   yylloc.start = yylloc.end; 
-   type_yylloc.start = type_yylloc.end; 
-   expression_yylloc.start = expression_yylloc.end; 
+   yylloc.start = yylloc.end;
+   type_yylloc.start = type_yylloc.end;
+   expression_yylloc.start = expression_yylloc.end;
 
 
 #line 1290 "lexer.ec"
@@ -1677,14 +1677,14 @@ YY_RULE_SETUP
  */
 /*
  [__attribute__] [spaces]
-   [((] [spaces] 
+   [((] [spaces]
       [digits | letters] [spaces]
          ( [(]  [digits or letters or "]  ( [spaces] [,] [spaces] [digits or letters or "] )*  [spaces]  [)] )?
       [spaces]
       ( [,] [spaces]  [digits or letters]  [spaces]
          ( [(]  [digits or letters or "]
             ( [spaces] [,] [spaces] [digits or letters or "] )*  [spaces] [)]
-         )? [spaces] 
+         )? [spaces]
       )*
    [))]
  */
@@ -2236,19 +2236,19 @@ YY_RULE_SETUP
 case 163:
 YY_RULE_SETUP
 #line 295 "lexer.l"
-{ 
-   yylloc.end.charPos = 1; yylloc.end.line += yyleng; yylloc.start = yylloc.end; 
-   type_yylloc.end.charPos = 1; type_yylloc.end.line += yyleng; type_yylloc.start = type_yylloc.end; 
-   expression_yylloc.end.charPos = 1; expression_yylloc.end.line += yyleng; expression_yylloc.start = expression_yylloc.end; 
+{
+   yylloc.end.charPos = 1; yylloc.end.line += yyleng; yylloc.start = yylloc.end;
+   type_yylloc.end.charPos = 1; type_yylloc.end.line += yyleng; type_yylloc.start = type_yylloc.end;
+   expression_yylloc.end.charPos = 1; expression_yylloc.end.line += yyleng; expression_yylloc.start = expression_yylloc.end;
    }
        YY_BREAK
 case 164:
 YY_RULE_SETUP
 #line 300 "lexer.l"
-{ 
-   yylloc.start.charPos++ /*= 3 - (yylloc.start.col % 3)*/; yylloc.end.charPos = yylloc.start.charPos; yylloc.start.pos = yylloc.end.pos; 
-   expression_yylloc.start.charPos++ /*= 3 - (expression_yylloc.start.col % 3)*/; expression_yylloc.end.charPos = expression_yylloc.start.charPos; expression_yylloc.start.pos = expression_yylloc.end.pos; 
-   type_yylloc.start.charPos++ /*= 3 - (type_yylloc.start.col % 3)*/; type_yylloc.end.charPos = type_yylloc.start.charPos; type_yylloc.start.pos = type_yylloc.end.pos; 
+{
+   yylloc.start.charPos++ /*= 3 - (yylloc.start.col % 3)*/; yylloc.end.charPos = yylloc.start.charPos; yylloc.start.pos = yylloc.end.pos;
+   expression_yylloc.start.charPos++ /*= 3 - (expression_yylloc.start.col % 3)*/; expression_yylloc.end.charPos = expression_yylloc.start.charPos; expression_yylloc.start.pos = expression_yylloc.end.pos;
+   type_yylloc.start.charPos++ /*= 3 - (type_yylloc.start.col % 3)*/; type_yylloc.end.charPos = type_yylloc.start.charPos; type_yylloc.start.pos = type_yylloc.end.pos;
    }
        YY_BREAK
 case 165:
@@ -3249,13 +3249,13 @@ int preprocessor()
             if(lineNumber)
             {
                char fileName[MAX_LOCATION];
-               
+
                int inOut;
 
                fileName[0] = 0;
                GetString(&pointer, fileName, MAX_LOCATION);
                inOut = GetValue(&pointer);
-                              
+
                if(inOut == 1)
                {
                   char extension[MAX_EXTENSION];
@@ -3316,7 +3316,7 @@ int preprocessor()
          }
       }
       last = c;
-   }   
+   }
    yylloc.start = yylloc.end;
    line[count] = 0;
 
index 421a1c4..351649c 100644 (file)
@@ -295,7 +295,7 @@ public bool LoadSymbols(char * fileName, ImportType importType, bool loadDllOnly
                         for(;;)
                         {
                            char * equal;
-                           
+
                            if(!f.GetLine(line, sizeof(line))) break;
                            TrimLSpaces(line, line);
                            if(!strcmp(line, ".")) break;
@@ -352,7 +352,7 @@ public bool LoadSymbols(char * fileName, ImportType importType, bool loadDllOnly
                            }
                            else
                            {
-                              strcpy(name, line);                              
+                              strcpy(name, line);
                               isVirtual = false;
                               memberAccess = publicAccess;
                            }
@@ -531,7 +531,7 @@ public bool LoadSymbols(char * fileName, ImportType importType, bool loadDllOnly
                            if(type == TemplateParameterType::type || type == TemplateParameterType::expression)
                               delete info;
                            if(type == TemplateParameterType::type || type == TemplateParameterType::identifier)
-                              delete defaultArg.dataTypeString;                           
+                              delete defaultArg.dataTypeString;
                         }
                         if(regClass)
                            eClass_DoneAddingTemplateParameters(regClass);
@@ -555,7 +555,7 @@ public bool LoadSymbols(char * fileName, ImportType importType, bool loadDllOnly
                   if(!f.GetLine(line, sizeof(line))) break;
                   TrimLSpaces(line, line);
                   if(!strcmp(line, ".")) break;
-                  if(!strcmp(line, "[Value]")) 
+                  if(!strcmp(line, "[Value]"))
                   {
                      f.GetLine(line, sizeof(line));
                      TrimLSpaces(line, line);
@@ -576,7 +576,7 @@ public bool LoadSymbols(char * fileName, ImportType importType, bool loadDllOnly
                   if(!f.GetLine(line, sizeof(line))) break;
                   TrimLSpaces(line, line);
                   if(!strcmp(line, ".")) break;
-                  if(!strcmp(line, "[Type]")) 
+                  if(!strcmp(line, "[Type]"))
                   {
                      f.GetLine(line, sizeof(line));
                      TrimLSpaces(line, line);
@@ -597,7 +597,7 @@ public bool LoadSymbols(char * fileName, ImportType importType, bool loadDllOnly
                   if(!f.GetLine(line, sizeof(line))) break;
                   TrimLSpaces(line, line);
                   if(!strcmp(line, ".")) break;
-                  if(!strcmp(line, "[Type]")) 
+                  if(!strcmp(line, "[Type]"))
                   {
                      f.GetLine(line, sizeof(line));
                      TrimLSpaces(line, line);
@@ -635,7 +635,7 @@ public bool LoadSymbols(char * fileName, ImportType importType, bool loadDllOnly
                                  delete spaceName;
                               nameSpace = newSpace;
                               if(name[c] == ':') c++;
-                              start = c+1;         
+                              start = c+1;
                            }
                         }
                         if(c - start)
@@ -777,7 +777,7 @@ public void ImportModule(char * name, ImportType importType, AccessMode importAc
                strcpy(file, name);
                StripExtension(file);
 
-               // Load an extra instance of any shared module to ensure freeing up a 
+               // Load an extra instance of any shared module to ensure freeing up a
                // module loaded in another file will not invalidate our objects.
                if(!inCompiler && !inPreCompiler && !inSymbolGen)
                {
@@ -887,7 +887,7 @@ int FindIncludeFileID(char * includeFile)
 int GetIncludeFileID(char * includeFile)
 {
    int found = FindIncludeFileID(includeFile);
-   if(found) 
+   if(found)
       return found;
 
    includes = renew includes char *[numIncludes+1];
index a7f4c6f..59feadb 100644 (file)
@@ -77,7 +77,7 @@ static void OutputOperator(int op, File f)
 
 public void OutputTypeName(TypeName type, File f, bool typeName)
 {
-   /*if(type.typedObject) 
+   /*if(type.typedObject)
    {
       //f.Puts("Class * class, void *");
       f.Puts("class");
@@ -91,7 +91,7 @@ public void OutputTypeName(TypeName type, File f, bool typeName)
          if(spec.next) f.Puts(" ");
       }
    }
-   if(type.declarator) 
+   if(type.declarator)
    {
       f.Puts(" ");
       OutputDeclarator(type.declarator, f);
@@ -116,7 +116,7 @@ public void OutputExpression(Expression exp, File f)
                OutputSpecifier(spec, f, false);
                if(spec.next) f.Puts(" ");
             }
-            if(exp._classExp.decl) 
+            if(exp._classExp.decl)
             {
                f.Puts(" ");
                OutputDeclarator(exp._classExp.decl, f);
@@ -196,7 +196,7 @@ public void OutputExpression(Expression exp, File f)
             OutputExpression(exp.op.exp2, f);
          }
          break;
-      case extensionExpressionExp: 
+      case extensionExpressionExp:
       case bracketsExp:
       {
          Expression expression;
@@ -358,7 +358,7 @@ static void OutputStatement(Statement stmt, File f)
    }
 
 
-   if(inCompiler && outputLineNumbers && stmt.loc.start.line) 
+   if(inCompiler && outputLineNumbers && stmt.loc.start.line)
    {
       /*if(stmt.loc.start.line == 1)
          printf("bug");*/
@@ -421,7 +421,7 @@ static void OutputStatement(Statement stmt, File f)
                outputLine ++;
             }
          }
-         if(inCompiler && outputLineNumbers && stmt.loc.end.line) 
+         if(inCompiler && outputLineNumbers && stmt.loc.end.line)
          {
             /*if(stmt.loc.end.line == 1)
                printf("bug");*/
@@ -530,7 +530,7 @@ static void OutputStatement(Statement stmt, File f)
          if(stmt.forStmt.increment)
          {
             // TESTING THIS HERE FOR FOR INCREMENT
-            if(inCompiler && outputLineNumbers && stmt.loc.end.line) 
+            if(inCompiler && outputLineNumbers && stmt.loc.end.line)
             {
                /*if(stmt.loc.end.line == 1)
                   printf("bug");*/
@@ -573,7 +573,7 @@ static void OutputStatement(Statement stmt, File f)
             f.Printf("{ ");
             if(exp && exp.expType)
             {
-               
+
                char string[1024] = "";
                OldList * specs = MkList();
                Declarator decl;
@@ -587,7 +587,7 @@ static void OutputStatement(Statement stmt, File f)
                   {
                      delete specs;
                      specs = CopyList(exp.expType.templateParameter.dataType.specifiers, CopySpecifier);
-                     decl = PlugDeclarator(/*CopyDeclarator(*/exp.expType.templateParameter.dataType.decl/*)*/, 
+                     decl = PlugDeclarator(/*CopyDeclarator(*/exp.expType.templateParameter.dataType.decl/*)*/,
                         MkDeclaratorIdentifier(MkIdentifier("__ecereReturnVal")));
                   }
                   else
@@ -612,7 +612,7 @@ static void OutputStatement(Statement stmt, File f)
          }
          if(!memoryGuard)
             f.Puts("return ");
-         else 
+         else
          {
             Expression exp = stmt.expressions ? stmt.expressions->last : null;
             if(exp && exp.expType)
@@ -691,7 +691,7 @@ static void OutputStatement(Statement stmt, File f)
       }
    }
 
-   if(inCompiler && outputLineNumbers && stmt.loc.start.line) 
+   if(inCompiler && outputLineNumbers && stmt.loc.start.line)
    {
       f.Printf("\n#line %d \"%s\"\n", outputLine+2, origName);
       outputLine += 2;
@@ -781,7 +781,7 @@ static void OutputDeclarator(Declarator decl, File f)
             if(_class && _class.registered)
             {
                f.Printf("%d", (int)eClass_GetProperty(_class.registered, "enumSize"));
-            }            
+            }
          }
          f.Puts("]");
          break;
@@ -806,7 +806,7 @@ static void OutputDeclarator(Declarator decl, File f)
       }
       case pointerDeclarator:
          if(decl.pointer.pointer) OutputPointer(decl.pointer.pointer, f);
-         if(decl.declarator) 
+         if(decl.declarator)
          {
             f.Puts(" ");
             OutputDeclarator(decl.declarator, f);
@@ -844,7 +844,7 @@ static void OutputAttrib(Attrib attr, File f)
       case __ATTRIB:    f.Puts("__attribute((");  break;
       case ATTRIB_DEP:  f.Puts("__attribute_deprecated__(("); break;
    }
-   
+
    if(attr.attribs)
    {
       Attribute attrib;
@@ -854,7 +854,7 @@ static void OutputAttrib(Attrib attr, File f)
          OutputAttribute(attrib, f);
       }
    }
-   f.Puts("))"); 
+   f.Puts("))");
 }
 
 static void OutputExtDecl(ExtDecl extDecl, File f)
@@ -1028,12 +1028,12 @@ static void OutputSpecifier(Specifier spec, File f, bool typeName)
       case typeOfSpecifier:
          f.Puts("__typeof(");
          OutputExpression(spec.expression, f);
-         f.Puts(")");                  
+         f.Puts(")");
          break;
       case subClassSpecifier:
          f.Puts("subclass(");
          OutputSpecifier(spec._class, f, false);
-         f.Puts(")");                  
+         f.Puts(")");
          break;
       case templateTypeSpecifier:
          OutputIdentifier(spec.templateParameter.identifier, f);
@@ -1062,7 +1062,7 @@ static void OutputInitializer(Initializer initializer, File f)
          f.Puts("\n{\n");
          outputLine += 2;
 
-         if(inCompiler && outputLineNumbers && initializer.loc.start.line) 
+         if(inCompiler && outputLineNumbers && initializer.loc.start.line)
          {
             /*if(initializer.loc.start.line == 1)
                printf("bug");*/
@@ -1078,7 +1078,7 @@ static void OutputInitializer(Initializer initializer, File f)
          }
          f.Puts("\n}");
 
-         if(inCompiler && outputLineNumbers && initializer.loc.start.line) 
+         if(inCompiler && outputLineNumbers && initializer.loc.start.line)
          {
             /*if(initializer.loc.start.line == 1)
                printf("bug");*/
@@ -1134,7 +1134,7 @@ static void OutputDeclaration(Declaration decl, File f)
 
                   GetSourceName(name, decl.loc.start.included ? GetIncludeFileFromID(decl.loc.start.included) : null);
 
-                  if(inCompiler && outputLineNumbers && decl.loc.start.line) 
+                  if(inCompiler && outputLineNumbers && decl.loc.start.line)
                   {
                      /*if(decl.loc.start.line == 1)
                         printf("bug");*/
@@ -1165,7 +1165,7 @@ static void OutputDeclaration(Declaration decl, File f)
             {
                OutputInitDeclarator(d, f);
                if(d.next) f.Puts(", ");
-            }   
+            }
          }
          break;
       }
@@ -1188,7 +1188,7 @@ static void OutputDeclaration(Declaration decl, File f)
             {
                OutputDeclarator(d, f);
                if(d.next) f.Puts(", ");
-            }   
+            }
          }
          if(decl.extStorage)
          {
@@ -1208,7 +1208,7 @@ static void OutputDeclaration(Declaration decl, File f)
    }
    f.Puts(";\n");
    outputLine ++;
-   if(inCompiler && outputLineNumbers && decl.loc.start.line && decl.type == initDeclaration) 
+   if(inCompiler && outputLineNumbers && decl.loc.start.line && decl.type == initDeclaration)
    {
       f.Printf("\n#line %d \"%s\"\n", outputLine+2, origName);
       outputLine += 2;
@@ -1221,7 +1221,7 @@ static void OutputFunction(FunctionDefinition func, File f)
 {
    FunctionDefinition oldFunc = curFunction;
    curFunction = func;
-   if(func.specifiers) 
+   if(func.specifiers)
    {
       Specifier spec;
       for(spec = func.specifiers->first; spec; spec = spec.next)
@@ -1356,7 +1356,7 @@ static void OutputInstance(Instantiation inst, File f)
 
 static void OutputClassFunction(ClassFunction func, File f)
 {
-   if(func.specifiers) 
+   if(func.specifiers)
    {
       Specifier spec;
       for(spec = func.specifiers->first; spec; spec = spec.next)
@@ -1471,19 +1471,19 @@ public void OutputTree(OldList ast, File f)
    {
       switch(external.type)
       {
-         case functionExternal: 
-            OutputFunction(external.function, f); 
+         case functionExternal:
+            OutputFunction(external.function, f);
             f.Puts("\n");
             outputLine ++;
             break;
-         case declarationExternal: 
+         case declarationExternal:
             OutputDeclaration(external.declaration, f);
-            f.Puts("\n");   
+            f.Puts("\n");
             outputLine ++;
             break;
-         case classExternal: 
+         case classExternal:
             OutputClass(external._class, f);
-            f.Puts("\n");   
+            f.Puts("\n");
             outputLine ++;
             break;
       }
index e21e640..8342ecb 100644 (file)
@@ -75,7 +75,7 @@ public void FullClassNameCat(char * output, char * className, bool includeTempla
          break;
       }
    }
-   
+
    len = strlen(output);
    for(c = 0; (ch = className[c]); c++)
    {
@@ -299,7 +299,7 @@ static void CheckPublicExpression(Expression exp, AccessMode access)
             break;
          }
       }
-   }   
+   }
 }
 
 static void CheckPublicDataType(Type type, AccessMode access, char * word)
@@ -415,7 +415,7 @@ static void CheckMembersDefinitions(Class regClass, DataMember member, OldList d
                            if(member)
                            {
                               BTNamedLink link = (BTNamedLink)member.membersAlpha.FindString(spec.id.string);
-                              dataMember = link ? link.data : null;                              
+                              dataMember = link ? link.data : null;
                            }
                            else
                               dataMember = eClass_FindDataMember(regClass, spec.id.string, privateModule, null, null);
@@ -477,7 +477,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
    if(inCompiler)
    {
       yylloc = loc;
-      
+
       if(!NameSpaceContained(regClass.nameSpace, &regClass.module.privateNameSpace) && regClass.inheritanceAccess == publicAccess)
       {
          if(!regClass.base.symbol)
@@ -495,7 +495,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
    /*
    if(NameSpaceContained(regClass.nameSpace, &regClass.module.privateNameSpace))
    {
-      if(regClass.inheritanceAccess == publicAccess && 
+      if(regClass.inheritanceAccess == publicAccess &&
          (regClass.base.nameSpace == &regClass.base.module.privateNameSpace || !ModuleAccess(privateModule, regClass.base.module)))
          Compiler_Error($"Public class publicly inheriting off private base class\n");
    }
@@ -534,7 +534,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
             }
             else
                // Sort of an error
-               eEnum_AddValue(regClass, e.id.string);                        
+               eEnum_AddValue(regClass, e.id.string);
          }
          else
             eEnum_AddValue(regClass, e.id.string);
@@ -555,14 +555,14 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
             if((prop = eClass_FindProperty(regClass, def.id.string, privateModule)))
             {
                eClass_AddProperty(regClass, def.id.string, null, null, null, def.memberAccess);
-            }            
+            }
             else if((member = eClass_FindDataMember(regClass, def.id.string, privateModule, null, null)))
             {
                eClass_AddDataMember(regClass, def.id.string, null, 0, 0, def.memberAccess);
             }
             else if((method = eClass_FindMethod(regClass, def.id.string, privateModule)))
             {
-               eClass_AddMethod(regClass, def.id.string, null, null, def.memberAccess);               
+               eClass_AddMethod(regClass, def.id.string, null, null, def.memberAccess);
             }
             else
             {
@@ -572,7 +572,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          }
       }
    }
-   
+
    if(inCompiler)
    {
       external = MkExternalDeclaration(null);
@@ -625,7 +625,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
 
                   ListAdd(specifiers, MkSpecifierName/*MkClassName*/(inst._class.name));
                   d = MkDeclaratorIdentifier(MkIdentifier(exp.identifier.string));
-               
+
                   if(inCompiler)
                   {
                      OldList * declarators = MkList();
@@ -652,8 +652,8 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                // If it is, we only need a constructor if there is data set,
                // and we don't need a destructor
                classSym = inst._class.symbol; // FindClass(inst._class.name);
-               if(classSym && classSym.registered && 
-                  (classSym.registered.type == structClass || 
+               if(classSym && classSym.registered &&
+                  (classSym.registered.type == structClass ||
                    classSym.registered.type == bitClass ||
                    classSym.registered.type == unitClass))
                {
@@ -689,7 +689,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          else if(def.type == functionClassDef)
          {
             ClassFunction func = def.function;
-            if(func.isDestructor) 
+            if(func.isDestructor)
             {
                if(destructor)
                {
@@ -712,7 +712,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                   }
                }
             }
-            if(func.isConstructor) 
+            if(func.isConstructor)
             {
                if(constructor)
                {
@@ -721,7 +721,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                }
                else
                {
-                  symbol.needConstructor = true;            
+                  symbol.needConstructor = true;
                   constructor = func;
 
                   if(!inCompiler && func.body)
@@ -759,7 +759,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          symbol.structName = CopyString(structName);
 
          {
-            Specifier spec = MkStructOrUnion(structSpecifier, MkIdentifier(structName), 
+            Specifier spec = MkStructOrUnion(structSpecifier, MkIdentifier(structName),
                isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(unionSpecifier, null, list)), null, null))) : list);
             spec.extDeclStruct = extDecl;
             ListAdd(specs, spec);
@@ -771,7 +771,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
 
          external.declaration = MkDeclaration(specs, declarators);
          after = external;
-      
+
          symbol.declaredStruct = true;
       }
       else
@@ -789,7 +789,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          char classDataStructName[1024];
          OldList * specs = MkList();
          External external;
-         
+
          strcpy(classDataStructName, "__ecereClassData_");
          FullClassNameCat(classDataStructName, symbol.string, false);
 
@@ -815,7 +815,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          MangleClassName(className);
 
          symbol.className = CopyString(className);
-   
+
          if(!strstr(sourceFile, ".main.ec"))
             ListAdd(specs, MkSpecifier(STATIC));
          ListAdd(specs, MkStructOrUnion(structSpecifier, MkIdentifier("__ecereNameSpace__ecere__com__Class"), null));
@@ -863,9 +863,9 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                   {
                      /*  FIX a DecRef declaration problem...
                      // Decrement counter if it isn't a simple class
-                     ListAdd(statements, 
+                     ListAdd(statements,
                         MkExpressionStmt(MkListOne(MkExpCall(
-                           MkExpIdentifier(MkIdentifier("ecere::com::eInstance_DecRef")), 
+                           MkExpIdentifier(MkIdentifier("ecere::com::eInstance_DecRef")),
                            MkListOne(CopyExpression(inst.exp))))));
                      */
                      Expression exp = MkExpOp(null, DELETE, CopyExpression(inst.exp));
@@ -903,7 +903,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          body = MkCompoundStmt(declarations, statements);
          PopContext(context);
          body.compound.context = context;
-      
+
          decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), null);
 
          // Destructor will have same Symbol ID as class
@@ -914,7 +914,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
             //id = symbol.endid;
          };
          excludedSymbols->Add(decl.symbol);
-      
+
          function = MkClassFunction(specs, null, decl, null);
          ProcessClassFunctionBody(function, body);
          function.id = symbol.id;
@@ -965,7 +965,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      newInst.exp = CopyExpression(inst.exp);
                      newInst._class = CopySpecifier(inst._class);
 
-                     ListAdd(statements, 
+                     ListAdd(statements,
                         MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
                      inst.built = true;
                   }
@@ -973,7 +973,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                   // Increment counter if it isn't a simple class
                   if(inst.exp && (!classSym || !classSym.registered || classSym.registered.type == normalClass))
                   {
-                     ListAdd(statements, 
+                     ListAdd(statements,
                         MkExpressionStmt(MkListOne(MkExpCall(
                            MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")),
                            MkListOne(CopyExpression(inst.exp))))));
@@ -996,10 +996,10 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                         memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
                         for(id = id.next; id; id = id.next)
                            memberExp = MkExpMember(memberExp, id);
-                     
+
                         // ASSUME: No list initializers here
-                        ListAdd(statements, 
-                           MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', 
+                        ListAdd(statements,
+                           MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=',
                               (propertyDef.initializer && propertyDef.initializer.type == expInitializer ? propertyDef.initializer.exp : null)))));
 
                      }
@@ -1033,7 +1033,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                         // Is it safe to take it out here?
                         def.decl.inst = null;
 
-                        ListAdd(statements, 
+                        ListAdd(statements,
                            MkExpressionStmt(MkListOne(MkExpInstance(inst))));
                      }
                   }
@@ -1045,7 +1045,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          {
             /*
             declarations = constructor.body.compound.declarations;
-            
+
             if(constructor.body.compound.declarations)
             {
                Declaration decl;
@@ -1076,7 +1076,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          body = MkCompoundStmt(declarations, statements);
          PopContext(context);
          body.compound.context = context;
-      
+
          decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), null);
 
          // Constructor will have same Symbol ID as class
@@ -1087,7 +1087,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          decl.symbol.id = symbol.id;
          decl.symbol.idCode = symbol.idCode;
          //decl.symbol.id = symbol.endid;
-      
+
          function = MkClassFunction(specs, null, decl, null);
          ProcessClassFunctionBody(function, body);
          function.id = symbol.id;
@@ -1120,7 +1120,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                else if(!symbol.isStatic)
                   CheckPublicDataType(propertyDef.symbol.type, privateAccess, "class property");
             }
-            
+
             {
                // Commented this out...  Why exactly?
                //if(inCompiler)
@@ -1141,8 +1141,8 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      params = MkList();
 
                      // decl = MkDeclaratorFunction(PlugDeclarator(propertyDef.declarator, MkDeclaratorIdentifier(MkIdentifier(name))), params);
-                  
-                     if(propertyDef.symbol.type && propertyDef.symbol.type.kind == TypeKind::classType && propertyDef.symbol.type._class && propertyDef.symbol.type._class.registered && 
+
+                     if(propertyDef.symbol.type && propertyDef.symbol.type.kind == TypeKind::classType && propertyDef.symbol.type._class && propertyDef.symbol.type._class.registered &&
                         propertyDef.symbol.type._class.registered.type == structClass)
                      {
                         ListAdd(params, MkTypeName(CopyList(propertyDef.specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
@@ -1157,21 +1157,21 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      {
                         decl = PlugDeclarator(propertyDef.declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
 
-                        func = MkClassFunction(CopyList(propertyDef.specifiers, CopySpecifier), 
+                        func = MkClassFunction(CopyList(propertyDef.specifiers, CopySpecifier),
                            null, decl, null);
                      }
-                  
+
                      ProcessClassFunctionBody(func, propertyDef.getStmt);
                      func.declarator.symbol = propertyDef.symbol;
                      //func.declarator.propSymbol = propertyDef.symbol;
                      propertyDef.symbol.externalGet = (External)func;
-               
+
                      func.dontMangle = true;
                      newDef = MkClassDefFunction(func);
                      definitions.Insert(after, newDef);
                      after = newDef;
 
-                     if(inCompiler) 
+                     if(inCompiler)
                         propertyDef.getStmt = null;
                      else
                         func.body = null;
@@ -1189,8 +1189,8 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
 
                      params = MkList();
 
-                     ListAdd(params, MkTypeName(CopyList(propertyDef.specifiers, CopySpecifier), 
-                        PlugDeclarator(propertyDef.declarator, 
+                     ListAdd(params, MkTypeName(CopyList(propertyDef.specifiers, CopySpecifier),
+                        PlugDeclarator(propertyDef.declarator,
                            MkDeclaratorIdentifier(MkIdentifier("value")))));
 
                      // Take it out here...
@@ -1230,7 +1230,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      definitions.Insert(after, newDef);
                      after = newDef;
 
-                     if(inCompiler) 
+                     if(inCompiler)
                         propertyDef.setStmt = null;
                      else
                         func.body = null;
@@ -1269,7 +1269,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      definitions.Insert(after, newDef);
                      after = newDef;
 
-                     if(inCompiler) 
+                     if(inCompiler)
                         propertyDef.issetStmt = null;
                      else
                         func.body = null;
@@ -1310,10 +1310,10 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      external = MkExternalDeclaration(decl);
                      ast->Insert(curExternal ? curExternal.prev : null, external);
                      external.symbol = propertyDef.symbol;
-                                          
+
                      // Setting it in the Property as well here to prevent DeclareProperty to declare it a second time...
                      propertyDef.symbol.externalPtr = external;
-                     
+
                      if(inCompiler && prop && prop.symbol)
                         ((Symbol)prop.symbol).externalPtr = external;
                   }
@@ -1329,7 +1329,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                if(inCompiler)
                {
                   yylloc = propertyDef.loc;
-                  
+
                   if(!NameSpaceContained(regClass.nameSpace, &regClass.module.privateNameSpace))
                      CheckPublicDataType(propertyDef.symbol.type, publicAccess, "classwide property");
                   else if(!symbol.isStatic)
@@ -1356,9 +1356,9 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      params = MkList();
 
                      declId = MkDeclaratorIdentifier(MkIdentifier(name));
-                  
+
                      // Class properties returns a uint64 even for struct types
-                     /*if(propertyDef.symbol.type && propertyDef.symbol.type.kind == TypeKind::classType && propertyDef.symbol.type._class && propertyDef.symbol.type._class.registered && 
+                     /*if(propertyDef.symbol.type && propertyDef.symbol.type.kind == TypeKind::classType && propertyDef.symbol.type._class && propertyDef.symbol.type._class.registered &&
                         propertyDef.symbol.type._class.registered.type == structClass)
                      {
                         // ListAdd(params, MkTypeName(CopyList(propertyDef.specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
@@ -1375,7 +1375,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                               body.compound.declarations = MkList();
                            ListAdd(body.compound.declarations,
                               MkDeclaration(CopyList(propertyDef.specifiers, CopySpecifier), MkListOne(MkInitDeclarator(
-                                 ptrDecl = MkDeclaratorPointer(MkPointer(null, null), MkDeclaratorIdentifier(MkIdentifier("value"))), MkInitializerAssignment(MkExpCast(MkTypeName(CopyList(propertyDef.specifiers, CopySpecifier), CopyDeclarator(propertyDef.declarator)), 
+                                 ptrDecl = MkDeclaratorPointer(MkPointer(null, null), MkDeclaratorIdentifier(MkIdentifier("value"))), MkInitializerAssignment(MkExpCast(MkTypeName(CopyList(propertyDef.specifiers, CopySpecifier), CopyDeclarator(propertyDef.declarator)),
                                     MkExpIdentifier(MkIdentifier("_value"))))))));
                            {
                               Symbol sym = ptrDecl.symbol;
@@ -1408,7 +1408,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      if(func.type.returnType.kind == TypeKind::classType && func.type.returnType._class && func.type.returnType._class.registered && func.type.returnType._class.registered.type == structClass)
                         func.type.returnType.byReference = true;
 
-                     if(inCompiler) 
+                     if(inCompiler)
                         propertyDef.getStmt = null;
                      else
                         func.body = null;
@@ -1428,8 +1428,8 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
 
                      params = MkList();
                      /*
-                     ListAdd(params, MkTypeName(CopyList(propertyDef.specifiers, CopySpecifier), 
-                        PlugDeclarator(propertyDef.declarator, 
+                     ListAdd(params, MkTypeName(CopyList(propertyDef.specifiers, CopySpecifier),
+                        PlugDeclarator(propertyDef.declarator,
                            MkDeclaratorIdentifier(MkIdentifier("value")))));
                      */
 
@@ -1473,7 +1473,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      definitions.Insert(after, newDef);
                      after = newDef;
 
-                     if(inCompiler) 
+                     if(inCompiler)
                         propertyDef.setStmt = null;
                      else
                         func.body = null;
@@ -1492,8 +1492,8 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
             {
                Declarator funcDecl = GetFuncDecl(func.declarator);
                Identifier id = GetDeclId(funcDecl);
-               Method method;               
-                        
+               Method method;
+
                if(!funcDecl.function.parameters || !funcDecl.function.parameters->first)
                {
                   if(!funcDecl.function.parameters)
@@ -1576,7 +1576,7 @@ public void PreProcessClassDefinitions()
                   Specifier specifier;
                   for(specifier = declaration.specifiers->first; specifier; specifier = specifier.next)
                   {
-                     if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string && 
+                     if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string &&
                         (declaration.declMode || specifier.baseSpecs || (specifier.type == enumSpecifier && specifier.definitions)))
                      {
                         Symbol symbol = FindClass(specifier.id.string);
index 26f51f0..102083f 100644 (file)
@@ -68,7 +68,7 @@ External ProcessClassFunction(Class owningClass, ClassFunction func, OldList def
          if(func.type) func.type.refCount++;
          ProcessFunctionBody(function, func.body);
          external = MkExternalFunction(function);
-         
+
          external.symbol = func.declarator.symbol;
          external.function._class = func._class;
       }
@@ -77,14 +77,14 @@ External ProcessClassFunction(Class owningClass, ClassFunction func, OldList def
       //symbol.id = func.id; //symid;
       symbol.id = symid;
       symbol.idCode = symidCode;
-      
+
       if(!func.dontMangle)
       {
          // Normal method
          Method method = func.declarator.symbol.method;
          func.declarator.symbol.methodExternal = external;
 
-         // DANGER: Added this one... 
+         // DANGER: Added this one...
 
          if(method && method.symbol)
             //((Symbol)method.symbol).methodExternal = external;
@@ -94,7 +94,7 @@ External ProcessClassFunction(Class owningClass, ClassFunction func, OldList def
          {
             Type methodDataType;
             ProcessMethodType(method);
-            
+
             methodDataType = method.dataType;
 
             // Do type checking here of type against method.dataType
@@ -213,7 +213,7 @@ External ProcessClassFunction(Class owningClass, ClassFunction func, OldList def
          {
             propSymbol.externalIsSet = external;
          }
-         else 
+         else
          {
             // Constructor destructor
             //symbol.type = Type { };
@@ -248,7 +248,7 @@ External ProcessClassFunction(Class owningClass, ClassFunction func, OldList def
       {
          globalContext /*curContext*/.symbols.Remove((BTNode)symbol);
          excludedSymbols->Add(symbol);
-         
+
          // Testing this...
          defs.Insert(after, external);
 
@@ -273,19 +273,19 @@ void CreateRegisterModuleBody()
       registerModuleBody.compound.context = Context { parent = globalContext };
 
       #if 0
-      ListAdd(registerModuleBody.compound.declarations, 
+      ListAdd(registerModuleBody.compound.declarations,
          MkDeclaration(MkListOne(MkStructOrUnion(structSpecifier, MkIdentifier("__ecereNameSpace__ecere__com__Class"), null) /*MkSpecifierName("ecere::com::Class")*/ /*MkStructOrUnion(SpecifierStruct, MkIdentifier("Class"), null)*/),
                        MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer(null,null), MkDeclaratorIdentifier(MkIdentifier("class"))), null))));
       #endif
-      ListAdd(registerModuleBody.compound.declarations, 
+      ListAdd(registerModuleBody.compound.declarations,
          MkDeclaration(MkListOne(MkSpecifierName("ecere::com::Class")),
                        MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("class")), null))));
 
       specifiers = MkList();
       ListAdd(specifiers, MkSpecifier(VOID));
 
-      moduleParam = MkTypeName(MkListOne(/*MkSpecifier(VOID)*/MkSpecifierName("Module")), 
-         //MkDeclaratorPointer(MkPointer(null, null), 
+      moduleParam = MkTypeName(MkListOne(/*MkSpecifier(VOID)*/MkSpecifierName("Module")),
+         //MkDeclaratorPointer(MkPointer(null, null),
          MkDeclaratorIdentifier(MkIdentifier("module")));
 
       GetLastDirectory(outputFile, moduleName);
@@ -308,7 +308,7 @@ void CreateRegisterModuleBody()
 
    // Unregister Module
    if(!unregisterModuleBody && inCompiler)
-   {      
+   {
       char registerName[1024], moduleName[MAX_FILENAME];
       OldList * specifiers;
       Declarator declarator;
@@ -320,8 +320,8 @@ void CreateRegisterModuleBody()
       specifiers = MkList();
       ListAdd(specifiers, MkSpecifier(VOID));
 
-      moduleParam = MkTypeName(MkListOne(/*MkSpecifier(VOID)*/ MkSpecifierName("Module")), 
-         //MkDeclaratorPointer(MkPointer(null, null), 
+      moduleParam = MkTypeName(MkListOne(/*MkSpecifier(VOID)*/ MkSpecifierName("Module")),
+         //MkDeclaratorPointer(MkPointer(null, null),
          MkDeclaratorIdentifier(MkIdentifier("module")));
 
       GetLastDirectory(outputFile, moduleName);
@@ -554,13 +554,13 @@ void RegisterMembersAndProperties(Class regClass, bool isMember, char * classNam
                ListAdd(list, MkExpOp(MkExpIdentifier(MkIdentifier(nameM)), '=', MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null,null), null)), MkExpConstant("0"))));
                // stmt = MkIfStmt(MkListOne(MkExpOp(null, '!', MkExpIdentifier(MkIdentifier(name)))), MkExpressionStmt(list), null);
                stmt = MkIfStmt(MkListOne(MkExpOp(
-                     MkExpMember(MkExpIdentifier(MkIdentifier("module")), MkIdentifier("application")), EQ_OP, 
+                     MkExpMember(MkExpIdentifier(MkIdentifier("module")), MkIdentifier("application")), EQ_OP,
                      MkExpMember(MkExpIdentifier(MkIdentifier("__thisModule")), MkIdentifier("application")))), MkExpressionStmt(list), null);
 
                ListAdd(registerModuleBody.compound.statements, stmt);
 
                // Unregister 2nd property
-               stmt = MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(nameM)), '=', 
+               stmt = MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(nameM)), '=',
                   MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null,null), null)), MkExpConstant("0")))));
                ListAdd(unregisterModuleBody.compound.statements, stmt);
             }
@@ -656,7 +656,7 @@ void RegisterMembersAndProperties(Class regClass, bool isMember, char * classNam
 
             // Declaration Mode
             ListAdd(args, MkExpIdentifier(MkIdentifier("privateAccess")));
-            
+
             stmt = MkExpressionStmt(MkListOne(
                MkExpCall(MkExpIdentifier(MkIdentifier(isMember ? "eMember_AddDataMember" : "eClass_AddDataMember")), args)));
 
@@ -716,7 +716,7 @@ void RegisterMembersAndProperties(Class regClass, bool isMember, char * classNam
                   ListAdd(args, MkExpIdentifier(MkIdentifier("publicAccess")));
                   break;
             }
-            
+
             stmt = MkExpressionStmt(MkListOne(
                MkExpCall(MkExpIdentifier(MkIdentifier(isMember ? "eMember_AddDataMember" : "eClass_AddDataMember")), args)));
 
@@ -736,9 +736,9 @@ void RegisterMembersAndProperties(Class regClass, bool isMember, char * classNam
 
             curContext = statement.compound.context;
             context = PushContext();
-            
+
             args = MkListOne(MkExpIdentifier(MkIdentifier((member.type == unionMember) ? "unionMember" : "structMember")));
-            
+
             // Declaration Mode
             switch(member.memberAccess)
             {
@@ -753,12 +753,12 @@ void RegisterMembersAndProperties(Class regClass, bool isMember, char * classNam
                   ListAdd(args, MkExpIdentifier(MkIdentifier("publicAccess")));
                   break;
             }
-            
-            compound = MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifierName("DataMember")), 
-               MkListOne(MkInitDeclarator(/*MkDeclaratorPointer(MkPointer(null, null), */MkDeclaratorIdentifier(MkIdentifier(memberName))/*)*/, 
+
+            compound = MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifierName("DataMember")),
+               MkListOne(MkInitDeclarator(/*MkDeclaratorPointer(MkPointer(null, null), */MkDeclaratorIdentifier(MkIdentifier(memberName))/*)*/,
                   MkInitializerAssignment(MkExpCall(MkExpIdentifier(MkIdentifier("eMember_New")), args)))))), MkList());
             compound.compound.context = context;
-         
+
             args = MkList();
 
             // Class class / DataMember member
@@ -894,7 +894,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
 {
    ClassDef def;
    Class regClass = symbol.registered;
-   
+
    if(regClass)
    {
       classType = regClass.type;
@@ -911,7 +911,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                   refCount = 1;
                };
                e.exp.destType = destType;
-            
+
                // Set parsingType to avoid producing errors
                parsingType = true;
                ProcessExpressionType(e.exp);
@@ -941,7 +941,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                }
                else
                   // Sort of an error
-                  eEnum_AddValue(regClass, e.id.string);                        
+                  eEnum_AddValue(regClass, e.id.string);
             }
             else
                eEnum_AddValue(regClass, e.id.string);
@@ -1011,9 +1011,9 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                      ListAdd(specifiers, MkSpecifier(VOID));
 
                      ast->Insert(curExternal.prev, externalDecl);
-               
-                     decl = MkDeclaration(specifiers, 
-                        MkListOne(MkInitDeclarator(MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), 
+
+                     decl = MkDeclaration(specifiers,
+                        MkListOne(MkInitDeclarator(MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)),
                            MkListOne(MkTypeName(MkListOne(MkSpecifierName(regClass.fullName)), null))), null)));
                      externalDecl.declaration = decl;
                      if(decl.symbol && !decl.symbol.methodExternal)
@@ -1025,7 +1025,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                         decl.symbol.idCode = symbol.idCode;
                      }
                   }
-            
+
                   propWatch.compound = null;
                   definitions.Insert(null, MkClassDefFunction(func));
 
@@ -1152,7 +1152,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
 
          //ListAdd(args, class.declaredStruct ? MkExpTypeSize(MkTypeName(MkListOne(
             //MkSpecifierName(class.structName)), null)) : MkExpConstant("0"));
-      
+
          if(regClass.type == structClass || regClass.type == normalClass || regClass.type == noHeadClass)
          {
             // Check if we have a data member in this class
@@ -1207,11 +1207,11 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
          if(regClass.type == normalClass || regClass.type == noHeadClass)
          {
             // Constructor
-            ListAdd(args, symbol.needConstructor ? 
+            ListAdd(args, symbol.needConstructor ?
                MkExpIdentifier(MkIdentifier(symbol.constructorName)) :
                MkExpConstant("0"));
             // Destructor
-            ListAdd(args, symbol.needDestructor ? 
+            ListAdd(args, symbol.needDestructor ?
                MkExpIdentifier(MkIdentifier(symbol.destructorName)) :
                MkExpConstant("0"));
          }
@@ -1242,7 +1242,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                ListAdd(args, MkExpIdentifier(MkIdentifier(buildingECERECOMModule ? "baseSystemAccess" : "publicAccess")));
                break;
          }
-         
+
          // Declaration Mode
          switch(inheritanceAccess)
          {
@@ -1271,7 +1271,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
 
          stmt = MkIfStmt(MkListOne(
                   MkExpOp(MkExpOp(
-                     MkExpMember(MkExpIdentifier(MkIdentifier("module")), MkIdentifier("application")), EQ_OP, 
+                     MkExpMember(MkExpIdentifier(MkIdentifier("module")), MkIdentifier("application")), EQ_OP,
                      MkExpMember(MkExpIdentifier(MkIdentifier("__thisModule")), MkIdentifier("application"))), AND_OP, MkExpIdentifier(MkIdentifier("class")))),
                MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(symbol.className)), '=',
             MkExpIdentifier(MkIdentifier("class"))))), null);
@@ -1305,7 +1305,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                   External external = method.methodExternal;
                   OldList * args = MkList();
                   Identifier id = external.function ? GetDeclId(external.function.declarator) : null;
-               
+
                   // Class class
                   ListAdd(args, MkExpIdentifier(MkIdentifier("class")));
                   // char * name
@@ -1547,10 +1547,10 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                   {
                      char memberTypeString[132] = "TemplateMemberType::";
                      bool needClass = true;
-                     
+
                      param.memberType.OnGetString(memberTypeString + strlen(memberTypeString), null, &needClass);
-                     ListAdd(args, 
-                        MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null, null), null)), 
+                     ListAdd(args,
+                        MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null, null), null)),
                            MkExpIdentifier(MkIdentifier(memberTypeString))));
                      break;
                   }
@@ -1564,7 +1564,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                   {
                      case type:
                      {
-                        char * typeString = param.defaultArgument.templateDatatype ? 
+                        char * typeString = param.defaultArgument.templateDatatype ?
                            StringFromSpecDecl(param.defaultArgument.templateDatatype.specifiers, param.defaultArgument.templateDatatype.decl) : null;
                         char * string = QMkString(typeString);
 
@@ -1596,7 +1596,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
 
                         // TOFIX: UNIONS ARE BROKEN FOR ASSIGNMENTS, USING dataTypeString INSTEAD
                         // members->Add(MkMemberInit(MkListOne(MkIdentifier("memberString")), MkInitializerAssignment(MkExpString(string))));
-                        members->Add(MkMemberInit(MkListOne(MkIdentifier("dataTypeString")), MkInitializerAssignment(MkExpString(string))));                        
+                        members->Add(MkMemberInit(MkListOne(MkIdentifier("dataTypeString")), MkInitializerAssignment(MkExpString(string))));
 
                         delete string;
                         break;
@@ -1618,7 +1618,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
 
                         //string = QMkString(ui64String);
                         members->Add(MkMemberInit(ids, MkInitializerAssignment(MkExpConstant(ui64String))));
-                        
+
                         delete string;
                         delete ui64String;
                         break;
@@ -1635,7 +1635,7 @@ static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
                ListAdd(registerModuleBody.compound.statements, stmt);
             }
             stmt = MkExpressionStmt(MkListOne(
-               MkExpCall(MkExpIdentifier(MkIdentifier("eClass_DoneAddingTemplateParameters")), 
+               MkExpCall(MkExpIdentifier(MkIdentifier("eClass_DoneAddingTemplateParameters")),
                   MkListOne(MkExpIdentifier(MkIdentifier("class"))))));
             ListAdd(registerModuleBody.compound.statements, stmt);
          }
@@ -1832,10 +1832,10 @@ public void ProcessClassDefinitions()
                {
                   Specifier specifier;
                   bool removeExternal = false;
-               
+
                   for(specifier = declaration.specifiers->first; specifier; specifier = specifier.next)
                   {
-                     if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string && 
+                     if((specifier.type == enumSpecifier || specifier.type == structSpecifier || specifier.type == unionSpecifier) && specifier.id && specifier.id.string &&
                         (declaration.declMode || specifier.baseSpecs || (specifier.type == enumSpecifier && specifier.definitions)))
                      {
                         Symbol symbol = FindClass(specifier.id.string);
@@ -1844,7 +1844,7 @@ public void ProcessClassDefinitions()
                            ClassType classType;
                            if(specifier.type == enumSpecifier)
                               classType = enumClass;
-                           else 
+                           else
                               classType = structClass;
 
                            removeExternal = true;
@@ -1855,7 +1855,7 @@ public void ProcessClassDefinitions()
                            ProcessClass(classType, specifier.definitions, symbol, specifier.baseSpecs, specifier.list,ast, external, declaration.declMode);
                         }
                      }
-                  }               
+                  }
                   if(inCompiler && removeExternal)
                   {
                      ast->Remove(external);
index 6ce2671..5a605ca 100644 (file)
@@ -360,7 +360,7 @@ void ComputeClassMembers(Class _class, bool isMember)
 {
    DataMember member = isMember ? (DataMember) _class : null;
    Context context = isMember ? null : SetupTemplatesContext(_class);
-   if(member || ((_class.type == bitClass || _class.type == normalClass || _class.type == structClass || _class.type == noHeadClass) && 
+   if(member || ((_class.type == bitClass || _class.type == normalClass || _class.type == structClass || _class.type == noHeadClass) &&
                  (_class.type == bitClass || (!_class.structSize || _class.structSize == _class.offset)) && _class.computeSize))
    {
       int c;
@@ -440,7 +440,7 @@ void ComputeClassMembers(Class _class, bool isMember)
                   int alignment = 0;
 
                   // Prevent infinite recursion
-                  if(dataMember.dataType.kind != classType || 
+                  if(dataMember.dataType.kind != classType ||
                      ((!dataMember.dataType._class || !dataMember.dataType._class.registered || dataMember.dataType._class.registered != _class ||
                      _class.type != structClass)))
                      ComputeTypeSize(dataMember.dataType);
@@ -607,7 +607,7 @@ void ComputeClassMembers(Class _class, bool isMember)
       {
          member.memberOffset = unionMemberOffset;
       }
-      
+
       if(!isMember)
       {
          /*if(_class.type == structClass)
@@ -668,7 +668,7 @@ public void ComputeModuleClasses(Module module)
 {
    Class _class;
    OldLink subModule;
-   
+
    for(subModule = module.modules.first; subModule; subModule = subModule.next)
       ComputeModuleClasses(subModule.data);
    for(_class = module.classes.first; _class; _class = _class.next)
@@ -707,8 +707,8 @@ public int ComputeTypeSize(Type type)
                   size += type.alignment - (size % type.alignment);
 
             }
-            else if(_class && (_class.type == unitClass || 
-                   _class.type == enumClass || 
+            else if(_class && (_class.type == unitClass ||
+                   _class.type == enumClass ||
                    _class.type == bitClass))
             {
                if(!_class.dataType)
@@ -720,12 +720,12 @@ public int ComputeTypeSize(Type type)
             break;
          }
          case pointerType: case subClassType: size = type.alignment = targetBits / 8; /*sizeof(void *); */break;
-         case arrayType: 
+         case arrayType:
             if(type.arraySizeExp)
             {
                ProcessExpressionType(type.arraySizeExp);
                ComputeExpression(type.arraySizeExp);
-               if(!type.arraySizeExp.isConstant || (type.arraySizeExp.expType.kind != intType && type.arraySizeExp.expType.kind != enumType && 
+               if(!type.arraySizeExp.isConstant || (type.arraySizeExp.expType.kind != intType && type.arraySizeExp.expType.kind != enumType &&
                   (type.arraySizeExp.expType.kind != classType || !type.arraySizeExp.expType._class.registered || type.arraySizeExp.expType._class.registered.type != enumClass)))
                {
                   Location oldLoc = yylloc;
@@ -759,7 +759,7 @@ public int ComputeTypeSize(Type type)
             size = ComputeTypeSize(type.type) * type.arraySize;
             if(type.type)
                type.alignment = type.type.alignment;
-            
+
             break;
          case structType:
          {
@@ -786,7 +786,7 @@ public int ComputeTypeSize(Type type)
             for(member = type.members.first; member; member = member.next)
             {
                uint addSize = ComputeTypeSize(member);
-               
+
                member.offset = size;
                if(member.alignment && size % member.alignment)
                   member.offset += member.alignment - (size % member.alignment);
@@ -874,7 +874,7 @@ public int ComputeTypeSize(Type type)
                   OldList * specs = MkList(), * decls = MkList();
                   Declarator decl;
 
-                  decl = SpecDeclFromString(member.dataTypeString, specs, 
+                  decl = SpecDeclFromString(member.dataTypeString, specs,
                      MkDeclaratorIdentifier(MkIdentifier(member.name)));
                   ListAdd(decls, MkStructDeclarator(decl, null));
                   ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, null)));
@@ -912,10 +912,10 @@ public int ComputeTypeSize(Type type)
             case structMember:
             {
                OldList * specs = MkList(), * list = MkList();
-               
+
                size = 0;
                AddMembers(list, (Class)member, true, &size, topClass, null);
-               ListAdd(specs, 
+               ListAdd(specs,
                   MkStructOrUnion((member.type == unionMember)?unionSpecifier:structSpecifier, null, list));
                ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, null, null)));
                alignment = member.structAlignment;
@@ -947,8 +947,8 @@ public int ComputeTypeSize(Type type)
       {
          char sizeString[50];
          sprintf(sizeString, "%d", maxSize - totalSize);
-         ListAdd(declarations, 
-            MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), 
+         ListAdd(declarations,
+            MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)),
             MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), null)));
          if(addedPadding)
             *addedPadding = true;
@@ -965,7 +965,7 @@ static int DeclareMembers(Class _class, bool isMember)
    uint totalSize = 0;
    DataMember member;
    Context context = isMember ? null : SetupTemplatesContext(_class);
-   
+
    if(!isMember && (_class.type == structClass || _class.type == noHeadClass) && _class.base.type != systemClass)
       DeclareMembers(_class.base, false);
 
@@ -1011,7 +1011,7 @@ void DeclareStruct(char * name, bool skipNoHead)
    if(!inCompiler || !classSym) return;
 
    // We don't need any declaration for bit classes...
-   if(classSym.registered && 
+   if(classSym.registered &&
       (classSym.registered.type == bitClass || classSym.registered.type == unitClass || classSym.registered.type == enumClass))
       return;
 
@@ -1026,7 +1026,7 @@ void DeclareStruct(char * name, bool skipNoHead)
       OldList * specifiers, * declarators;
       OldList * declarations = null;
       char structName[1024];
-      external = (classSym.registered && classSym.registered.type == structClass) ? 
+      external = (classSym.registered && classSym.registered.type == structClass) ?
          classSym.pointerExternal : classSym.structExternal;
 
       // TEMPORARY HACK: Pass 3 will move up struct declarations without moving members
@@ -1043,14 +1043,14 @@ void DeclareStruct(char * name, bool skipNoHead)
          }
          return;
       }
-      
+
       //if(!skipNoHead)
          DeclareMembers(classSym.registered, false);
 
       structName[0] = 0;
       FullClassNameCat(structName, name, false);
 
-      /*if(!external)      
+      /*if(!external)
          external = MkExternalDeclaration(null);*/
 
       if(!skipNoHead)
@@ -1095,7 +1095,7 @@ void DeclareStruct(char * name, bool skipNoHead)
          }
          else
          {
-            if(!external)      
+            if(!external)
                external = MkExternalDeclaration(null);
 
             specifiers = MkList();
@@ -1281,7 +1281,7 @@ void DeclareProperty(Property prop, char * setName, char * getName)
             declarators = MkList();
             params = MkList();
 
-            ListAdd(params, MkTypeName(MkListOne(MkSpecifierName /*MkClassName*/(prop._class.fullName)), 
+            ListAdd(params, MkTypeName(MkListOne(MkSpecifierName /*MkClassName*/(prop._class.fullName)),
                MkDeclaratorIdentifier(MkIdentifier("this"))));
 
             d = MkDeclaratorIdentifier(MkIdentifier(getName));
@@ -1317,13 +1317,13 @@ void DeclareProperty(Property prop, char * setName, char * getName)
                d = PlugDeclarator(typeDecl, d);
             else
             {
-               ListAdd(params, MkTypeName(specifiers, 
+               ListAdd(params, MkTypeName(specifiers,
                   PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
                specifiers = MkList();
             }
 
             d = MkDeclaratorFunction(d, params);
+
             //if(imported)
             if(dllImport)
                specifiers->Insert(null, MkSpecifier(EXTERN));
@@ -1372,7 +1372,7 @@ void DeclareProperty(Property prop, char * setName, char * getName)
             // TESTING COMMENTING THIS FIRST LINE OUT, what was the problem? Trying to add noHeadClass here ...
             if(!prop.conversion || prop._class.type == structClass)
             {
-               ListAdd(params, MkTypeName(MkListOne(MkSpecifierName/*MkClassName*/(prop._class.fullName)), 
+               ListAdd(params, MkTypeName(MkListOne(MkSpecifierName/*MkClassName*/(prop._class.fullName)),
                   MkDeclaratorIdentifier(MkIdentifier("this"))));
             }
 
@@ -1454,7 +1454,7 @@ void DeclareProperty(Property prop, char * setName, char * getName)
 
          {
             OldList * list = MkList();
-            ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer(null, null), 
+            ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer(null, null),
                   MkDeclaratorIdentifier(MkIdentifier(propName))), null));
 
             if(!imported)
@@ -1467,7 +1467,7 @@ void DeclareProperty(Property prop, char * setName, char * getName)
 
                MangleClassName(propName);
 
-               ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer(null, null), 
+               ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer(null, null),
                      MkDeclaratorIdentifier(MkIdentifier(propName))), null));
             }
             decl = MkDeclaration(specifiers, list);
@@ -1695,7 +1695,7 @@ void ProcessMemberInitData(MemberInit member, Class _class, Class * curClass, Da
          int c;
          int paramCount = 0;
          int lastParam = -1;
-         
+
          char templateString[1024];
          ClassTemplateParameter param;
          sprintf(templateString, "%s<", expClass.templateClass.fullName);
@@ -1708,7 +1708,7 @@ void ProcessMemberInitData(MemberInit member, Class _class, Class * curClass, Da
                int id = p;
                Class sClass;
                ClassTemplateArgument arg;
-               for(sClass = cClass.base; sClass; sClass = sClass.base) 
+               for(sClass = cClass.base; sClass; sClass = sClass.base)
                {
                   if(sClass.templateClass) sClass = sClass.templateClass;
                   id += sClass.templateParams.count;
@@ -1723,12 +1723,12 @@ void ProcessMemberInitData(MemberInit member, Class _class, Class * curClass, Da
                   Class nextClass;
                   if(sClass.templateClass) sClass = sClass.templateClass;
 
-                  for(nextClass = sClass.base; nextClass; nextClass = nextClass.base) 
+                  for(nextClass = sClass.base; nextClass; nextClass = nextClass.base)
                   {
                      if(nextClass.templateClass) nextClass = nextClass.templateClass;
                      p += nextClass.templateParams.count;
                   }
-                  
+
                   for(cParam = sClass.templateParams.first; cParam; cParam = cParam.next, p++)
                   {
                      if(cParam.type == TemplateParameterType::type && arg.dataTypeString && !strcmp(cParam.name, arg.dataTypeString))
@@ -1797,7 +1797,7 @@ void ProcessMemberInitData(MemberInit member, Class _class, Class * curClass, Da
                      lastParam = p;
                   }
                   p++;
-               }               
+               }
             }
          }
          {
@@ -1905,7 +1905,7 @@ void ProcessInstantiationType(Instantiation inst)
       MembersInit members;
       Symbol classSym; // = inst._class.symbol; // FindClass(inst._class.name);
       Class _class;
-      
+
       /*if(!inst._class.symbol)
          inst._class.symbol = FindClass(inst._class.name);*/
       classSym = inst._class.symbol;
@@ -1954,7 +1954,7 @@ void ProcessInstantiationType(Instantiation inst)
                      strcat(name, nameID.string);
                      strcat(name, "_");
                      sprintf(number, "_%08d", instMethodID++);
-                     strcat(name, number);                     
+                     strcat(name, number);
                      nameID.string = CopyString(name);
                   }
 
@@ -1963,7 +1963,7 @@ void ProcessInstantiationType(Instantiation inst)
                   {
                      Symbol symbol = declarator.symbol;
                      Method method = eClass_FindMethod(_class, unmangled, privateModule);
-                                    
+
                      if(method && method.type == virtualMethod)
                      {
                         symbol.method = method;
@@ -1971,7 +1971,7 @@ void ProcessInstantiationType(Instantiation inst)
 
                         if(!symbol.type.thisClass)
                         {
-                           if(method.dataType.thisClass && currentClass && 
+                           if(method.dataType.thisClass && currentClass &&
                               eClass_IsDerived(currentClass, method.dataType.thisClass.registered))
                            {
                               if(!currentClass.symbol)
@@ -2038,7 +2038,7 @@ void ProcessInstantiationType(Instantiation inst)
                         delete declarator.symbol.string;
                         declarator.symbol.string = CopyString(name);
                      }
-                     
+
                      if(!declarator.symbol.parent && globalContext.symbols.root != (BTNode)declarator.symbol)
                      {
                         printf("TOCHECK: Will this ever be in a list? Yes.\n");
@@ -2049,7 +2049,7 @@ void ProcessInstantiationType(Instantiation inst)
 
                      }
                      */
-                  
+
                      //curExternal = curExternal.prev;
                      //afterExternal = afterExternal->next;
 
@@ -2071,11 +2071,11 @@ void ProcessInstantiationType(Instantiation inst)
                            {
                               //Declaration decl = MkDeclaration(members.function.specifiers, MkListOne(MkInitDeclarator(CopyDeclarator(declarator), null)));
 
-                              Declaration decl = MkDeclaration(CopyList(createdExternal.function.specifiers, CopySpecifier), 
+                              Declaration decl = MkDeclaration(CopyList(createdExternal.function.specifiers, CopySpecifier),
                                  MkListOne(MkInitDeclarator(CopyDeclarator(declarator), null)));
-                     
+
                               //externalDecl = MkExternalDeclaration(decl);
-                        
+
                               //***** ast->Insert(external.prev, externalDecl);
                               //ast->Insert(curExternal.prev, externalDecl);
                               externalDecl.declaration = decl;
@@ -2234,7 +2234,7 @@ public Context SetupTemplatesContext(Class _class)
                   // ADD DATA TYPE HERE...
                   p.param = param = TemplateParameter
                   {
-                     identifier = MkIdentifier(p.name), type = p.type, 
+                     identifier = MkIdentifier(p.name), type = p.type,
                      dataTypeString = p.dataTypeString /*, dataType = { specs, decl }*/
                   };
                }
@@ -2360,7 +2360,7 @@ public void DeclareMethod(Method method, char * name)
             if(!classSym._import)
             {
                ModuleImport module;
-               
+
                if(method._class.module && method._class.module.name)
                   module = FindModule(method._class.module);
                else
@@ -2404,7 +2404,7 @@ public void DeclareMethod(Method method, char * name)
             }
             /*
             if(!method.thisClass || strcmp(method.thisClass, "void"))
-               symbol.type.params.Insert(null, 
+               symbol.type.params.Insert(null,
                   MkClassType(method.thisClass ? method.thisClass : method._class.fullName));
             */
          }
@@ -2482,7 +2482,7 @@ public void DeclareMethod(Method method, char * name)
                {
                   Class _class = method.dataType.thisClass ? method.dataType.thisClass.registered : method._class;
                   TypeName thisParam = MkTypeName(MkListOne(
-                     MkSpecifierName/*MkClassName*/(method.dataType.thisClass ? method.dataType.thisClass.string : method._class.fullName)), 
+                     MkSpecifierName/*MkClassName*/(method.dataType.thisClass ? method.dataType.thisClass.string : method._class.fullName)),
                      (_class && _class.type == systemClass) ? MkDeclaratorPointer(MkPointer(null,null), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
                   TypeName firstParam = ((TypeName)funcDecl.function.parameters->first);
                   Specifier firstSpec = firstParam.qualifiers ? firstParam.qualifiers->first : null;
@@ -2504,7 +2504,7 @@ public void DeclareMethod(Method method, char * name)
             else if(!funcDecl.function.parameters)
             {
                funcDecl.function.parameters = MkList();
-               funcDecl.function.parameters->Insert(null, 
+               funcDecl.function.parameters->Insert(null,
                   MkTypeName(MkListOne(MkSpecifier(VOID)),null));
             }*/
          }
@@ -2557,7 +2557,7 @@ char * ReplaceThisClass(Class _class)
       int p = 0;
       ClassTemplateParameter param;
       int lastParam = -1;
-      
+
       char className[1024];
       strcpy(className, _class.fullName);
       for(param = _class.templateParams.first; param; param = param.next)
@@ -2587,7 +2587,7 @@ char * ReplaceThisClass(Class _class)
       return CopyString(className);
    }
    else
-      return CopyString(_class.fullName);   
+      return CopyString(_class.fullName);
 }
 
 Type ReplaceThisClassType(Class _class)
@@ -2600,7 +2600,7 @@ Type ReplaceThisClassType(Class _class)
       int lastParam = -1;
       char className[1024];
       strcpy(className, _class.fullName);
-      
+
       for(param = _class.templateParams.first; param; param = param.next)
       {
          // if((!param.defaultArg.dataTypeString && !param.defaultArg.expression.ui64))
@@ -2744,7 +2744,7 @@ bool DeclareFunction(GlobalFunction function, char * name)
             if(funcDecl && !funcDecl.function.parameters)
             {
                funcDecl.function.parameters = MkList();
-               funcDecl.function.parameters->Insert(null, 
+               funcDecl.function.parameters->Insert(null,
                   MkTypeName(MkListOne(MkSpecifier(VOID)),null));
             }
 
@@ -2889,7 +2889,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
          if(dest.classObjectType == anyObject && source.classObjectType != typedObject)
             return true;
       }
-      
+
       if((dest.kind == structType && source.kind == structType) ||
          (dest.kind == unionType && source.kind == unionType))
       {
@@ -2906,7 +2906,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
          || source.kind == subClassType || source.kind == pointerType || source.kind == arrayType || source.kind == functionType || source.kind == thisClassType)
 
          /*source.kind != voidType && source.kind != structType && source.kind != unionType  */
-      
+
          /*&& (source.kind != classType /-*|| source._class.registered.type != structClass)*/)
          return true;
       if(!isConversionExploration && source.kind == pointerType && source.type.kind == voidType &&
@@ -2939,14 +2939,14 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
          // Don't match enum inheriting from other enum if resolving enumeration values
          // TESTING: !dest.classObjectType
          else if(source._class && dest._class && (dest.classObjectType == source.classObjectType || !dest.classObjectType) &&
-            (enumBaseType || 
-               (!source._class.registered || source._class.registered.type != enumClass) || 
+            (enumBaseType ||
+               (!source._class.registered || source._class.registered.type != enumClass) ||
                (!dest._class.registered || dest._class.registered.type != enumClass)) && eClass_IsDerived(source._class.registered, dest._class.registered))
             return true;
          else
          {
             // Added this so that DefinedColor = Color doesn't go through ColorRGB property
-            if(enumBaseType && 
+            if(enumBaseType &&
                dest._class && dest._class.registered && dest._class.registered.type == enumClass &&
                ((source._class && source._class.registered && source._class.registered.type != enumClass) || source.kind == classType)) // Added this here for a base enum to be acceptable for a derived enum (#139)
             {
@@ -2985,8 +2985,8 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
                            return true;
                         else if(conversions != null)
                         {
-                           if(_class.type == unitClass && convert.dataType.kind == classType && convert.dataType._class && 
-                              convert.dataType._class.registered && _class.base == convert.dataType._class.registered.base && 
+                           if(_class.type == unitClass && convert.dataType.kind == classType && convert.dataType._class &&
+                              convert.dataType._class.registered && _class.base == convert.dataType._class.registered.base &&
                               (dest.kind != classType || dest._class.registered != _class.base))
                               return true;
                            else
@@ -3027,8 +3027,8 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
                            return true;
                         else if(conversions != null)
                         {
-                           if(_class.type == unitClass && convert.dataType.kind == classType && convert.dataType._class && 
-                              convert.dataType._class.registered && _class.base == convert.dataType._class.registered.base && 
+                           if(_class.type == unitClass && convert.dataType.kind == classType && convert.dataType._class &&
+                              convert.dataType._class.registered && _class.base == convert.dataType._class.registered.base &&
                               (source.kind != classType || source._class.registered != _class.base))
                               return true;
                            else
@@ -3046,7 +3046,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
             }
             /*if(dest._class.registered && !strcmp(dest._class.registered.name, "bool"))
             {
-               if(source.kind != voidType && source.kind != structType && source.kind != unionType && 
+               if(source.kind != voidType && source.kind != structType && source.kind != unionType &&
                   (source.kind != classType || source._class.registered.type != structClass))
                   return true;
             }*/
@@ -3089,8 +3089,8 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
                            return true;
                         else if(conversions != null)
                         {
-                           if(_class.type == unitClass && convert.dataType.kind == classType && convert.dataType._class && 
-                              convert.dataType._class.registered && _class.base == convert.dataType._class.registered.base && 
+                           if(_class.type == unitClass && convert.dataType.kind == classType && convert.dataType._class &&
+                              convert.dataType._class.registered && _class.base == convert.dataType._class.registered.base &&
                               (dest.kind != classType || dest._class.registered != _class.base))
                               return true;
                            else
@@ -3122,7 +3122,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
 
       if(source.kind == classType || source.kind == subClassType)
          ;
-      else if(dest.kind == source.kind && 
+      else if(dest.kind == source.kind &&
          (dest.kind != structType && dest.kind != unionType &&
           dest.kind != functionType && dest.kind != arrayType && dest.kind != pointerType && dest.kind != methodType))
           return true;
@@ -3145,21 +3145,21 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
       else if(dest.kind == enumType &&
          (source.kind == intType || source.kind == shortType || source.kind == charType || source.kind == longType || source.kind == int64Type || source.kind == intPtrType || source.kind == intSizeType))
           return true;
-      else if((dest.kind == functionType || (dest.kind == pointerType && dest.type.kind == functionType) || dest.kind == methodType) && 
+      else if((dest.kind == functionType || (dest.kind == pointerType && dest.type.kind == functionType) || dest.kind == methodType) &&
               ((source.kind == functionType || (source.kind == pointerType && source.type.kind == functionType) || source.kind == methodType)))
       {
          Type paramSource, paramDest;
 
-         if(dest.kind == methodType)     
+         if(dest.kind == methodType)
             owningClassDest = dest.methodClass ? dest.methodClass : dest.method._class;
-         if(source.kind == methodType)   
+         if(source.kind == methodType)
             owningClassSource = source.methodClass ? source.methodClass : source.method._class;
 
          if(dest.kind == pointerType && dest.type.kind == functionType) dest = dest.type;
          if(source.kind == pointerType && source.type.kind == functionType) source = source.type;
-         if(dest.kind == methodType) 
+         if(dest.kind == methodType)
             dest = dest.method.dataType;
-         if(source.kind == methodType) 
+         if(source.kind == methodType)
             source = source.method.dataType;
 
          paramSource = source.params.first;
@@ -3167,8 +3167,8 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
          paramDest = dest.params.first;
          if(paramDest && paramDest.kind == voidType) paramDest = null;
 
-     
-         if((dest.staticMethod || (!dest.thisClass && !owningClassDest)) && 
+
+         if((dest.staticMethod || (!dest.thisClass && !owningClassDest)) &&
             !(source.staticMethod || (!source.thisClass && !owningClassSource)))
          {
             // Source thisClass must be derived from destination thisClass
@@ -3204,7 +3204,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
                      if(owningClassDest)
                        Compiler_Error($"%s expected to be derived from method class\n", owningClassDest.fullName);
                      else
-                        Compiler_Error($"overriding class expected to be derived from method class\n");      
+                        Compiler_Error($"overriding class expected to be derived from method class\n");
                      return false;
                   }
                }
@@ -3230,7 +3230,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
                      //if(owningClass)
                         Compiler_Error($"%s expected to be derived from method class\n", /*owningClass.name*/ source.thisClass.registered.fullName);
                      //else
-                        //Compiler_Error($"overriding class expected to be derived from method class\n");      
+                        //Compiler_Error($"overriding class expected to be derived from method class\n");
                      return false;
                   }
                }
@@ -3246,7 +3246,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
          }
 
          // Check parameters
-      
+
          for(; paramDest; paramDest = paramDest.next)
          {
             if(!paramSource)
@@ -3295,14 +3295,14 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
                }
 
                // paramDest must be derived from paramSource
-               if(!MatchTypes(paramDestType, paramSourceType, null, null, null, true, true, false, false) && 
+               if(!MatchTypes(paramDestType, paramSourceType, null, null, null, true, true, false, false) &&
                   (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, null, null, null, true, true, false, false)))
                {
                   char type[1024];
                   type[0] = 0;
                   PrintType(paramDest, type, false, true);
                   Compiler_Warning($"incompatible parameter %s (expected %s)\n", paramSource.name, type);
-                  
+
                   if(paramDestType != paramDest)
                      FreeType(paramDestType);
                   return false;
@@ -3310,7 +3310,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
                if(paramDestType != paramDest)
                   FreeType(paramDestType);
             }
-         
+
             paramSource = paramSource.next;
          }
          if(paramSource)
@@ -3324,7 +3324,7 @@ public bool MatchTypes(Type source, Type dest, OldList conversions, Class owning
       {
          return true;
       }
-      else if((dest.kind == pointerType || dest.kind == arrayType) && 
+      else if((dest.kind == pointerType || dest.kind == arrayType) &&
          (source.kind == arrayType || source.kind == pointerType))
       {
          if(MatchTypes(source.type, dest.type, null, null, null, true, true, false, false))
@@ -3340,7 +3340,7 @@ static void FreeConvert(Conversion convert)
       FreeType(convert.resultType);
 }
 
-bool MatchWithEnums_NameSpace(NameSpace nameSpace, Expression sourceExp, Type dest, 
+bool MatchWithEnums_NameSpace(NameSpace nameSpace, Expression sourceExp, Type dest,
                               char * string, OldList conversions)
 {
    BTNamedLink link;
@@ -3391,7 +3391,7 @@ bool MatchWithEnums_NameSpace(NameSpace nameSpace, Expression sourceExp, Type de
                         sourceExp.constant = CopyString(constant);
                         //for(;baseClass.base && baseClass.base.type != systemClass; baseClass = baseClass.base);
                      }
-                  
+
                      while(converts.first)
                      {
                         Conversion convert = converts.first;
@@ -3418,7 +3418,7 @@ bool MatchWithEnums_NameSpace(NameSpace nameSpace, Expression sourceExp, Type de
 public bool ModuleVisibility(Module searchIn, Module searchFor)
 {
    SubModule subModule;
-   
+
    if(searchFor == searchIn)
       return true;
 
@@ -3466,10 +3466,10 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
        if(source._class && source._class.registered && source._class.registered.type == unitClass)
        {
           Class sourceBase, destBase;
-          for(sourceBase = source._class.registered; 
+          for(sourceBase = source._class.registered;
               sourceBase && sourceBase.base && sourceBase.base.type != systemClass;
               sourceBase = sourceBase.base);
-          for(destBase = dest._class.registered; 
+          for(destBase = dest._class.registered;
               destBase && destBase.base && destBase.base.type != systemClass;
               destBase = destBase.base);
           //if(source._class.registered == dest._class.registered)
@@ -3502,7 +3502,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
             value = -strtoull(sourceExp.op.exp2.constant, null, 0);
       }
 
-      if(dest.kind != classType && source.kind == classType && source._class && source._class.registered && 
+      if(dest.kind != classType && source.kind == classType && source._class && source._class.registered &&
          !strcmp(source._class.registered.fullName, "ecere::com::unichar"))
       {
          FreeType(source);
@@ -3537,7 +3537,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
                backupSourceExpType = sourceExp.expType;
                sourceExp.expType = dest; dest.refCount++;
                //sourceExp.expType = MkClassType(_class.fullName);
-               flag = true;            
+               flag = true;
 
                delete tempType;
             }
@@ -3555,7 +3555,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
                FreeType(sourceExp.expType);
                source = sourceExp.expType = MkClassType(dest._class.string);
                source.refCount++;
-               
+
                //source.kind = classType;
                //source._class = dest._class;
             }
@@ -3575,7 +3575,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
                FreeType(source);
                source = sourceExp.expType = MkClassType(dest._class.string);
                source.refCount++;
-               
+
                //source.kind = classType;
                //source._class = dest._class;
             }
@@ -3617,14 +3617,14 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
                // Testing this simpler piece of code... (Broke Units Conversion to no unit Logic)
                if(!source._class.registered.dataType)
                   source._class.registered.dataType = ProcessTypeString(source._class.registered.dataTypeString, false);
-               
+
                FreeType(dest);
                dest = MkClassType(source._class.string);
                //if(MatchTypes(source._class.registered.dataType, dest, conversions, null, null, true, false, false))
                //   dest = MkClassType(source._class.string);
             }
             */
-            
+
             if(dest.kind != classType)
             {
                Type tempType { };
@@ -3643,14 +3643,14 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
 
                if(tempType._class)
                   MatchTypes(tempSource, tempDest, conversions, null, null, true, true, false, false);
-               
+
                // PUT THIS BACK TESTING UNITS?
                if(conversions.last)
                {
                   ((Conversion)(conversions.last)).resultType = dest;
                   dest.refCount++;
                }
-               
+
                FreeType(sourceExp.expType);
                sourceExp.expType = MkClassType(_class.fullName);
                sourceExp.expType.truth = source.truth;
@@ -3676,7 +3676,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
                dest = MkClassType(source._class.string);
                dest.truth = source.truth;
                dest.classObjectType = source.classObjectType;
-               
+
                FreeType(source);
                source = _class.dataType;
                source.refCount++;
@@ -3712,7 +3712,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
       if(dest.kind == classType)
       {
          Class _class = dest._class ? dest._class.registered : null;
-         if(_class && !dest.truth && (_class.type == unitClass || !strcmp(_class.fullName, "bool") || 
+         if(_class && !dest.truth && (_class.type == unitClass || !strcmp(_class.fullName, "bool") ||
             (/*_class.type == enumClass*/_class.type != structClass && !value && source.kind == intType) || _class.type == bitClass))   // TOCHECK: enumClass, bitClass is new here...
          {
             if(_class.type == normalClass || _class.type == noHeadClass)
@@ -3750,13 +3750,13 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
          }
 
          // Accept lower precision types for units, since we want to keep the unit type
-         if(dest.kind == doubleType && 
+         if(dest.kind == doubleType &&
             (source.kind == doubleType || source.kind == floatType || dest.kind == int64Type || source.kind == intType || source.kind == shortType ||
              source.kind == charType))
          {
             specs = MkListOne(MkSpecifier(DOUBLE));
          }
-         else if(dest.kind == floatType && 
+         else if(dest.kind == floatType &&
             (source.kind == floatType || dest.kind == int64Type || source.kind == intType || source.kind == shortType || source.kind == charType ||
             source.kind == doubleType))
          {
@@ -3803,25 +3803,25 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
             return false;
          }
       }
-      else if(dest.kind == doubleType && 
+      else if(dest.kind == doubleType &&
          (source.kind == doubleType || source.kind == floatType || source.kind == int64Type || source.kind == intType || source.kind == enumType || source.kind == shortType ||
           source.kind == charType))
       {
          specs = MkListOne(MkSpecifier(DOUBLE));
       }
-      else if(dest.kind == floatType && 
+      else if(dest.kind == floatType &&
          (source.kind == floatType || source.kind == enumType || source.kind == int64Type || source.kind == intType || source.kind == shortType || source.kind == charType))
       {
          specs = MkListOne(MkSpecifier(FLOAT));
       }
-      else if(dest.kind == charType && (source.kind == charType || source.kind == enumType || source.kind == shortType || source.kind == intType) && 
+      else if(dest.kind == charType && (source.kind == charType || source.kind == enumType || source.kind == shortType || source.kind == intType) &&
          (dest.isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
       {
          specs = MkList();
          if(!dest.isSigned) ListAdd(specs, MkSpecifier(UNSIGNED));
          ListAdd(specs, MkSpecifier(CHAR));
       }
-      else if(dest.kind == shortType && (source.kind == enumType || source.kind == charType || source.kind == shortType || 
+      else if(dest.kind == shortType && (source.kind == enumType || source.kind == charType || source.kind == shortType ||
          (source.kind == intType && (dest.isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
       {
          specs = MkList();
@@ -3840,7 +3840,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
          if(!dest.isSigned) ListAdd(specs, MkSpecifier(UNSIGNED));
          ListAdd(specs, MkSpecifier(INT64));
       }
-      else if(dest.kind == enumType && 
+      else if(dest.kind == enumType &&
          (source.kind == int64Type || source.kind == intType || source.kind == shortType || source.kind == charType))
       {
          specs = MkListOne(MkEnum(MkIdentifier(dest.enumName), null));
@@ -3881,7 +3881,7 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
          }
          else
             sourceExp.cast.exp = newExp;
-         
+
          FreeType(sourceExp.expType);
          sourceExp.expType = null;
          ProcessExpressionType(sourceExp);
@@ -4145,9 +4145,9 @@ public void ReadString(char * output,  char * string)
          d++;
          escaped = false;
       }
-      else 
+      else
       {
-         if(ch == '\"') 
+         if(ch == '\"')
             quoted ^= true;
          else if(quoted)
          {
@@ -4167,13 +4167,13 @@ public Operand GetOperand(Expression exp)
    Type type = exp.expType;
    if(type)
    {
-      while(type.kind == classType && 
+      while(type.kind == classType &&
          type._class.registered && (type._class.registered.type == bitClass || type._class.registered.type == unitClass || type._class.registered.type == enumClass))
       {
          if(!type._class.registered.dataType)
             type._class.registered.dataType = ProcessTypeString(type._class.registered.dataTypeString, false);
          type = type._class.registered.dataType;
-         
+
       }
       op.kind = type.kind;
       op.type = exp.expType;
@@ -4279,7 +4279,7 @@ public Operand GetOperand(Expression exp)
                op.ui64 = _strtoui64(exp.constant, null, 0);
                op.kind = pointerType;
                op.ops = uintOps;
-               // op.ptrSize = 
+               // op.ptrSize =
                break;
          }
       }
@@ -4470,7 +4470,7 @@ void PopulateInstance(Instantiation inst)
                      exp.type = identifierExp;
                      exp.destType = MkClassType(_class.fullName);
                      ProcessExpressionType(exp);
-                  }                     
+                  }
                }
                if(_class.type == enumClass || _class.type == unitClass || _class.type == bitClass)
                {
@@ -4537,9 +4537,9 @@ void ComputeInstantiation(Expression exp)
 
    if(_class && (_class.type == structClass || _class.type == normalClass || _class.type == noHeadClass ))
    {
-      // Don't recompute the instantiation... 
+      // Don't recompute the instantiation...
       // Non Simple classes will have become constants by now
-      if(inst.data) 
+      if(inst.data)
          return;
 
       if(_class.type == normalClass || _class.type == noHeadClass)
@@ -4583,7 +4583,7 @@ void ComputeInstantiation(Expression exp)
                            else
                            {
                               dataMember = curMember;
-                              
+
                               // CHANGED THIS HERE
                               eClass_FindDataMemberAndOffset(_class, dataMember.name, &dataMemberOffset, privateModule, null, null);
 
@@ -4642,7 +4642,7 @@ void ComputeInstantiation(Expression exp)
                         {
                            if(!dataMember.dataType)
                               dataMember.dataType = ProcessTypeString(dataMember.dataTypeString, false);
-                           
+
                            type = dataMember.dataType;
                         }
 
@@ -4661,7 +4661,7 @@ void ComputeInstantiation(Expression exp)
                                     type = prop.dataType;
                                  else
                                  {
-                                    dataMember = eClass_FindDataMemberAndOffset(type._class.registered, 
+                                    dataMember = eClass_FindDataMemberAndOffset(type._class.registered,
                                        ident.string, &dataMemberOffset, privateModule, null, null);
                                     if(dataMember)
                                        type = dataMember.dataType;
@@ -4705,7 +4705,7 @@ void ComputeInstantiation(Expression exp)
                            if(dataMember)
                            {
                               void * ptr = inst.data + dataMemberOffset;
-                              
+
                               if(value.type == constantExp)
                               {
                                  switch(type.kind)
@@ -4891,7 +4891,7 @@ void ComputeInstantiation(Expression exp)
                               if(type.kind == classType && type._class && type._class.registered)
                               {
                                  if(!type._class.registered.dataType)
-                                    type._class.registered.dataType = ProcessTypeString(type._class.registered.dataTypeString, false);                                    
+                                    type._class.registered.dataType = ProcessTypeString(type._class.registered.dataTypeString, false);
                                  type = type._class.registered.dataType;
                               }
 
@@ -4953,7 +4953,7 @@ void ComputeInstantiation(Expression exp)
                            ComputeExpression(member.initializer.exp);
                            exp.constant = member.initializer.exp.constant;
                            exp.type = constantExp;
-                           
+
                            member.initializer.exp.constant = null;
                         }
                      }
@@ -5143,7 +5143,7 @@ void ComputeExpression(Expression exp)
                if(op2.type) op2.type.refCount++;
             }
          }
-         else 
+         else
          {
             exp1 = exp.op.exp2;
             op1 = GetOperand(exp1);
@@ -5202,7 +5202,7 @@ void ComputeExpression(Expression exp)
             case '-':
                if(exp.op.exp1)
                {
-                  if(op1.ops.Sub) 
+                  if(op1.ops.Sub)
                   {
                      FreeExpContents(exp);
                      op1.ops.Sub(exp, op1, op2);
@@ -5210,7 +5210,7 @@ void ComputeExpression(Expression exp)
                }
                else
                {
-                  if(op1.ops.Neg) 
+                  if(op1.ops.Neg)
                   {
                      FreeExpContents(exp);
                      op1.ops.Neg(exp, op1);
@@ -5233,7 +5233,7 @@ void ComputeExpression(Expression exp)
                break;
             // Binary only operators
             case '/':
-               if(op1.ops.Div) 
+               if(op1.ops.Div)
                {
                   FreeExpContents(exp);
                   op1.ops.Div(exp, op1, op2);
@@ -5311,14 +5311,14 @@ void ComputeExpression(Expression exp)
                }
                break;
             case '|':
-               if(op1.ops.BitOr) 
+               if(op1.ops.BitOr)
                {
                   FreeExpContents(exp);
                   op1.ops.BitOr(exp, op1, op2);
                }
                break;
             case '^':
-               if(op1.ops.BitXor) 
+               if(op1.ops.BitXor)
                {
                   FreeExpContents(exp);
                   op1.ops.BitXor(exp, op1, op2);
@@ -5429,7 +5429,7 @@ void ComputeExpression(Expression exp)
                _class = classSym ? classSym.registered : null;
                prop = eClass_FindProperty(_class, convertTo.fullName, privateModule);
             }
-      
+
             if(prop)
             {
                if(prop.compiled)
@@ -5464,7 +5464,7 @@ void ComputeExpression(Expression exp)
                            double value;
                            double (*Get)(double);
                            GetDouble(exp.member.exp, &value);
-                     
+
                            if(convertTo)
                               Get = (void *)prop.Set;
                            else
@@ -5519,7 +5519,7 @@ void ComputeExpression(Expression exp)
                                  exp.instance._class = MkSpecifierName/*MkClassName*/(_class.fullName);
                                  exp.instance.loc = exp.loc;
                                  exp.type = instanceExp;
-                              
+
                                  GetInt(value, &intValue);
 
                                  Set(exp.instance.data, intValue);
@@ -5536,7 +5536,7 @@ void ComputeExpression(Expression exp)
                                  exp.instance._class = MkSpecifierName/*MkClassName*/(_class.fullName);
                                  exp.instance.loc = exp.loc;
                                  exp.type = instanceExp;
-                              
+
                                  GetInt64(value, &intValue);
 
                                  Set(exp.instance.data, intValue);
@@ -5554,7 +5554,7 @@ void ComputeExpression(Expression exp)
                                  exp.instance._class = MkSpecifierName/*MkClassName*/(_class.fullName);
                                  exp.instance.loc = exp.loc;
                                  exp.type = instanceExp;
-                              
+
                                  GetIntPtr(value, &intValue);
 
                                  Set(exp.instance.data, intValue);
@@ -5589,7 +5589,7 @@ void ComputeExpression(Expression exp)
                                  exp.instance._class = MkSpecifierName/*MkClassName*/(_class.fullName);
                                  exp.instance.loc = exp.loc;
                                  exp.type = instanceExp;
-                              
+
                                  GetDouble(value, &doubleValue);
 
                                  Set(exp.instance.data, doubleValue);
@@ -5736,7 +5736,7 @@ void ComputeExpression(Expression exp)
          Type type = ProcessType(exp.typeName.qualifiers, exp.typeName.declarator);
          FreeExpContents(exp);
          exp.constant = PrintUInt(ComputeTypeSize(type));
-         exp.type = constantExp;         
+         exp.type = constantExp;
          FreeType(type);
          break;
       }
@@ -5795,7 +5795,7 @@ void ComputeExpression(Expression exp)
                   type = _class.dataType;
                }
             }
-            
+
             switch(type.kind)
             {
                case charType:
@@ -5916,7 +5916,7 @@ void ComputeExpression(Expression exp)
                   break;
                }
                case doubleType:
-               {  
+               {
                   double value;
                   GetDouble(e, &value);
                   FreeExpContents(exp);
@@ -5954,7 +5954,7 @@ void ComputeExpression(Expression exp)
          if(op2.type) FreeType(op2.type);
          if(op3.type) FreeType(op3.type);
          break;
-      }  
+      }
    }
 }
 
@@ -6006,7 +6006,7 @@ static bool CheckExpressionType(Expression exp, Type destType, bool skipUnitBla)
                }
                else
                {
-               
+
                   /*if(exp.isConstant)
                   {
                      // Color { ColorRGB = [exp] };
@@ -6082,9 +6082,9 @@ static bool CheckExpressionType(Expression exp, Type destType, bool skipUnitBla)
       }
       if(!result && exp.expType && exp.destType)
       {
-         if((exp.destType.kind == classType && exp.expType.kind == pointerType && 
+         if((exp.destType.kind == classType && exp.expType.kind == pointerType &&
              exp.expType.type.kind == classType && exp.expType.type._class == exp.destType._class && exp.destType._class.registered && exp.destType._class.registered.type == structClass) ||
-            (exp.expType.kind == classType && exp.destType.kind == pointerType && 
+            (exp.expType.kind == classType && exp.destType.kind == pointerType &&
             exp.destType.type.kind == classType && exp.destType.type._class == exp.expType._class && exp.expType._class.registered && exp.expType._class.registered.type == structClass))
             result = true;
       }
@@ -6124,7 +6124,7 @@ void CheckTemplateTypes(Expression exp)
                OldList * unionDefs = MkList();
                OldList * statements = MkList();
                context = PushContext();
-               ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), null))); 
+               ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), null)));
                ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), null)));
                specs = MkListOne(MkStructOrUnion(unionSpecifier, null, unionDefs ));
                exp.type = extensionCompoundExp;
@@ -6171,7 +6171,7 @@ void CheckTemplateTypes(Expression exp)
                OldList * unionDefs = MkList();
                OldList * statements = MkList();
                context = PushContext();
-               ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), null))); 
+               ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), null)));
                ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), null)));
                specs = MkListOne(MkStructOrUnion(unionSpecifier, null, unionDefs ));
                exp.type = extensionCompoundExp;
@@ -6230,7 +6230,7 @@ void CheckTemplateTypes(Expression exp)
                typeString[0] = '\0';
                PrintType(exp.expType, typeString, false, false);
                decl = SpecDeclFromString(typeString, specs, null);
-               
+
                exp.type = castExp;
                //exp.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), null);
                exp.cast.typeName = MkTypeName(specs, decl);
@@ -6367,7 +6367,7 @@ static void ProcessDeclaration(Declaration decl);
 
          // Modified this recently...
          Context tmpContext = curContext;
-         curContext = null;         
+         curContext = null;
          symbol.pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function.specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function.declarator), null))));
          curContext = tmpContext;
 
@@ -6398,7 +6398,7 @@ static void GetTypeSpecs(Type type, OldList * specs)
    if(!type.isSigned && type.kind != intPtrType && type.kind != intSizeType) ListAdd(specs, MkSpecifier(UNSIGNED));
    switch(type.kind)
    {
-      case classType: 
+      case classType:
       {
          if(type._class.registered)
          {
@@ -6415,7 +6415,7 @@ static void GetTypeSpecs(Type type, OldList * specs)
       case int64Type: ListAdd(specs, MkSpecifier(INT64)); break;
       case intPtrType: ListAdd(specs, MkSpecifierName(type.isSigned ? "intptr" : "uintptr")); break;
       case intSizeType: ListAdd(specs, MkSpecifierName(type.isSigned ? "intsize" : "uintsize")); break;
-      case intType: 
+      case intType:
       default:
          ListAdd(specs, MkSpecifier(INT)); break;
    }
@@ -6521,7 +6521,7 @@ static void PrintTypeSpecs(Type type, char * string, bool fullName, bool printCo
          case subClassType:
             strcat(string, "subclass(");
             strcat(string, type._class ? type._class.string : "int");
-            strcat(string, ")");                  
+            strcat(string, ")");
             break;
          case templateType:
             strcat(string, type.templateParameter.identifier.string);
@@ -6966,7 +6966,7 @@ void ApplyAnyObjectLogic(Expression e)
                   newExp = checkedExp.op.exp2;
                   checkedExp.op.exp2 = null;
                   FreeExpContents(checkedExp);
-                  
+
                   if(e.expType && e.expType.passAsTemplate)
                   {
                      char size[100];
@@ -7036,11 +7036,11 @@ void ApplyAnyObjectLogic(Expression e)
                         /*
                         e.compound = MkCompoundStmt(
                            MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(
-                              MkDeclaratorIdentifier(MkIdentifier("__internalValue")), MkInitializerAssignment(newExp))))), 
+                              MkDeclaratorIdentifier(MkIdentifier("__internalValue")), MkInitializerAssignment(newExp))))),
 
                            MkListOne(MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("__internalValue"))))));
                         */
-                        
+
                         {
                            Type type = e.destType;
                            e.destType = { };
@@ -7096,7 +7096,7 @@ void ApplyAnyObjectLogic(Expression e)
       // FixReference(e, true);
    }
 //#if 0
-   if((!destType || destType.kind == ellipsisType || destType.kind == voidType) && e.expType && (e.expType.classObjectType == anyObject || e.expType.classObjectType == typedObject) && 
+   if((!destType || destType.kind == ellipsisType || destType.kind == voidType) && e.expType && (e.expType.classObjectType == anyObject || e.expType.classObjectType == typedObject) &&
       (e.expType.byReference || (e.expType.kind == classType && e.expType._class && e.expType._class.registered &&
          (e.expType._class.registered.type == bitClass || e.expType._class.registered.type == enumClass || e.expType._class.registered.type == unitClass ) )))
    {
@@ -7141,11 +7141,11 @@ void ApplyAnyObjectLogic(Expression e)
 // TOFIX: Try this for a nice IDE crash!
 //#endif
    // The other way around
-   else 
+   else
 //#endif
-   if(destType && e.expType && 
+   if(destType && e.expType &&
          //e.expType.kind == classType && e.expType._class && e.expType._class.registered && !strcmp(e.expType._class.registered.name, "class") &&
-         (e.expType.classObjectType == anyObject || e.expType.classObjectType == typedObject) && 
+         (e.expType.classObjectType == anyObject || e.expType.classObjectType == typedObject) &&
          !destType.classObjectType && /*(destType.kind != pointerType || !destType.type || destType.type.kind != voidType) &&*/ destType.kind != voidType)
    {
       if(destType.kind == ellipsisType)
@@ -7166,7 +7166,7 @@ void ApplyAnyObjectLogic(Expression e)
          if(e.expType.kind == classType && e.expType._class && e.expType._class.registered && strcmp(e.expType._class.registered.name, "class"))
             type = e.expType;
          else
-            type = destType;            
+            type = destType;
 
          backupClassObjectType = type.classObjectType;
          backupByReference = type.byReference;
@@ -7186,8 +7186,8 @@ void ApplyAnyObjectLogic(Expression e)
          thisExp.next = null;
          e.Clear();
 
-         if( ( type.kind == classType && type._class && type._class.registered && 
-                   (type._class.registered.type == systemClass || type._class.registered.type == bitClass || 
+         if( ( type.kind == classType && type._class && type._class.registered &&
+                   (type._class.registered.type == systemClass || type._class.registered.type == bitClass ||
                     type._class.registered.type == enumClass || type._class.registered.type == unitClass) ) ||
              (type.kind != pointerType && type.kind != intPtrType && type.kind != arrayType && type.kind != classType) ||
              (!destType.byReference && byReference && (destType.kind != pointerType || type.kind != pointerType)))
@@ -7222,16 +7222,16 @@ void ProcessExpressionType(Expression exp)
    bool unresolved = false;
    Location oldyylloc = yylloc;
    bool notByReference = false;
-#ifdef _DEBUG   
+#ifdef _DEBUG
    char debugExpString[4096];
    debugExpString[0] = '\0';
    PrintExpression(exp, debugExpString);
 #endif
-   if(!exp || exp.expType) 
+   if(!exp || exp.expType)
       return;
 
    //eSystem_Logf("%s\n", expString);
-   
+
    // Testing this here
    yylloc = exp.loc;
    switch(exp.type)
@@ -7335,10 +7335,10 @@ void ProcessExpressionType(Expression exp)
                {
                   if(_class && _class.type == structClass && !type.declaredWithStruct)
                      exp.byReference = true;
-                  
+
                   //TESTING COMMENTING THIS OUT IN FAVOR OF ApplyAnyObjectLogic
-                  /*if(type && _class && (type.classObjectType == typedObject || type.classObjectType == anyObject) && 
-                     ((_class.type == unitClass || _class.type == enumClass || _class.type == bitClass) || 
+                  /*if(type && _class && (type.classObjectType == typedObject || type.classObjectType == anyObject) &&
+                     ((_class.type == unitClass || _class.type == enumClass || _class.type == bitClass) ||
                      (type.byReference && (_class.type == normalClass || _class.type == noHeadClass))))
                   {
                      Identifier id = exp.identifier;
@@ -7355,7 +7355,7 @@ void ProcessExpressionType(Expression exp)
                      exp.list = MkListOne(MkExpOp(null, '*', MkExpIdentifier(exp.identifier)));
                      ((Expression)exp.list->first).op.exp2.expType = exp.expType;
                      exp.expType = null;
-                     ProcessExpressionType(exp);                     
+                     ProcessExpressionType(exp);
                   }
                   else if(symbol.isIterator != 4)
                   {
@@ -7533,10 +7533,10 @@ void ProcessExpressionType(Expression exp)
          if(exp.instance._class)
          {
             exp.expType = MkClassType(exp.instance._class.name);
-            /*if(exp.expType._class && exp.expType._class.registered && 
+            /*if(exp.expType._class && exp.expType._class.registered &&
                (exp.expType._class.registered.type == normalClass || exp.expType._class.registered.type == noHeadClass))
                exp.expType.byReference = true;*/
-         }         
+         }
          break;
       }
       case constantExp:
@@ -7659,7 +7659,7 @@ void ProcessExpressionType(Expression exp)
          switch(exp.op.op)
          {
             // Assignment Operators
-            case '=': 
+            case '=':
             case MUL_ASSIGN:
             case DIV_ASSIGN:
             case MOD_ASSIGN:
@@ -7708,7 +7708,7 @@ void ProcessExpressionType(Expression exp)
             case '/':
             case '%':
             case '*':
-               
+
                if(exp.op.op != '*' || exp.op.exp1)
                {
                   useSideType = true;
@@ -7751,11 +7751,11 @@ void ProcessExpressionType(Expression exp)
          {
             if(exp.destType && exp.destType.kind == classType &&
                exp.destType._class && exp.destType._class.registered && useDestType &&
-               
-              ((exp.destType._class.registered.type == unitClass && useSideUnit) || 
+
+              ((exp.destType._class.registered.type == unitClass && useSideUnit) ||
                exp.destType._class.registered.type == enumClass ||
                exp.destType._class.registered.type == bitClass
-               )) 
+               ))
 
               //(exp.destType._class.registered.type == unitClass || exp.destType._class.registered.type == enumClass) && useDestType)
             {
@@ -7768,7 +7768,7 @@ void ProcessExpressionType(Expression exp)
             {
                if(exp.op.exp1.destType) FreeType(exp.op.exp1.destType);
                exp.op.exp1.destType = dummy;
-               dummy.refCount++;               
+               dummy.refCount++;
             }
 
             // TESTING THIS HERE...
@@ -7826,7 +7826,7 @@ void ProcessExpressionType(Expression exp)
                }
                else
                {
-                  // Don't convert to the type for those... (e.g.: Degrees a; a /= 2;) 
+                  // Don't convert to the type for those... (e.g.: Degrees a; a /= 2;)
                   if(exp.op.op == MUL_ASSIGN || exp.op.op == DIV_ASSIGN ||exp.op.op == MOD_ASSIGN ||exp.op.op == LEFT_ASSIGN ||exp.op.op == RIGHT_ASSIGN/* ||
                      exp.op.op == AND_ASSIGN || exp.op.op == OR_ASSIGN*/);
                   else
@@ -7841,10 +7841,10 @@ void ProcessExpressionType(Expression exp)
                exp.expType = type1;
             }
             else if(exp.destType && exp.destType.kind == classType &&
-               exp.destType._class && exp.destType._class.registered && 
-               
-                  ((exp.destType._class.registered.type == unitClass && useDestType && useSideUnit) || 
-                  (exp.destType._class.registered.type == enumClass && useDestType)) 
+               exp.destType._class && exp.destType._class.registered &&
+
+                  ((exp.destType._class.registered.type == unitClass && useDestType && useSideUnit) ||
+                  (exp.destType._class.registered.type == enumClass && useDestType))
                   )
             {
                if(exp.op.exp2.destType) FreeType(exp.op.exp2.destType);
@@ -7860,7 +7860,7 @@ void ProcessExpressionType(Expression exp)
             }
 
             // TESTING THIS HERE... (DANGEROUS)
-            if(type1 && boolResult && useSideType && type1.kind == classType && type1._class && type1._class.registered && 
+            if(type1 && boolResult && useSideType && type1.kind == classType && type1._class && type1._class.registered &&
                (type1._class.registered.type == bitClass || type1._class.registered.type == enumClass))
             {
                FreeType(exp.op.exp2.destType);
@@ -7875,23 +7875,23 @@ void ProcessExpressionType(Expression exp)
             {
                if(exp.op.exp2.expType.kind == intSizeType || exp.op.exp2.expType.kind == intPtrType || exp.op.exp2.expType.kind == int64Type || exp.op.exp2.expType.kind == intType || exp.op.exp2.expType.kind == shortType || exp.op.exp2.expType.kind == charType)
                {
-                  if(exp.op.op != '=' && type1.type.kind == voidType) 
+                  if(exp.op.op != '=' && type1.type.kind == voidType)
                      Compiler_Error($"void *: unknown size\n");
                }
-               else if(exp.op.exp2.expType.kind == pointerType || exp.op.exp2.expType.kind == arrayType || exp.op.exp2.expType.kind == functionType || exp.op.exp2.expType.kind == methodType|| 
+               else if(exp.op.exp2.expType.kind == pointerType || exp.op.exp2.expType.kind == arrayType || exp.op.exp2.expType.kind == functionType || exp.op.exp2.expType.kind == methodType||
                            (type1.type.kind == voidType && exp.op.exp2.expType.kind == classType && exp.op.exp2.expType._class.registered &&
-                              (exp.op.exp2.expType._class.registered.type == normalClass || 
+                              (exp.op.exp2.expType._class.registered.type == normalClass ||
                               exp.op.exp2.expType._class.registered.type == structClass ||
                               exp.op.exp2.expType._class.registered.type == noHeadClass)))
                {
                   if(exp.op.op == ADD_ASSIGN)
-                     Compiler_Error($"cannot add two pointers\n");                   
+                     Compiler_Error($"cannot add two pointers\n");
                }
-               else if((exp.op.exp2.expType.kind == classType && type1.kind == pointerType && type1.type.kind == classType && 
+               else if((exp.op.exp2.expType.kind == classType && type1.kind == pointerType && type1.type.kind == classType &&
                   type1.type._class == exp.op.exp2.expType._class && exp.op.exp2.expType._class.registered && exp.op.exp2.expType._class.registered.type == structClass))
                {
                   if(exp.op.op == ADD_ASSIGN)
-                     Compiler_Error($"cannot add two pointers\n");                   
+                     Compiler_Error($"cannot add two pointers\n");
                }
                else if(inCompiler)
                {
@@ -7899,7 +7899,7 @@ void ProcessExpressionType(Expression exp)
                   char type2String[1024];
                   type1String[0] = '\0';
                   type2String[0] = '\0';
-                  
+
                   PrintType(exp.op.exp2.expType, type1String, false, true);
                   PrintType(type1, type2String, false, true);
                   ChangeCh(expString, '\n', ' ');
@@ -7954,7 +7954,7 @@ void ProcessExpressionType(Expression exp)
          {
             if(boolOps)
             {
-               if(exp.op.exp1) 
+               if(exp.op.exp1)
                {
                   if(exp.op.exp1.destType) FreeType(exp.op.exp1.destType);
                   exp.op.exp1.destType = MkClassType("bool");
@@ -7967,7 +7967,7 @@ void ProcessExpressionType(Expression exp)
                   exp.op.exp1.expType = MkClassType("bool");
                   exp.op.exp1.expType.truth = true;
                }
-               if(exp.op.exp2) 
+               if(exp.op.exp2)
                {
                   if(exp.op.exp2.destType) FreeType(exp.op.exp2.destType);
                   exp.op.exp2.destType = MkClassType("bool");
@@ -7981,12 +7981,12 @@ void ProcessExpressionType(Expression exp)
                   exp.op.exp2.expType.truth = true;
                }
             }
-            else if(exp.op.exp1 && exp.op.exp2 && 
-               ((useSideType /*&& 
-                     (useSideUnit || 
+            else if(exp.op.exp1 && exp.op.exp2 &&
+               ((useSideType /*&&
+                     (useSideUnit ||
                         ((!type1 || type1.kind != classType || type1._class.registered.type != unitClass) &&
                          (!type2 || type2.kind != classType || type2._class.registered.type != unitClass)))*/) ||
-                  ((!type1 || type1.kind != classType || !strcmp(type1._class.string, "String")) && 
+                  ((!type1 || type1.kind != classType || !strcmp(type1._class.string, "String")) &&
                   (!type2 || type2.kind != classType || !strcmp(type2._class.string, "String")))))
             {
                if(type1 && type2 &&
@@ -8000,9 +8000,9 @@ void ProcessExpressionType(Expression exp)
                   exp.op.exp1.destType = type2;
                   type2.refCount++;
                   // Warning here for adding Radians + Degrees with no destination type
-                  if(!boolResult && type1.kind == classType && (!exp.destType || exp.destType.kind != classType) && 
-                     type1._class.registered && type1._class.registered.type == unitClass && 
-                     type2._class.registered && type2._class.registered.type == unitClass && 
+                  if(!boolResult && type1.kind == classType && (!exp.destType || exp.destType.kind != classType) &&
+                     type1._class.registered && type1._class.registered.type == unitClass &&
+                     type2._class.registered && type2._class.registered.type == unitClass &&
                      type1._class.registered != type2._class.registered)
                      Compiler_Warning($"operating on %s and %s with an untyped result, assuming %s\n",
                         type1._class.string, type2._class.string, type1._class.string);
@@ -8015,7 +8015,7 @@ void ProcessExpressionType(Expression exp)
                         Expression classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
 
                         exp.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(
-                           MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer(null, null), null)), 
+                           MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer(null, null), null)),
                            exp.op.exp1)));
 
                         ProcessExpressionType(exp.op.exp1);
@@ -8024,16 +8024,16 @@ void ProcessExpressionType(Expression exp)
                         {
                            ProcessExpressionType(classExp);
 
-                           exp.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp.op.exp2, '*', 
+                           exp.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp.op.exp2, '*',
                               // ((_class.type == noHeadClass || _class.type == normalClass) ? sizeof(void *) : type.size)
                               MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(
                                  // noHeadClass
                                  MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("5")),
-                                    OR_OP, 
+                                    OR_OP,
                                  // normalClass
                                  MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("0"))))),
                                     MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(
-                                       MkPointer(null, null), null)))),                                  
+                                       MkPointer(null, null), null)))),
                                        MkExpMember(classExp, MkIdentifier("typeSize"))))))));
 
                            if(!exp.op.exp2.expType)
@@ -8043,17 +8043,17 @@ void ProcessExpressionType(Expression exp)
                         }
                      }
                   }
-                  
+
                   if(!boolResult && ((type1.kind == pointerType || type1.kind == arrayType || (type1.kind == classType && !strcmp(type1._class.string, "String"))) && (type2.kind == intSizeType || type2.kind == intPtrType || type2.kind == int64Type || type2.kind == intType || type2.kind == shortType || type2.kind == charType)))
                   {
-                     if(type1.kind != classType && type1.type.kind == voidType) 
+                     if(type1.kind != classType && type1.type.kind == voidType)
                         Compiler_Error($"void *: unknown size\n");
                      exp.expType = type1;
                      if(type1) type1.refCount++;
                   }
                   else if(!boolResult && ((type2.kind == pointerType || type2.kind == arrayType || (type2.kind == classType && !strcmp(type2._class.string, "String"))) && (type1.kind == intSizeType || type1.kind == intPtrType || type1.kind == int64Type || type1.kind == intType || type1.kind == shortType || type1.kind == charType)))
                   {
-                     if(type2.kind != classType && type2.type.kind == voidType) 
+                     if(type2.kind != classType && type2.type.kind == voidType)
                         Compiler_Error($"void *: unknown size\n");
                      exp.expType = type2;
                      if(type2) type2.refCount++;
@@ -8063,7 +8063,7 @@ void ProcessExpressionType(Expression exp)
                   {
                      Compiler_Warning($"different levels of indirection\n");
                   }
-                  else 
+                  else
                   {
                      bool success = false;
                      if(type1.kind == pointerType && type2.kind == pointerType)
@@ -8095,28 +8095,28 @@ void ProcessExpressionType(Expression exp)
                                     exp.list = MkListOne(MkExpOp(
                                        MkExpBrackets(MkListOne(MkExpOp(
                                              MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer(null, null), null)), MkExpBrackets(MkListOne(exp.op.exp1)))
-                                             , exp.op.op, 
-                                             MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer(null, null), null)), MkExpBrackets(MkListOne(exp.op.exp2)))))), '/', 
-                                          
+                                             , exp.op.op,
+                                             MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer(null, null), null)), MkExpBrackets(MkListOne(exp.op.exp2)))))), '/',
+
                                              //MkExpMember(classExp, MkIdentifier("typeSize"))
 
                                              // ((_class.type == noHeadClass || _class.type == normalClass) ? sizeof(void *) : type.size)
                                              MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(
                                                 // noHeadClass
                                                 MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass"))),
-                                                   OR_OP, 
+                                                   OR_OP,
                                                 // normalClass
                                                 MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass")))))),
                                                    MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(
-                                                      MkPointer(null, null), null)))),                                  
+                                                      MkPointer(null, null), null)))),
                                                       MkExpMember(classExp, MkIdentifier("typeSize")))))
 
-                                             
+
                                              ));
-                                    
+
                                     ProcessExpressionType(((Expression)exp.list->first).op.exp2);
                                     FreeType(dummy);
-                                    return;                                       
+                                    return;
                                  }
                               }
                            }
@@ -8224,7 +8224,7 @@ void ProcessExpressionType(Expression exp)
                      exp.expType = type2;
                      type2.refCount++;
                   }
-                  
+
                   if(!boolResult && useSideUnit && type2 && type2.kind == classType && type2._class.registered && type2._class.registered.type == unitClass && type1 && type1.kind != classType)
                   {
                      if(exp.op.exp1.destType) FreeType(exp.op.exp1.destType);
@@ -8294,7 +8294,7 @@ void ProcessExpressionType(Expression exp)
                         if(type2._class.registered.dataType)
                            type2._class.registered.dataType.refCount++;
                         CheckExpressionType(exp.op.exp2, exp.op.exp2.destType, false);
-                        
+
                         //exp.expType = type2._class.registered.dataType; //type2;
                         //if(type2) type2.refCount++;
                      }
@@ -8434,7 +8434,7 @@ void ProcessExpressionType(Expression exp)
                if(type1) type1.refCount++;
             }
          }
-         
+
          yylloc = exp.loc;
          if(exp.op.exp1 && !exp.op.exp1.expType)
          {
@@ -8519,7 +8519,7 @@ void ProcessExpressionType(Expression exp)
             FreeType(exp.expType);
             FreeType(exp.destType);
             delete exp.list;
-            
+
             *exp = *e;
 
             exp.prev = prev;
@@ -8637,7 +8637,7 @@ void ProcessExpressionType(Expression exp)
                   a = exp.call.arguments->first;
                   tempExp1 = a;
                }
-               
+
                if(a)
                {
                   exp.call.arguments->Clear();
@@ -8685,7 +8685,7 @@ void ProcessExpressionType(Expression exp)
                               if(b.expType)
                                  b.expType.refCount++;
                               ListAdd(exp.list, MkExpOp(CopyExpression(tempExp2), '=', b));
-                           }                        
+                           }
 
                            decl = MkDeclaration(specs, decls);
                            if(!curCompound.compound.declarations)
@@ -8698,7 +8698,7 @@ void ProcessExpressionType(Expression exp)
                   if(!strcmp(id.string, "Max") || !strcmp(id.string, "Min"))
                   {
                      int op = (!strcmp(id.string, "Max")) ? '>' : '<';
-                     ListAdd(exp.list, 
+                     ListAdd(exp.list,
                         MkExpCondition(MkExpBrackets(MkListOne(
                            MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))),
                            MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
@@ -8708,7 +8708,7 @@ void ProcessExpressionType(Expression exp)
                   }
                   else if(!strcmp(id.string, "Abs"))
                   {
-                     ListAdd(exp.list, 
+                     ListAdd(exp.list,
                         MkExpCondition(MkExpBrackets(MkListOne(
                            MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))),
                            MkListOne(MkExpOp(null, '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
@@ -8719,7 +8719,7 @@ void ProcessExpressionType(Expression exp)
                   else if(!strcmp(id.string, "Sgn"))
                   {
                      // ((!(a))?(0):(((a)<0)?(-1):(1)))
-                     ListAdd(exp.list, 
+                     ListAdd(exp.list,
                         MkExpCondition(MkExpBrackets(MkListOne(
                            MkExpOp(null, '!', CopyExpression(tempExp1)))), MkListOne(MkExpConstant("0")),
                               MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(
@@ -8764,7 +8764,7 @@ void ProcessExpressionType(Expression exp)
          {
             methodType = functionType;
             functionType = methodType.method.dataType;
-            
+
             //if(functionType.returnType && functionType.returnType.kind == thisClassType)
             // TOCHECK: Instead of doing this here could this be done per param?
             if(exp.call.exp.expType.usedClass)
@@ -8786,12 +8786,12 @@ void ProcessExpressionType(Expression exp)
                      Context context = SetupTemplatesContext(exp.call.exp.expType.usedClass);
 
                      decl = SpecDeclFromString(typeString, specs, null);
-                     
+
                      // SET THIS TO FALSE WHEN PROCESSING THISCLASS OUTSIDE THE CLASS
                      if(thisClass != (exp.call.exp.expType.usedClass.templateClass ? exp.call.exp.expType.usedClass.templateClass :
                         exp.call.exp.expType.usedClass))
                         thisClassParams = false;
-                     
+
                      ReplaceThisClassSpecifiers(specs, exp.call.exp.expType.usedClass);
                      {
                         Class backupThisClass = thisClass;
@@ -8849,7 +8849,7 @@ void ProcessExpressionType(Expression exp)
             // Fixed #141 by adding '&& !functionType.extraParam'
             if(!functionType.staticMethod && !functionType.extraParam)
             {
-               if(memberExp && memberExp.member.exp && memberExp.member.exp.expType && memberExp.member.exp.expType.kind == subClassType && 
+               if(memberExp && memberExp.member.exp && memberExp.member.exp.expType && memberExp.member.exp.expType.kind == subClassType &&
                   memberExp.member.exp.expType._class)
                {
                   type = MkClassType(memberExp.member.exp.expType._class.string);
@@ -8940,7 +8940,7 @@ void ProcessExpressionType(Expression exp)
                      ClassTemplateArgument arg = _class.templateArgs[id];
                      {
                         Context context = SetupTemplatesContext(_class);
-                     
+
                         /*if(!arg.dataType)
                            arg.dataType = ProcessTypeString(arg.dataTypeString, false);*/
                         templatedType = ProcessTypeString(arg.dataTypeString, false);
@@ -9098,7 +9098,7 @@ void ProcessExpressionType(Expression exp)
          }
 
          ProcessExpressionType(exp.member.exp);
-         if(exp.member.exp.expType && exp.member.exp.expType.kind == classType && exp.member.exp.expType._class && 
+         if(exp.member.exp.expType && exp.member.exp.expType.kind == classType && exp.member.exp.expType._class &&
             exp.member.exp.expType._class.registered && exp.member.exp.expType._class.registered.type == normalClass)
          {
             exp.isConstant = false;
@@ -9159,7 +9159,7 @@ void ProcessExpressionType(Expression exp)
                      int c;
                      int paramCount = 0;
                      int lastParam = -1;
-                     
+
                      char templateString[1024];
                      ClassTemplateParameter param;
                      sprintf(templateString, "%s<", expClass.templateClass.fullName);
@@ -9181,7 +9181,7 @@ void ProcessExpressionType(Expression exp)
                               int p = 0;
                               Class nextClass;
                               for(nextClass = sClass.base; nextClass; nextClass = nextClass.base) p += nextClass.templateParams.count;
-                              
+
                               for(cParam = sClass.templateParams.first; cParam; cParam = cParam.next, p++)
                               {
                                  if(cParam.type == TemplateParameterType::type && arg.dataTypeString && !strcmp(cParam.name, arg.dataTypeString))
@@ -9255,7 +9255,7 @@ void ProcessExpressionType(Expression exp)
                                  lastParam = p;
                               }
                               p++;
-                           }               
+                           }
                         }
                      }
                      {
@@ -9269,7 +9269,7 @@ void ProcessExpressionType(Expression exp)
                         FreeType(exp.expType);
                         exp.expType = ProcessTypeString(templateString, false);
                         FinishTemplatesContext(context);
-                     }                     
+                     }
                   }
 
                   // *([expType] *)(((byte *)[exp.member.exp]) + [argExp].member.offset)
@@ -9282,15 +9282,15 @@ void ProcessExpressionType(Expression exp)
                   MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer(null, null), decl)), MkExpBrackets(MkListOne(MkExpOp(
                      MkExpBrackets(MkListOne(
                         MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer(null, null), null)), expMember))),
-                           '+',  
-                           MkExpOp(MkExpMember(MkExpMember(argExp, MkIdentifier("member")), MkIdentifier("offset")), 
+                           '+',
+                           MkExpOp(MkExpMember(MkExpMember(argExp, MkIdentifier("member")), MkIdentifier("offset")),
                            '+',
                            MkExpMember(MkExpMember(MkExpMember(CopyExpression(argExp), MkIdentifier("member")), MkIdentifier("_class")), MkIdentifier("offset")))))))
-                           
+
                            ));
                }
             }
-            else if(type.templateParameter && type.templateParameter.type == TemplateParameterType::type && 
+            else if(type.templateParameter && type.templateParameter.type == TemplateParameterType::type &&
                (type.templateParameter.dataType || type.templateParameter.dataTypeString))
             {
                type = ProcessTemplateParameterType(type.templateParameter);
@@ -9346,8 +9346,8 @@ void ProcessExpressionType(Expression exp)
 
             if(_class && id)
             {
-               /*bool thisPtr = 
-                  (exp.member.exp.type == identifierExp && 
+               /*bool thisPtr =
+                  (exp.member.exp.type == identifierExp &&
                   !strcmp(exp.member.exp.identifier.string, "this"));*/
                Property prop = null;
                Method method = null;
@@ -9432,16 +9432,16 @@ void ProcessExpressionType(Expression exp)
 
                         FreeType(classExp.expType);
                         classExp.expType = ProcessTypeString("ecere::com::Class", false);
-                     
+
                         strcpy(structName, "__ecereClassData_");
                         FullClassNameCat(structName, type._class.string, false);
                         exp.type = pointerExp;
                         exp.member.member = id;
 
                         exp.member.exp = MkExpBrackets(MkListOne(MkExpCast(
-                           MkTypeName(MkListOne(MkStructOrUnion(structSpecifier, MkIdentifier(structName), null)), MkDeclaratorPointer(MkPointer(null, null), null)), 
+                           MkTypeName(MkListOne(MkStructOrUnion(structSpecifier, MkIdentifier(structName), null)), MkDeclaratorPointer(MkPointer(null, null), null)),
                               MkExpBrackets(MkListOne(MkExpOp(
-                                 MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null,null), null)), 
+                                 MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null,null), null)),
                                     MkExpMember(classExp, MkIdentifier("data"))), '+',
                                        MkExpMember(MkExpClass(MkListOne(MkSpecifierName(type._class.string)), null), MkIdentifier("offsetClass")))))
                                  )));
@@ -9466,13 +9466,13 @@ void ProcessExpressionType(Expression exp)
                      }
                   }
                }
-      
+
                if(prop)
                {
                   exp.member.memberType = propertyMember;
                   if(!prop.dataType)
                      ProcessPropertyType(prop);
-                  exp.expType = prop.dataType;                     
+                  exp.expType = prop.dataType;
                   if(prop.dataType) prop.dataType.refCount++;
                }
                else if(member)
@@ -9627,7 +9627,7 @@ void ProcessExpressionType(Expression exp)
                         if(sClass.templateClass) sClass = sClass.templateClass;
                         for(curParam = sClass.templateParams.first; curParam; curParam = curParam.next)
                         {
-                           if(curParam.type == TemplateParameterType::type && 
+                           if(curParam.type == TemplateParameterType::type &&
                               !strcmp(exp.expType.type.templateParameter.identifier.string, curParam.name))
                            {
                               for(sClass = sClass.base; sClass; sClass = sClass.base)
@@ -9646,7 +9646,7 @@ void ProcessExpressionType(Expression exp)
                         Type basicType;
                         /*if(!arg.dataType)
                            arg.dataType = ProcessTypeString(arg.dataTypeString, false);*/
-                        
+
                         basicType = ProcessTypeString(arg.dataTypeString, false);
                         if(basicType)
                         {
@@ -9660,7 +9660,7 @@ void ProcessExpressionType(Expression exp)
                            if(tClass.templateClass)
                               basicType.passAsTemplate = true;
                            */
-                           
+
                            FreeType(exp.expType);
 
                            exp.expType = Type { refCount = 1, kind = pointerType, type = basicType };
@@ -9726,7 +9726,7 @@ void ProcessExpressionType(Expression exp)
                                  {
                                     if(!strcmp(paramCur.name, param.name))
                                     {
-                                       
+
                                        break;
                                     }
                                     cp++;
@@ -9785,7 +9785,7 @@ void ProcessExpressionType(Expression exp)
                                     {
                                        strcat(templateString, param.name);
                                        strcat(templateString, " = ");
-                                    }                                       
+                                    }
                                     strcat(templateString, argument);
                                     paramCount++;
                                     lastParam = p;
@@ -9824,7 +9824,7 @@ void ProcessExpressionType(Expression exp)
                   memberType.refCount++;
             }
          }
-         else 
+         else
          {
             char expString[10240];
             expString[0] = '\0';
@@ -9844,7 +9844,7 @@ void ProcessExpressionType(Expression exp)
                   exp.expType = ReplaceThisClassType(_class);
                }
             }
-         }         
+         }
          yylloc = oldyylloc;
          break;
       }
@@ -9948,7 +9948,7 @@ void ProcessExpressionType(Expression exp)
          type.count = 0;
          exp.expType = type;
          //type.refCount++;
-         
+
          // if(!NeedCast(exp.cast.exp.expType, exp.cast.exp.destType))
          if(!exp.cast.exp.needCast && !NeedCast(exp.cast.exp.expType, type))
          {
@@ -9962,7 +9962,7 @@ void ProcessExpressionType(Expression exp)
             //FreeType(exp.destType);
             FreeType(exp.expType);
             FreeTypeName(exp.cast.typeName);
-            
+
             *exp = *castExp;
             FreeType(exp.expType);
             FreeType(exp.destType);
@@ -10095,9 +10095,9 @@ void ProcessExpressionType(Expression exp)
                classExp = MkExpIdentifier(MkIdentifier("class"));
 
             exp.member.exp = MkExpBrackets(MkListOne(MkExpCast(
-               MkTypeName(MkListOne(MkStructOrUnion(structSpecifier, MkIdentifier(structName), null)), MkDeclaratorPointer(MkPointer(null, null), null)), 
+               MkTypeName(MkListOne(MkStructOrUnion(structSpecifier, MkIdentifier(structName), null)), MkDeclaratorPointer(MkPointer(null, null), null)),
                   MkExpBrackets(MkListOne(MkExpOp(
-                     MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null,null), null)), 
+                     MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null,null), null)),
                         MkExpMember(classExp, MkIdentifier("data"))), '+',
                            MkExpMember(MkExpClass(MkListOne(MkSpecifierName(_class.fullName)), null), MkIdentifier("offsetClass")))))
                      )));
@@ -10136,7 +10136,7 @@ void ProcessExpressionType(Expression exp)
                         FreeType(type);
                         type = e.expType;
                         e.expType = null;
-                        
+
                         e = exp.list->first;
                         ProcessExpressionType(e);
                         if(e.expType)
@@ -10149,7 +10149,7 @@ void ProcessExpressionType(Expression exp)
                               FreeType(type);
                               type = null;
                               break;
-                           }                           
+                           }
                         }
                      }
                   }
@@ -10205,7 +10205,7 @@ void ProcessExpressionType(Expression exp)
                FreeType(type);
                delete exp.list;
             }
-            
+
             DeclareStruct("ecere::com::BuiltInContainer", false);
 
             ListAdd(structInitializers, /*MkIdentifier("_vTbl")*/    MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), null), MkIdentifier("_vTbl"))));
@@ -10338,7 +10338,7 @@ void ProcessExpressionType(Expression exp)
                //CheckExpressionType(exp, exp.destType, false);
 
                if(exp.destType.truth && exp.destType._class && exp.destType._class.registered && !strcmp(exp.destType._class.registered.name, "bool") &&
-                  exp.expType.kind != voidType && exp.expType.kind != structType && exp.expType.kind != unionType && 
+                  exp.expType.kind != voidType && exp.expType.kind != structType && exp.expType.kind != unionType &&
                   (exp.expType.kind != classType || exp.expType.classObjectType || (exp.expType._class && exp.expType._class.registered && exp.expType._class.registered.type != structClass)));
                else
                {
@@ -10379,7 +10379,7 @@ void ProcessExpressionType(Expression exp)
 
          PrintType(exp.expType, typeString, false, false);
          decl = SpecDeclFromString(typeString, specs, null);
-         
+
          exp.cast.typeName = MkTypeName(specs, decl);
          exp.cast.exp = newExp;
       }
@@ -10405,8 +10405,8 @@ void ProcessExpressionType(Expression exp)
 
    // Mark nohead classes as by reference, unless we're casting them to an integral type
    if(!notByReference && exp.expType && exp.expType.kind == classType && exp.expType._class && exp.expType._class.registered &&
-      exp.expType._class.registered.type == noHeadClass && (!exp.destType || 
-         (exp.destType.kind != intType && exp.destType.kind != int64Type && exp.destType.kind != intPtrType && exp.destType.kind != intSizeType && 
+      exp.expType._class.registered.type == noHeadClass && (!exp.destType ||
+         (exp.destType.kind != intType && exp.destType.kind != int64Type && exp.destType.kind != intPtrType && exp.destType.kind != intSizeType &&
           exp.destType.kind != longType && exp.destType.kind != shortType && exp.destType.kind != charType)))
    {
       exp.byReference = true;
@@ -10417,7 +10417,7 @@ void ProcessExpressionType(Expression exp)
 static void FindNextDataMember(Class _class, Class * curClass, DataMember * curMember, DataMember * subMemberStack, int * subMemberStackPos)
 {
    // THIS CODE WILL FIND NEXT MEMBER...
-   if(*curMember) 
+   if(*curMember)
    {
       *curMember = (*curMember).next;
 
@@ -10439,7 +10439,7 @@ static void FindNextDataMember(Class _class, Class * curClass, DataMember * curM
 
             *curMember = (*curMember).members.first;
             while(*curMember && (*curMember).isProperty)
-               *curMember = (*curMember).next;                     
+               *curMember = (*curMember).next;
          }
       }
    }
@@ -10472,7 +10472,7 @@ static void FindNextDataMember(Class _class, Class * curClass, DataMember * curM
 
                *curMember = (*curMember).members.first;
                while(*curMember && (*curMember).isProperty)
-                  *curMember = (*curMember).next;                     
+                  *curMember = (*curMember).next;
             }
          }
       }
@@ -10681,14 +10681,14 @@ static void ProcessDeclarator(Declarator decl)
                   declarator = null;
                };
                if(!decl.function.parameters)
-                  decl.function.parameters = MkList();               
+                  decl.function.parameters = MkList();
                decl.function.parameters->Insert(null, param);
                id._class = null;
             }
             if(decl.function.parameters)
             {
                TypeName param;
-               
+
                for(param = decl.function.parameters->first; param; param = param.next)
                {
                   if(param.qualifiers && param.qualifiers->first)
@@ -10702,7 +10702,7 @@ static void ProcessDeclarator(Declarator decl)
                            qualifiers = MkListOne(MkSpecifier(VOID));
                            declarator = MkDeclaratorPointer(MkPointer(null,null), d);
                         };
-                        
+
                         FreeList(param.qualifiers, FreeSpecifier);
 
                         param.qualifiers = MkListOne(MkStructOrUnion(structSpecifier, MkIdentifier("__ecereNameSpace__ecere__com__Class"), null));
@@ -10714,11 +10714,11 @@ static void ProcessDeclarator(Declarator decl)
                      else if(spec && spec.specifier == ANY_OBJECT)
                      {
                         Declarator d = param.declarator;
-                        
+
                         FreeList(param.qualifiers, FreeSpecifier);
 
                         param.qualifiers = MkListOne(MkSpecifier(VOID));
-                        param.declarator = MkDeclaratorPointer(MkPointer(null,null), d);                        
+                        param.declarator = MkDeclaratorPointer(MkPointer(null,null), d);
                      }
                      else if(spec.specifier == THISCLASS)
                      {
@@ -10757,7 +10757,7 @@ static void ProcessDeclaration(Declaration decl)
          if(decl.declarators)
          {
             InitDeclarator d;
-         
+
             for(d = decl.declarators->first; d; d = d.next)
             {
                Type type, subType;
@@ -10769,17 +10769,17 @@ static void ProcessDeclaration(Declaration decl)
                {
                   ProcessInitializer(d.initializer, type);
 
-                  // Change "ColorRGB a = ColorRGB { 1,2,3 } => ColorRGB a { 1,2,3 }                  
-                  
+                  // Change "ColorRGB a = ColorRGB { 1,2,3 } => ColorRGB a { 1,2,3 }
+
                   if(decl.declarators->count == 1 && d.initializer.type == expInitializer &&
                      d.initializer.exp.type == instanceExp)
                   {
-                     if(type.kind == classType && type._class == 
+                     if(type.kind == classType && type._class ==
                         d.initializer.exp.expType._class)
                      {
                         Instantiation inst = d.initializer.exp.instance;
                         inst.exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d.declarator)));
-                        
+
                         d.initializer.exp.instance = null;
                         if(decl.specifiers)
                            FreeList(decl.specifiers, FreeSpecifier);
@@ -10905,7 +10905,7 @@ static void CreateFireWatcher(Property prop, Expression object, Statement stmt)
       ListAdd(stmt.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
    }
 
-   
+
    {
       args = MkList();
       ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
@@ -10917,8 +10917,8 @@ static void CreateFireWatcher(Property prop, Expression object, Statement stmt)
       ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
       ListAdd(stmt.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
    }
-   
-   if(curFunction.propSet && !strcmp(curFunction.propSet.string, prop.name) && 
+
+   if(curFunction.propSet && !strcmp(curFunction.propSet.string, prop.name) &&
       (!object || (object.type == identifierExp && !strcmp(object.identifier.string, "this"))))
       curFunction.propSet.fireWatchersDone = true;
 }
@@ -11109,8 +11109,8 @@ static void ProcessStatement(Statement stmt)
          char iteratorType[1024];
          Type source;
          Expression e;
-         bool isBuiltin = exp && exp->last && 
-            (((Expression)exp->last).type == ExpressionType::arrayExp || 
+         bool isBuiltin = exp && exp->last &&
+            (((Expression)exp->last).type == ExpressionType::arrayExp ||
               (((Expression)exp->last).type == castExp && ((Expression)exp->last).cast.exp.type == ExpressionType::arrayExp));
          Expression arrayExp;
          char * typeString = null;
@@ -11139,7 +11139,7 @@ static void ProcessStatement(Statement stmt)
             Class linkListClass = eSystem_FindClass(privateModule, "LinkList");
             Class customAVLTreeClass = eSystem_FindClass(privateModule, "CustomAVLTree");
             stmt.type = compoundStmt;
-            
+
             stmt.compound.context = Context { };
             stmt.compound.context.parent = curContext;
             curContext = stmt.compound.context;
@@ -11155,7 +11155,7 @@ static void ProcessStatement(Statement stmt)
                   isMap = true;
             }
             else if(source && eClass_IsDerived(source._class.registered, arrayClass)) isArray = true;
-            else if(source && eClass_IsDerived(source._class.registered, linkListClass)) 
+            else if(source && eClass_IsDerived(source._class.registered, linkListClass))
             {
                Class listClass = eSystem_FindClass(privateModule, "List");
                isLinkList = true;
@@ -11166,19 +11166,19 @@ static void ProcessStatement(Statement stmt)
             {
                Declarator decl;
                OldList * specs = MkList();
-               decl = SpecDeclFromString(_class.templateArgs[2].dataTypeString, specs, 
+               decl = SpecDeclFromString(_class.templateArgs[2].dataTypeString, specs,
                   MkDeclaratorPointer(MkPointer(null, null), MkDeclaratorIdentifier(id)));
                stmt.compound.declarations = MkListOne(
                   MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, null))));
                ListAdd(stmt.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source._class.registered.fullName)),
-                  MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), 
+                  MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")),
                      MkInitializerAssignment(MkExpBrackets(exp))))));
             }
             else if(isBuiltin)
             {
                Type type = null;
                char typeStringBuf[1024];
-               
+
                // TODO: Merge this code?
                arrayExp = (((Expression)exp->last).type == ExpressionType::arrayExp) ? (Expression)exp->last : ((Expression)exp->last).cast.exp;
                if(((Expression)exp->last).type == castExp)
@@ -11213,7 +11213,7 @@ static void ProcessStatement(Statement stmt)
                               FreeType(type);
                               type = e.expType;
                               e.expType = null;
-                              
+
                               e = arrayExp.list->first;
                               ProcessExpressionType(e);
                               if(e.expType)
@@ -11226,7 +11226,7 @@ static void ProcessStatement(Statement stmt)
                                     FreeType(type);
                                     type = null;
                                     break;
-                                 }                           
+                                 }
                               }
                            }
                         }
@@ -11268,7 +11268,7 @@ static void ProcessStatement(Statement stmt)
                      delete arrayExp.list;
                   }
                   decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
-                  stmt.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), 
+                  stmt.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier),
                      MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer(null, null), /*CopyDeclarator(*/decl/*)*/), null))));
 
                   ListAdd(stmt.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(
@@ -11287,12 +11287,12 @@ static void ProcessStatement(Statement stmt)
                Declarator decl;
                OldList * specs = MkList();
 
-               decl = SpecDeclFromString(_class.templateArgs[2].dataTypeString, specs, 
+               decl = SpecDeclFromString(_class.templateArgs[2].dataTypeString, specs,
                   MkDeclaratorPointer(MkPointer(null, null), MkDeclaratorIdentifier(id)));
                stmt.compound.declarations = MkListOne(
                   MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, null))));
                ListAdd(stmt.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName("BuiltInContainer")),
-                  MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer(null, null), MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), 
+                  MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer(null, null), MkDeclaratorIdentifier(MkIdentifier("__internalArray"))),
                      MkInitializerAssignment(MkExpBrackets(exp))))));
                */
             }
@@ -11303,7 +11303,7 @@ static void ProcessStatement(Statement stmt)
                decl = SpecDeclFromString(_class.templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
                stmt.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, null))));
                ListAdd(stmt.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source._class.registered.fullName)),
-                  MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), 
+                  MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")),
                      MkInitializerAssignment(MkExpBrackets(exp))))));
             }
             /*else if(isCustomAVLTree)
@@ -11313,7 +11313,7 @@ static void ProcessStatement(Statement stmt)
                decl = SpecDeclFromString(_class.templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
                stmt.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, null))));
                ListAdd(stmt.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source._class.registered.fullName)),
-                  MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalTree")), 
+                  MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalTree")),
                      MkInitializerAssignment(MkExpBrackets(exp))))));
             }*/
             else if(_class.templateArgs)
@@ -11325,7 +11325,7 @@ static void ProcessStatement(Statement stmt)
 
                stmt.compound.declarations = MkListOne(
                   MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)),
-                  MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : null, 
+                  MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : null,
                   MkInitializerAssignment(MkExpBrackets(exp)))))))));
             }
             symbol = FindSymbol(id.string, curContext, curContext, false, false);
@@ -11342,7 +11342,7 @@ static void ProcessStatement(Statement stmt)
             {
                stmt.compound.statements = MkListOne(MkForStmt(
                   MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array"))))),
-                  MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', 
+                  MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<',
                      MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array")), '+', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("count")))))),
                   MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, null)),
                   block));
@@ -11360,7 +11360,7 @@ static void ProcessStatement(Statement stmt)
 
                stmt.compound.statements = MkListOne(MkForStmt(
                   MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpIdentifier(MkIdentifier("__internalArray"))))),
-                  MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', 
+                  MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<',
                      MkExpOp(MkExpIdentifier(MkIdentifier("__internalArray")), '+', MkExpConstant(count))))),
                   MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, null)),
                   block));
@@ -11369,7 +11369,7 @@ static void ProcessStatement(Statement stmt)
                Declarator decl = SpecDeclFromString(_class.templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer(null, null), null));
                stmt.compound.statements = MkListOne(MkForStmt(
                   MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpPointer(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("data"))))),
-                  MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', 
+                  MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<',
                      MkExpOp(MkExpCast(MkTypeName(specs, decl), MkExpPointer(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("data"))), '+', MkExpPointer(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("count")))))),
                   MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, null)),
                   block));
@@ -11382,7 +11382,7 @@ static void ProcessStatement(Statement stmt)
             {
                Class typeClass = eSystem_FindClass(_class.module, _class.templateArgs[3].dataTypeString);
                Class listItemClass = eSystem_FindClass(_class.module, "ListItem");
-               if(typeClass && eClass_IsDerived(typeClass, listItemClass) && _class.templateArgs[5].dataTypeString && 
+               if(typeClass && eClass_IsDerived(typeClass, listItemClass) && _class.templateArgs[5].dataTypeString &&
                   !strcmp(_class.templateArgs[5].dataTypeString, "LT::link"))
                {
                   stmt.compound.statements = MkListOne(MkForStmt(
@@ -11429,7 +11429,7 @@ static void ProcessStatement(Statement stmt)
             if(stmt.compound.declarations->first)
                ProcessDeclaration(stmt.compound.declarations->first);
 
-            if(symbol) 
+            if(symbol)
                symbol.isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
 
             ProcessStatement(stmt);
@@ -11526,7 +11526,7 @@ static void ProcessStatement(Statement stmt)
                {
                   ClassFunction func;
                   char watcherName[1024];
-                  Class watcherClass = watcher ? 
+                  Class watcherClass = watcher ?
                      ((watcher.expType && watcher.expType.kind == classType && watcher.expType._class) ? watcher.expType._class.registered : null) : thisClass;
                   External createdExternal;
 
@@ -11569,7 +11569,7 @@ static void ProcessStatement(Statement stmt)
 
                      // Create a declaration above
                      {
-                        Declaration decl = MkDeclaration(CopyList(createdExternal.function.specifiers, CopySpecifier), 
+                        Declaration decl = MkDeclaration(CopyList(createdExternal.function.specifiers, CopySpecifier),
                            MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal.function.declarator), null)));
                         externalDecl.declaration = decl;
                         if(decl.symbol && !decl.symbol.pointerExternal)
@@ -11598,8 +11598,8 @@ static void ProcessStatement(Statement stmt)
                               char getName[1024], setName[1024];
                               OldList * args = MkList();
 
-                              DeclareProperty(prop, setName, getName);                              
-                              
+                              DeclareProperty(prop, setName, getName);
+
                               // eInstance_Watch(stmt.watch.object, prop, stmt.watch.watcher, callback);
                               strcpy(propName, "__ecereProp_");
                               FullClassNameCat(propName, prop._class.fullName, false);
@@ -11658,7 +11658,7 @@ static void ProcessStatement(Statement stmt)
 
          if(inCompiler)
          {
-            _class = object ? 
+            _class = object ?
                   ((object.expType && object.expType.kind == classType && object.expType._class) ? object.expType._class.registered : null) : thisClass;
 
             if(_class)
@@ -11742,7 +11742,7 @@ static void ProcessStatement(Statement stmt)
                   if(!watches)
                   {
                      OldList * args;
-                     // eInstance_StopWatching(object, null, watcher); 
+                     // eInstance_StopWatching(object, null, watcher);
                      args = MkList();
                      ListAdd(args, CopyExpression(object));
                      ListAdd(args, MkExpConstant("0"));
@@ -11761,8 +11761,8 @@ static void ProcessStatement(Statement stmt)
                            OldList * args = MkList();
 
                            DeclareProperty(prop, setName, getName);
-         
-                           // eInstance_StopWatching(object, prop, watcher); 
+
+                           // eInstance_StopWatching(object, prop, watcher);
                            strcpy(propName, "__ecereProp_");
                            FullClassNameCat(propName, prop._class.fullName, false);
                            strcat(propName, "_");
@@ -11807,7 +11807,7 @@ static void ProcessFunction(FunctionDefinition function)
 
    yylloc = function.loc;
    // Process thisClass
-   
+
    if(type && type.thisClass)
    {
       Symbol classSym = type.thisClass;
@@ -11862,7 +11862,7 @@ static void ProcessFunction(FunctionDefinition function)
          FullClassNameCat(structName, _class.fullName, false);
 
          // [class] this
-         
+
 
          funcDecl = GetFuncDecl(function.declarator);
          if(funcDecl)
@@ -11879,12 +11879,12 @@ static void ProcessFunction(FunctionDefinition function)
 
             // DANGER: Watch for this... Check if it's a Conversion?
             // if((_class.type != bitClass && _class.type != unitClass && _class.type != enumClass) || function != (FunctionDefinition)symbol.externalSet)
-            
+
             // WAS TRYING THIS FOR CONVERSION PROPERTIES ON NOHEAD CLASSES: if((_class.type == structClass) || function != (FunctionDefinition)symbol.externalSet)
             if(!function.propertyNoThis)
             {
                TypeName thisParam;
-               
+
                if(type.classObjectType != classPointer)
                {
                   thisParam = QMkClass(_class.fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
@@ -11939,10 +11939,10 @@ static void ProcessFunction(FunctionDefinition function)
                      funcDecl.function.parameters->Insert(null, thisParam);
                   }
                }
-            }         
+            }
          }
       }
-      
+
       // Add this to the context
       if(function.body)
       {
@@ -11969,7 +11969,7 @@ static void ProcessFunction(FunctionDefinition function)
       }
 
       // Pointer to class data
-      
+
       if(inCompiler && _class && (_class.type == normalClass /*|| _class.type == noHeadClass*/) && type.classObjectType != classPointer)
       {
          DataMember member = null;
@@ -11990,11 +11990,11 @@ static void ProcessFunction(FunctionDefinition function)
          if(member)
          {
             char pointerName[1024];
-   
+
             Declaration decl;
             Initializer initializer;
             Expression exp, bytePtr;
-   
+
             strcpy(pointerName, "__ecerePointer_");
             FullClassNameCat(pointerName, _class.fullName, false);
             {
@@ -12031,7 +12031,7 @@ static void ProcessFunction(FunctionDefinition function)
                kind = pointerType;
                type = Type { refCount = 1, kind = voidType };
             };
-   
+
             if(function.body)
             {
                yylloc = function.body.loc;
@@ -12062,7 +12062,7 @@ static void ProcessFunction(FunctionDefinition function)
             }
          }
       }
-      
+
 
       // Loop through the function and replace undeclared identifiers
       // which are a member of the class (methods, properties or data)
@@ -12172,7 +12172,7 @@ static void ProcessClass(OldList definitions, Symbol symbol)
             type = regClass ? MkClassType(regClass.fullName) : null;
          };
          globalContext.symbols.Add((BTNode)thisSymbol);
-         
+
          for(defProperty = def.defProperties->first; defProperty; defProperty = defProperty.next)
          {
             thisClass = regClass;
@@ -12192,7 +12192,7 @@ static void ProcessClass(OldList definitions, Symbol symbol)
          Symbol thisSymbol = Symbol { string = CopyString("this"), type = MkClassType(regClass.fullName) };
          globalContext.symbols.Add(thisSymbol);
          */
-         
+
          thisClass = regClass;
          if(prop.setStmt)
          {
@@ -12250,7 +12250,7 @@ static void ProcessClass(OldList definitions, Symbol symbol)
       else if(def.type == propertyWatchClassDef && def.propertyWatch)
       {
          PropertyWatch propertyWatch = def.propertyWatch;
-        
+
          thisClass = regClass;
          if(propertyWatch.compound)
          {
index 1d9db07..d179cc6 100644 (file)
@@ -321,7 +321,7 @@ static bool ProcessInstMembers(Instantiation inst, Expression instExp, OldList l
                               MkTypeName(specs, decl), MkExpBrackets(MkListOne(member.initializer.exp))))), LEFT_OP, MkExpConstant(pos))));
                         }
                         else
-                           part = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(specs, decl), 
+                           part = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(specs, decl),
                               MkExpBrackets(MkListOne(member.initializer.exp)))));
                         // Take it out
                         member.initializer.exp = null;
@@ -504,7 +504,7 @@ static bool ProcessInstMembers(Instantiation inst, Expression instExp, OldList l
                                           subMemberStackPos = _subMemberStackPos;
                                        }
                                        if(!firstID.next && curMember == dataMember)
-                                       {                                 
+                                       {
                                           memberFilled = true;
                                           break;
                                        }
@@ -636,7 +636,7 @@ static bool ProcessInstMembers(Instantiation inst, Expression instExp, OldList l
                            // TODO: Set the member types for those
                            memberExp = MkExpMember(instExpCopy, id);
                            for(id = id.next; id; id = id.next)
-                              memberExp = MkExpMember(memberExp, id);                     
+                              memberExp = MkExpMember(memberExp, id);
                         }
                         else
                            memberExp = MkExpMember(instExpCopy, ident);
@@ -731,7 +731,7 @@ public void DeclareClass(Symbol classSym, char * className)
       ListAdd(specifiers, MkStructOrUnion(structSpecifier, MkIdentifier("__ecereNameSpace__ecere__com__Class"), null));
 
       d = MkDeclaratorPointer(MkPointer(null, null),
-         MkDeclaratorIdentifier(MkIdentifier(className)));                           
+         MkDeclaratorIdentifier(MkIdentifier(className)));
 
       ListAdd(declarators, MkInitDeclarator(d, null));
 
@@ -805,7 +805,7 @@ static void ProcessExpression(Expression exp)
                   OldList list = { 0 };
 
                   ProcessInstMembers(inst, null, &list, false);
-               
+
                   ProcessExpression(inst.exp);
 
                   //Why was this here twice? ProcessInstMembers(inst, null, &list);
@@ -850,7 +850,7 @@ static void ProcessExpression(Expression exp)
                   Expression e;
 
                   ProcessInstMembers(inst, null, &list, false);
-               
+
                   ProcessExpression(inst.exp);
 
                   //Why was this here twice? ProcessInstMembers(inst, null, &list);
@@ -909,7 +909,7 @@ static void ProcessExpression(Expression exp)
                   exp.list = MkList();
 
                   ProcessInstMembers(inst, inst.exp, exp.list, false);
-               
+
                   ProcessExpression(inst.exp);
 
                   if(!exp.list->count)
@@ -1029,7 +1029,7 @@ static void ProcessExpression(Expression exp)
             {
                Expression newCall;
 
-               if(classSym && classSym.registered && classSym.registered.type == noHeadClass && 
+               if(classSym && classSym.registered && classSym.registered.type == noHeadClass &&
                   (classSym.registered.templateClass ? classSym.registered.templateClass.fixed : classSym.registered.fixed))
                {
                   char size[256];
@@ -1095,7 +1095,7 @@ static void ProcessExpression(Expression exp)
                      MembersInit members;
                      int tempCount = exp.tempCount;
                      OldList * expList;
-               
+
                      // Check if members use temp count...
                      for(members = inst.members->first; members; members = members.next)
                      {
@@ -1114,7 +1114,7 @@ static void ProcessExpression(Expression exp)
                      }
                      if(curDecl)
                         tempCount = Max(tempCount, declTempCount);
-               
+
                      tempCount++;
                      curExternal.function.tempCount = Max(curExternal.function.tempCount, tempCount);
                      sprintf(ecereTemp, "__ecereInstance%d", tempCount);
@@ -1122,7 +1122,7 @@ static void ProcessExpression(Expression exp)
                      exp.compound = MkCompoundStmt(null, null);
                      exp.compound.compound.context = PushContext();
                      exp.compound.compound.context.simpleID = exp.compound.compound.context.parent.simpleID;
-                     exp.compound.compound.declarations = MkListOne(QMkDeclaration(inst._class.name, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(ecereTemp)), 
+                     exp.compound.compound.declarations = MkListOne(QMkDeclaration(inst._class.name, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(ecereTemp)),
                         MkInitializerAssignment(newCall))));
                      exp.compound.compound.statements = MkListOne(MkExpressionStmt((expList = MkList())));
 
@@ -1185,7 +1185,7 @@ static void ProcessExpression(Expression exp)
          switch(exp.op.op)
          {
             // Assignment Operators
-            case '=': 
+            case '=':
                if(exp.op.exp2)
                   exp.op.exp2.usage.usageGet = true;
                if(exp.op.exp1)
@@ -1251,7 +1251,7 @@ static void ProcessExpression(Expression exp)
             case '|':
             case '^':
             case AND_OP:
-            case OR_OP:        
+            case OR_OP:
                if(exp.op.exp1)
                   exp.op.exp1.usage.usageGet = true;
                if(exp.op.exp2)
@@ -1326,16 +1326,16 @@ static void ProcessExpression(Expression exp)
                Context context = PushContext();
 
                sprintf(iteratorType, "Iterator<%s, %s >", _class.templateArgs[2].dataTypeString, _class.templateArgs[1].dataTypeString);
-      
+
                ListAdd(instMembers, MkMemberInit(null, MkInitializerAssignment(exp.index.exp)));
-               
+
                ListAdd(declarations, MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)),
                   MkExpIdentifier(MkIdentifier("__internalIterator")), MkListOne(MkMembersInitList(instMembers)))));
 
                ListAdd(args, MkExpBrackets(exp.index.index));
                ListAdd(args, exp.usage.usageSet ? MkExpIdentifier(MkIdentifier("true")) : MkExpIdentifier(MkIdentifier("false")));
-               
-               ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("__internalIterator")), 
+
+               ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("__internalIterator")),
                   MkIdentifier("Index")), args))));
 
                ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(null, '&', MkExpIdentifier(MkIdentifier("__internalIterator"))))));
@@ -1428,7 +1428,7 @@ static void ProcessExpression(Expression exp)
                         revConvert = eClass_FindProperty(convertClass, _class.fullName, privateModule);
                   }
                }
-      
+
                if(prop)
                {
                   exp.member.memberType = propertyMember;
@@ -1445,7 +1445,7 @@ static void ProcessExpression(Expression exp)
                   if(!method.dataType)
                      //method.dataType = ((Symbol)method.symbol).type;
                      ProcessMethodType(method);
-                  
+
                   FreeType(exp.expType);
                   exp.expType = method.dataType;
                   if(method.dataType) method.dataType.refCount++;
@@ -1469,7 +1469,7 @@ static void ProcessExpression(Expression exp)
                   exp.expType = MkClassType(revConvert._class.fullName);
                }/*
                else
-                  printf($"Error: Couldn't find member %s in class %s\n", 
+                  printf($"Error: Couldn't find member %s in class %s\n",
                      exp.member.member.string, _class.name);*/
             }
          }
@@ -1505,7 +1505,7 @@ static void ProcessExpression(Expression exp)
       case extensionCompoundExp:
       {
          if(exp.compound.compound.statements &&
-         ((Statement)exp.compound.compound.statements->last).type == expressionStmt && 
+         ((Statement)exp.compound.compound.statements->last).type == expressionStmt &&
          ((Statement)exp.compound.compound.statements->last).expressions &&
          ((Statement)exp.compound.compound.statements->last).expressions->last)
          {
@@ -1609,7 +1609,7 @@ static bool ProcessBracketInst_DataMember(DataMember parentMember, Instantiation
          if(!ProcessBracketInst_DataMember(dataMember, inst, list))
             return false;
       }
-      else 
+      else
       {
          Class curClass = null;
          DataMember curMember = null;
@@ -1685,10 +1685,10 @@ static bool ProcessBracketInst_DataMember(DataMember parentMember, Instantiation
                                  // *** THE IDENTIFIERS WERE BEING REUSED, CAUSING A CRASH WITH EXPRESSION TEMPLATE CODE IN pass1.ec ***
                                  // members->Add(MkMemberInit(ids, MkInitializerAssignment(MkExpConstant(ui64String))));
                                  /*member.identifiers->Remove(firstID);*/
-                                 ListAdd(partList, 
+                                 ListAdd(partList,
                                     MkMemberInit(/*member.identifiers*/identifiers, MkInitializerAssignment(member.initializer.exp)));
                               }
-                          
+
                               for(nextMembers = members; nextMembers; nextMembers = nextMembers.next)
                               {
                                  if(!nextMembers.dataMembers)
@@ -1704,7 +1704,7 @@ static bool ProcessBracketInst_DataMember(DataMember parentMember, Instantiation
                                         nextMember = next, next = nextMember ? nextMember.next : null)
                                     {
                                        Identifier nextID = nextMember.identifiers->first;
-                                       if(nextMember.identifiers && 
+                                       if(nextMember.identifiers &&
                                           nextMember.identifiers->count > 1 &&
                                           !strcmp(firstID.string, nextID.string))
                                        {
@@ -1716,7 +1716,7 @@ static bool ProcessBracketInst_DataMember(DataMember parentMember, Instantiation
                                  }
                               }
 
-                              member.initializer.exp = MkExpInstance(MkInstantiation(spec, null, 
+                              member.initializer.exp = MkExpInstance(MkInstantiation(spec, null,
                                  MkListOne(MkMembersInitList(partList))));
                            }
                            found = true;
@@ -1788,7 +1788,7 @@ static bool ProcessBracketInst_DataMember(DataMember parentMember, Instantiation
             if(classSym && classSym.registered && classSym.registered.type == structClass)
             {
                OldList * subList = MkList();
-               Specifier spec = _MkSpecifierName/*MkClassName*/(dataMember.dataTypeString, classSym, null); 
+               Specifier spec = _MkSpecifierName/*MkClassName*/(dataMember.dataTypeString, classSym, null);
                Instantiation inst = MkInstantiation(spec, null, null);
                ProcessBracketInst(inst, subList);
                FreeInstance(inst);
@@ -1815,7 +1815,7 @@ static bool ProcessBracketInst_DataMember(DataMember parentMember, Instantiation
       if(classSym && classSym.registered && classSym.registered.type == structClass)
       {
          OldList * subList = MkList();
-         Specifier spec = _MkSpecifierName/*MkClassName*/(dataMember.dataTypeString, classSym, null); 
+         Specifier spec = _MkSpecifierName/*MkClassName*/(dataMember.dataTypeString, classSym, null);
          Instantiation inst = MkInstantiation(spec, null, null);
          ProcessBracketInst(inst, subList);
          FreeInstance(inst);
@@ -1854,7 +1854,7 @@ static bool ProcessBracketInst(Instantiation inst, OldList list)
                return false;
             }
          }
-         else 
+         else
          {
             MembersInit members;
             MemberInit member = null;
@@ -1894,7 +1894,7 @@ static bool ProcessBracketInst(Instantiation inst, OldList list)
                            {
                               if(dataMember.isProperty)
                               {
-                                 if(!((Property)dataMember).Set) 
+                                 if(!((Property)dataMember).Set)
                                  {
                                     Compiler_Error($"No set defined for property %s\n", dataMember.name);
                                     continue;
@@ -1916,10 +1916,10 @@ static bool ProcessBracketInst(Instantiation inst, OldList list)
                                  if(!dataMember.dataType)
                                     dataMember.dataType = ProcessTypeString(dataMember.dataTypeString, false);
                                  symbol = (dataMember.dataType && dataMember.dataType.kind == classType) ? dataMember.dataType._class : null;
-                                 spec = _MkSpecifierName/*MkClassName*/(dataMember.dataTypeString, symbol, null); 
+                                 spec = _MkSpecifierName/*MkClassName*/(dataMember.dataTypeString, symbol, null);
 
                                  member.identifiers->Remove(firstID);
-                                 ListAdd(partList, 
+                                 ListAdd(partList,
                                     MkMemberInit(member.identifiers, MkInitializerAssignment(member.initializer.exp)));
 
                                  for(nextMembers = members; nextMembers; nextMembers = nextMembers.next)
@@ -1936,7 +1936,7 @@ static bool ProcessBracketInst(Instantiation inst, OldList list)
                                            nextMember = next, next = nextMember ? nextMember.next : null)
                                        {
                                           Identifier nextID = nextMember.identifiers->first;
-                                          if(nextMember.identifiers && 
+                                          if(nextMember.identifiers &&
                                              nextMember.identifiers->count > 1 &&
                                              !strcmp(firstID.string, nextID.string))
                                           {
@@ -1948,7 +1948,7 @@ static bool ProcessBracketInst(Instantiation inst, OldList list)
                                     }
                                  }
 
-                                 member.initializer.exp = MkExpInstance(MkInstantiation(spec, null, 
+                                 member.initializer.exp = MkExpInstance(MkInstantiation(spec, null,
                                     MkListOne(MkMembersInitList(partList))));
 
                                  // TESTING THIS
@@ -1965,7 +1965,7 @@ static bool ProcessBracketInst(Instantiation inst, OldList list)
                            {
                               if(dataMember.isProperty)
                               {
-                                 if(!((Property)dataMember).Set) 
+                                 if(!((Property)dataMember).Set)
                                  {
                                     Compiler_Error($"No set defined for property %s\n", dataMember.name);
                                     continue;
@@ -2023,7 +2023,7 @@ static bool ProcessBracketInst(Instantiation inst, OldList list)
                if(classSym && classSym.registered && classSym.registered.type == structClass)
                {
                   OldList * subList = MkList();
-                  Specifier spec = _MkSpecifierName/*MkClassName*/(dataMember.dataTypeString, classSym, null); 
+                  Specifier spec = _MkSpecifierName/*MkClassName*/(dataMember.dataTypeString, classSym, null);
                   Instantiation inst = MkInstantiation(spec, null, null);
                   ProcessBracketInst(inst, subList);
                   FreeInstance(inst);
@@ -2097,7 +2097,7 @@ static void ProcessDeclaration(Declaration decl)
       case instDeclaration:
       {
          Instantiation inst = decl.inst;
-         
+
          if(inCompiler)
          {
             Symbol classSym = inst._class.symbol; // FindClass(inst._class.name);
@@ -2128,7 +2128,7 @@ static void ProcessDeclaration(Declaration decl)
 
                   if(classSym && classSym.registered && (classSym.registered.type == normalClass))
                   {
-                     ListAdd(createInstancesBody.compound.statements, 
+                     ListAdd(createInstancesBody.compound.statements,
                         MkExpressionStmt(MkListOne(MkExpCall(
                            MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")),
                            MkListOne(CopyExpression(inst.exp))))));
@@ -2154,14 +2154,14 @@ static void ProcessDeclaration(Declaration decl)
                   CreateInstancesBody();
                }
             }
-         
+
             {
                char className[1024];
-               
+
                decl.type = initDeclaration;
                decl.specifiers = MkList();
                decl.declarators = MkList();
-      
+
                // Replace instantiation here
                if(classSym && classSym.registered && classSym.registered.type == bitClass)
                {
@@ -2209,11 +2209,11 @@ static void ProcessDeclaration(Declaration decl)
                      if(inst.fullSet)
                      {
                         ListAdd(decl.specifiers, MkSpecifierName/*MkClassName*/(inst._class.name));
-                        ListAdd(decl.declarators, 
+                        ListAdd(decl.declarators,
                            MkInitDeclarator(MkDeclaratorIdentifier(inst.exp.identifier), null));
                         inst.exp.identifier = null;
                      }
-                     else 
+                     else
                      {
                         OldList * list = MkList();
                         if(ProcessBracketInst(inst, list))
@@ -2248,7 +2248,7 @@ static void ProcessDeclaration(Declaration decl)
                {
                   Expression newCall;
 
-                  if(classSym && classSym.registered && classSym.registered.type == noHeadClass && 
+                  if(classSym && classSym.registered && classSym.registered.type == noHeadClass &&
                      (classSym.registered.templateClass ? classSym.registered.templateClass.fixed : classSym.registered.fixed))
                   {
                      char size[256];
@@ -2529,7 +2529,7 @@ public void ProcessInstantiations()
    External external;
    // Is this still needed?
    //CreateInstancesBody();
-   
+
    for(external = ast->first; external; external = external.next)
    {
       curExternal = external;
@@ -2576,7 +2576,7 @@ public void ProcessInstantiations()
                      type = MkClassTypeSymbol(_class.symbol); //regClass.fullName);
                   };
                   globalContext.symbols.Add((BTNode)thisSymbol);
-                  
+
                   for(defProperty = def.defProperties->first; defProperty; defProperty = defProperty.next)
                   {
                      //thisClass = regClass;
@@ -2598,7 +2598,7 @@ public void ProcessInstantiations()
                      type = MkClassTypeSymbol(_class.symbol); //regClass.fullName);
                   };
                   globalContext.symbols.Add((BTNode)thisSymbol);
-                  
+
                   //thisClass = regClass;
                   if(prop.setStmt)
                   {
@@ -2623,7 +2623,7 @@ public void ProcessInstantiations()
                else if(def.type == propertyWatchClassDef && def.propertyWatch)
                {
                   PropertyWatch propertyWatch = def.propertyWatch;
-        
+
                   // Add this to the context
                   Symbol thisSymbol
                   {
@@ -2631,7 +2631,7 @@ public void ProcessInstantiations()
                      type = MkClassTypeSymbol(_class.symbol); //regClass.fullName);
                   };
                   globalContext.symbols.Add((BTNode)thisSymbol);
-                  
+
                   //thisClass = regClass;
                   if(propertyWatch.compound)
                   {
index 8e222a5..5e0d6ce 100644 (file)
@@ -8,7 +8,7 @@ static Statement curCompound;
 
 static void _FixRefExp(Expression * expPtr, Expression * memberExpPtr)
 {
-   
+
    Expression memberExp = *memberExpPtr;
    if(memberExp && memberExp.type == ExpressionType::memberExp &&
       memberExp.member.exp && (memberExp.member.exp.type == bracketsExp || memberExp.member.exp.type == extensionExpressionExp))
@@ -29,7 +29,7 @@ static void _FixRefExp(Expression * expPtr, Expression * memberExpPtr)
          *(Expression *)((byte *)newExp + (uint)((byte *)memberExpPtr - (byte *)exp)) = memberExp;
 
          memberExp.member.exp = idExp;
-      
+
          exp.type = bracketsExp;
          exp.list = bracketExp.list;
          bracketExp.list = null;
@@ -50,7 +50,7 @@ static void _FixRefExp(Expression * expPtr, Expression * memberExpPtr)
       *memberExpPtr = null;
       newExp = CopyExpression(exp);
       *(Expression *)((byte *)newExp + (uint)((byte *)memberExpPtr - (byte *)exp)) = memberExp.list->last;
-   
+
       exp.type = bracketsExp;
       exp.list = memberExp.list;
       memberExp.list = null;
@@ -96,11 +96,11 @@ static Expression FixReference(Expression e, bool wantReference)
          Class _class = type._class ? type._class.registered : null;
          // TOLOOKINTO: What was systemClass used for here? Exclude "typed_object"...
          // TOFIX: In which case with systemClass do we actually want this to come here? Can't think of any!
-         if(_class && ((_class.type == structClass && !type.declaredWithStruct) || _class.type == noHeadClass || 
-           (_class.type == systemClass && _class.base && 
-           strcmp(_class.fullName, "uintptr") && 
-           strcmp(_class.fullName, "intptr") && 
-           strcmp(_class.fullName, "uintsize") && 
+         if(_class && ((_class.type == structClass && !type.declaredWithStruct) || _class.type == noHeadClass ||
+           (_class.type == systemClass && _class.base &&
+           strcmp(_class.fullName, "uintptr") &&
+           strcmp(_class.fullName, "intptr") &&
+           strcmp(_class.fullName, "uintsize") &&
            strcmp(_class.fullName, "intsize"))))
          {
             // if(wantReference != ((_class.type == systemClass) ? false : e.byReference))
@@ -148,7 +148,7 @@ static Expression FixReference(Expression e, bool wantReference)
                            exp.op.op = '&';
                         else
                            exp.op.op = '*';
-                       
+
                         e.byReference = wantReference;
                         exp.byReference = wantReference;
                      }
@@ -320,7 +320,7 @@ static void ProcessExpression(Expression exp)
          switch(exp.op.op)
          {
             // Assignment Operators
-            case '=': 
+            case '=':
                if(exp.op.exp2)
                   exp.op.exp2.usage.usageGet = true;
                break;
@@ -381,7 +381,7 @@ static void ProcessExpression(Expression exp)
             case '|':
             case '^':
             case AND_OP:
-            case OR_OP:            
+            case OR_OP:
                if(exp.op.exp1)
                   exp.op.exp1.usage.usageGet = true;
                if(exp.op.exp2)
@@ -405,7 +405,7 @@ static void ProcessExpression(Expression exp)
                Expression lastExp = exp.op.exp1, parentExp = null;
                Property lastProperty = null;
                Class propertyClass;
-               
+
                char setName[1024], getName[1024];
                testExp = exp.op.exp1.member.exp;
                while(true)
@@ -424,7 +424,7 @@ static void ProcessExpression(Expression exp)
                   }
                   if(!testExp) break;
 
-                  if(testExp.member.memberType == propertyMember || 
+                  if(testExp.member.memberType == propertyMember ||
                      testExp.member.memberType == reverseConversionMember)
                   {
                      Type type = testExp.member.exp.expType;
@@ -440,7 +440,7 @@ static void ProcessExpression(Expression exp)
                               _class = FindClass(testExp.member.member.string).registered;
                               // lastProperty = eClass_FindProperty(_class, convertTo.name, privateModule);
                               lastProperty = eClass_FindProperty(_class, convertTo.fullName, privateModule);
-                           }                              
+                           }
                            else
                            {
                               lastProperty = eClass_FindProperty(_class, testExp.member.member.string, privateModule);
@@ -449,8 +449,8 @@ static void ProcessExpression(Expression exp)
                            {
                               DeclareProperty(lastProperty, setName, getName);
                               // propertyClass = convertTo ? _class : ((Symbol)lastProperty.symbol)._class;
-                              propertyClass = convertTo ? _class : 
-                                 ((((Symbol)lastProperty.symbol).type && 
+                              propertyClass = convertTo ? _class :
+                                 ((((Symbol)lastProperty.symbol).type &&
                                     ((Symbol)lastProperty.symbol).type.kind == classType) ? ((Symbol)lastProperty.symbol).type._class.registered : ((Symbol)lastProperty.symbol)._class);
                               // TODO: Handle this kind of things with bit classes?
                               if(propertyClass && propertyClass.type == structClass)
@@ -464,7 +464,7 @@ static void ProcessExpression(Expression exp)
                                  parentExp = lastExp;
                               }
                            }
-                           
+
                         }
                      }
                   }
@@ -480,7 +480,7 @@ static void ProcessExpression(Expression exp)
                      Expression value;
                      char className[1024];
                      Expression tempExp;
-                  
+
                      sprintf(className, "__simpleStruct%d", curContext.simpleID); //++);
                      tempExp = QMkExpId(className);
                      tempExp.expType = MkClassType(propertyClass.fullName);
@@ -500,7 +500,7 @@ static void ProcessExpression(Expression exp)
                      tempExp.expType.refCount++;
 
                      // Go on as usual with these new values:
-                     exp.op.exp1 = topExp;                  
+                     exp.op.exp1 = topExp;
                      exp.op.exp2 = value;
                      exp.op.op = '=';
 
@@ -513,7 +513,7 @@ static void ProcessExpression(Expression exp)
                      Expression value;
                      char className[1024];
                      Expression tempExp;
-                  
+
                      sprintf(className, "__simpleStruct%d", curContext.simpleID); //++);
                      tempExp = QMkExpId(className);
                      tempExp.expType = MkClassType(propertyClass.fullName);
@@ -535,7 +535,7 @@ static void ProcessExpression(Expression exp)
                      //value = MkExpOp(exp.op.exp1, exp.op.op, exp.op.exp2);
 
                      // Go on as usual with these new values:
-                     exp.op.exp1 = topExp;                  
+                     exp.op.exp1 = topExp;
                      exp.op.exp2 = value;
                      exp.op.op = '=';
 
@@ -547,7 +547,7 @@ static void ProcessExpression(Expression exp)
 
             memberExp = exp.op.exp1;
 
-            while(memberExp && ((memberExp.type == bracketsExp && memberExp.list->count == 1) || 
+            while(memberExp && ((memberExp.type == bracketsExp && memberExp.list->count == 1) ||
                memberExp.type == extensionExpressionExp || memberExp.type == extensionCompoundExp))
             {
                parentExp = memberExp;
@@ -557,13 +557,13 @@ static void ProcessExpression(Expression exp)
                   memberExp = memberExp.list->last;
             }
 
-            if(memberExp && memberExp.type == indexExp && memberExp.index.exp && memberExp.index.exp.expType && 
+            if(memberExp && memberExp.type == indexExp && memberExp.index.exp && memberExp.index.exp.expType &&
                memberExp.index.exp.expType.kind == classType && memberExp.index.exp.expType._class && memberExp.index.exp.expType._class.registered &&
                memberExp.index.exp.expType._class.registered != containerClass && eClass_IsDerived(memberExp.index.exp.expType._class.registered, containerClass))
             {
                ProcessExpression(memberExp);
 
-               while(memberExp && ((memberExp.type == bracketsExp && memberExp.list->count == 1) || 
+               while(memberExp && ((memberExp.type == bracketsExp && memberExp.list->count == 1) ||
                   memberExp.type == extensionExpressionExp || memberExp.type == extensionCompoundExp))
                {
                   parentExp = memberExp;
@@ -621,20 +621,20 @@ static void ProcessExpression(Expression exp)
 
                      if(_class && _class.type == bitClass && memberExp.member.memberType == dataMember)
                      {
-                         BitMember bitMember = 
-                            (BitMember)eClass_FindDataMember(_class, 
+                         BitMember bitMember =
+                            (BitMember)eClass_FindDataMember(_class,
                               memberExp.member.member.string, privateModule, null, null);
                          char mask[32], shift[10];
                          OldList * specs = MkList();
                          //Declarator decl = SpecDeclFromString(bitMember.dataTypeString, specs, null);
-                         Declarator decl = SpecDeclFromString(_class.dataTypeString, specs, null);                         
+                         Declarator decl = SpecDeclFromString(_class.dataTypeString, specs, null);
                          TypeName type = MkTypeName(specs, decl);
 
                          if(bitMember.mask > MAXDWORD)
                             sprintf(mask, FORMAT64HEXLL, bitMember.mask);
                          else
                             sprintf(mask, FORMAT64HEX, bitMember.mask);
-                         sprintf(shift, "%d", bitMember.pos);                         
+                         sprintf(shift, "%d", bitMember.pos);
 
                          // color = (color & ~0xFF0000) | (((unsigned char)200) << 16)
                          exp.op.exp1 = memberExp.member.exp;
@@ -651,7 +651,7 @@ static void ProcessExpression(Expression exp)
                          else
                          {
                             exp.op.exp2 = MkExpOp(
-                               MkExpBrackets(MkListOne(MkExpOp(CopyExpression(memberExp.member.exp), '&', 
+                               MkExpBrackets(MkListOne(MkExpOp(CopyExpression(memberExp.member.exp), '&',
                                  MkExpOp(null, '~', MkExpConstant(mask))))), '|',
                                MkExpBrackets(MkListOne(MkExpOp(MkExpBrackets(
                                  MkListOne(MkExpCast(type, exp.op.exp2))), LEFT_OP, MkExpConstant(shift)))));
@@ -685,7 +685,7 @@ static void ProcessExpression(Expression exp)
 
                         if(memberExp.member.memberType == classPropertyMember)
                            classProperty = eClass_FindClassProperty(_class, memberExp.member.member.string);
-                        
+
                         exp.tempCount = memberExp.member.exp.tempCount;
 
                         if(classProperty)
@@ -744,14 +744,14 @@ static void ProcessExpression(Expression exp)
                               if(operator != '=')
                               {
                                  if(operator == INC_OP)
-                                    value = MkExpOp(CopyExpression(memberExp), 
+                                    value = MkExpOp(CopyExpression(memberExp),
                                        '+', MkExpConstant("1"));
                                  else if(operator == DEC_OP)
-                                    value = MkExpOp(CopyExpression(memberExp), 
+                                    value = MkExpOp(CopyExpression(memberExp),
                                        '-', MkExpConstant("1"));
                                  else
                                  {
-                                    value = MkExpOp(CopyExpression(memberExp), 
+                                    value = MkExpOp(CopyExpression(memberExp),
                                        operator, value);
                                     exp2 = null;
                                  }
@@ -762,9 +762,9 @@ static void ProcessExpression(Expression exp)
                               else if(value)
                               {
                                  // Dont free exp2, we're using it
-                                 exp2 = null;                              
+                                 exp2 = null;
                               }
-                        
+
                               if(value)
                                  value.usage.usageArg = true;
 
@@ -774,7 +774,7 @@ static void ProcessExpression(Expression exp)
                                  ProcessExpression(memberExp.member.exp);
 
                               // If get flag present
-                              if(exp.usage.usageGet && 
+                              if(exp.usage.usageGet &&
                                  ((!convertTo && prop.Get) || (convertTo && prop.Set)))
                               {
                                  OldList * list = MkList();
@@ -782,7 +782,7 @@ static void ProcessExpression(Expression exp)
                                  char ecereTemp[100];
                                  Context context = PushContext();
                                  exp.tempCount++;
-                           
+
                                  curExternal.function.tempCount = Max(curExternal.function.tempCount, exp.tempCount);
                                  sprintf(ecereTemp, "__ecTemp%d", exp.tempCount);
 
@@ -791,7 +791,7 @@ static void ProcessExpression(Expression exp)
                                  exp.compound = MkCompoundStmt(
                                     MkListOne(MkDeclaration(MkListOne(MkSpecifier(VOID)), MkListOne(MkInitDeclarator(
                                        MkDeclaratorPointer(MkPointer(null, null), MkDeclaratorIdentifier(MkIdentifier(ecereTemp))),
-                                          MkInitializerAssignment(QBrackets(memberExp.member.exp)))))), 
+                                          MkInitializerAssignment(QBrackets(memberExp.member.exp)))))),
                                     list);
 
                                  // Add the set
@@ -808,7 +808,7 @@ static void ProcessExpression(Expression exp)
                                     ListAdd(args, value);
                                     ListAdd(list, MkExpressionStmt(MkListOne(MkExpCall(QMkExpId(setName), args))));
                                  }
-                              
+
                                  // Add the get
                                  args = MkList();
                                  if(convertTo)
@@ -896,7 +896,7 @@ static void ProcessExpression(Expression exp)
                               {
                                  OldList * list = MkList();
                                  OldList * args;
-                           
+
                                  // Set the method
                                  args = MkList();
                                  ListAdd(args, memberExp.member.exp);
@@ -963,7 +963,7 @@ static void ProcessExpression(Expression exp)
          {
             Expression object = exp.op.exp2;
             OldList * args = MkList();
-            
+
             exp.type = bracketsExp;
             exp.list = MkList();
 
@@ -975,7 +975,7 @@ static void ProcessExpression(Expression exp)
 
             // TOFIX: Same time as when we fix for = 0
 
-            if(exp.expType && exp.expType.kind == classType && exp.expType._class && exp.expType._class.registered && 
+            if(exp.expType && exp.expType.kind == classType && exp.expType._class && exp.expType._class.registered &&
                exp.expType._class.registered.type == normalClass &&
                strcmp(exp.expType._class.registered.dataTypeString, "char *"))
             {
@@ -994,17 +994,17 @@ static void ProcessExpression(Expression exp)
                MangleClassName(className);
 
                DeclareClass(exp.expType._class, className);
-               
+
                // Call the non virtual destructor
                ListAdd(list, MkExpCall(MkExpPointer(QMkExpId(className), MkIdentifier("Destructor")), CopyList(args, CopyExpression)));
                ListAdd(list, MkExpCall(QMkExpId("ecere::com::eSystem_Delete"), args));
 
                ListAdd(exp.list, MkExpBrackets(MkListOne(MkExpCondition(CopyExpression(object), MkListOne(
-                  
-                  MkExpBrackets(MkListOne(MkExpCondition(   
+
+                  MkExpBrackets(MkListOne(MkExpCondition(
                   MkExpPointer(QMkExpId(className), MkIdentifier("Destructor")),
                   MkListOne(MkExpBrackets(list)), MkExpCall(QMkExpId("ecere::com::eSystem_Delete"), CopyList(args, CopyExpression)))))), MkExpConstant("0"))))
-                  
+
                   );
                */
 
@@ -1027,15 +1027,15 @@ static void ProcessExpression(Expression exp)
                   ListAdd(list,
                      MkExpCondition(
                         MkExpPointer(
-                           QMkExpId(className), 
+                           QMkExpId(className),
                            MkIdentifier("Destructor")
                         ),
                         MkListOne(
                            MkExpCall(
                               MkExpPointer(
-                                 QMkExpId(className), 
+                                 QMkExpId(className),
                                  MkIdentifier("Destructor")
-                              ), 
+                              ),
                               CopyList(args, CopyExpression)
                            )
                         ),
@@ -1044,11 +1044,11 @@ static void ProcessExpression(Expression exp)
                   );
                }
                ListAdd(list, MkExpCall(QMkExpId("ecere::com::eSystem_Delete"), args));
-               ListAdd(exp.list, 
+               ListAdd(exp.list,
                   MkExpBrackets(
                      MkListOne(
                         MkExpCondition(
-                           CopyExpression(object), 
+                           CopyExpression(object),
                            MkListOne(
                               MkExpBrackets(list)
                            ),
@@ -1077,7 +1077,7 @@ static void ProcessExpression(Expression exp)
                      MkExpBrackets(MkListOne(MkExpCast(typeName,
                         MkExpIndex(MkExpPointer(classExp, MkIdentifier("_vTbl")),
                            MkListOne(MkExpIdentifier(MkIdentifier("__ecereVMethodID_class_OnFree"))))))), args));
-                  //ProcessExpression(exp.list->last);                  
+                  //ProcessExpression(exp.list->last);
                }
             }
             else
@@ -1096,7 +1096,7 @@ static void ProcessExpression(Expression exp)
          if(exp.type == opExp)
          {
             // Handle assigment of template structures
-            if(exp.op.op == '=' && exp.op.exp1 && exp.op.exp1.expType && exp.op.exp1.expType.kind == templateType && 
+            if(exp.op.op == '=' && exp.op.exp1 && exp.op.exp1.expType && exp.op.exp1.expType.kind == templateType &&
                (exp.op.exp1.type == indexExp || (exp.op.exp1.type == opExp && exp.op.exp1.op.op == '*' && !exp.op.exp1.op.exp1)))
             {
                Expression argExp = GetTemplateArgExp(exp.op.exp1.expType.templateParameter, thisClass, false);
@@ -1109,22 +1109,22 @@ static void ProcessExpression(Expression exp)
                   Expression derefExp = exp.op.exp1;
                   Expression sizeExp = MkExpCondition(MkExpBrackets(MkListOne(
                         MkExpOp(
-                           MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass"))), 
+                           MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass"))),
                            OR_OP,
                            MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass")))))),
                            MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null, null), null)))),
                            MkExpMember(CopyExpression(classExp), MkIdentifier("typeSize")));
-   
+
                   if(exp.op.exp1.type == indexExp)
                   {
                      Expression indexExp = derefExp.index.exp;
                      OldList * indexExpIndex = derefExp.index.index;
-                     
+
                      derefExp.index.index = null;
                      derefExp.index.exp = null;
                      FreeExpression(derefExp);
 
-                     derefExp = MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null, null), null)), indexExp), '+', 
+                     derefExp = MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null, null), null)), indexExp), '+',
                         MkExpBrackets(MkListOne(MkExpOp(MkExpBrackets(indexExpIndex), '*', MkExpBrackets(MkListOne(CopyExpression(sizeExp)))))));
                   }
                   else
@@ -1134,13 +1134,13 @@ static void ProcessExpression(Expression exp)
                      FreeExpression(derefExp);
                      derefExp = indexExp;
                   }
-                  
+
                   args->Add(derefExp);
                   ProcessExpressionType(args->last);
                   ProcessExpression(args->last);
 
-                  args->Add(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null, null), null)), 
-                     MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpMember(classExp, MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("structClass"))))), 
+                  args->Add(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null, null), null)),
+                     MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpMember(classExp, MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("structClass"))))),
                         MkListOne(exp.op.exp2), MkExpOp(null, '&', CopyExpression(exp.op.exp2)))));
 
                   thisClass = curExternal.function ? curExternal.function._class : null;
@@ -1151,17 +1151,17 @@ static void ProcessExpression(Expression exp)
                         type = MkClassType(thisClass.fullName);
                      };
                      globalContext.symbols.Add((BTNode)thisSymbol);
-                     
+
                      ProcessExpressionType(args->last);
                      ProcessExpression(args->last);
 
                      args->Add(sizeExp);
                      ProcessExpressionType(args->last);
                      ProcessExpression(args->last);
-                     
+
                      exp.list = MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("memcpy")), args));
                      exp.type = bracketsExp;
-                  
+
                      //globalContext.symbols.Delete((BTNode)thisSymbol);
                      globalContext.symbols.Remove((BTNode)thisSymbol);
                      FreeSymbol(thisSymbol);
@@ -1170,7 +1170,7 @@ static void ProcessExpression(Expression exp)
                   return;
                }
             }
-            else if(exp.op.op == '*' && !exp.op.exp1 && exp.op.exp2 && exp.op.exp2.expType && exp.op.exp2.expType.kind == pointerType && 
+            else if(exp.op.op == '*' && !exp.op.exp1 && exp.op.exp2 && exp.op.exp2.expType && exp.op.exp2.expType.kind == pointerType &&
                exp.op.exp2.expType.type && exp.op.exp2.expType.type.kind == templateType)
             {
                Expression argExp = GetTemplateArgExp(exp.op.exp2.expType.type.templateParameter, thisClass, false);
@@ -1178,11 +1178,11 @@ static void ProcessExpression(Expression exp)
                {
                   Expression classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
                   Expression sizeExp = MkExpMember(CopyExpression(classExp), MkIdentifier("typeSize"));
-               
+
                   exp.type = bracketsExp;
                   exp.list = MkListOne(
                      // (uint64)
-                     MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), null), 
+                     MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), null),
 
                      // ((class.type == structClass) ?
                      MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("structClass"))))),
@@ -1193,11 +1193,11 @@ static void ProcessExpression(Expression exp)
                      // ((class.type == normalClass || class.type == noHeadClass) ?
                      MkExpCondition(MkExpBrackets(MkListOne(
                         MkExpOp(
-                           MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass"))), 
+                           MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass"))),
                            OR_OP,
                            MkExpOp(MkExpMember(classExp, MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass")))))),
                         // *((void **)array)
-                        MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), null), MkExpOp(null, '*', MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null, MkPointer(null, null)), null)), 
+                        MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), null), MkExpOp(null, '*', MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null, MkPointer(null, null)), null)),
                            CopyExpression(exp.op.exp2))))))),
 
                      // ((class.size == 1) ?
@@ -1219,9 +1219,9 @@ static void ProcessExpression(Expression exp)
                            CopyExpression(exp.op.exp2)))))),
 
                      // *((uint64 *)array)
-                     MkExpOp(null, '*', MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer(null, null), null)), 
+                     MkExpOp(null, '*', MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer(null, null), null)),
                         exp.op.exp2)))))))))))))))))))));
-                  
+
                   // Add this to the context
                   thisClass = curExternal.function ? curExternal.function._class : null;
                   {
@@ -1231,10 +1231,10 @@ static void ProcessExpression(Expression exp)
                         type = MkClassType(thisClass.fullName);
                      };
                      globalContext.symbols.Add((BTNode)thisSymbol);
-                     
+
                      ProcessExpressionType(exp.list->first);
                      ProcessExpression(exp.list->first);
-                     
+
                      //globalContext.symbols.Delete((BTNode)thisSymbol);
                      globalContext.symbols.Remove((BTNode)thisSymbol);
                      FreeSymbol(thisSymbol);
@@ -1253,9 +1253,9 @@ static void ProcessExpression(Expression exp)
                   ProcessExpression(exp.op.exp1);
 
                   // TESTING THIS...
-                  if(exp.op.op == '=' && exp.op.exp2 && (!exp.op.exp2.byReference || 
-                     (exp.op.exp2.expType && exp.op.exp2.expType.kind == classType && exp.op.exp2.expType._class && 
-                      exp.op.exp2.expType._class.registered && exp.op.exp2.expType._class.registered.type == structClass)) && 
+                  if(exp.op.op == '=' && exp.op.exp2 && (!exp.op.exp2.byReference ||
+                     (exp.op.exp2.expType && exp.op.exp2.expType.kind == classType && exp.op.exp2.expType._class &&
+                      exp.op.exp2.expType._class.registered && exp.op.exp2.expType._class.registered.type == structClass)) &&
                      exp.op.exp2.expType && (exp.op.exp2.expType.kind != pointerType && exp.op.exp2.expType.kind != templateType /*|| !exp.op.exp2.expType.type || exp.op.exp2.expType.type.kind != voidType*/))
                      FixReference(exp.op.exp1, false);
                   // TEST: exp.tempCount = Max(exp.op.exp1.tempCount, exp.tempCount);
@@ -1270,11 +1270,11 @@ static void ProcessExpression(Expression exp)
                   if(exp.op.exp1 || (exp.op.op != '*' && exp.op.op != '&'))
                   {
                      // TESTING THIS IF:
-                     if((!exp.op.exp1 && 
-                        (!exp.op.exp2 || !exp.op.exp2.expType || exp.op.exp2.expType.kind != classType || !exp.op.exp2.expType._class || !exp.op.exp2.expType._class.registered || 
-                        (exp.op.exp2.expType._class.registered.type != normalClass && 
-                         exp.op.exp2.expType._class.registered.type != structClass && 
-                         exp.op.exp2.expType._class.registered.type != noHeadClass))) 
+                     if((!exp.op.exp1 &&
+                        (!exp.op.exp2 || !exp.op.exp2.expType || exp.op.exp2.expType.kind != classType || !exp.op.exp2.expType._class || !exp.op.exp2.expType._class.registered ||
+                        (exp.op.exp2.expType._class.registered.type != normalClass &&
+                         exp.op.exp2.expType._class.registered.type != structClass &&
+                         exp.op.exp2.expType._class.registered.type != noHeadClass)))
 
                             // TESTING THIS TEMPLATE TYPE CHECK HERE
                         || (exp.op.exp1 && exp.op.exp1.expType && exp.op.exp1.expType.kind != pointerType && exp.op.exp1.expType.kind != templateType))
@@ -1316,16 +1316,16 @@ static void ProcessExpression(Expression exp)
                   Expression classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
                   Expression e;
                   exp.type = bracketsExp;
-                  exp.list = MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null, null), null)), 
-                                 MkExpOp(null, '&', exp2)), '+', 
-                                    MkExpCall(MkExpIdentifier(MkIdentifier("__ENDIAN_PAD")), 
+                  exp.list = MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer(null, null), null)),
+                                 MkExpOp(null, '&', exp2)), '+',
+                                    MkExpCall(MkExpIdentifier(MkIdentifier("__ENDIAN_PAD")),
                                        MkListOne((e = MkExpCondition(MkExpBrackets(MkListOne(
-                              
+
                               MkExpOp(
                                  MkExpOp(
-                                    MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("structClass"))), 
+                                    MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("structClass"))),
                                        OR_OP,
-                                       MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass")))), 
+                                       MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass")))),
                                        OR_OP,
                                        MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass"))))
                              )),
@@ -1390,8 +1390,8 @@ static void ProcessExpression(Expression exp)
       case indexExp:
       {
          Expression e;
-         /*bool isBuiltin = exp && exp.index.exp && 
-            (exp.index.exp.type == ExpressionType::arrayExp || 
+         /*bool isBuiltin = exp && exp.index.exp &&
+            (exp.index.exp.type == ExpressionType::arrayExp ||
               (exp.index.exp.type == castExp && exp.index.exp.cast.exp.type == ExpressionType::arrayExp));
          */
          Expression checkedExp = exp.index.exp;
@@ -1415,7 +1415,7 @@ static void ProcessExpression(Expression exp)
          exp.index.exp.usage.usageGet = true;
          ProcessExpression(exp.index.exp);
 
-         if(exp.index.exp.expType && exp.index.exp.expType.kind == pointerType && 
+         if(exp.index.exp.expType && exp.index.exp.expType.kind == pointerType &&
             exp.index.exp.expType.type && exp.index.exp.expType.type.kind == templateType)
          {
             Expression argExp = GetTemplateArgExp(exp.index.exp.expType.type.templateParameter, thisClass, false);
@@ -1423,27 +1423,27 @@ static void ProcessExpression(Expression exp)
             {
                Expression classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
                Expression sizeExp = MkExpMember(CopyExpression(classExp), MkIdentifier("typeSize"));
-            
+
                exp.type = bracketsExp;
                exp.list = MkListOne(
                   // (uint64)
-                  MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), null), 
+                  MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), null),
 
                   // ((class.type == structClass) ?
                   MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("structClass"))))),
                      // ((byte *)array) + (i) * class.size
                      MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), null), MkExpBrackets(MkListOne(MkExpOp(
-                        MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer(null, null), null)), CopyExpression(exp.index.exp)))), '+', 
+                        MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer(null, null), null)), CopyExpression(exp.index.exp)))), '+',
                         MkExpOp(MkExpBrackets(CopyList(exp.index.index, CopyExpression)), '*', CopyExpression(sizeExp))))))),
 
                   // ((class.type == normalClass || class.type == noHeadClass) ?
                   MkExpCondition(MkExpBrackets(MkListOne(
                      MkExpOp(
-                        MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass"))), 
+                        MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass"))),
                         OR_OP,
                         MkExpOp(MkExpMember(classExp, MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass")))))),
                      // ((void **)array)[i]
-                     MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), null), MkExpIndex(MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null, MkPointer(null, null)), null)), 
+                     MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), null), MkExpIndex(MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null, MkPointer(null, null)), null)),
                         CopyExpression(exp.index.exp)))), CopyList(exp.index.index, CopyExpression)))),
 
                   // ((class.size == 1) ?
@@ -1465,9 +1465,9 @@ static void ProcessExpression(Expression exp)
                         CopyExpression(exp.index.exp)))), CopyList(exp.index.index, CopyExpression))),
 
                   // ((uint64 *)array)[i]
-                  MkExpIndex(MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer(null, null), null)), 
+                  MkExpIndex(MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer(null, null), null)),
                      exp.index.exp))), exp.index.index))))))))))))))))));
-               
+
                // Add this to the context
                thisClass = curExternal.function ? curExternal.function._class : null;
                {
@@ -1477,10 +1477,10 @@ static void ProcessExpression(Expression exp)
                      type = MkClassType(thisClass.fullName);
                   };
                   globalContext.symbols.Add((BTNode)thisSymbol);
-                     
+
                   ProcessExpressionType(exp.list->first);
                   ProcessExpression(exp.list->first);
-                     
+
                   //globalContext.symbols.Delete((BTNode)thisSymbol);
                   globalContext.symbols.Remove((BTNode)thisSymbol);
                   FreeSymbol(thisSymbol);
@@ -1525,7 +1525,7 @@ static void ProcessExpression(Expression exp)
                   OldList * specs = MkList();
                   Declarator decl = SpecDeclFromString(_class.templateArgs[2].dataTypeString, specs, null);
                   TypeName typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer(null, null), decl);
-                  exp.index.exp = MkExpBrackets(MkListOne(MkExpCast(typeName, 
+                  exp.index.exp = MkExpBrackets(MkListOne(MkExpCast(typeName,
                      MkExpPointer(MkExpCast(QMkType("BuiltInContainer", QMkPtrDecl(null)), exp.index.exp), MkIdentifier("data")))));
                   ProcessExpressionType(exp.index.exp);
                   ProcessExpression(exp);
@@ -1543,16 +1543,16 @@ static void ProcessExpression(Expression exp)
                   Context context = PushContext();
 
                   sprintf(iteratorType, "Iterator<%s, %s >", _class.templateArgs[2].dataTypeString, _class.templateArgs[1].dataTypeString);
-         
+
                   ListAdd(instMembers, MkMemberInit(null, MkInitializerAssignment(exp.index.exp)));
-                  
+
                   ListAdd(declarations, MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)),
                      MkExpIdentifier(MkIdentifier("__internalIterator")), MkListOne(MkMembersInitList(instMembers)))));
 
                   ListAdd(args, MkExpBrackets(exp.index.index));
                   ListAdd(args, exp.usage.usageSet ? MkExpIdentifier(MkIdentifier("true")) : MkExpIdentifier(MkIdentifier("false")));
-                  
-                  ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("__internalIterator")), 
+
+                  ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("__internalIterator")),
                      MkIdentifier("Index")), args))));
 
                   // ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(null, '&', MkExpIdentifier(MkIdentifier("__internalIterator"))))));
@@ -1622,9 +1622,9 @@ static void ProcessExpression(Expression exp)
                // Cast function to its type
                {
                   Context context = SetupTemplatesContext(method._class);
-                  
+
                   decl = SpecDeclFromString(method.dataTypeString, specs, MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer(null, null), null)));
-                  
+
                   FinishTemplatesContext(context);
                }
                curContext = back;
@@ -1800,7 +1800,7 @@ static void ProcessExpression(Expression exp)
 
                   // Testing this (COMMENTED OUT TESTING, CALLING METHODS ON ENUM/UNIT ADDED & IN FRONT OF VARIABLES
                   /*
-                  if(memberExp.member.exp.expType.kind != classType || 
+                  if(memberExp.member.exp.expType.kind != classType ||
                      memberExp.member.exp.expType._class.registered.type == enumClass ||
                      memberExp.member.exp.expType._class.registered.type == unitClass)
                   {
@@ -1813,7 +1813,7 @@ static void ProcessExpression(Expression exp)
                      // THIS WAS NASTY:
                      // memberExp.member.exp.expType.kind = classType;
                      // memberExp.member.exp.expType._class = FindClass(typeString);
-                     
+
                      FreeType(memberExp.member.exp.expType);
                      memberExp.member.exp.expType = Type
                      {
@@ -1830,20 +1830,20 @@ static void ProcessExpression(Expression exp)
                      }
                   }
                   */
-                  
+
                   if(typedObject && memberExp.member.exp && memberExp.member.exp.expType)
                   {
                      bool changeReference = false;
                      Expression memberExpMemberExp = CopyExpression(memberExp.member.exp);
 
                      // Patched so that class isn't considered SYSTEM...
-                     if(argClass && (argClass.type == enumClass || argClass.type == unitClass || argClass.type == bitClass || argClass.type == systemClass) && strcmp(argClass.fullName, "class") && 
+                     if(argClass && (argClass.type == enumClass || argClass.type == unitClass || argClass.type == bitClass || argClass.type == systemClass) && strcmp(argClass.fullName, "class") &&
                         strcmp(argClass.fullName, "uintptr") && strcmp(argClass.fullName, "intptr"))
                         changeReference = true;
-                     if(!memberExp.member.exp.expType.classObjectType && 
+                     if(!memberExp.member.exp.expType.classObjectType &&
                         (((
-                           (memberExp.member.exp.expType.kind != pointerType && 
-                              (memberExp.member.exp.expType.kind != classType || !memberExp.member.exp.expType._class || 
+                           (memberExp.member.exp.expType.kind != pointerType &&
+                              (memberExp.member.exp.expType.kind != classType || !memberExp.member.exp.expType._class ||
                                !memberExp.member.exp.expType._class.registered || memberExp.member.exp.expType._class.registered.type == structClass)))) ||
                            method.dataType.byReference)) // ADDED THIS FOR OnGetDataFromString
                         changeReference = true;
@@ -1851,7 +1851,7 @@ static void ProcessExpression(Expression exp)
                         changeReference = true;
                      if(changeReference)
                      {
-                        if(memberExp.member.exp.type == bracketsExp && memberExp.member.exp.list && memberExp.member.exp.list->count == 1 && 
+                        if(memberExp.member.exp.type == bracketsExp && memberExp.member.exp.list && memberExp.member.exp.list->count == 1 &&
                            ((Expression)memberExp.member.exp.list->first).type == opExp && ((Expression)memberExp.member.exp.list->first).op.op == '*' && !((Expression)memberExp.member.exp.list->first).op.exp1)
                         {
                            exp.call.arguments->Insert(null, ((Expression)memberExp.member.exp.list->first).op.exp2);
@@ -1913,7 +1913,7 @@ static void ProcessExpression(Expression exp)
                         if(memberExp.member.exp && memberExp.member.exp.expType && memberExp.member.exp.expType.classObjectType == ClassObjectType::typedObject)
                            strcpy(className, "class");
                         else if(cl)
-                        {                           
+                        {
                            // Need the class itself here...
                            strcpy(className, "__ecereClass_");
                            FullClassNameCat(className, cl.fullName, true);
@@ -2055,7 +2055,7 @@ static void ProcessExpression(Expression exp)
                               newExp = checkedExp.op.exp2;
                               checkedExp.op.exp2 = null;
                               FreeExpContents(checkedExp);
-                              
+
                               if(e.expType && e.expType.passAsTemplate)
                               {
                                  char size[100];
@@ -2067,7 +2067,7 @@ static void ProcessExpression(Expression exp)
                               }
 
                               if(parentExp.type == callExp)
-                              {                              
+                              {
                                  exp.call.arguments->Insert(e.prev, newExp);
                                  exp.call.arguments->Remove(e);
                                  e = newExp;
@@ -2158,10 +2158,10 @@ static void ProcessExpression(Expression exp)
                                     /*
 
                                     e.compound = MkCompoundStmt(
-                                       MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalValue")), MkInitializerAssignment(newExp))))), 
+                                       MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalValue")), MkInitializerAssignment(newExp))))),
                                        MkListOne(MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("__internalValue"))))));
                                     */
-                                    
+
                                     e.compound.compound.context = context;
                                     PopContext(context);
                                     curContext = context.parent;
@@ -2189,7 +2189,7 @@ static void ProcessExpression(Expression exp)
                               newExp = MkExpOp(null, '&', checkedExp);
                               newExp.byReference = true;
                               if(parentExp.type == callExp)
-                              {                              
+                              {
                                  exp.call.arguments->Insert(e.prev, newExp);
                                  exp.call.arguments->Remove(e);
                                  e = newExp;
@@ -2209,7 +2209,7 @@ static void ProcessExpression(Expression exp)
                            }
                         }
                      }
-                     
+
                      if(destType.classObjectType == ClassObjectType::typedObject)
                      {
                         char className[1024];
@@ -2243,7 +2243,7 @@ static void ProcessExpression(Expression exp)
                            c = MkExpExtensionCompound(MkCompoundStmt(
                                  MkListOne(MkDeclaration(
                                     MkListOne(MkSpecifierName("Instance")),
-                                    MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")), 
+                                    MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_ClassInst")),
                                        MkInitializerAssignment(CopyExpression(e)))))),
                                  MkListOne(MkExpressionStmt(MkListOne(MkExpCondition(
                                     MkExpIdentifier(MkIdentifier("__internal_ClassInst")),
@@ -2270,8 +2270,8 @@ static void ProcessExpression(Expression exp)
             }
             if(ellipsisDestType)
             {
-               if(usedEllipsis || 
-                  (exp.call.exp.expType && exp.call.exp.expType.kind == functionType && exp.call.exp.expType.params.last && 
+               if(usedEllipsis ||
+                  (exp.call.exp.expType && exp.call.exp.expType.kind == functionType && exp.call.exp.expType.params.last &&
                    ((Type)exp.call.exp.expType.params.last).kind == ellipsisType))
                {
                   exp.call.arguments->Insert(exp.call.arguments->last, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null, null),null)),MkExpConstant("0")));
@@ -2330,7 +2330,7 @@ static void ProcessExpression(Expression exp)
                   prop = eClass_FindProperty(_class, exp.member.member.string, null);
                if(!prop)
                   prop = eClass_FindProperty(_class, exp.member.member.string, privateModule);
-               if(prop && (exp.usage.usageRef || 
+               if(prop && (exp.usage.usageRef ||
                   (exp.usage.usageGet && !prop.Get && !prop.conversion) ||
                   (exp.usage.usageDelete && !prop.Set && !prop.conversion)))
                {
@@ -2340,7 +2340,7 @@ static void ProcessExpression(Expression exp)
                      exp.member.memberType = dataMember;
                      prop = null;
                   }
-                  else 
+                  else
                   {
                      if(exp.usage.usageRef)
                         Compiler_Error($"cannot obtain address of property\n");
@@ -2390,7 +2390,7 @@ static void ProcessExpression(Expression exp)
 
                      DeclareProperty(prop, setName, getName);
                      //propertyClass = convertTo ? _class : ((Symbol)prop.symbol)._class;
-                     propertyClass = convertTo ? _class : 
+                     propertyClass = convertTo ? _class :
                         ((((Symbol)prop.symbol).type && ((Symbol)prop.symbol).type.kind == classType) ? ((Symbol)prop.symbol).type._class.registered : ((Symbol)prop.symbol)._class);
 
 
@@ -2409,8 +2409,8 @@ static void ProcessExpression(Expression exp)
                            // Make a declaration in the closest compound statement
                            // (Do not reuse (since using address for function calls)...)
                            sprintf(className, "__simpleStruct%d", curContext.simpleID++);
-                           declarator = 
-                              SpecDeclFromString(propertyClass.dataTypeString, specs, 
+                           declarator =
+                              SpecDeclFromString(propertyClass.dataTypeString, specs,
                                  MkDeclaratorIdentifier(MkIdentifier(className)));
 
                            ListAdd(decls, MkInitDeclarator(declarator, null));
@@ -2647,12 +2647,12 @@ static void ProcessExpression(Expression exp)
                   else
                      sprintf(mask, FORMAT64HEX, bitMember.mask);
                   sprintf(shift, "%d", bitMember.pos);
-                  
+
                   FreeIdentifier(exp.member.member);
-                 
+
                   // ((type) ((color & mask) >> bitPos))
                   ListAdd(list, MkExpCast(type, MkExpBrackets(MkListOne(MkExpOp(MkExpBrackets(MkListOne(
-                     MkExpOp(exp.member.exp, '&', MkExpConstant(mask)))), RIGHT_OP, 
+                     MkExpOp(exp.member.exp, '&', MkExpConstant(mask)))), RIGHT_OP,
                         MkExpConstant(shift))))));
 
                   exp.type = bracketsExp;
@@ -2739,13 +2739,13 @@ static void ProcessExpression(Expression exp)
                         }
                         else
                         {
-                           e = QBrackets(MkExpOp(QMkExpId(ecereTemp), '+', 
+                           e = QBrackets(MkExpOp(QMkExpId(ecereTemp), '+',
                               MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
                         }
 
                         compound.compound.context = context;
                         compound.compound.statements = MkListOne(MkExpressionStmt(MkListOne(
-                           QBrackets(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(structSpecifier, MkIdentifier(structName), null)), 
+                           QBrackets(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(structSpecifier, MkIdentifier(structName), null)),
                               MkDeclaratorPointer(MkPointer(null, null), null)), e)))));
 
                         exp.member.exp =  MkExpExtensionCompound(compound);
@@ -2758,11 +2758,11 @@ static void ProcessExpression(Expression exp)
                         bytePtr = MkExpCast(QMkType("char", QMkPtrDecl(null)), /*CopyExpression(*/exp.member.exp/*)*/);
                         // DISABLED BECAUSE PREVENTS GETTING ADDRESS OF MEMBERS WITH ADDRESS 0
                         /*
-                        e = QBrackets(QMkExpCond(exp.member.exp, 
+                        e = QBrackets(QMkExpCond(exp.member.exp,
                            QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(classExp, MkIdentifier("offset")))),
                            MkExpConstant("0")));
                         */
-                        
+
                         // if(class.fixed)
                         if(member._class.fixed)
                         {
@@ -2830,7 +2830,7 @@ static void ProcessExpression(Expression exp)
             if(argExp)
             {
                Expression classExp;
-               
+
                FreeTypeName(exp.typeName);
 
                classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
@@ -2840,16 +2840,16 @@ static void ProcessExpression(Expression exp)
                   MkExpCondition(MkExpBrackets(MkListOne(
                      MkExpOp(
                         MkExpOp(
-                           MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, 
-                              MkExpIdentifier(MkIdentifier("normalClass"))), 
+                           MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP,
+                              MkExpIdentifier(MkIdentifier("normalClass"))),
                         OR_OP,
                         MkExpOp(
-                           MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, 
+                           MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP,
                               MkExpIdentifier(MkIdentifier("noHeadClass"))
                             )))),
                      MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer(null, null), null)))),
                      MkExpMember(classExp, MkIdentifier("typeSize")))
-                  ); 
+                  );
 
                ProcessExpressionType(exp);
                ProcessExpression(exp);
@@ -2868,7 +2868,7 @@ static void ProcessExpression(Expression exp)
                exp.byReference = exp.cast.exp.byReference;
             if(exp.expType && exp.expType.kind == classType && exp.expType._class && exp.expType._class.registered && exp.expType._class.registered.type == structClass &&
                exp.cast.exp.expType && (exp.cast.exp.expType.kind == pointerType || exp.cast.exp.expType.kind == arrayType || (
-                  exp.cast.exp.expType.kind == classType && exp.cast.exp.expType._class && exp.cast.exp.expType._class.registered && 
+                  exp.cast.exp.expType.kind == classType && exp.cast.exp.expType._class && exp.cast.exp.expType._class.registered &&
                      !strcmp(exp.cast.exp.expType._class.registered.dataTypeString, "char *")) ) )
                exp.byReference = true;
          }
@@ -2918,7 +2918,7 @@ static void ProcessExpression(Expression exp)
             char className[1024];
             char * string = StringFromSpecDecl(exp._classExp.specifiers, exp._classExp.decl);
             Symbol classSym = FindClass(string);
-            
+
             strcpy(className, "__ecereClass_");
             FullClassNameCat(className, string, true);      // TODO: Verify this
             MangleClassName(className);
@@ -2983,7 +2983,7 @@ static void ProcessDeclaration(Declaration decl)
          if(decl.declarators)
          {
             InitDeclarator d;
-         
+
             for(d = decl.declarators->first; d; d = d.next)
             {
                if(d.initializer)
@@ -3125,7 +3125,7 @@ static void ProcessStatement(Statement stmt)
             ProcessStatement(stmt.forStmt.check);
          }
          if(stmt.forStmt.increment)
-         {        
+         {
             for(exp = stmt.forStmt.increment->first; exp; exp = exp.next)
             {
                ProcessExpression(exp);
@@ -3238,7 +3238,7 @@ public void ProcessMemberAccess()
             ProcessDeclaration(external.declaration);
       }
    }
-   
+
    for(external = ast->first; external; external = external.next)
    {
       curExternal = external;
@@ -3284,7 +3284,7 @@ public void ProcessMemberAccess()
                      type = MkClassType(regClass.fullName);
                   };
                   globalContext.symbols.Add((BTNode)thisSymbol);
-                  
+
                   for(defProperty = def.defProperties->first; defProperty; defProperty = defProperty.next)
                   {
                      //thisClass = regClass;
@@ -3307,7 +3307,7 @@ public void ProcessMemberAccess()
                      type = MkClassType(regClass.fullName);
                   };
                   globalContext.symbols.Add((BTNode)thisSymbol);
-                  
+
                   //thisClass = regClass;
                   if(prop.setStmt)
                   {
@@ -3351,7 +3351,7 @@ public void ProcessMemberAccess()
                else if(def.type == propertyWatchClassDef && def.propertyWatch)
                {
                   PropertyWatch propertyWatch = def.propertyWatch;
-        
+
                   // Add this to the context
                   Symbol thisSymbol
                   {
@@ -3359,7 +3359,7 @@ public void ProcessMemberAccess()
                      type = MkClassType(regClass.fullName);
                   };
                   globalContext.symbols.Add((BTNode)thisSymbol);
-                  
+
                   //thisClass = regClass;
                   if(propertyWatch.compound)
                   {
index 0aa7a8e..a5b56b6 100644 (file)
@@ -12,7 +12,7 @@ static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
    if(spec.type == templateTypeSpecifier)
    {
       TemplateParameter parameter = spec.templateParameter;
-      
+
       if(!param && parameter.dataTypeString)
       {
          OldList * newSpecs = MkList();
@@ -24,7 +24,7 @@ static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
             delete newSpec;
          }
          FreeList(newSpecs, FreeSpecifier);
-         
+
          if(decl)
          {
             bool isPointer = decl.type == pointerDeclarator;
@@ -44,7 +44,7 @@ static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
             *spec = *newSpec;
             delete newSpec;
          }
-         
+
          if(decl)
          {
             bool isPointer = decl.type == pointerDeclarator;
@@ -140,7 +140,7 @@ static bool ReplaceClassSpec(OldList specs, Specifier spec, bool param)
                   {
                      if(!_class.dataType)
                         _class.dataType = ProcessTypeString(_class.dataTypeString, false);
-                     if(_class.dataType && _class.dataType.kind == classType) 
+                     if(_class.dataType && _class.dataType.kind == classType)
                         classSym = _class.dataType._class;
                      else
                         classSym = FindClass(_class.dataTypeString);
@@ -220,7 +220,7 @@ static void ReplaceByInstancePtr(Specifier spec, Declarator * declPtr, int type)
       else
          decl = newDecl;
       decl.type = pointerDeclarator;
-      decl.pointer.pointer = MkPointer(null, null);      
+      decl.pointer.pointer = MkPointer(null, null);
       *declPtr = decl;
    }
 }
@@ -245,7 +245,7 @@ static void InstDeclPassSpecifier(Specifier spec)
          {
             for(e = spec.list->first; e; e = e.next)
             {
-            
+
             }
          }
          break;
@@ -289,7 +289,7 @@ static void InstDeclPassSpecifier(Specifier spec)
                      spec.extDecl.s = CopyString("extern __attribute__ ((visibility(\"default\")))");
                }
             }
-            else if(!strcmp(spec.extDecl.s, "stdcall") || !strcmp(spec.extDecl.s, "_stdcall") || 
+            else if(!strcmp(spec.extDecl.s, "stdcall") || !strcmp(spec.extDecl.s, "_stdcall") ||
                !strcmp(spec.extDecl.s, "__stdcall") || !strcmp(spec.extDecl.s, "__stdcall__"))
             {
                delete spec.extDecl.s;
@@ -373,7 +373,7 @@ static void InstDeclPassDeclarator(Declarator decl)
                   decl.extended.extended.s = CopyString("extern __attribute__ ((visibility(\"default\")))");
             }
             else if(decl.extended.extended.type == extDeclString && decl.extended.extended.s &&
-               (!strcmp(decl.extended.extended.s, "stdcall") || !strcmp(decl.extended.extended.s, "_stdcall") || 
+               (!strcmp(decl.extended.extended.s, "stdcall") || !strcmp(decl.extended.extended.s, "_stdcall") ||
                !strcmp(decl.extended.extended.s, "__stdcall") || !strcmp(decl.extended.extended.s, "__stdcall__")))
             {
                delete decl.extended.extended.s;
@@ -402,7 +402,7 @@ static void InstDeclPassDeclarator(Declarator decl)
          else
          {
             Symbol classSym = (spec.type == nameSpecifier) ? spec.symbol /*FindClass(spec.name)*/ : null;
-            if(type.classObjectType && (!classSym || (classSym && classSym.registered && 
+            if(type.classObjectType && (!classSym || (classSym && classSym.registered &&
                (classSym.registered.type == enumClass || classSym.registered.type == bitClass || classSym.registered.type == unitClass))))
                ReplaceByInstancePtr(spec, &type.declarator, 2);
          }
@@ -667,7 +667,7 @@ static void InstDeclPassStatement(Statement stmt)
 
          if(!stmt.compound.isSwitch)
             curContext = stmt.compound.context;
-         
+
          if(stmt.compound.declarations)
          {
             for(decl = stmt.compound.declarations->first; decl; decl = decl.next)
@@ -819,7 +819,7 @@ public void ProcessInstanceDeclarations()
       else if(external.type == declarationExternal)
       {
          if(external.declaration)
-            InstDeclPassDeclaration(external.declaration);         
+            InstDeclPassDeclaration(external.declaration);
       }
    }
 }
index f95fc76..2e3951e 100644 (file)
@@ -34,7 +34,7 @@ Declarator PlugDeclarator(Declarator decl, Declarator baseDecl)
       }
       if(baseDecl)
       {
-         if(base.declarator) 
+         if(base.declarator)
             FreeDeclarator(base.declarator);
          base.declarator = baseDecl;
       }
@@ -126,7 +126,7 @@ char * QMkString(char * source)
       for(i = 0; (ch = source[i]); i++)
       {
          len++;
-         if(ch == '\"' || ch == '\\') 
+         if(ch == '\"' || ch == '\\')
             len++;
       }
 
index 50c624c..7e45c5b 100644 (file)
@@ -2,20 +2,20 @@
 /* A Bison parser, made by GNU Bison 2.4.2.  */
 
 /* Skeleton implementation for Bison's Yacc-like parsers in C
-   
+
       Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
    Foundation, Inc.
-   
+
    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 3 of the License, or
    (at your option) any later version.
-   
+
    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.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -28,7 +28,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -3450,7 +3450,7 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-\f
+
 
 #if YYERROR_VERBOSE
 
@@ -3661,7 +3661,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
     }
 }
 #endif /* YYERROR_VERBOSE */
-\f
+
 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
@@ -4978,10 +4978,10 @@ yyreduce:
     {
       (yyval.specifier) = null;
       DeclClass(0, (yyvsp[(1) - (2)].id).string);
-      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start); 
+      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start);
       resetScannerPos(&(yylsp[(1) - (2)]).start);
       yyclearin;
-      
+
       FreeIdentifier((yyvsp[(1) - (2)].id));
 
       YYPOPSTACK(1);
@@ -5015,7 +5015,7 @@ yyreduce:
 
       FreeIdentifier((yyvsp[(1) - (2)].id));
 
-      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start); 
+      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start);
       resetScannerPos(&(yylsp[(1) - (2)]).start);
       yyclearin;
 
@@ -5036,7 +5036,7 @@ yyreduce:
 #line 278 "type.y"
     {
       DeclClass(0, (yyvsp[(1) - (2)].id).string);
-      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start); 
+      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start);
       parseTypeError = 0;
       resetScannerPos(&(yylsp[(1) - (2)]).start);
       yyclearin;
@@ -5066,7 +5066,7 @@ yyreduce:
     {
    #ifdef PRECOMPILER
       DeclClass(0, (yyvsp[(1) - (2)].id).string);
-      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start); 
+      fileInput.Seek((yylsp[(1) - (2)]).start.pos, start);
       resetScannerPos(&(yylsp[(1) - (2)]).start);
       yyclearin;
 
@@ -5081,8 +5081,8 @@ yyreduce:
       YY_STACK_PRINT (yyss, yyssp);
       goto yysetstate;
    #else
-      Location tmpLoc = yylloc; (yyval.specifier) = (yyvsp[(2) - (2)].id); yylloc = (yylsp[(1) - (2)]); 
-      Compiler_Error($"Not a type: %s\n", (yyvsp[(1) - (2)].id).string);      
+      Location tmpLoc = yylloc; (yyval.specifier) = (yyvsp[(2) - (2)].id); yylloc = (yylsp[(1) - (2)]);
+      Compiler_Error($"Not a type: %s\n", (yyvsp[(1) - (2)].id).string);
       yylloc = tmpLoc; (yyvsp[(2) - (2)].id).badID = (yyvsp[(1) - (2)].id); // FreeIdentifier($1);
    #endif
    ;}
@@ -5112,7 +5112,7 @@ yyreduce:
       (yyval.specifier).loc = (yyloc);
 
       (yylsp[(4) - (4)]).end.pos--;
-      fileInput.Seek((yylsp[(4) - (4)]).end.pos, start); 
+      fileInput.Seek((yylsp[(4) - (4)]).end.pos, start);
       resetScannerPos(&(yylsp[(4) - (4)]).end);
       yyclearin;
     ;}
@@ -6953,7 +6953,7 @@ yyreduce:
 /* Line 1464 of yacc.c  */
 #line 934 "type.y"
     {
-      (yyval.templateArgument) = (yyvsp[(3) - (3)].templateArgument); 
+      (yyval.templateArgument) = (yyvsp[(3) - (3)].templateArgument);
       if((yyvsp[(1) - (3)].templateDatatype).specifiers && (yyvsp[(1) - (3)].templateDatatype).specifiers->first)
       {
          Specifier spec = (yyvsp[(1) - (3)].templateDatatype).specifiers->first;
@@ -6970,7 +6970,7 @@ yyreduce:
 /* Line 1464 of yacc.c  */
 #line 958 "type.y"
     {
-      (yyval.templateArgument) = (yyvsp[(3) - (3)].templateArgument); 
+      (yyval.templateArgument) = (yyvsp[(3) - (3)].templateArgument);
       if((yyvsp[(1) - (3)].templateDatatype).specifiers && (yyvsp[(1) - (3)].templateDatatype).specifiers->first)
       {
          Specifier spec = (yyvsp[(1) - (3)].templateDatatype).specifiers->first;
@@ -7861,16 +7861,16 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 1349 "type.y"
-    { 
-         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (4)].list)); 
-         (yyval.initializer).loc = (yyloc); 
+    {
+         (yyval.initializer) = MkInitializerList((yyvsp[(2) - (4)].list));
+         (yyval.initializer).loc = (yyloc);
 
          {
             Expression exp = MkExpDummy();
             Initializer init = MkInitializerAssignment(exp);
             init.loc = (yylsp[(3) - (4)]);
             exp.loc = (yylsp[(3) - (4)]);
-            ListAdd((yyvsp[(2) - (4)].list), init); 
+            ListAdd((yyvsp[(2) - (4)].list), init);
          }
       ;}
     break;
@@ -7991,11 +7991,11 @@ yyreduce:
 
 /* Line 1464 of yacc.c  */
 #line 1437 "type.y"
-    { 
-      (yyval.stmt) = MkCompoundStmt(null, null); 
-      (yyval.stmt).compound.context = PushContext(); 
+    {
+      (yyval.stmt) = MkCompoundStmt(null, null);
+      (yyval.stmt).compound.context = PushContext();
       PopContext((yyval.stmt).compound.context);
-      (yyval.stmt).loc = (yyloc); 
+      (yyval.stmt).loc = (yyloc);
    ;}
     break;
 
index 3663100..e01391e 100644 (file)
@@ -30,7 +30,7 @@ static bool editing = true;
 
 enum CodeObjectType { typeClass, typeData, typeMethod, typeEvent, typeProperty, typeNameSpace, typeDataType, typeEnumValue, typeDataPrivate, typeMethodPrivate, typePropertyPrivate };
 
-static char * iconNames[CodeObjectType] = 
+static char * iconNames[CodeObjectType] =
 {
    "<:ecere>constructs/class.png",
    "<:ecere>constructs/data.png",
@@ -192,7 +192,7 @@ static void _PrintType(Type type, char * string, bool printName, bool printFunct
                DocPrintType(type.returnType, string, false, fullName);
                strcat(string, " ");
             }
-            
+
             // DANGER: Testing This
             if(printName)
             {
@@ -270,7 +270,7 @@ static void _PrintType(Type type, char * string, bool printName, bool printFunct
                      strcat(size, arrayType.enumClass.string);
                   else if(arrayType.arraySizeExp)
                      PrintExpression(arrayType.arraySizeExp, size);
-                  //sprintf(string, "%s[%s]", baseType, size); 
+                  //sprintf(string, "%s[%s]", baseType, size);
                   strcat(size, "]");
 
                   arrayType = arrayType.arrayType;
@@ -286,10 +286,10 @@ static void _PrintType(Type type, char * string, bool printName, bool printFunct
                   strcpy(size, type.enumClass.string);
                else if(type.arraySizeExp)
                   PrintExpression(type.arraySizeExp, size);
-               //sprintf(string, "%s[%s]", baseType, size); 
+               //sprintf(string, "%s[%s]", baseType, size);
                strcat(string, baseType);
                strcat(string, "[");
-               strcat(string, size); 
+               strcat(string, size);
                strcat(string, "]");
                */
 
@@ -499,7 +499,7 @@ static void FigureFileName(char * fileName, Module module, DocumentationType typ
       case example: strcat(fileName, "example"); break;
       case seeAlso: strcat(fileName, "seeAlso"); break;
       case returnValue: strcat(fileName, "returnValue"); break;
-      case enumerationValue: 
+      case enumerationValue:
          strcat(fileName, "enumeration values/");
          strcat(fileName, ((NamedLink)data).name);
          break;
@@ -578,7 +578,7 @@ class APIPageNameSpace : APIPage
    {
       return module;
    }
-   
+
    NameSpace * GetNameSpace()
    {
       return nameSpace;
@@ -626,7 +626,7 @@ class APIPageNameSpace : APIPage
          strcpy(nsName, temp);
          ns = ns->parent;
       }
-      if(nsName[0]) 
+      if(nsName[0])
          f.Printf($"Parent namespace: <a href=\"api://%p\" style=\"text-decoration: none;\">%s</a><br>\n", nameSpace->parent, nsName);
 
       f.Printf("<br>");
@@ -839,7 +839,7 @@ class APIPageClass : APIPage
       f.Printf("<FONT FACE=\"Arial\" SIZE=\"6\">%s</FONT><br><br>\n", name);
 
       f.Printf($"Module: <a href=\"api://%p\" style=\"text-decoration: none;\">%s</a><br>\n", (module && module.name) ? module : null, (!module || !module.name || !strcmp(nsName, "ecere::com")) ? "ecereCOM" : module.name);
-      if(nsName[0]) 
+      if(nsName[0])
          f.Printf($"Namespace: <a href=\"api://%p\" style=\"text-decoration: none;\">%s</a><br>\n", cl.nameSpace, nsName);
 
       {
@@ -870,7 +870,7 @@ class APIPageClass : APIPage
          }
          f.Printf($"Type: %s<br>\n", classType);
       }
-      
+
       if(cl.type != systemClass && cl.base)
       {
          f.Printf($"Base Class: ");
@@ -910,7 +910,7 @@ class APIPageClass : APIPage
          if(enumeration.values.first)
          {
             NamedLink item;
-                        
+
             f.Printf($"<a name=EnumerationValues></a><H3>Enumeration Values</H3><br><br>\n");
             f.Printf("<TABLE>\n");
 
@@ -944,7 +944,7 @@ class APIPageClass : APIPage
                }
                else
                   dataClass = base;
-               
+
                f.Printf("<TR>");
                f.Printf("<TD valign=top height=22 nowrap=1><a name=%p></a><img valign=center src=\"%s\">&nbsp;&nbsp;%s</TD>", item, iconNames[typeEnumValue], item.name);
                if(dataClass.type == systemClass)
@@ -994,10 +994,10 @@ class APIPageClass : APIPage
                if(name) name += 2; else name = prop.name;
 
                f.Printf("<TR>");
-               
+
                string[0] = 0;
                DocPrintType(type, string, true, false);
-               
+
                f.Printf("<TD valign=top height=22 nowrap=1><a name=%p></a><img valign=center src=\"%s\">&nbsp;&nbsp;%s</TD>", prop, iconNames[typeDataType], string);
                if(desc)
                {
@@ -1013,9 +1013,9 @@ class APIPageClass : APIPage
                      f.Printf("<TD valign=top height=22>%s</TD>", desc);
                   delete desc;
                }
-               
+
                f.Printf("</TR>\n");
-               
+
                FreeType(type);
             }
          }
@@ -1147,7 +1147,7 @@ class APIPageClass : APIPage
                      f.Printf("<TD valign=top height=22>%s</TD>", desc);
                   delete desc;
                }
-               
+
                f.Printf("</TR><br>\n");
             }
          }
@@ -1216,7 +1216,7 @@ class APIPageClass : APIPage
             delete remarksDoc;
          }
       }
-      
+
       if(cl.type != systemClass)
       {
          bool first = true;
@@ -1376,7 +1376,7 @@ class APIPageMethod : APIPage
                   f.Printf("<TD valign=top height=22>%s&nbsp;</TD>\n", desc);
                delete desc;
             }
-            
+
             f.Printf("</TR>\n");
          }
       }
@@ -1489,7 +1489,7 @@ class APIPageMethod : APIPage
             }
             else
                f.Printf("<br>%s\n", method, seeAlsoDoc);
-            
+
             f.Printf("<br><br>\n");
             delete seeAlsoDoc;
          }
@@ -1740,7 +1740,7 @@ static void AddNameSpace(DataRow parentRow, Module module, NameSpace mainNameSpa
    APIPage page;
 
    char fileName[MAX_LOCATION];
-   
+
    strcpy(nsName, parentName ? parentName : "");
    if(nameSpace->name)
    {
@@ -1807,7 +1807,7 @@ static void AddNameSpace(DataRow parentRow, Module module, NameSpace mainNameSpa
    {
       for(nameSpace = mainNameSpace ; nameSpace; nameSpace = (nameSpace == mainNameSpace) ? comNameSpace : null)
       {
-         if(nameSpace->functions.first)                            
+         if(nameSpace->functions.first)
          {
             BTNamedLink link;
             GlobalFunction fn;
@@ -1825,7 +1825,7 @@ static void AddNameSpace(DataRow parentRow, Module module, NameSpace mainNameSpa
          }
       }
    }
-   
+
    if(mainNameSpace.defines.first || (comNameSpace && comNameSpace.defines.first))
    {
       for(nameSpace = mainNameSpace ; nameSpace; nameSpace = (nameSpace == mainNameSpace) ? comNameSpace : null)
@@ -1886,7 +1886,7 @@ static void AddDataMemberToPage(File f, DataMember member, int indent, bool show
    }
    else
       f.Printf("<TD valign=top height=22></TD>");
-   
+
    if(member.type != normalMember)
    {
       DataMember subMember;
@@ -2107,7 +2107,7 @@ class MainForm : Window
       FreeExcludedSymbols(excludedSymbols);
       ::defines.Free(FreeModuleDefine);
       imports.Free(FreeModuleImport);
-      
+
       FreeGlobalData(globalData);
       FreeTypeData(componentsApp);
       FreeIncludeFiles();
@@ -2128,7 +2128,7 @@ class MainForm : Window
 
       if(extension[0] && strcmpi(extension, "so") && strcmpi(extension, "dll"))
          componentsApp.name = CopyString(filePath);
-      
+
       for(module = componentsApp.allModules.first; module; module = module.next)
       {
          if(module.name && (!strcmp(module.name, "ecere") || !strcmp(module.name, "ecereCOM")))
@@ -2173,7 +2173,7 @@ class MainForm : Window
          }
          else if(!view.created)
             view.Create();
-         
+
          {
             page = row.GetData(null);
             if(page && page.page)
@@ -2809,7 +2809,7 @@ class HelpView : HTMLView
                            len = (nextSpace - (text + textPos)) + 1;
                         else
                            len = textBlock.textLen - textPos;
-                        
+
                         display.FontExtent(textBlock.font.font, text + textPos, len, &w, &th);
 
                         if(x + width + w > maxW && x > 0)
@@ -2919,7 +2919,7 @@ class HelpView : HTMLView
                         len = (nextSpace - (text + textPos)) + 1;
                      else
                         len = textBlock.textLen - textPos;
-                     
+
                      display.FontExtent(textBlock.font.font, text + textPos, len, &w, &th);
 
                      if(x + width + w > maxW && x > 0)
@@ -2966,7 +2966,7 @@ class HelpView : HTMLView
                      Update(null);
                      PositionCaret(false);
                      return false;
-                  } 
+                  }
                   else if(textPos == textBlock.textLen && textBlock.next && textBlock.next.next)
                   {
                      startPos = 0;
@@ -2982,7 +2982,7 @@ class HelpView : HTMLView
                      sx = textBlock.startX;
                   }
                }
-               
+
                /*if(textBlock.next && textBlock.next.next)
                {
                   textBlock = textBlock.next.next;
@@ -3032,7 +3032,7 @@ class HelpView : HTMLView
                         break;
                      }
                   }
-                  // No next word found, 
+                  // No next word found,
                   if(!found && (c != curPosition || line != textBlock))
                   {
                      found = true;
@@ -3102,7 +3102,7 @@ class HelpView : HTMLView
                         }
                      }
                   }
-                  // No next word found, 
+                  // No next word found,
                   if(!found && curPosition > 0)
                   {
                      foundAlpha = true;
@@ -3411,7 +3411,7 @@ class HelpView : HTMLView
 
                   textBlock.text = renew textBlock.text char[textBlock.textLen + len + 1];
                   memmove(textBlock.text + curPosition + len, textBlock.text + curPosition, textBlock.textLen - curPosition + 1);
-                  
+
                   for(c = 0; c<len; c++)
                   {
                      textBlock.text[curPosition] = string[c];
@@ -3420,7 +3420,7 @@ class HelpView : HTMLView
                   }
                   selPosition = curPosition;
                   selBlock = textBlock;
-                  
+
                   {
                      //Clear(html.block);
                      //CreateForms(html.block);
@@ -3466,7 +3466,7 @@ class HelpView : HTMLView
          }
          else
             maxW = clientSize.w - 10 - sx;
-         
+
          display.FontExtent(textBlock.font.font, " ", 1, null, &th);
 
          while(textPos < textBlock.textLen)
@@ -3486,7 +3486,7 @@ class HelpView : HTMLView
                   len = (nextSpace - (text + textPos)) + 1;
                else
                   len = textBlock.textLen - textPos;
-               
+
                display.FontExtent(textBlock.font.font, text + textPos, len, &w, &th);
 
                if(x + width + w > maxW && x > 0)
@@ -3584,7 +3584,7 @@ class HelpView : HTMLView
          }
          else
             maxW = clientSize.w - 10 - sx;
-         
+
          display.FontExtent(textBlock.font.font, " ", 1, &space, &th);
          //space = space/2+2;
          space = 2;
@@ -3606,7 +3606,7 @@ class HelpView : HTMLView
                   len = (nextSpace - (text + textPos)) + 1;
                else
                   len = textBlock.textLen - textPos;
-               
+
                display.FontExtent(textBlock.font.font, text + textPos, len, &w, &th);
 
                sx = x + textBlock.startX;
@@ -3678,7 +3678,7 @@ class Documentor : GuiApplication
          if(os == win32) // if Windows OS then
          {
             char programFilesDir[MAX_LOCATION];
-            char appData[MAX_LOCATION]; 
+            char appData[MAX_LOCATION];
             char homeDrive[MAX_LOCATION];
             char winDir[MAX_LOCATION];
             GetEnvironment("APPDATA", appData, sizeof(appData));
index 7b05f38..5fe1709 100644 (file)
@@ -12,11 +12,11 @@ class SettingsDialog : Window
    tabCycle = true;
    size = { 436, 120 };
    anchor = { horz = -83, vert = -104 };
-   
+
    Label docLabel { this, text = $"Documentation Path:", anchor = { left = 16, top = 16 }, labeledWindow = pathEditBox };
 
-   Button browseBtn 
-   { 
+   Button browseBtn
+   {
       this, text = "...", font = { $"Tahoma", 8.25f, bold = true }, hotKey = f2;
       anchor = { right = 20, top = 16 };
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -26,7 +26,7 @@ class SettingsDialog : Window
             pathEditBox.contents = settingsFileDialog.filePath; // display the selected directory in the edit box
          }
          return true;
-      }     
+      }
    };
 
    FileDialog settingsFileDialog
@@ -34,8 +34,8 @@ class SettingsDialog : Window
       type = selectDir, text = $"Select a path"; // set the file dialog box to choose a directory instead of a file.
    };
 
-   Button saveBtn 
-   { 
+   Button saveBtn
+   {
       this, text = $"Save", size = { 68, 21 }, position = { 224, 56 }, isDefault = true;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -44,11 +44,11 @@ class SettingsDialog : Window
          settingsContainer.Save(); // write that path to the ini file
          Destroy(DialogResult::ok); // close the window
          return true;
-      }  
+      }
    };
 
-   Button cancelBtn 
-   { 
+   Button cancelBtn
+   {
       this, text = $"Cancel", size = { 68, 21 }, position = { 304, 56 }, hotKey = escape;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
index eb92e7a..638ab6e 100644 (file)
@@ -64,7 +64,7 @@ static void ViewArchive(char * path)
       strcat(string, "\n");
       Log(string);
    }
-   
+
    while(listing.Find())
    {
       char timeString[100]; //28]; I18n strings take up more characters
@@ -83,7 +83,7 @@ static void ViewArchive(char * path)
       strcat(string, $"\n   Modified: ");
       strcat(string, timeString);
       strcat(string, "\n");
-      
+
       if(listing.stats.attribs.isDirectory)
          ViewArchive(listing.path);
       else
@@ -250,7 +250,7 @@ static void MoveFileInArchive(Archive* archive, char * sourcePath, char * output
       bool doMove = false;
 
       SplitArchivePath(sourcePath, archiveName, &source);
-      
+
       GetLastDirectory(source, sourceFileName);
       StripLastDirectory(source, sourceDirectory);
 
@@ -269,7 +269,7 @@ static void MoveFileInArchive(Archive* archive, char * sourcePath, char * output
       {
          // If directory exists in destination directory, move files and then delete
          outputExists = FileExists(existingFilePath);
-      
+
          // If source is a directory
          if(exists.isDirectory)
          {
@@ -277,7 +277,7 @@ static void MoveFileInArchive(Archive* archive, char * sourcePath, char * output
             bool within = true;
             char outputPart[MAX_FILENAME], outputRest[MAX_LOCATION];
             char sourcePart[MAX_FILENAME], sourceRest[MAX_LOCATION];
-         
+
             strcpy(outputRest, outputDirectory);
             strcpy(sourceRest, source);
 
@@ -300,7 +300,7 @@ static void MoveFileInArchive(Archive* archive, char * sourcePath, char * output
                {
                   ArchiveDir input;
                   FileListing listing { sourcePath };
-                  
+
                   if(!source[0])
                   {
                      ArchiveDir dir;
@@ -316,12 +316,12 @@ static void MoveFileInArchive(Archive* archive, char * sourcePath, char * output
                      }
                   }
                   else if(!rootMoving)
-                     Logf($"Merging directory %s in %s with %s in %s.\n", 
-                        sourceFileName, 
+                     Logf($"Merging directory %s in %s with %s in %s.\n",
+                        sourceFileName,
                         sourceDirectory[0] ? sourceDirectory : "root",
                         sourceFileName,
                         outputDirectory[0] ? outputDirectory : "root");
-                  
+
                   while(listing.Find())
                   {
                      if(strcmp(listing.path, existingFilePath))
@@ -367,8 +367,8 @@ static void MoveFileInArchive(Archive* archive, char * sourcePath, char * output
                   if(outputExists.isFile)
                      output.Delete(sourceFileName);
 
-                  Logf($"Moving file %s in directory %s to %s.\n", sourceFileName, 
-                     sourceDirectory[0] ? sourceDirectory : "root", 
+                  Logf($"Moving file %s in directory %s to %s.\n", sourceFileName,
+                     sourceDirectory[0] ? sourceDirectory : "root",
                      outputDirectory[0] ? outputDirectory : "root");
 
                   // Perform operation
@@ -404,7 +404,7 @@ class EARApp : Application
       int c;
 
       quiet = false;
-         
+
       DumpErrors(false);
       SetLoggingMode(stdOut, null);
 
@@ -412,7 +412,7 @@ class EARApp : Application
       {
          // First validate command / options
          char ch;
-        
+
          valid = true;
          for(c = 0; (ch = (char)tolower(argv[1][c])) && valid; c++)
          {
@@ -477,7 +477,7 @@ class EARApp : Application
                   numFiles = argc - 3;
                   firstFileArg = 3;
                   break;
-               case ARCHIVE_ACTION_EXTRACT: 
+               case ARCHIVE_ACTION_EXTRACT:
                   firstFileArg = 3;
                   if(extractWhere)
                      numFiles = argc - 4;
@@ -534,7 +534,7 @@ class EARApp : Application
                Logf($"Archive file is empty: %s\n", argv[2]);
                action = 0;
             }
-            else 
+            else
             {
                Archive archive = ArchiveOpen(argv[2], { false });
                if(archive)
@@ -559,7 +559,7 @@ class EARApp : Application
          switch(action)
          {
             case ARCHIVE_ACTION_VIEW:
-            {     
+            {
                if(!numFiles)
                   ViewArchive(archivePath);
                else
@@ -629,7 +629,7 @@ class EARApp : Application
                         strcpy(outputFile, DIR_SEPS);
 
                      StripLastDirectory(outputFile, directory);
-                  
+
                      MakeDir(directory);
 
                      ExtractFileFromArchive(fileName, outputFile);
@@ -670,7 +670,7 @@ class EARApp : Application
                            }
                            else
                               StripLastDirectory(argv[c], directory);
-                           
+
                            dir = archive.OpenDirectory(directory, extractWhere ? &stats : null, addMode);
                            if(dir)
                            {
@@ -752,7 +752,7 @@ class EARApp : Application
                if(archive)
                {
                   char fileName[MAX_LOCATION];
-    
+
                   for(c = firstFileArg; c<firstFileArg + numFiles; c++)
                   {
                      strcpy(fileName, archivePath);
index 9bf65af..4ff0844 100644 (file)
@@ -81,7 +81,7 @@ void ExtractFileFromArchive(ProgressBar progressBar, char * path, char * outputF
             FileGetSize(path, &dataSize);
             GetLastDirectory(outputFile, fileName);
             progressBar.statusBar.SetText($"Extracting %s...", fileName);
-            
+
             app.UpdateDisplay();
 
             for(c = 0; c<dataSize; c += BUFFERSIZE)
@@ -239,7 +239,7 @@ class SelfExtract : Window
             row.SetData(cField, c);//(void *)stats.created.local);
          }
       }
-      
+
       while(listing.Find())
       {
          if(strcmp(listing.path, "<:>ecere"))
@@ -305,7 +305,7 @@ class SelfExtractApp : GuiApplication
 
       SetLoggingMode(stdOut, null);
       SelfExtract { text = title };
-      
+
       GuiApplication::Main();
    }
 }
index 797d707..b791e6e 100644 (file)
@@ -121,7 +121,7 @@ public:
 private:
 
    void Free(void (*FreeKey)(void * key))
-   {  
+   {
        if (left) left.Free(FreeKey);
        if (right) right.Free(FreeKey);
       if(FreeKey) FreeKey((void *)key);
@@ -318,13 +318,13 @@ private:
          }
       }
 
-      //if(!swap.left) 
+      //if(!swap.left)
       {
          swap.left = left;
          if(left)
             left.parent = swap;
       }
-      //if(!swap.right) 
+      //if(!swap.right)
       {
           swap.right = right;
           if (right)
@@ -368,7 +368,7 @@ private:
          return parent.Rebalance();
       else
          return null;
-   }      
+   }
 
    BTNode RemoveSwapRight()
    {
@@ -522,7 +522,7 @@ private:
 
    #define NUMSIZE   4
 
-   char * Print(char * output, TreePrintStyle tps) 
+   char * Print(char * output, TreePrintStyle tps)
    {
       switch(tps)
       {
@@ -540,7 +540,7 @@ private:
 
             if(tps == postOrder) strcatf(output, "%d ", key);
 
-               return output;          
+            return output;
          }
          case depthOrder:
          {
@@ -561,7 +561,7 @@ private:
       return null;
    }
 
-   void PrintDepth(char * output, int wantedDepth, int curDepth, int maxDepth, bool last) 
+   void PrintDepth(char * output, int wantedDepth, int curDepth, int maxDepth, bool last)
    {
       int c;
       if(wantedDepth == curDepth)
index 8e877d5..6662d4f 100644 (file)
@@ -40,7 +40,7 @@ public struct BinaryTree
 
    int (*CompareKey)(BinaryTree tree, uintptr a, uintptr b);
    void (*FreeKey)(void * key);
-   
+
    void Free()
    {
       if(root)
@@ -48,7 +48,7 @@ public struct BinaryTree
       root = null;
       count = 0;
    }
-   
+
    bool Add(BTNode node)
    {
       if(!CompareKey) CompareKey = CompareInt;
@@ -123,7 +123,7 @@ public struct BinaryTree
       delete voidNode;
    }
 
-   char * Print(char * output, TreePrintStyle tps) 
+   char * Print(char * output, TreePrintStyle tps)
    {
       output[0] = 0;
       if(root) root.Print(output, tps);
index 11d7ba8..fb17aac 100644 (file)
@@ -21,7 +21,7 @@ public:
    char * name;
 };
 public class OldLink : struct
-{ 
+{
 public:
    OldLink prev, next;
    void * data;
@@ -124,7 +124,7 @@ public:
 #endif
 
          link.prev = last;
-         if(link.prev) 
+         if(link.prev)
             ((Item) ((byte *)link.prev + offset)).next = item;
          if(!first) first = item;
          last = item;
@@ -211,7 +211,7 @@ public:
 
          if(link.prev)
             ((Item) ((byte *)link.prev + offset)).next = link.next;
-         if(link.next) 
+         if(link.next)
             ((Item) ((byte *)link.next + offset)).prev = link.prev;
          if(circ && last == first)
             last = first = null;
@@ -244,7 +244,7 @@ public:
          Item link = (Item) ((byte *)item + offset);
          next = link.next;
 
-         if(freeFn) 
+         if(freeFn)
             freeFn(item);
          delete item;
 
@@ -264,7 +264,7 @@ public:
          Item link = (Item) ((byte *)item + offset);
          next = link.next;
 
-         if(freeFn) 
+         if(freeFn)
             freeFn(item);
 
          // Handle list->circular linked lists
@@ -291,18 +291,18 @@ public:
          Item link = (Item) ((byte *)item + offset);
          Item prevLink = (Item) ((byte *)prevItem + offset);
 
-         if(prevItem != item && (first != item || prevItem)) 
+         if(prevItem != item && (first != item || prevItem))
          {
-            if(link.prev) 
+            if(link.prev)
                ((Item)((byte *)link.prev + offset)).next = link.next;
-            if(link.next) 
+            if(link.next)
                ((Item)((byte *)link.next + offset)).prev = link.prev;
             if(item == first) first = link.next;
             if(item == last)  last = link.prev;
-      
-            if(prevItem == last) 
+
+            if(prevItem == last)
                last = item;
-         
+
             link.prev = prevItem ? prevItem : (circ ? last : null);
             if(prevItem)
             {
@@ -321,7 +321,7 @@ public:
                       link.next = item;
                }
             }
-            if(link.next) 
+            if(link.next)
                ((Item) ((byte *)link.next + offset)).prev = item;
          }
       }
@@ -338,7 +338,7 @@ public:
       link1.next = link2.next;
       link2.prev = prev1;
       link2.next = next1;
-      
+
       if(first == tmp1)      first = item2;
       else if(first == tmp2) first = item1;
 
@@ -374,7 +374,7 @@ public:
          list2.offset = offset;
          list1.circ = circ;
          list2.circ = circ;
-         
+
          list1.first = first;
          list1.last = middle;
          list2.first = ((Item)((byte *)middle + offset)).next;
index a7314b2..5d0e4dc 100644 (file)
@@ -128,14 +128,14 @@ public char * SplitDirectory(const char * string, char * part, char * rest)
       for(;(ch = string[c]) && (ch != '/' && ch != '\\'); c++)
       {
          if(len < MAX_FILENAME)
-            part[len++] = ch;  
+            part[len++] = ch;
       }
    }
 
    for(;(ch = string[c]) && (ch == '/' || ch == '\\'); c++);
    memmove(rest, string + c, strlen(string + c) + 1);
    for(c = strlen(rest); c >= 0; c--)
-      if(ch != '/' && ch != '\\') 
+      if(ch != '/' && ch != '\\')
          break;
    if(c > 0)
       rest[c] = '\0';
@@ -160,7 +160,7 @@ public char * GetLastDirectory(char * string, char * output)
 
    len = strlen(output);
    if(len > 1 && (output[len-1] == '\\' || output[len-1] == '/'))
-      output[len-1] = '\0';   
+      output[len-1] = '\0';
    return output;
 }
 
@@ -296,7 +296,7 @@ public char * PathCatSlash(char * string, char * addedPath)
          int len = 0;
          char ch;
          int count;
-      
+
          for(;(ch = addedPath[c]) && (ch == '/' || ch == '\\'); c++);
          for(;(ch = addedPath[c]) && (ch != '/' && ch != '\\'); c++)
          {
@@ -305,7 +305,7 @@ public char * PathCatSlash(char * string, char * addedPath)
                break;
             }
             if(len < MAX_FILENAME)
-               directory[len++] = ch;  
+               directory[len++] = ch;
          }
          directory[len] = '\0';
 
@@ -513,7 +513,7 @@ public char * PathCat(char * string, char * addedPath)
          int len = 0;
          char ch;
          int count;
-      
+
          for(;(ch = addedPath[c]) && (ch == '/' || ch == '\\'); c++);
          for(;(ch = addedPath[c]) && (ch != '/' && ch != '\\'); c++)
          {
@@ -522,7 +522,7 @@ public char * PathCat(char * string, char * addedPath)
                break;
             }
             if(len < MAX_FILENAME)
-               directory[len++] = ch;  
+               directory[len++] = ch;
          }
          directory[len] = '\0';
 
@@ -650,7 +650,7 @@ public char * MakePathRelative(char * path, char * to, char * destination)
       destination[0] = '\0';
       for(;toRest[0];)
       {
-         SplitDirectory(toRest, toPart, toRest);      
+         SplitDirectory(toRest, toPart, toRest);
          if(!different)
             SplitDirectory(pathRest, pathPart, pathRest);
 
@@ -775,12 +775,12 @@ public char * SearchString(char * buffer, int start, char * subStr, bool matchCa
          {
             if(matchWord)
             {
-               if(!strcompare(ptr,subStr,subLen) && 
+               if(!strcompare(ptr,subStr,subLen) &&
                   /*
-                  !IS_ALUNDER(ptr[subLen]) && 
+                  !IS_ALUNDER(ptr[subLen]) &&
                   !IS_ALUNDER(beforeChar))
                   */
-                  (!IS_ALUNDER(subStr[subLen-1]) || !IS_ALUNDER(ptr[subLen])) && 
+                  (!IS_ALUNDER(subStr[subLen-1]) || !IS_ALUNDER(ptr[subLen])) &&
                   (!IS_ALUNDER(subStr[0]) || !IS_ALUNDER(beforeChar)))
                   return ptr;
             }
@@ -790,7 +790,7 @@ public char * SearchString(char * buffer, int start, char * subStr, bool matchCa
                   return ptr;
             }
          }
-         beforeChar = ptr[0];  
+         beforeChar = ptr[0];
       }
    }
    return null;
@@ -810,9 +810,9 @@ public char * RSearchString(char * buffer, char * subStr, int maxLen, bool match
          {
             if(matchWord)
             {
-               if(!strcompare(ptr1,subStr,subLen) && 
+               if(!strcompare(ptr1,subStr,subLen) &&
                   //!IS_ALUNDER(ptr1[subLen]) && !IS_ALUNDER(*ptr2))
-                  (!IS_ALUNDER(subStr[subLen-1]) || !IS_ALUNDER(ptr1[subLen])) && 
+                  (!IS_ALUNDER(subStr[subLen-1]) || !IS_ALUNDER(ptr1[subLen])) &&
                   (!IS_ALUNDER(subStr[0]) || !IS_ALUNDER(*ptr2)))
 
                  return ptr1;
@@ -1055,7 +1055,7 @@ public bool GetString(char ** buffer, char * string, int max)
          {
             c++;
             //result = false;
-            break;            
+            break;
          }
          (*buffer)++;
       }
index c81cf7e..b82bc22 100644 (file)
@@ -154,7 +154,7 @@ public:
          array = renew array T[count];
 
       // TOFIX: Precomp fails on (BuiltInContainer *)
-      if((source._class == class(BuiltInContainer) && ((struct BuiltInContainer *)source)->type.type != structClass ) || 
+      if((source._class == class(BuiltInContainer) && ((struct BuiltInContainer *)source)->type.type != structClass ) ||
          eClass_IsDerived(source._class, class(Array)))
       {
          memcpy(array, ((Array)source).array, count * Tsize);
@@ -189,6 +189,6 @@ public:
    {
       T data = *(T*)item;
       delete data;
-      Remove(item);      
+      Remove(item);
    }
 };
index a3ab342..77e833a 100644 (file)
@@ -27,22 +27,22 @@ public:
    virtual IteratorPointer GetLast()  { return (IteratorPointer)(data ? ((byte *)data + (count * type.typeSize) - 1) : null); }
    virtual IteratorPointer GetPrev(IteratorPointer pointer)
    {
-      return (IteratorPointer)((pointer && (byte *)pointer > (byte *)data) ? 
+      return (IteratorPointer)((pointer && (byte *)pointer > (byte *)data) ?
          ((byte *)pointer - ((type.type == noHeadClass || type.type == normalClass) ? sizeof(void *) : type.typeSize)) : null);
    }
    virtual IteratorPointer GetNext(IteratorPointer pointer)
    {
-      return (IteratorPointer)((pointer && (byte *)pointer < (byte *)data + (count - 1) * 
-         ((type.type == noHeadClass || type.type == normalClass) ? sizeof(void *) : type.typeSize) ? 
+      return (IteratorPointer)((pointer && (byte *)pointer < (byte *)data + (count - 1) *
+         ((type.type == noHeadClass || type.type == normalClass) ? sizeof(void *) : type.typeSize) ?
          ((byte *)pointer + ((type.type == noHeadClass || type.type == normalClass) ? sizeof(void *) : type.typeSize)) : null);
    }
    virtual uint64 GetData(IteratorPointer pointer)
    {
       uint64 * item = (uint64 *)pointer;
-      return ((((type.type == structClass) ? ((uint64)item) : 
-         (type.type == normalClass || type.type == noHeadClass) ? (uint64)*((void **)item) : 
-            ((type.typeSize == 1) ? *((unsigned char *)item) : 
-               ((type.typeSize == 2) ? *((unsigned short *)item) : 
+      return ((((type.type == structClass) ? ((uint64)item) :
+         (type.type == normalClass || type.type == noHeadClass) ? (uint64)*((void **)item) :
+            ((type.typeSize == 1) ? *((unsigned char *)item) :
+               ((type.typeSize == 2) ? *((unsigned short *)item) :
                   ((type.typeSize == 4) ? *((unsigned int *)item) : *((uint64 *)item)))))));
    }
    virtual bool SetData(IteratorPointer pointer, uint64 data)
@@ -51,7 +51,7 @@ public:
    }
    virtual IteratorPointer GetAtPosition(uint64 pos, bool create)
    {
-      return data ? (IteratorPointer)((byte *)data + 
+      return data ? (IteratorPointer)((byte *)data +
          ((type.type == noHeadClass || type.type == normalClass) ? sizeof(void *) : type.typeSize)) : null;
    }
    virtual IteratorPointer Insert(IteratorPointer after, uint64 value)
@@ -86,7 +86,7 @@ public:
       {
          uint64 data = GetData(i);
          Class Dclass = type;
-         int result = ((int (*)(void *, void *, void *))(void *)Dclass._vTbl[__ecereVMethodID_class_OnCompare])(Dclass, 
+         int result = ((int (*)(void *, void *, void *))(void *)Dclass._vTbl[__ecereVMethodID_class_OnCompare])(Dclass,
             ((Dclass.type == systemClass && !Dclass.byValueSystemClass) || Dclass.type == bitClass || Dclass.type == enumClass || Dclass.type == unitClass) ? &value : (void *)value,
             ((Dclass.type == systemClass && !Dclass.byValueSystemClass) || Dclass.type == bitClass || Dclass.type == enumClass || Dclass.type == unitClass) ? &data : (void *)data);
          if(!result)
@@ -94,7 +94,7 @@ public:
       }
       return null;
    }
-   
+
    virtual void FreeIterator(IteratorPointer it);
    virtual int GetCount() { return count; }
 
index 1d32824..bf59837 100644 (file)
@@ -145,7 +145,7 @@ public:
          delete this;
       }
    }
-   
+
    void OnCopy(Container<T> source)
    {
       if(source)
@@ -191,7 +191,7 @@ public:
    }
 
    virtual void FreeIterator(IteratorPointer it);
-   
+
    virtual int GetCount()
    {
       int count = 0;
@@ -229,12 +229,12 @@ public:
             char * result;
 
             itemString[0] = '\0';
-            
+
             result = ((char *(*)(void *, void *, char *, void *, bool *))(void *)Dclass._vTbl[__ecereVMethodID_class_OnGetString])(Dclass,
                ((Dclass.type == systemClass && !Dclass.byValueSystemClass) || Dclass.type == bitClass || Dclass.type == enumClass || Dclass.type == unitClass) ? &data : (void *)data, itemString, null, null);
             if(!first) strcat(tempString, ", ");
 
-            strcat(tempString, result);         
+            strcat(tempString, result);
             first = false;
          }
       }
@@ -266,7 +266,7 @@ public:
       {
          D data = GetData(i);
          Class Eclass = isNormalClass ? ((Instance)data)._class : Dclass;
-         ((void (*)(void *, void *, void *))(void *)Eclass._vTbl[__ecereVMethodID_class_OnSerialize])(Eclass, 
+         ((void (*)(void *, void *, void *))(void *)Eclass._vTbl[__ecereVMethodID_class_OnSerialize])(Eclass,
             ((Dclass.type == systemClass && !Dclass.byValueSystemClass) || Dclass.type == bitClass || Dclass.type == enumClass || Dclass.type == unitClass) ? &data : (void *)data, channel);
       }
    }
index 328df01..a2538ae 100644 (file)
@@ -79,7 +79,7 @@ public:
 private:
 
    void Free()
-   {  
+   {
        if (left) left.Free();
        if (right) right.Free();
       delete this;
@@ -93,7 +93,7 @@ private:
       while(true)
       {
          // *** NEED COMPARISON OPERATOR SUPPORT HERE INVOKING OnCompare, AS WELL AS TYPE INFORMATION PASSED ***
-         int result = ((int (*)(void *, void *, void *))(void *)Tclass._vTbl[__ecereVMethodID_class_OnCompare])(Tclass, 
+         int result = ((int (*)(void *, void *, void *))(void *)Tclass._vTbl[__ecereVMethodID_class_OnCompare])(Tclass,
             ((Tclass.type == systemClass && !Tclass.byValueSystemClass) || Tclass.type == bitClass || Tclass.type == enumClass || Tclass.type == unitClass || Tclass.type == structClass) ? (((byte *)&(uint64)node.key) + __ENDIAN_PAD((Tclass.type == structClass) ? sizeof(void *) : Tclass.typeSize)) : (void *)node.key,
             ((Tclass.type == systemClass && !Tclass.byValueSystemClass) || Tclass.type == bitClass || Tclass.type == enumClass || Tclass.type == unitClass || Tclass.type == structClass) ? (((byte *)&(uint64)key) + __ENDIAN_PAD((Tclass.type == structClass) ? sizeof(void *) : Tclass.typeSize)) : (void *)key);
          if(!result)
@@ -152,7 +152,7 @@ private:
       while(this)
       {
          // *** NEED COMPARISON OPERATOR SUPPORT HERE INVOKING OnCompare, AS WELL AS TYPE INFORMATION PASSED ***
-         int result = ((int (*)(void *, void *, void *))(void *)Tclass._vTbl[__ecereVMethodID_class_OnCompare])(Tclass, 
+         int result = ((int (*)(void *, void *, void *))(void *)Tclass._vTbl[__ecereVMethodID_class_OnCompare])(Tclass,
             ((Tclass.type == systemClass && !Tclass.byValueSystemClass) || Tclass.type == bitClass || Tclass.type == enumClass || Tclass.type == unitClass) ? (((byte *)&(uint64)key) + __ENDIAN_PAD(Tclass.typeSize)) : (void *)key,
             ((Tclass.type == systemClass && !Tclass.byValueSystemClass) || Tclass.type == bitClass || Tclass.type == enumClass || Tclass.type == unitClass || Tclass.type == structClass) ? (((byte *)&(uint64)this.key) + __ENDIAN_PAD((Tclass.type == structClass) ? sizeof(void *) : Tclass.typeSize)) : (void *)this.key);
          if(result < 0)
@@ -257,7 +257,7 @@ private:
          return parent.Rebalance();
       else
          return null;
-   }      
+   }
 
    thisclass RemoveSwapRight()
    {
@@ -427,7 +427,7 @@ public:
          Class Tclass = class(BT).templateArgs[0].dataTypeClass;
          if(!Tclass)
          {
-            Tclass = class(BT).templateArgs[0].dataTypeClass = 
+            Tclass = class(BT).templateArgs[0].dataTypeClass =
                eSystem_FindClass(__thisModule.application, class(BT).templateArgs[0].dataTypeString);
          }
          if(root.Add(Tclass /*class(BT).templateArgs[0].dataTypeClass*/, node))
index 9de8419..a594d8e 100644 (file)
@@ -50,7 +50,7 @@ public:
       if(item)
       {
          item.link.prev = last;
-         if(item.link.prev) 
+         if(item.link.prev)
             item.link.prev.link.next = item;
          if(!first) first = item;
          last = item;
@@ -83,7 +83,7 @@ public:
                   item.link.prev.link.next = item;
                else
                   item.link.next = item;
-            }                 
+            }
          }
          if(prevItem == last) last = item;
          if(item.link.next)
@@ -101,7 +101,7 @@ public:
       {
          if(item.link.prev)
             item.link.prev.link.next = item.link.next;
-         if(item.link.next) 
+         if(item.link.next)
             item.link.next.link.prev = item.link.prev;
          if(circ && last == first)
             last = first = null;
@@ -122,18 +122,18 @@ public:
       LT prevItem = (LT)_prevItem;
       if(item)
       {
-         if(prevItem != item && (first != item || prevItem)) 
+         if(prevItem != item && (first != item || prevItem))
          {
-            if(item.link.prev) 
+            if(item.link.prev)
                item.link.prev.link.next = item.link.next;
-            if(item.link.next) 
+            if(item.link.next)
                item.link.next.link.prev = item.link.prev;
             if(item == first) first = item.link.next;
             if(item == last)  last = item.link.prev;
-      
-            if(prevItem == last) 
+
+            if(prevItem == last)
                last = item;
-         
+
             item.link.prev = prevItem ? prevItem : (circ ? last : null);
             if(prevItem)
             {
@@ -152,7 +152,7 @@ public:
                       item.link.next = item;
                }
             }
-            if(item.link.next) 
+            if(item.link.next)
                item.link.next.link.prev = item;
          }
       }
index 6474d71..08e0eb5 100644 (file)
@@ -56,7 +56,7 @@ public class List<class LLT> : LinkList<Link, T = LLT, D = LLT>
    void Delete(Link link)
    {
       D data = GetData(link);
-      delete data;      
+      delete data;
       Remove(link);
    }
 
@@ -66,7 +66,7 @@ public class List<class LLT> : LinkList<Link, T = LLT, D = LLT>
       while(item = first)
       {
          D data = GetData(item);
-         delete data;      
+         delete data;
          Remove(item);
       }
    }
index 8766074..031fcaf 100644 (file)
@@ -49,7 +49,7 @@ public struct MapIterator<class KT, class V> : Iterator<V, IT = KT>
    }
    property V value
    {
-      get { return container.GetData(pointer); } 
+      get { return container.GetData(pointer); }
       set { container.SetData(pointer, value); }
    }
 };
@@ -182,7 +182,7 @@ public class Map<class MT, class V> : CustomAVLTree<MapNode<MT, V>, I = MT, D =
          if(class(MT).type == structClass || class(V).type == structClass)
          {
             uint size = sizeof(class MapNode<MT, V>);
-            
+
             if(class(MT).type == structClass) size += class(MT).typeSize - sizeof(node.AVLNode::key);
             if(class(V).type == structClass) size += class(V).typeSize - sizeof(*&node.value);
             node = (MapNode<MT, V>)new0 byte[size];
index 8ba2419..713972c 100644 (file)
@@ -268,8 +268,8 @@ static int DataMember_OnCompare(DataMember parentMember, void * data1, void * da
 
          if(memberType.type == structClass || memberType.type == normalClass || memberType.type == noHeadClass)
          {
-            memberResult = ((int (*)(void *, void *, void *))(void *)memberType._vTbl[__ecereVMethodID_class_OnCompare])(memberType, 
-               (byte *)data1 + member.offset, 
+            memberResult = ((int (*)(void *, void *, void *))(void *)memberType._vTbl[__ecereVMethodID_class_OnCompare])(memberType,
+               (byte *)data1 + member.offset,
                (byte *)data2 + member.offset);
             if(memberResult)
                return memberResult;
@@ -286,8 +286,8 @@ static int DataMember_OnCompare(DataMember parentMember, void * data1, void * da
       }
       else
       {
-         memberResult = DataMember_OnCompare(member, 
-            (byte *)data1 + member.offset, 
+         memberResult = DataMember_OnCompare(member,
+            (byte *)data1 + member.offset,
             (byte *)data2 + member.offset);
          if(memberResult)
             return memberResult;
@@ -324,7 +324,7 @@ static int OnCompare(Class _class, void * data1, void * data2)
                if(member.isProperty || member.type == normalMember)
                {
                   Class memberType = member.dataTypeClass;
-                        
+
                   if(!memberType)
                      memberType = member.dataTypeClass = eSystem_FindClass(module, member.dataTypeString);
                   /*
@@ -371,14 +371,14 @@ static int OnCompare(Class _class, void * data1, void * data2)
                            if(memberType.type == normalClass || memberType.type == noHeadClass)
                            {
                               // TESTING THIS!
-                              memberResult = ((int (*)(void *, void *, void *))(void *)memberType._vTbl[__ecereVMethodID_class_OnCompare])(memberType, 
-                                 *(void **)((byte *)data1 + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset)), 
+                              memberResult = ((int (*)(void *, void *, void *))(void *)memberType._vTbl[__ecereVMethodID_class_OnCompare])(memberType,
+                                 *(void **)((byte *)data1 + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset)),
                                  *(void **)((byte *)data2 + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset)));
                            }
                            else
                            {
-                              memberResult = ((int (*)(void *, void *, void *))(void *)memberType._vTbl[__ecereVMethodID_class_OnCompare])(memberType, 
-                                 (byte *)data1 + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset), 
+                              memberResult = ((int (*)(void *, void *, void *))(void *)memberType._vTbl[__ecereVMethodID_class_OnCompare])(memberType,
+                                 (byte *)data1 + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset),
                                  (byte *)data2 + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset));
                            }
                         }
@@ -406,8 +406,8 @@ static int OnCompare(Class _class, void * data1, void * data2)
                }
                else
                {
-                  memberResult = DataMember_OnCompare(member, 
-                     (byte *)data1 + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset), 
+                  memberResult = DataMember_OnCompare(member,
+                     (byte *)data1 + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset),
                      (byte *)data2 + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset));
                }
                if(memberResult)
@@ -546,7 +546,7 @@ static char * OnGetString(Class _class, void * data, char * tempString, void * f
             Class memberType = member.dataTypeClass;
             char * name = member.name;
             if(member.id < 0) continue;
-                  
+
             memberString[0] = 0;
 
             if(!memberType)
@@ -583,7 +583,7 @@ static char * OnGetString(Class _class, void * data, char * tempString, void * f
                         if(value.p || prop.IsSet)
                         {
                            bool needClass = true;
-                           char * result = ((char *(*)(void *, void *, char *, void *, bool *))(void *)memberType._vTbl[__ecereVMethodID_class_OnGetString])(memberType, 
+                           char * result = ((char *(*)(void *, void *, char *, void *, bool *))(void *)memberType._vTbl[__ecereVMethodID_class_OnGetString])(memberType,
                               (memberType.type == normalClass) ? value.p : &value, memberString, null, &needClass);
                            if(result && result != memberString)
                               strcpy(memberString, result);
@@ -745,7 +745,7 @@ static char * OnGetString(Class _class, void * data, char * tempString, void * f
                         tempString[len++] = memberString[c];
                         tempString[len] = 0;
                      }
-                  }                              
+                  }
                   strcat(tempString, "\"");
                }
                else
@@ -856,13 +856,13 @@ static bool OnGetDataFromString(Class _class, void ** data, char * string)
 
       result = true;
 
-      if(_class.type == noHeadClass || _class.type == normalClass) 
+      if(_class.type == noHeadClass || _class.type == normalClass)
       {
          data = *data = eInstance_New(_class);
-         if(_class.type == normalClass) 
+         if(_class.type == normalClass)
             ((Instance)data)._refCount++;
       }
-      else if(/*_class.type == noHeadClass || */_class.type == structClass) 
+      else if(/*_class.type == noHeadClass || */_class.type == structClass)
          memset(data, 0, _class.structSize);
       // Bit classes cleared outside?
 
@@ -898,7 +898,7 @@ static bool OnGetDataFromString(Class _class, void ** data, char * string)
             // Is it used by the compiler?
             else if(ch == ' ') // || ch == '\n' || ch == '\t' || ch == '\r')
             {
-               if(gotChar) 
+               if(gotChar)
                   memberString[count++] = ch;
             }
             else if(ch == ',')
@@ -916,7 +916,7 @@ static bool OnGetDataFromString(Class _class, void ** data, char * string)
             else if(ch == '{')
             {
                // If bracket is not initialization
-               if(gotChar && !brackets) 
+               if(gotChar && !brackets)
                {
                   count = 0;
                   gotChar = false;
@@ -950,7 +950,7 @@ static bool OnGetDataFromString(Class _class, void ** data, char * string)
                   //TrimLSpaces(memberString, memberName);
                   //TrimRSpaces(memberName, memberString);
                   //strcpy(memberName, memberString);
-            
+
                   TrimRSpaces(memberString, memberName);
                   count = 0;
                   gotChar = false;
@@ -1000,7 +1000,7 @@ static bool OnGetDataFromString(Class _class, void ** data, char * string)
          if(found)
          {
             Class memberType = thisMember.dataTypeClass;
-            
+
             if(!memberType)
                memberType = thisMember.dataTypeClass = eSystem_FindClass(module, thisMember.dataTypeString);
             if(!memberType)
@@ -1009,7 +1009,7 @@ static bool OnGetDataFromString(Class _class, void ** data, char * string)
             {
                if(thisMember)
                {
-                  if(!((bool (*)(void *, void *, const char *))(void *)memberType._vTbl[__ecereVMethodID_class_OnGetDataFromString])(memberType, 
+                  if(!((bool (*)(void *, void *, const char *))(void *)memberType._vTbl[__ecereVMethodID_class_OnGetDataFromString])(memberType,
                      (byte *)data + (((thisMember._class.type == normalClass) ? thisMember._class.offset : 0) + memberOffset), memberString))
                      result = false;
                }
@@ -1049,7 +1049,7 @@ static bool OnGetDataFromString(Class _class, void ** data, char * string)
          }
          else
             result = false;
-            
+
          count = 0;
          memberName[0] = '\0';
       }
@@ -1139,7 +1139,7 @@ static void OnSerialize(Class _class, void * data, IOChannel channel)
                if(member.isProperty || member.type == normalMember)
                {
                   Class memberType = member.dataTypeClass;
-                        
+
                   if(!memberType)
                      memberType = member.dataTypeClass = eSystem_FindClass(module, member.dataTypeString);
                   if(memberType)
@@ -1226,7 +1226,7 @@ static int DataMember_OnUnserialize(DataMember parentMember, void * data, IOChan
    }
    return 0;
 }
+
 static void OnUnserialize(Class _class, void ** data, IOChannel channel)
 {
    Module module = _class.module;
@@ -1245,10 +1245,10 @@ static void OnUnserialize(Class _class, void ** data, IOChannel channel)
          {
             // TOFIX: Seriously!?!?? Fix me!
             data = *data = eInstance_New(_class);
-            if(_class.type == normalClass) 
+            if(_class.type == normalClass)
                ((Instance)data)._refCount++;
          }
-         else if(/*_class.type == noHeadClass || */_class.type == structClass) 
+         else if(/*_class.type == noHeadClass || */_class.type == structClass)
             memset(data, 0, _class.structSize);
 
          while(lastClass != _class)
@@ -1264,7 +1264,7 @@ static void OnUnserialize(Class _class, void ** data, IOChannel channel)
                if(member.isProperty || member.type == normalMember)
                {
                   Class memberType = member.dataTypeClass;
-                        
+
                   if(!memberType)
                      memberType = member.dataTypeClass = eSystem_FindClass(module, member.dataTypeString);
                   if(memberType)
@@ -1287,7 +1287,7 @@ static void OnUnserialize(Class _class, void ** data, IOChannel channel)
                         }*/
                      }
                      else
-                        ((void (*)(void *, void *, void *))(void *)memberType._vTbl[__ecereVMethodID_class_OnUnserialize])(memberType, 
+                        ((void (*)(void *, void *, void *))(void *)memberType._vTbl[__ecereVMethodID_class_OnUnserialize])(memberType,
                            (byte *)data + (((member._class.type == normalClass) ? member._class.offset : 0) + member.offset), channel);
                   }
                   else
@@ -1623,7 +1623,7 @@ static bool UInt64_OnGetDataFromString(Class _class, uint64 * data, char * strin
 {
    byte bytes[4];
    if(channel.ReadData(bytes, 4) == 4)
-      *data = GETXDWORD(bytes);   
+      *data = GETXDWORD(bytes);
    else
       *data = 0;
 }
@@ -1664,7 +1664,7 @@ static void IntPtr64_OnSerialize(Class _class, int64 data, IOChannel channel)
 {
    byte bytes[8];
    if(channel.ReadData(bytes, 8) == 8)
-      *data = GETXQWORD(bytes);   
+      *data = GETXQWORD(bytes);
    else
       *data = 0;
 }
@@ -1680,7 +1680,7 @@ static void IntPtr64_OnSerialize(Class _class, int64 data, IOChannel channel)
 {
    byte bytes[2];
    if(channel.ReadData(bytes, 2) == 2)
-      *data = GETXWORD(bytes);   
+      *data = GETXWORD(bytes);
    else
       *data = 0;
 }
@@ -1693,7 +1693,7 @@ static void RegisterClass_Integer(Module module)
    integerClass.dataTypeString = CopyString("int");
    integerClass.structSize = 0;
    integerClass.typeSize = sizeof(int);
-   
+
    eClass_AddMethod(integerClass, "OnCompare", null, Integer_OnCompare, publicAccess);
    eClass_AddMethod(integerClass, "OnGetString", null, Integer_OnGetString, publicAccess);
    eClass_AddMethod(integerClass, "OnGetDataFromString", null, Integer_OnGetDataFromString, publicAccess);
@@ -1937,7 +1937,7 @@ static char * Float_OnGetString(Class _class, float * data, char * string, void
    c = strlen(string)-1;
    for( ; c >= 0; c--)
    {
-      if(string[c] != '0') 
+      if(string[c] != '0')
          last = Max(last, c);
       if(string[c] == '.')
       {
@@ -1975,7 +1975,7 @@ static void Float_OnUnserialize(Class _class, float * data, IOChannel channel)
 {
    byte bytes[4];
    if(channel.ReadData(bytes, 4) == 4)
-      *(uint *)data = GETXDWORD(bytes);   
+      *(uint *)data = GETXDWORD(bytes);
    else
       *data = 0;
 }
@@ -2021,7 +2021,7 @@ static char * Double_OnGetString(Class _class, double * data, char * string, voi
    c = strlen(string)-1;
    for( ; c >= 0; c--)
    {
-      if(string[c] != '0') 
+      if(string[c] != '0')
          last = Max(last, c);
       if(string[c] == '.')
       {
@@ -2045,7 +2045,7 @@ static bool Double_OnGetDataFromString(Class _class, double * data, char * strin
    {
       *data = result;
       return true;
-   
+
     }
     return false;
 }
@@ -2157,7 +2157,7 @@ static bool String_OnGetDataFromString(Class _class, char ** data, char * newDat
    }
    return true;
 }
+
 /*static */int String_OnCompare(Class _class, char * string1, char * string2)
 {
    int result = 0;
@@ -2177,7 +2177,7 @@ static char * String_OnGetString(Class _class, char * string, char * tempString,
 
 static void String_OnFree(Class _class, char * string)
 {
-   if(string) 
+   if(string)
    {
       eSystem_Delete(string);
    }
@@ -2224,14 +2224,14 @@ static void RegisterClass_String(Module module)
    delete stringClass.dataTypeString;
    stringClass.dataTypeString = CopyString("char *");
    stringClass.structSize = 0;
-   
+
    eClass_AddMethod(stringClass, "OnCompare", null, String_OnCompare, publicAccess);
    eClass_AddMethod(stringClass, "OnCopy", null, String_OnCopy, publicAccess);
    eClass_AddMethod(stringClass, "OnFree", null, String_OnFree, publicAccess);
    eClass_AddMethod(stringClass, "OnGetString", null, String_OnGetString, publicAccess);
    eClass_AddMethod(stringClass, "OnGetDataFromString", null, String_OnGetDataFromString, publicAccess);
    eClass_AddMethod(stringClass, "OnSerialize", null, String_OnSerialize, publicAccess);
-   eClass_AddMethod(stringClass, "OnUnserialize", null, String_OnUnserialize, publicAccess); 
+   eClass_AddMethod(stringClass, "OnUnserialize", null, String_OnUnserialize, publicAccess);
    // eClass_AddProperty(stringClass, null, "Class", null, String_GetClass, publicAccess);
 
    stringClass = eSystem_RegisterClass(normalClass, "String", "char *", 0, 0, null, null, module, baseSystemAccess, publicAccess);
@@ -2299,7 +2299,7 @@ public int PrintStdArgsToBuffer(char * buffer, int maxLen, typed_object object,
             if(len + newLen >= maxLen) newLen = maxLen-1-len;
             if(result != buffer + len)
                memcpy(buffer + len, result, newLen);
-            len += newLen;              
+            len += newLen;
          }
       }
    }
index 5c8bbeb..04d507c 100644 (file)
@@ -56,7 +56,7 @@ int osfStdin, osfStdout;
 FILE * fStdIn, * fStdOut;
 #endif
 
-FILE *eC_stdin(void)  { 
+FILE *eC_stdin(void)  {
 #if defined(__WIN32__)
    if(!fStdIn)
    {
@@ -172,7 +172,7 @@ static bool DualPipe_GetLine(FILE * p, char *s, int max)
             result = false;
             break;
          }
-         if(ch =='\n') 
+         if(ch =='\n')
             break;
          if(ch !='\r')
             s[c++]=(char)ch;
@@ -374,7 +374,7 @@ bool Instance_LocateModule(char * name, char * fileName)
          sysctl(mib, 4, fileName, &cb, null, 0);
          if(fileName[0])
             return true;
-      }  
+      }
 #endif
 #if !defined(__linux__)
       {
@@ -517,13 +517,13 @@ void * Instance_Module_Load(const char * libLocation, const char * name, void **
       if(returnCode == NSObjectFileImageSuccess)
       {
          printf("NSObjectFileImageSuccess!\n");
-         library = NSLinkModule(fileImage,fileName, 
+         library = NSLinkModule(fileImage,fileName,
               NSLINKMODULE_OPTION_RETURN_ON_ERROR
             | NSLINKMODULE_OPTION_PRIVATE);
          // NSDestroyObjectFileImage(fileImage);
          if(library)
          {
-            *Load = NSAddressOfSymbol(NSLookupSymbolInModule(library, "__ecereDll_Load")); 
+            *Load = NSAddressOfSymbol(NSLookupSymbolInModule(library, "__ecereDll_Load"));
             *Unload = NSAddressOfSymbol(NSLookupSymbolInModule(library, "__ecereDll_Unload"));
             if(!*Load)
             {
index 8fd07b9..cd9f651 100644 (file)
@@ -235,7 +235,7 @@ class SelfWatcher : struct
 };
 
 public enum AccessMode
-{ 
+{
    defaultAccess,
    publicAccess,
    privateAccess,
@@ -248,7 +248,7 @@ public class SubModule : struct
 public:
    SubModule prev, next;
    Module module;
-   AccessMode importMode;      
+   AccessMode importMode;
 };
 
 public enum DataMemberType { normalMember, unionMember, structMember };
@@ -329,7 +329,7 @@ public:
    {
       get { return name; }
       set
-      {  
+      {
          Class theClass = eSystem_FindClass(__thisModule, value);
          /*
          if(!theClass)
@@ -602,7 +602,7 @@ public:
    void * symbol;
 };
 
-public class EnumClassData : struct 
+public class EnumClassData : struct
 {
 public:
    class_fixed
@@ -927,7 +927,7 @@ private struct BlockPool
             {
                BlockPool * pool = &pools[c];
                printf("[%d %s (%d)]: available: %d, allocated: %d, free: %d, used: %d k, wasted: %d k, free: %d k\n", c, (&pools[c] == this) ? "*" : " ",
-                  pools[c].blockSize, pools[c].totalSize, pools[c].numBlocks, 
+                  pools[c].blockSize, pools[c].totalSize, pools[c].numBlocks,
                   pools[c].totalSize - pools[c].numBlocks, pools[c].usedSpace / 1024, ((pools[c].numBlocks * pools[c].blockSize) - pools[c].usedSpace) / 1024,
                   (pools[c].totalSize - pools[c].numBlocks) * pools[c].blockSize / 1024);
                totalAvailable += pools[c].totalSize * pools[c].blockSize;
@@ -970,8 +970,8 @@ private struct BlockPool
          last = block;
          free = block.next;
          /*if(blockSize == 28)
-            printf("Free: %x, free.part: %x, free.part.size: %d, free.part.pool: %x (this = %x), next = %x (part = %x)\n", free, free ? free.part : null, 
-               (free && free.part) ? free.part.size : 0, (free && free.part) ? free.part.pool : 0, this, 
+            printf("Free: %x, free.part: %x, free.part.size: %d, free.part.pool: %x (this = %x), next = %x (part = %x)\n", free, free ? free.part : null,
+               (free && free.part) ? free.part.size : 0, (free && free.part) ? free.part.pool : 0, this,
                (free ? free.next : 0), (free && free.next) ? free.next.part : 0);
          if(free && free.part && (free.part.size < 0 || free.part.pool == (void *)-1))
             printf("WARNING! Bad next free block!\n");*/
@@ -1001,7 +1001,7 @@ private struct BlockPool
          first = block.next;
       if(last == block)
          last = block.prev;
-      
+
       // block.prev = null;
       block.next = free;
       free = block;
@@ -1037,7 +1037,7 @@ private struct BlockPool
          };
          if(prev)
             prev.next = null;
-         
+
          TOTAL_MEM -= part.size * blockSpace;
          TOTAL_MEM -= sizeof(class MemPart);
          numParts--;
@@ -1057,7 +1057,7 @@ static uint PosFibonacci(uint number)
    uint pos;
    uint last = 1, prev = 0;
    uint current = 1;
-   
+
    for(pos=0; ; pos++)
    {
       current += prev;
@@ -1074,7 +1074,7 @@ static uint NthFibonacci(uint number)
    uint pos;
    uint last = 1, prev = 0;
    uint current = 1;
-   
+
    for(pos=0; pos <= number; pos++)
    {
       current += prev;
@@ -1089,7 +1089,7 @@ static uint NextFibonacci(uint number)
    uint pos;
    uint last = 1, prev = 0;
    uint current = 1;
-   
+
    for(pos=0; ; pos++)
    {
       current += prev;
@@ -1104,7 +1104,7 @@ static uint log1_5i(uint number)
 {
    uint pos;
    uint64 current = sizeof(void *);
-   
+
    for(pos=0; pos < NUM_POOLS; pos++)
    {
       if(current >= number)
@@ -1131,7 +1131,7 @@ static uint pow1_5i(uint number)
 {
    uint pos;
    uint64 current = sizeof(void *);
-   
+
    for(pos=0; pos < NUM_POOLS; pos++)
    {
       if(current >= number)
@@ -1140,7 +1140,7 @@ static uint pow1_5i(uint number)
       if(current == 1) current = 2;
    }
    return (uint)current;
-} 
+}
 
 // -- Math Helpers ---
 public uint log2i(uint number)
@@ -1167,14 +1167,14 @@ static void InitMemory()
    for(c = 0; c<NUM_POOLS; c++)
    {
       int expansion;
-      
+
       pools[c].blockSize = NTH_SIZE(c);
       if(pools[c].blockSize % sizeof(void *))
          pools[c].blockSize += sizeof(void *) - (pools[c].blockSize % sizeof(void *));
       pools[c].blockSpace = pools[c].blockSize;
-      pools[c].blockSpace += sizeof(class MemBlock);      
+      pools[c].blockSpace += sizeof(class MemBlock);
       // pools[c].Expand(initNumBlocks[c]);
-      
+
       expansion = (pools[c].blockSize < 128) ? 1024 : (131072 / pools[c].blockSize);
 
       if(c < 12)
@@ -1519,7 +1519,7 @@ static void * _realloc(void * pointer, unsigned int size)
          block.OutputStacks(true);
       }
    }
-   
+
    pointer = malloc(size + REDZONE * 2);
    if(!pointer)
    {
@@ -1611,7 +1611,7 @@ static void * _crealloc(void * pointer, unsigned int size)
          block.OutputStacks(true);
       }
    }
-   
+
    pointer = calloc(1, size + REDZONE * 2);
    if(!pointer)
    {
@@ -1882,7 +1882,7 @@ public void CheckMemory()
             block.OutputStacks(true);
          }
       }
-      
+
       address = (byte *)block.key;
       for(c = 0; c<REDZONE; c++)
       {
@@ -1899,7 +1899,7 @@ public void CheckMemory()
             block.OutputStacks(block.freed);
          }
       }
-            
+
       memBlocks.Delete(block);
    }
    if(leaksCount)
@@ -1966,7 +1966,7 @@ static void FixDerivativesBase(Class base, Class mod)
       dataTypeString = enumBase ? enumBase.dataTypeString : base.dataTypeString;
 
       /////////////////////
-      
+
       offsetClass = base ? (base.templateClass ? base.templateClass.sizeClass : base.sizeClass) : (type == noHeadClass ? 0 : 0 /*sizeof(class Class)*/);
       totalSizeClass = offsetClass + sizeClass;
 
@@ -1984,7 +1984,7 @@ static void FixDerivativesBase(Class base, Class mod)
          _class.typeSize = _class.structSize = _class.memberOffset + size;
       }
       else if(type == bitClass || type == enumClass || type == unitClass)
-      {  
+      {
          Class dataTypeClass = eSystem_FindClass(_class.module, dataTypeString);
          if(dataTypeClass)
             _class.typeSize = dataTypeClass.typeSize;
@@ -2099,7 +2099,7 @@ static void FixDerivativesBase(Class base, Class mod)
       }
 
       // _class.defaultAlignment = base ? base.defaultAlignment : 0;
-   
+
       if(type == normalClass || type == noHeadClass || type == structClass)
       {
          Property prop;
@@ -2179,7 +2179,7 @@ static void FixDerivativesBase(Class base, Class mod)
          }
       }
    }
-   
+
    {
       OldLink templateLink;
       for(templateLink = base.templatized.first; templateLink; templateLink = templateLink.next)
@@ -2196,7 +2196,7 @@ static void FixDerivativesBase(Class base, Class mod)
          template.sizeClass = base.sizeClass;
          template.structSize = base.structSize;
          template.vTblSize = base.vTblSize;
-         
+
          FixDerivativesBase(template, mod);
       }
    }
@@ -2264,7 +2264,7 @@ public dllexport Class eSystem_RegisterClass(ClassType type, char * name, char *
 
    if(c - start)
    {
-      int offsetClass; 
+      int offsetClass;
       int totalSizeClass;
       BTNamedLink classLink = null;
       Class _class = null;
@@ -2274,7 +2274,7 @@ public dllexport Class eSystem_RegisterClass(ClassType type, char * name, char *
       bool refine = false;
       Class prevBase = null;
 
-      if(base && !base.internalDecl && (base.type == noHeadClass || base.type == structClass || base.type == normalClass)) 
+      if(base && !base.internalDecl && (base.type == noHeadClass || base.type == structClass || base.type == normalClass))
       {
          // Normal classes inheriting off simple classes should become no head classes
          if(base.type == structClass && type == normalClass)
@@ -2282,7 +2282,7 @@ public dllexport Class eSystem_RegisterClass(ClassType type, char * name, char *
          else
             type = base.type;
       }
-      if(base && (type == normalClass || type == noHeadClass || type == structClass) && 
+      if(base && (type == normalClass || type == noHeadClass || type == structClass) &&
          (base.type == unitClass || base.type == bitClass || base.type == enumClass))
       {
          type = base.type;
@@ -2293,17 +2293,17 @@ public dllexport Class eSystem_RegisterClass(ClassType type, char * name, char *
          {
             // TO IMPROVE:
             if(base || !baseName || !baseName[0] ||
-               !strcmp(baseName, "unsigned int") || 
-               !strcmp(baseName, "uint") || 
-               !strcmp(baseName, "unsigned int64") || 
-               !strcmp(baseName, "uint64") || 
-               !strcmp(baseName, "int64") || 
-               !strcmp(baseName, "unsigned short") || 
-               !strcmp(baseName, "short") || 
-               !strcmp(baseName, "unsigned char") || 
-               !strcmp(baseName, "byte") || 
-               !strcmp(baseName, "char") || 
-               !strcmp(baseName, "uint32") || 
+               !strcmp(baseName, "unsigned int") ||
+               !strcmp(baseName, "uint") ||
+               !strcmp(baseName, "unsigned int64") ||
+               !strcmp(baseName, "uint64") ||
+               !strcmp(baseName, "int64") ||
+               !strcmp(baseName, "unsigned short") ||
+               !strcmp(baseName, "short") ||
+               !strcmp(baseName, "unsigned char") ||
+               !strcmp(baseName, "byte") ||
+               !strcmp(baseName, "char") ||
+               !strcmp(baseName, "uint32") ||
                !strcmp(baseName, "uint16"))
             {
                base = eSystem_FindClass(module, "enum");
@@ -2325,7 +2325,7 @@ public dllexport Class eSystem_RegisterClass(ClassType type, char * name, char *
             base = eSystem_FindClass(module, "struct");
             dataTypeString = name + start;
          }
-         else 
+         else
          {
             if(type == normalClass)
                // dataTypeString = "struct Instance";
@@ -2345,17 +2345,17 @@ public dllexport Class eSystem_RegisterClass(ClassType type, char * name, char *
                // DANGEROUSLY TESTING THIS... PUT IT BACK
                //if(!base)
                if(base || !baseName || !baseName[0] ||
-                  !strcmp(baseName, "unsigned int") || 
-                  !strcmp(baseName, "uint") || 
-                  !strcmp(baseName, "unsigned int64") || 
-                  !strcmp(baseName, "uint64") || 
-                  !strcmp(baseName, "int64") || 
-                  !strcmp(baseName, "unsigned short") || 
-                  !strcmp(baseName, "short") || 
-                  !strcmp(baseName, "unsigned char") || 
-                  !strcmp(baseName, "byte") || 
-                  !strcmp(baseName, "char") || 
-                  !strcmp(baseName, "uint32") || 
+                  !strcmp(baseName, "unsigned int") ||
+                  !strcmp(baseName, "uint") ||
+                  !strcmp(baseName, "unsigned int64") ||
+                  !strcmp(baseName, "uint64") ||
+                  !strcmp(baseName, "int64") ||
+                  !strcmp(baseName, "unsigned short") ||
+                  !strcmp(baseName, "short") ||
+                  !strcmp(baseName, "unsigned char") ||
+                  !strcmp(baseName, "byte") ||
+                  !strcmp(baseName, "char") ||
+                  !strcmp(baseName, "uint32") ||
                   !strcmp(baseName, "uint16"))
                {
                   if(type == normalClass && strcmp(name, "ecere::com::Instance") && strcmp(name, "enum") && strcmp(name, "struct"))
@@ -2385,7 +2385,7 @@ public dllexport Class eSystem_RegisterClass(ClassType type, char * name, char *
 
       offsetClass = base ? base.sizeClass : (type == noHeadClass ? 0 : 0 /*sizeof(class Class)*/);
       totalSizeClass = offsetClass + sizeClass;
-   
+
       if((_class = eSystem_FindClass(module, name)))
       {
          if(!_class.internalDecl)
@@ -2417,8 +2417,8 @@ public dllexport Class eSystem_RegisterClass(ClassType type, char * name, char *
          }
          {
             NameSpace * ns = _class.nameSpace;
-            while(ns->parent && 
-               !ns->classes.first && 
+            while(ns->parent &&
+               !ns->classes.first &&
                !ns->functions.first &&
                !ns->defines.first &&
                !ns->nameSpaces.first)
@@ -2665,7 +2665,7 @@ public dllexport Class eSystem_RegisterClass(ClassType type, char * name, char *
             _class.typeSize = _class.structSize = _class.memberOffset + size;
          }
          else if(type == bitClass || type == enumClass || type == unitClass)
-         {  
+         {
             Class dataTypeClass = eSystem_FindClass(_class.module, dataTypeString);
             if(dataTypeClass)
                _class.typeSize = dataTypeClass.typeSize;
@@ -2780,7 +2780,7 @@ static void FreeTemplateArg(Class template, ClassTemplateParameter param, int id
          delete template.templateArgs[id].memberString;
          break;
       case expression:
-         
+
          break;
    }
 }
@@ -2796,7 +2796,7 @@ static void FreeTemplateArgs(Class template)
          ClassTemplateParameter param;
          int id = 0;
          if(_class.templateClass) _class = _class.templateClass;
-         for(prevClass = _class.base; prevClass; prevClass = prevClass.base) 
+         for(prevClass = _class.base; prevClass; prevClass = prevClass.base)
          {
             if(prevClass.templateClass) prevClass = prevClass.templateClass;
             id += prevClass.templateParams.count;
@@ -2884,7 +2884,7 @@ public dllexport void eClass_Unregister(Class _class)
    delete _class._vTbl;
 
    FreeTemplates(_class);
-   
+
    FreeTemplateArgs(_class);
    delete _class.templateArgs;
 
@@ -2943,7 +2943,7 @@ public dllexport void eClass_Unregister(Class _class)
    _class.delayedCPValues.Free(null);
 
    _class.selfWatchers.Free(null);
-   
+
    if(_class.base)
    {
       // Class base = _class.base.templateClass ? _class.base.templateClass : _class.base;
@@ -2970,7 +2970,7 @@ public dllexport void eClass_Unregister(Class _class)
 
    delete _class.name;
    delete _class.fullName;
-   
+
    delete _class.dataTypeString;
 
    delete _class.data;
@@ -2986,7 +2986,7 @@ public dllexport void eClass_Unregister(Class _class)
             delete param.defaultArg.memberString;
             break;
          case expression:
-            
+
             break;
       }
       if(param.type != identifier) delete param.dataTypeString;
@@ -3104,9 +3104,9 @@ public int64 _strtoi64(char * string, char ** endString, int base)
    {
       if(ch >= '0' && ch <= '9')
          ch -= '0';
-      else if(ch >= 'a' && ch <= 'z') 
-         ch -= ('a' - 10); 
-      else if(ch >= 'A' && ch <= 'Z') 
+      else if(ch >= 'a' && ch <= 'z')
+         ch -= ('a' - 10);
+      else if(ch >= 'A' && ch <= 'Z')
          ch -= ('A'- 10);
       else
       {
@@ -3159,9 +3159,9 @@ public uint64 _strtoui64(char * string, char ** endString, int base)
    {
       if(ch >= '0' && ch <= '9')
          ch -= '0';
-      else if(ch >= 'a' && ch <= 'z') 
-         ch -= ('a' - 10); 
-      else if(ch >= 'A' && ch <= 'Z') 
+      else if(ch >= 'a' && ch <= 'z')
+         ch -= ('a' - 10);
+      else if(ch >= 'A' && ch <= 'Z')
          ch -= ('A' - 10);
       else
       {
@@ -3196,7 +3196,7 @@ public dllexport Class eSystem_FindClass(Module module, char * name)
 
       link = SearchModule(module, name, &((NameSpace *)0)->classes, true);
       if(link) return link.data;
-      
+
       {
          char noTemplateName[1024];
          char * templateParams = strchr(name, '<');
@@ -3264,7 +3264,7 @@ static void CopyTemplateArg(ClassTemplateParameter param, ClassTemplateArgument
          arg.dataTypeString = CopyString(arg.dataTypeString);
          break;
       case expression:
-         
+
          break;
       case identifier:
          arg.memberString = CopyString(arg.memberString);
@@ -3287,7 +3287,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
       if(sClass.templateClass) sClass = sClass.templateClass;
       numParams += sClass.templateParams.count;
    }
-   
+
    if(templatedClass.templateArgs)
       FreeTemplateArgs(templatedClass);
    delete templatedClass.templateArgs;
@@ -3314,11 +3314,11 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
            CopyTemplateArg(param, templatedClass.templateArgs[id++]);
       }*/
    }
-   
+
    if(templatedClass.base && templatedClass.base.templateArgs && _class == templatedClass)
    {
       Class sClass;
-      memcpy(templatedClass.templateArgs, templatedClass.base.templateArgs, 
+      memcpy(templatedClass.templateArgs, templatedClass.base.templateArgs,
          sizeof(ClassTemplateArgument) * (numParams - templatedClass.templateParams.count));
       for(sClass = templatedClass.base; sClass; sClass = sClass.base)
       {
@@ -3336,7 +3336,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
             CopyTemplateArg(param, templatedClass.templateArgs[id++]);
       }
    }
-   
+
    while(nextParamStart)
    {
       char * paramStart = nextParamStart;
@@ -3344,7 +3344,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
       int level = 0;
       while(*paramStart == ' ') paramStart++;
       paramEnd = paramStart;
-      while((ch = *paramEnd, ch && (level > 0 || (ch != '>' && ch != ',')))) 
+      while((ch = *paramEnd, ch && (level > 0 || (ch != '>' && ch != ','))))
       {
          if(ch == '<') level++;
          if(ch == '>') level--;
@@ -3368,11 +3368,11 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
          {
             char * end = equal - 1;
             char ident[1024];
-            
+
             while(*end == ' ') end--;
             strncpy(ident, paramStart, end + 1 - paramStart);
             ident[end + 1 - paramStart] = 0;
-            
+
             for(sClass = _class; sClass; sClass = sClass.base)
             {
                if(sClass.templateClass) sClass = sClass.templateClass;
@@ -3417,7 +3417,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
                      curParam = param;
                      break;
                   }
-                  if(curParam) 
+                  if(curParam)
                   {
                      Class nextClass;
                      for(nextClass = sClass.base; nextClass; nextClass = nextClass.base)
@@ -3448,7 +3448,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
                         {
                            curParamID += nextClass.templateParams.count;
                            break;
-                        } 
+                        }
                      break;
                   }
                }
@@ -3460,7 +3460,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
          {
             ClassTemplateArgument argument { };
             char value[1024];
-            if(equal) 
+            if(equal)
             {
                equal++;
                while(*equal == ' ') equal++;
@@ -3488,7 +3488,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
                   if(!expClass) expClass = eSystem_FindClass(_class.module.application, curParam.dataTypeString);
                   if(expClass)
                   {
-                     //if(expClass.type == 
+                     //if(expClass.type ==
                      ((bool (*)(void *, void *, const char *))(void *)expClass._vTbl[__ecereVMethodID_class_OnGetDataFromString])(expClass, &argument.expression, value);
                   }
                   // Expression should be pre simplified here
@@ -3546,7 +3546,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
                      argument.expression.i = (int)strtol(value, null, 0);
                   }
                   break;
-               } 
+               }
                case identifier:
                   argument.memberString = CopyString(value);
                   break;
@@ -3579,9 +3579,9 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
             if(param.type == type && param.defaultArg.dataTypeString)
             {
                templatedClass.templateArgs[curParamID].dataTypeClass = eSystem_FindClass(templatedClass.module, param.defaultArg.dataTypeString);
-               if(!templatedClass.templateArgs[curParamID].dataTypeClass) 
+               if(!templatedClass.templateArgs[curParamID].dataTypeClass)
                   templatedClass.templateArgs[curParamID].dataTypeClass = eSystem_FindClass(templatedClass.module.application, param.defaultArg.dataTypeString);
-               if(!templatedClass.templateArgs[curParamID].dataTypeClass) 
+               if(!templatedClass.templateArgs[curParamID].dataTypeClass)
                   templatedClass.templateArgs[curParamID].dataTypeClass = eSystem_FindClass(findModule, param.defaultArg.dataTypeString);
             }
          }
@@ -3613,7 +3613,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
                      Class cClass = null;
                      int paramCount = 0;
                      int lastParam = -1;
-                     
+
                      char templateString[1024];
                      sprintf(templateString, "%s<", expClass.templateClass.fullName);
                      for(cClass = expClass; cClass; cClass = cClass.base)
@@ -3730,7 +3730,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
                   }
                }
             }
-            c--;                        
+            c--;
          }
       }
    }
@@ -3743,8 +3743,8 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
          Class nextClass;
          ClassTemplateParameter param;
          if(sClass.templateClass) sClass = sClass.templateClass;
-         
-         for(nextClass = sClass.base; nextClass; nextClass = nextClass.base) 
+
+         for(nextClass = sClass.base; nextClass; nextClass = nextClass.base)
          {
             if(nextClass.templateClass) nextClass = nextClass.templateClass;
             curParamID += nextClass.templateParams.count;
@@ -3785,7 +3785,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
                Class dClass;
                int p = numParams - 1;
                for(dClass = _class; dClass; dClass = dClass.base)
-               {                              
+               {
                   if(dClass.templateClass) dClass = dClass.templateClass;
                   for(cParam = dClass.templateParams.last; cParam; cParam = cParam.prev, p--)
                   {
@@ -3838,7 +3838,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
 
                   memcpy(className, memberString, colon - memberString);
                   className[colon - memberString] = '\0';
-                  
+
                   for(sClass = _class; sClass; sClass = sClass.base)
                   {
                      ClassTemplateParameter cParam;
@@ -3846,7 +3846,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
                      int id = 0;
 
                      if(sClass.templateClass) sClass = sClass.templateClass;
-                     for(nextClass = sClass.base; nextClass; nextClass = nextClass.base) 
+                     for(nextClass = sClass.base; nextClass; nextClass = nextClass.base)
                      {
                         if(nextClass.templateClass) nextClass = nextClass.templateClass;
                         id += nextClass.templateParams.count;
@@ -3858,7 +3858,7 @@ static void ComputeClassParameters(Class templatedClass, char * templateParams,
                            strcpy(className, templatedClass.templateArgs[id].dataTypeString);
                         }
                         id++;
-                     }                  
+                     }
                   }
                   memberClass = eSystem_FindClass(templatedClass.module, className);
                   // TESTING: Added this here...
@@ -3918,7 +3918,7 @@ public dllexport bool eClass_IsDerived(Class _class, Class from)
                   ClassTemplateParameter param;
                   Class nextClass;
                   int p = 0;
-                  for(nextClass = sClass.base; nextClass; nextClass = nextClass.base) p += nextClass.templateParams.count;               
+                  for(nextClass = sClass.base; nextClass; nextClass = nextClass.base) p += nextClass.templateParams.count;
                   for(param = sClass.templateParams.first; param; param = param.next, p++)
                   {
                      ClassTemplateArgument * arg = &_class.templateArgs[p];
@@ -4240,7 +4240,7 @@ static void SetDelayedCPValues(Class _class, ClassProperty _property)
 
 public dllexport ClassProperty eClass_AddClassProperty(Class _class, char * name, char * dataType, void * setStmt, void * getStmt)
 {
-   if(name && !_class.classProperties.FindString(name)) 
+   if(name && !_class.classProperties.FindString(name))
    {
       ClassProperty _property
       {
@@ -4396,7 +4396,7 @@ public dllexport void * eInstance_New(Class _class)
    Instance instance = null;
    if(_class)
    {
-      // instance = _malloc(_class.size);   
+      // instance = _malloc(_class.size);
 #ifdef MEMINFO
 
 #undef malloc
@@ -4513,13 +4513,13 @@ public dllexport void eInstance_Evolve(Instance * instancePtr, Class _class)
          for(nameSpace = (NameSpace *)app.systemNameSpace.nameSpaces.first; nameSpace; nameSpace = (NameSpace *)((BTNode)nameSpace).next)
             nameSpace->parent = &app.systemNameSpace;
          // --------------------------------------------------
-         
+
          for(_class = app.classes.first; _class; _class = _class.next)
          {
             OldLink templateLink;
             _class.module = (Module) app;
             for(templateLink = _class.templatized.first; templateLink; templateLink = templateLink.next)
-            {  
+            {
                Class template = templateLink.data;
                template.module = _class.module;
             }
@@ -4609,14 +4609,14 @@ public dllexport void eInstance_Delete(Instance instance)
                   OldList * watchers = (OldList *)((byte *)instance + _property.watcherOffset);
                   Watcher watcher, next;
                   for(watcher = watchers->first; watcher; watcher = next)
-                  {  
+                  {
                      next = watcher.next;
                      watchers->Delete(watcher);
                   }
                }
             }
          }*/
-         
+
 
          base = _class.base;
          if(base && (base.type == systemClass || base.isInstanceClass)) base = null;
@@ -4865,7 +4865,7 @@ public dllexport DataMember eClass_FindDataMemberAndId(Class _class, char * name
 public dllexport void eClass_FindNextMember(Class _class, Class * curClass, DataMember * curMember, DataMember * subMemberStack, int * subMemberStackPos)
 {
    // THIS CODE WILL FIND NEXT MEMBER... (PUBLIC MEMBERS ONLY)
-   if(*curMember) 
+   if(*curMember)
    {
       *curMember = (*curMember).next;
 
@@ -4902,7 +4902,7 @@ public dllexport void eClass_FindNextMember(Class _class, Class * curClass, Data
 
             *curMember = (*curMember).members.first;
             while(*curMember && ((*curMember).memberAccess == privateAccess))
-               *curMember = (*curMember).next;                     
+               *curMember = (*curMember).next;
          }
       }
    }
@@ -4952,7 +4952,7 @@ public dllexport void eClass_FindNextMember(Class _class, Class * curClass, Data
 
                *curMember = (*curMember).members.first;
                while(*curMember && (*curMember).memberAccess == privateAccess)
-                  *curMember = (*curMember).next;                     
+                  *curMember = (*curMember).next;
             }
          }
       }
@@ -4973,7 +4973,7 @@ public dllexport void eInstance_SetMethod(Instance instance, char * name, void *
             {
                instance._vTbl = _malloc(sizeof(void *) * instance._class.vTblSize);
                memcpy(instance._vTbl, instance._class._vTbl,
-                  sizeof(int(*)()) * instance._class.vTblSize);               
+                  sizeof(int(*)()) * instance._class.vTblSize);
             }
             instance._vTbl[method.vid] = function ? function : DefaultFunction;
          }
@@ -5019,7 +5019,7 @@ static void FixOffsets(Class _class)
    OldLink deriv;
    _class.structSize += _class.base.structSize - _class.offset;
 
-   _class.offset = _class.base.structSize;   
+   _class.offset = _class.base.structSize;
 
    for(deriv = _class.derivatives.first; deriv; deriv = deriv.next)
       FixOffsets(deriv.data);
@@ -5037,7 +5037,7 @@ public dllexport DataMember eClass_AddDataMember(Class _class, char * name, char
 {
    if(_class && name)
    {
-      if(!_class.members.FindString(name)) 
+      if(!_class.members.FindString(name))
       {
          DataMember dataMember;
 
@@ -5048,7 +5048,7 @@ public dllexport DataMember eClass_AddDataMember(Class _class, char * name, char
             if(_class.memberOffset % alignment)
                _class.memberOffset += alignment - (_class.memberOffset % alignment);
          }
-         
+
          dataMember = DataMember {
             name = CopyString(name);
             dataTypeString = CopyString(type);
@@ -5071,7 +5071,7 @@ public dllexport DataMember eClass_AddDataMember(Class _class, char * name, char
 
 public dllexport DataMember eMember_AddDataMember(DataMember member, char * name, char * type, unsigned int size, unsigned int alignment, AccessMode declMode)
 {
-   if(name && !member.membersAlpha.FindString(name)) 
+   if(name && !member.membersAlpha.FindString(name))
    {
       DataMember dataMember;
 
@@ -5115,7 +5115,7 @@ static void SetMemberClass(DataMember member, Class _class)
    DataMember dataMember;
    member._class = _class;
    for(dataMember = member.members.first; dataMember; dataMember = dataMember.next)
-      SetMemberClass(dataMember, _class);      
+      SetMemberClass(dataMember, _class);
 }
 
 public dllexport bool eMember_AddMember(DataMember addTo, DataMember dataMember)
@@ -5184,7 +5184,7 @@ public dllexport bool eClass_AddMember(Class _class, DataMember dataMember)
 
 public dllexport BitMember eClass_AddBitMember(Class _class, char * name, char * type, int bitSize, int bitPos, AccessMode declMode)
 {
-   if(_class && name && !_class.members.FindString(name)) 
+   if(_class && name && !_class.members.FindString(name))
    {
       uint64 mask = 0;
       int c;
@@ -5273,7 +5273,7 @@ static Module Module_Load(Module fromModule, char * name, AccessMode importAcces
    if(ensureCOM && !strcmp(name, "ecere") && module)
    {
       name = !strcmp(module.name, "ecereCOM") ? "ecere" : "ecereCOM";
-      if((!Load && !strcmp(module.name, "ecereCOM")) || 
+      if((!Load && !strcmp(module.name, "ecereCOM")) ||
          (Load && (!__thisModule || !__thisModule.name || !strcmp(__thisModule.name, "ecereCOM")) && Load != COM_LOAD_FUNCTION))
       {
          Module module;
@@ -5392,9 +5392,9 @@ public dllexport void eEnum_AddFixedValue(Class _class, char * string, int value
    {
       EnumClassData data = (EnumClassData)_class.data;
       NamedLink item;
-      
+
       for(item = data.values.first; item; item = item.next)
-         if(!strcmp(item.name, string)) 
+         if(!strcmp(item.name, string))
             break;
       if(!item)
       {
@@ -5413,7 +5413,7 @@ public dllexport int eEnum_AddValue(Class _class, char * string)
       int value = ((int) data.largest) + 1;
       NamedLink item;
       for(item = data.values.first; item; item = item.next)
-         if(!strcmp(item.name, string)) 
+         if(!strcmp(item.name, string))
             break;
       if(!item)
       {
@@ -5504,7 +5504,7 @@ static void Module_Destructor(Module module)
       while((handle = module.modules.last))  // STARTING WITH LAST SO THAT ecereCOM IS UNLOADED LAST...
       {
          Module depModule = handle.module;
-         if(depModule == ourWorld) 
+         if(depModule == ourWorld)
          {
             module.modules.Remove(handle);
             ourHandle = handle;
@@ -5513,7 +5513,7 @@ static void Module_Destructor(Module module)
          {
             module.modules.Delete(handle);
             delete depModule;
-         }         
+         }
       }
       if(ourHandle)
       {
@@ -5639,7 +5639,7 @@ default dllexport char * strupr(char *string)
 public dllexport DefinedExpression eSystem_RegisterDefine(char * name, char * value, Module module, AccessMode declMode)
 {
    NameSpace * nameSpace = null;
-   
+
    int start = 0, c;
 
    nameSpace = (declMode == publicAccess) ? &module.publicNameSpace : &module.privateNameSpace;
@@ -5673,7 +5673,7 @@ public dllexport DefinedExpression eSystem_RegisterDefine(char * name, char * va
                delete spaceName;
             nameSpace = newSpace;
             if(name[c] == ':') c++;
-            start = c+1;         
+            start = c+1;
          }
       }
    }
@@ -5732,7 +5732,7 @@ public dllexport GlobalFunction eSystem_RegisterFunction(char * name, char * typ
                delete spaceName;
             nameSpace = newSpace;
             if(name[c] == ':') c++;
-            start = c+1;         
+            start = c+1;
          }
       }
    }
@@ -5892,7 +5892,7 @@ public dllexport void eProperty_SelfWatch(Class _class, char * name, void (*call
    if(_class)
    {
       Property _property = eClass_FindProperty(_class, name, _class.module);
-      
+
       if(!_property)
          _property = eClass_AddProperty(_class, name, null, null, null, baseSystemAccess /*privateAccess*/);
       _class.selfWatchers.Add(SelfWatcher { _property = _property, callback = callback });
@@ -6031,7 +6031,7 @@ static void LoadCOM(Module module)
    enumClass = eSystem_RegisterClass(normalClass, "enum", null, 0, force64Bits ? 40 : sizeof(class EnumClassData), null, null, module, baseSystemAccess, publicAccess);
    eClass_AddClassProperty(enumClass, "enumSize", "int", null, GetEnumSize).constant = true;
    enumClass.type = systemClass;
-   
+
    delete enumClass.dataTypeString;
    enumClass.dataTypeString = CopyString(/*"unsigned int"*/"int");
 
@@ -6079,7 +6079,7 @@ static void LoadCOM(Module module)
    moduleClass.count++;
    if(inCompiler && force32Bits)
       moduleClass.structSize = 12 + 4 + 20 + 20 + 20 + 20 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + (16 + 4 + 4 + 4*16) + (16 + 4 + 4 + 4*16);
-   
+
    // Create Application class
    applicationClass = eSystem_RegisterClass(normalClass, "ecere::com::Application", "Module", force64Bits ? (8+8+4+4 + 32 + 8 + 176) : sizeof(struct Application), 0, null, (void *)Application_Destructor, module, baseSystemAccess, publicAccess);
    if(inCompiler && force32Bits)
@@ -6250,7 +6250,7 @@ public dllexport ClassTemplateParameter eClass_AddTemplateParameter(Class _class
          type = type;
          (type == identifier) ? info : CopyString(info);
       };
-      if(defaultArg != null) 
+      if(defaultArg != null)
       {
          param.defaultArg = defaultArg;
          CopyTemplateArg(param, param.defaultArg);
@@ -6339,7 +6339,7 @@ public dllexport void eClass_DoneAddingTemplateParameters(Class base)
                }
             }
          }
-      }      
+      }
 
       //ComputeClassParameters(base, null, null);
 
@@ -6385,7 +6385,7 @@ public enum Platform
    {
       get { return OnGetString(null, null, null); }
       set
-      {  
+      {
          if(value)
          {
             Platform c;
@@ -6409,7 +6409,7 @@ public enum Platform
          tempString[0] = '\0';
       return null;
    }
-   
+
    bool OnGetDataFromString(char * string)
    {
       this = string;
@@ -6466,22 +6466,22 @@ public:
 
    // FIX THIS WITH PUBLIC:
    property ClassDesignerBase classDesigner
-   { 
+   {
       get { return classDesigner; }
       set { classDesigner = value; }
    };
    property char * objectClass
-   { 
+   {
       get { return objectClass; }
       set { objectClass = value; }
    };
    property bool isDragging
-   { 
+   {
       get { return isDragging; }
       set { isDragging = value; }
    };
 }
+
 public class ClassDesignerBase : Window
 {
 public:
@@ -6573,9 +6573,9 @@ public bool UTF8Validate(char * source)
          }
          if(i < numBytes) return false;
 
-         if(codePoint > 0x10FFFF || (codePoint >= 0xD800 && codePoint <= 0xDFFF) || 
-           (codePoint < 0x80 && numBytes > 1) || 
-           (codePoint < 0x800 && numBytes > 2) || 
+         if(codePoint > 0x10FFFF || (codePoint >= 0xD800 && codePoint <= 0xDFFF) ||
+           (codePoint < 0x80 && numBytes > 1) ||
+           (codePoint < 0x800 && numBytes > 2) ||
            (codePoint < 0x10000 && numBytes > 3))
             return false;
       }
@@ -6645,12 +6645,12 @@ public char * UTF16toUTF8(uint16 * source)
          continue;
       }
       if(invert) { u16 = ((u16 & 0xFF00) >> 8) | ((u16 & 0x00FF) << 8); }
-      
+
       if(u16 < 0xD800 || u16 > 0xDBFF)
-         ch = (unichar)u16;         
+         ch = (unichar)u16;
       else
          ch = ((unichar)u16 << 10) + source[c++] + SURROGATE_OFFSET;
-                  
+
       if(ch < 0x80)
       {
          dest[d++] = (char)ch;
@@ -6688,7 +6688,7 @@ public int UTF16toUTF8Buffer(uint16 * source, byte * dest, int max)
    {
       unichar ch;
       if(u16 < 0xD800 || u16 > 0xDBFF)
-         ch = (unichar)u16;         
+         ch = (unichar)u16;
       else
          ch = ((unichar)u16 << 10) + source[c++] + SURROGATE_OFFSET;
 
@@ -6765,10 +6765,10 @@ public unichar UTF8GetChar(char * string, int * numBytes)
       }
    }
 
-   if(i < nb || 
-      ch > 0x10FFFF || (ch >= 0xD800 && ch <= 0xDFFF) || 
-     (ch < 0x80 && nb > 1) || 
-     (ch < 0x800 && nb > 2) || 
+   if(i < nb ||
+      ch > 0x10FFFF || (ch >= 0xD800 && ch <= 0xDFFF) ||
+     (ch < 0x80 && nb > 1) ||
+     (ch < 0x800 && nb > 2) ||
      (ch < 0x10000 && nb > 3))
    {
       ch = 0;
@@ -6830,7 +6830,7 @@ public int UTF8toUTF16Buffer(char * source, uint16 * dest, int max)
       dest[d] = 0;
       return d;
    }
-   return 0;   
+   return 0;
 }
 
 public int UTF32toUTF8Len(unichar * source, int count, byte * dest, int max)
index 1fc32e6..7622986 100644 (file)
@@ -78,7 +78,7 @@ public:
          // Compute Clipping Planes
          {
             Vector3D normal, point = {0,0,0};
-         
+
             // --- Left ---
             quat.Yaw(fovLeft - Pi/2);
             quat.ToDirection(normal);
@@ -133,7 +133,7 @@ public:
    void AdjustAngle(Quaternion angle)
    {
       cAngle = angle;
-      
+
       inverseMatrix.RotationQuaternion(angle);
       viewMatrix.Transpose(inverseMatrix);
 
@@ -196,7 +196,7 @@ public:
                      toAngle = euler;
                   }
                   else if(type == attachedQuaternion)*/
-                     toAngle.Multiply(orientation, target->orientation); 
+                     toAngle.Multiply(orientation, target->orientation);
                }
                else
                   toAngle = orientation;
@@ -239,7 +239,7 @@ public:
             }
          }
 
-         if(cAngle.w != toAngle.w || cAngle.x != toAngle.x || 
+         if(cAngle.w != toAngle.w || cAngle.x != toAngle.x ||
             cAngle.y != toAngle.y || cAngle.z != toAngle.z ||
             needUpdate)
          {
@@ -298,8 +298,8 @@ public:
          Plane * plane = &worldClippingPlanes[p];
          for(c = 0; c<numPoints; c++)
          {
-            double dot = 
-               plane->a * points[c].x + 
+            double dot =
+               plane->a * points[c].x +
                plane->b * points[c].y +
                plane->c * points[c].z;
             if(dot + plane->d > 0)
@@ -314,9 +314,9 @@ public:
          plane = &worldClippingPlanes[p+1];
          for(c = 0; c<numPoints; c++)
          {
-            double dot = 
-               plane->a * points[c].x + 
-               plane->b * points[c].y + 
+            double dot =
+               plane->a * points[c].x +
+               plane->b * points[c].y +
                plane->c * points[c].z;
             if(dot + plane->d > 0)
             {
@@ -349,14 +349,14 @@ public:
       for(c = 0; c<numPoints; c++)
          points[c] = origPoints[c];
 
-      for(p = 0; p < 6; p++) 
+      for(p = 0; p < 6; p++)
       {
          Plane * plane = &planes[p];
          int i;
          int numGoodPoints = 0;
+
          memset(goodPoints, 0, n);
-             for(i = 0; i < n; i++) 
+             for(i = 0; i < n; i++)
          {
             double dot = plane->normal.DotProduct(points[i]);
             double distance = dot + plane->d;
@@ -371,7 +371,7 @@ public:
             outside = true;
             break;
          }
-         
+
          if(numGoodPoints < n)
          {
             // Clip the polygon
@@ -388,7 +388,7 @@ public:
                }
                else
                {
-                  Line edge; 
+                  Line edge;
                   int next;
 
                   if(lastGood == -1)
@@ -461,7 +461,7 @@ public:
          {
             euler.pitch = Min(euler.pitch, max);
             euler.pitch = Max(euler.pitch, min);
-         } 
+         }
          orientation = euler;
       }
    }
@@ -480,7 +480,7 @@ public:
          {
             euler.yaw = Min(euler.yaw, max);
             euler.yaw = Max(euler.yaw, min);
-         } 
+         }
          orientation = euler;
       }
    }
@@ -499,7 +499,7 @@ public:
          {
             euler.roll = Min(euler.roll, max);
             euler.roll = Max(euler.roll, min);
-         } 
+         }
          orientation = euler;
       }
    }
@@ -546,7 +546,7 @@ public:
          floatZ = ((((float)zMax * (float)zMin / -(float)vector.z) + (float)zMax) / ((float)zMax - (float)zMin));
          point.x += origin.x;
          point.y += origin.y;
-         return (point.x >= 0 && point.y >= 0 && 
+         return (point.x >= 0 && point.y >= 0 &&
                  point.x < width && point.y < height);
       }
       return false;
index 055b3c5..8663e55 100644 (file)
@@ -73,7 +73,7 @@ public union Matrix
       double xy = quat.x*quat.y, xz = quat.x*quat.z, yz = quat.y*quat.z;
       double wx = quat.w*quat.x, wy = quat.w*quat.y, wz = quat.w*quat.z;
 
-      m[0][0] = (double) (1 - 2 * ( yy + zz )); 
+      m[0][0] = (double) (1 - 2 * ( yy + zz ));
       m[0][1] = (double) (    2 * ( xy - wz ));
       m[0][2] = (double) (    2 * ( xz + wy ));
 
@@ -131,9 +131,9 @@ public union Matrix
          double msub3[3][3];
          int di, dj;
 
-         for(di = 0; di < 3; di++) 
+         for(di = 0; di < 3; di++)
          {
-            for(dj = 0; dj < 3; dj++) 
+            for(dj = 0; dj < 3; dj++)
             {
                int si = di + ( ( di >= 0 ) ? 1 : 0 );
                int sj = dj + ( ( dj >= n ) ? 1 : 0 );
@@ -157,7 +157,7 @@ public union Matrix
          Identity();
       else
       {
-         int i, j, sign;   
+         int i, j, sign;
          for ( i = 0; i < 4; i++ )
             for ( j = 0; j < 4; j++ )
             {
@@ -167,9 +167,9 @@ public union Matrix
 
                sign = 1 - ( (i+j) % 2 ) * 2;
 
-               for(di = 0; di < 3; di++) 
+               for(di = 0; di < 3; di++)
                {
-                  for(dj = 0; dj < 3; dj++) 
+                  for(dj = 0; dj < 3; dj++)
                   {
                      int si = di + ( ( di >= i ) ? 1 : 0 );
                      int sj = dj + ( ( dj >= j ) ? 1 : 0 );
index db4988a..1bedb5f 100644 (file)
@@ -51,7 +51,7 @@ public:
    Material material;
 private:
    void * data;
-};   
+};
 
 public struct PrimitiveSingle
 {
@@ -319,10 +319,10 @@ public:
 
                if(group.type.primitiveType == triFan)
                {
-                  plane.FromPointsf(vertices[group.indices[0]], 
-                                   vertices[group.indices[c]], 
+                  plane.FromPointsf(vertices[group.indices[0]],
+                                   vertices[group.indices[c]],
                                    vertices[group.indices[c-1]]);
-                  planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z }; 
+                  planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z };
 
                   normals[group.indices[0]].Add(normals[group.indices[0]], planeNormal);
                   numShared[group.indices[0]]++;
@@ -333,10 +333,10 @@ public:
                }
                else if(group.type.primitiveType == triStrip || group.type.primitiveType == quadStrip)
                {
-                  plane.FromPointsf(vertices[group.indices[c-1-strip]], 
-                                   vertices[group.indices[c-2+strip]], 
+                  plane.FromPointsf(vertices[group.indices[c-1-strip]],
+                                   vertices[group.indices[c-2+strip]],
                                    vertices[group.indices[c]]);
-                  planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z }; 
+                  planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z };
 
                   normals[group.indices[c-1-strip]].Add(normals[group.indices[c-1-strip]], planeNormal);
                   numShared[group.indices[c-1-strip]]++;
@@ -351,10 +351,10 @@ public:
                {
                   if(group.type.vertexRange)
                   {
-                     plane.FromPointsf(vertices[c+2], 
-                                      vertices[c+1], 
+                     plane.FromPointsf(vertices[c+2],
+                                      vertices[c+1],
                                       vertices[c]);
-                     planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z }; 
+                     planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z };
 
                      for(i = c; i<c+nIndex; i++)
                      {
@@ -364,10 +364,10 @@ public:
                   }
                   else
                   {
-                     plane.FromPointsf(vertices[i32bit ? indices32[c+2] : indices16[c+2]], 
-                                      vertices[i32bit ? indices32[c+1] : indices16[c+1]], 
+                     plane.FromPointsf(vertices[i32bit ? indices32[c+2] : indices16[c+2]],
+                                      vertices[i32bit ? indices32[c+1] : indices16[c+1]],
                                       vertices[i32bit ? indices32[c] : indices16[c]]);
-                     planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z }; 
+                     planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z };
 
                      for(i = c; i<c+nIndex; i++)
                      {
@@ -387,10 +387,10 @@ public:
 
             Plane plane;
             Vector3Df planeNormal;
-            plane.FromPointsf(vertices[primitive->indices[2]], 
-                             vertices[primitive->indices[1]], 
+            plane.FromPointsf(vertices[primitive->indices[2]],
+                             vertices[primitive->indices[1]],
                              vertices[primitive->indices[0]]);
-            planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z }; 
+            planeNormal = { (float) plane.normal.x, (float) plane.normal.y, (float) plane.normal.z };
 
             if(primitive->material.flags.doubleSided && plane.d < 0)
             {
index 6a10e61..268bf2d 100644 (file)
@@ -31,13 +31,13 @@ public struct Transform
    Vector3Df scaling;
 };
 
-/*static float ease(float t, float a, float b) 
+/*static float ease(float t, float a, float b)
 {
    float k;
    float s = a + b;
 
    if (s == 0.0f) return t;
-   if (s > 1.0f) 
+   if (s > 1.0f)
    {
       a /= s;
       b /= s;
@@ -108,18 +108,18 @@ public class FrameTrack : struct
          value = pn;
       else
       {
-         if(n == 0) 
+         if(n == 0)
          {
             kn1 = &keys[1];
             pn1 = kn1->roll;
 
-            if(numKeys == 2) 
+            if(numKeys == 2)
             {
                value = pn1 - pn;
                value *= 1.0f - kn->tension;
                return value;
             }
-            if(type.loop) 
+            if(type.loop)
             {
                kn_1 = &keys[numKeys-2];
                d1 = keys[numKeys-1].frame - kn_1->frame;
@@ -139,24 +139,24 @@ public class FrameTrack : struct
                return value;
             }
          }
-         else if(n == numKeys-1) 
+         else if(n == numKeys-1)
          {
             kn_1 = &keys[n-1];
             pn_1 = kn_1->roll;
 
-            if(numKeys == 2) 
+            if(numKeys == 2)
             {
                value = pn - pn_1;
                value *= 1.0f - kn->tension;
                return value;
             }
-            if(type.loop) 
+            if(type.loop)
             {
                kn1 = &keys[1];
                d1 = kn->frame - kn_1->frame;
                d2 = kn1->frame - keys[0].frame;
-            } 
-            else 
+            }
+            else
             {
                float bn_1;
                value = pn - pn_1;
@@ -169,8 +169,8 @@ public class FrameTrack : struct
                value *= 1.0f - kn->tension;
                return value;
             }
-         } 
-         else 
+         }
+         else
          {
             kn_1 = &keys[n-1];
             kn1 = &keys[n+1];
@@ -188,8 +188,8 @@ public class FrameTrack : struct
             {
                C = kn->continuity;
                adjust = (float)d1;
-            } 
-            else 
+            }
+            else
             {
                C = -kn->continuity;
                adjust = (float)d2;
@@ -223,18 +223,18 @@ public class FrameTrack : struct
          vector = *pn;
       else
       {
-         if(n == 0) 
+         if(n == 0)
          {
             kn1 = &keys[1];
             pn1 = &kn1->position;
 
-            if(numKeys == 2) 
+            if(numKeys == 2)
             {
                vector.Subtract(pn1, pn);
                vector.Scale(vector, 1.0f - kn->tension);
                return;
             }
-            if(type.loop) 
+            if(type.loop)
             {
                kn_1 = &keys[numKeys-2];
                d1 = keys[numKeys-1].frame - kn_1->frame;
@@ -254,24 +254,24 @@ public class FrameTrack : struct
                return;
             }
          }
-         else if(n == numKeys-1) 
+         else if(n == numKeys-1)
          {
             kn_1 = &keys[n-1];
             pn_1 = &kn_1->position;
 
-            if(numKeys == 2) 
+            if(numKeys == 2)
             {
                vector.Subtract(pn, pn_1);
                vector.Scale(vector, 1.0f - kn->tension);
                return;
             }
-            if(type.loop) 
+            if(type.loop)
             {
                kn1 = &keys[1];
                d1 = kn->frame - kn_1->frame;
                d2 = kn1->frame - keys[0].frame;
-            } 
-            else 
+            }
+            else
             {
                Vector3Df bn_1;
                vector.Subtract(pn, pn_1);
@@ -284,8 +284,8 @@ public class FrameTrack : struct
                vector.Scale(vector, 1.0f - kn->tension);
                return;
             }
-         } 
-         else 
+         }
+         else
          {
             kn_1 = &keys[n-1];
             kn1 = &keys[n+1];
@@ -303,8 +303,8 @@ public class FrameTrack : struct
             {
                C = kn->continuity;
                adjust = (float)d1;
-            } 
-            else 
+            }
+            else
             {
                C = -kn->continuity;
                adjust = (float)d2;
@@ -337,41 +337,41 @@ public class FrameTrack : struct
          quat = *qn;
       else
       {
-         if(n == 0) 
+         if(n == 0)
          {
             kn1 = &keys[1];
 
-            if (!(type.loop) || numKeys <= 2) 
+            if (!(type.loop) || numKeys <= 2)
             {
                qn1 = &kn1->orientation;
                quat.Slerp(qn, qn1, (1.0f - kn->tension)*(1.0f + kn->continuity*kn->bias)/3.0f);
                return;
-            } 
-            else 
+            }
+            else
             {
                kn_1= &keys[numKeys-2];
                d1 = keys[numKeys-1].frame - kn_1->frame;
                d2 = kn1->frame - kn->frame;
             }
-         } 
-         else if (n == numKeys-1) 
+         }
+         else if (n == numKeys-1)
          {
             kn_1 = &keys[n-1];
 
-            if (!(type.loop) || numKeys <= 2) 
+            if (!(type.loop) || numKeys <= 2)
             {
                qn_1 = &kn_1->orientation;
                quat.Slerp(qn, qn_1, (1.0f - kn->tension)*(1.0f - kn->continuity*kn->bias)/3.0f);
                return;
-            } 
-            else 
+            }
+            else
             {
                kn1 = &keys[1];
                d1 = kn->frame - kn_1->frame;
                d2 = kn1->frame - keys[0].frame;
             }
-         } 
-         else 
+         }
+         else
          {
             kn_1 = &keys[n-1];
             kn1 = &keys[n+1];
@@ -385,12 +385,12 @@ public class FrameTrack : struct
             qn_1 = &kn_1->orientation;
             qn1 = &kn1->orientation;
 
-            if (what == splineA) 
+            if (what == splineA)
             {
                f = 1.0f;
                adjust = (float)d1;
             }
-            else 
+            else
             {
                f = -1.0f;
                adjust = (float)d2;
@@ -644,7 +644,7 @@ public:
          }
 
          tracks.Free(FrameTrack::Free);
-         
+
          delete name;
       }
    }
@@ -656,7 +656,7 @@ public:
       OldLink link;
       bool result = false;
 
-      if(!type && fileName) 
+      if(!type && fileName)
       {
          type = GetExtension(fileName, ext);
          strlwr(type);
@@ -704,7 +704,7 @@ public:
             for(child = children.first; child; child = child.next)
             {
                Object result = child.Find(name);
-               if(result) 
+               if(result)
                   return result;
             }
          }
@@ -729,7 +729,7 @@ public:
       if(this)
       {
          flags.mesh = true;
-         if(!mesh) 
+         if(!mesh)
          {
             mesh = Mesh { };
             flags.ownMesh = true;
@@ -812,7 +812,7 @@ public:
                for(c = 0; c<objectMesh.nVertices; c++)
                {
                   mesh.vertices[nVertices] = objectMesh.vertices[c];
-                  
+
                   if(objectMesh.normals)
                      mesh.normals[nVertices] = objectMesh.normals[c];
                   if(objectMesh.texCoords)
@@ -848,14 +848,14 @@ public:
                }
             }
 
-            // Merge Indexed Primitive Groups 
+            // Merge Indexed Primitive Groups
             while(true)
             {
                int nIndices = 0;
                PrimitiveGroupType type;
                Material material = null;
                bool foundGroup = false;
-            
+
                // Find first group type/material to process and determine how many indices are required
                if(objectMesh)
                {
@@ -908,7 +908,7 @@ public:
                      nIndices = 0;
 
                      vertexOffset = 0;
-                     
+
                      if(objectMesh)
                      {
                         for(group = objectMesh.groups.first; group; group = group.next)
@@ -929,7 +929,7 @@ public:
                         {
                            for(group = child.mesh.groups.first; group; group = group.next)
                            {
-                              if(newGroup.material == (group.material ? group.material : child.material) && 
+                              if(newGroup.material == (group.material ? group.material : child.material) &&
                                  newGroup.type == group.type)
                               {
                                  int c;
@@ -944,12 +944,12 @@ public:
                   }
                }
                else
-                  break;                         
+                  break;
             }
 
-            // Merge Non-Indexed Primitive Groups 
+            // Merge Non-Indexed Primitive Groups
             vertexOffset = 0;
-            
+
             if(objectMesh)
             {
                for(group = objectMesh.groups.first; group; group = group.next)
@@ -988,11 +988,11 @@ public:
                   vertexOffset += child.mesh.nVertices;
                }
             }
-            
+
             // Merge Triangles
             if(objectMesh)
                nTriangles = objectMesh.nPrimitives;
-            
+
             for(child = children.first; child; child = child.next)
             {
                if(child.mesh)
@@ -1007,14 +1007,14 @@ public:
                {
                   int i;
                   PrimitiveSingle * triangle = &mesh.primitives[mesh.nPrimitives++];
-                  
+
                   mesh.AllocatePrimitive(triangle, objectMesh.primitives[c].type, objectMesh.primitives[c].nIndices);
                   triangle->material = objectMesh.primitives[c].material;
                   triangle->middle = objectMesh.primitives[c].middle;
                   triangle->plane = objectMesh.primitives[c].plane;
 
                   memcpy(triangle->indices, objectMesh.primitives[c].indices, objectMesh.primitives[c].nIndices * sizeof(uint16));
-                  
+
                   /*
                   *triangle = objectMesh.primitives[c];
                   objectMesh.primitives[c].indices = null;
@@ -1148,7 +1148,7 @@ public:
    bool IntersectsGroundPolygon(int count, Pointf * pointfs)
    {
       bool result = false;
-   
+
       Pointf * p1;
       Pointf * p2;
       double minX = wmin.x, maxX = wmax.x;
@@ -1191,7 +1191,7 @@ public:
             else
             {
                float a, b, dy, dx;
-               
+
                a = p2->y - p1->y;
                b = p1->x - p2->x;
                dy =  a;
@@ -1200,7 +1200,7 @@ public:
                if (a < 0) a = -a;
                if (b < 0) b = -b;
                if (d < 0) d = -d;
-               
+
                if(d < a * delta)
                   return true;
                else if (d < b * delta)
@@ -1208,7 +1208,7 @@ public:
                else if( ( (p1->y <= y) && (p2->y >  y) ) || ( (p1->y >  y) && (p2->y <= y) ) )
                {
                   double xdy;
-                  
+
                   xdy = (dx * (y - p1->y)) + (dy * p1->x);
                   if(dy < 0)
                   {
@@ -1347,7 +1347,7 @@ private:
       for(track = tracks.first; track; track = track.next)
       {
          unsigned int c;
-      
+
          if(track.numKeys)
          {
             unsigned int prev = 0, next = track.numKeys - 1;
@@ -1366,7 +1366,7 @@ private:
 
             switch(track.type.type)
             {
-               case position: 
+               case position:
                {
                   Vector3Df position;
                   track.Interpolate(position, prevKey->position, nextKey->position, prev, next, t);
@@ -1396,7 +1396,7 @@ private:
                // Lights
                case colorChange:
                {
-                  track.Interpolate((Vector3Df *)&light.diffuse, 
+                  track.Interpolate((Vector3Df *)&light.diffuse,
                      (Vector3Df *)&prevKey->color, (Vector3Df *)&nextKey->color, prev, next, t);
                   light.specular = light.diffuse;
                   break;
@@ -1457,12 +1457,12 @@ private:
             { wmax.x, wmax.y, wmax.z }
          };
           int numPlanesAllIn = 0;
-          for(p = 0; p < 6; p++) 
+         for(p = 0; p < 6; p++)
          {
             Plane * plane = &planes[p];
             int i;
             int numGoodPoints = 0;
-                  for(i = 0; i < 8; ++i) 
+            for(i = 0; i < 8; ++i)
             {
                double dot = plane->normal.DotProduct(box[i]);
                double distance = dot + plane->d;
index dc400aa..f7a8fc6 100644 (file)
@@ -46,21 +46,21 @@ public struct Plane
 
    void MultMatrix(Plane source, Matrix inverseTranspose)
    {
-      a = source.a * inverseTranspose.m[0][0] + 
+      a = source.a * inverseTranspose.m[0][0] +
           source.b * inverseTranspose.m[1][0] +
-          source.c * inverseTranspose.m[2][0] + 
+          source.c * inverseTranspose.m[2][0] +
           source.d * inverseTranspose.m[3][0];
-      b = source.a * inverseTranspose.m[0][1] + 
+      b = source.a * inverseTranspose.m[0][1] +
           source.b * inverseTranspose.m[1][1] +
-          source.c * inverseTranspose.m[2][1] + 
+          source.c * inverseTranspose.m[2][1] +
           source.d * inverseTranspose.m[3][1];
-      c = source.a * inverseTranspose.m[0][2] + 
+      c = source.a * inverseTranspose.m[0][2] +
           source.b * inverseTranspose.m[1][2] +
-          source.c * inverseTranspose.m[2][2] + 
+          source.c * inverseTranspose.m[2][2] +
           source.d * inverseTranspose.m[3][2];
-      d = source.a * inverseTranspose.m[0][3] + 
+      d = source.a * inverseTranspose.m[0][3] +
           source.b * inverseTranspose.m[1][3] +
-          source.c * inverseTranspose.m[2][3] + 
+          source.c * inverseTranspose.m[2][3] +
           source.d * inverseTranspose.m[3][3];
    }
 
@@ -68,15 +68,15 @@ public struct Plane
    {
       double divisor = a * line.delta.x + b * line.delta.y + c * line.delta.z;
 
-      result.x = (b * line.delta.y * line.p0.x - b * line.delta.x * line.p0.y + 
+      result.x = (b * line.delta.y * line.p0.x - b * line.delta.x * line.p0.y +
                   c * line.delta.z * line.p0.x - c * line.delta.x * line.p0.z -
                   d * line.delta.x ) / divisor;
 
-      result.y = (a * line.delta.x * line.p0.y - a * line.delta.y * line.p0.x + 
-                  c * line.delta.z * line.p0.y - c * line.delta.y * line.p0.z - 
+      result.y = (a * line.delta.x * line.p0.y - a * line.delta.y * line.p0.x +
+                  c * line.delta.z * line.p0.y - c * line.delta.y * line.p0.z -
                   d * line.delta.y ) / divisor;
 
-      result.z = (a * line.delta.x * line.p0.z - a * line.delta.z * line.p0.x + 
+      result.z = (a * line.delta.x * line.p0.z - a * line.delta.z * line.p0.x +
                   b * line.delta.y * line.p0.z - b * line.delta.z * line.p0.y -
                   d * line.delta.z ) / divisor;
    }
@@ -85,15 +85,15 @@ public struct Plane
    {
       double divisor = a * line.delta.x + b * line.delta.y + c * line.delta.z;
 
-      result.x = (float)((b * line.delta.y * line.p0.x - b * line.delta.x * line.p0.y + 
+      result.x = (float)((b * line.delta.y * line.p0.x - b * line.delta.x * line.p0.y +
                   c * line.delta.z * line.p0.x - c * line.delta.x * line.p0.z -
                   d * line.delta.x ) / divisor);
 
-      result.y = (float)((a * line.delta.x * line.p0.y - a * line.delta.y * line.p0.x + 
-                  c * line.delta.z * line.p0.y - c * line.delta.y * line.p0.z - 
+      result.y = (float)((a * line.delta.x * line.p0.y - a * line.delta.y * line.p0.x +
+                  c * line.delta.z * line.p0.y - c * line.delta.y * line.p0.z -
                   d * line.delta.y ) / divisor);
 
-      result.z = (float)((a * line.delta.x * line.p0.z - a * line.delta.z * line.p0.x + 
+      result.z = (float)((a * line.delta.x * line.p0.z - a * line.delta.z * line.p0.x +
                   b * line.delta.y * line.p0.z - b * line.delta.z * line.p0.y -
                   d * line.delta.z ) / divisor);
    }
index d5db04f..80a2d57 100644 (file)
@@ -188,13 +188,13 @@ public struct Quaternion
 
       if ( cosom < 0.0 )
       {
-         cosom = -cosom; 
+         cosom = -cosom;
          to1[0] = -to.x;
          to1[1] = -to.y;
          to1[2] = -to.z;
          to1[3] = -to.w;
-      } 
-      else  
+      }
+      else
       {
          to1[0] = to.x;
          to1[1] = to.y;
@@ -202,16 +202,16 @@ public struct Quaternion
          to1[3] = to.w;
       }
 
-      if ( (1.0 - cosom) > DELTA ) 
+      if ( (1.0 - cosom) > DELTA )
       {
          omega = acos(cosom);
          sinom = sin(omega);
          scale0 = sin((1.0 - t) * omega) / sinom;
          scale1 = sin(t * omega) / sinom;
 
-      } 
-      else 
-      {        
+      }
+      else
+      {
          scale0 = 1.0 - t;
          scale1 = t;
       }
index 60822c7..d051507 100644 (file)
@@ -82,19 +82,19 @@ public struct Vector3D
       }, { sourceX, sourceY, sourceZ });
       */
 
-      double var1 = 
+      double var1 =
          matrix.m[2][0] * matrix.m[0][2] * matrix.m[1][1]
        - matrix.m[0][2] * matrix.m[2][1] * matrix.m[1][0]
        - matrix.m[2][2] * matrix.m[0][0] * matrix.m[1][1]
        - matrix.m[0][2] * matrix.m[0][1] * matrix.m[1][0]
        + matrix.m[2][1] * matrix.m[0][0] * matrix.m[1][2]
        + matrix.m[0][1] * matrix.m[0][0] * matrix.m[1][2];
-      
+
       x = (
          - matrix.m[2][2] * source.x * matrix.m[1][1]
          + matrix.m[2][2] * matrix.m[1][0] * source.y
          - matrix.m[2][2] * matrix.m[1][0] * matrix.m[3][1]
-         + matrix.m[2][2] * matrix.m[3][0] * matrix.m[1][1] 
+         + matrix.m[2][2] * matrix.m[3][0] * matrix.m[1][1]
          - matrix.m[2][0] * matrix.m[3][2] * matrix.m[1][1]
          + source.x * matrix.m[2][1] * matrix.m[1][2]
          + source.x * matrix.m[0][1] * matrix.m[1][2]
@@ -140,7 +140,7 @@ public struct Vector3D
    property double lengthApprox
    {
       get
-      { 
+      {
          double ix = Abs(x), iy = Abs(y), iz = Abs(z);
          double tmp;
          if(ix < iy) { tmp = ix; ix = iy; iy = tmp; }
@@ -154,7 +154,7 @@ public struct Vector3D
 public struct Vector3Df
 {
    float x, y, z;
-   
+
    void Add(Vector3Df vector1, Vector3Df vector2)
    {
       x = vector1.x + vector2.x;
@@ -226,12 +226,12 @@ public struct Vector3Df
        - matrix.m[0][2] * matrix.m[0][1] * matrix.m[1][0]
        + matrix.m[2][1] * matrix.m[0][0] * matrix.m[1][2]
        + matrix.m[0][1] * matrix.m[0][0] * matrix.m[1][2]);
-      
+
       x = (float)(
          - matrix.m[2][2] * source.x * matrix.m[1][1]
          + matrix.m[2][2] * matrix.m[1][0] * source.y
          - matrix.m[2][2] * matrix.m[1][0] * matrix.m[3][1]
-         + matrix.m[2][2] * matrix.m[3][0] * matrix.m[1][1] 
+         + matrix.m[2][2] * matrix.m[3][0] * matrix.m[1][1]
          - matrix.m[2][0] * matrix.m[3][2] * matrix.m[1][1]
          + source.x * matrix.m[2][1] * matrix.m[1][2]
          + source.x * matrix.m[0][1] * matrix.m[1][2]
@@ -245,7 +245,7 @@ public struct Vector3Df
          + matrix.m[2][0] * source.z * matrix.m[1][1]
          - matrix.m[3][0] * matrix.m[0][1] * matrix.m[1][2]
          ) / var1;
-      
+
       y = - (float)(
          - matrix.m[2][0] * matrix.m[0][2] * source.y
          + matrix.m[2][1] * matrix.m[0][0] * matrix.m[3][2]
@@ -277,7 +277,7 @@ public struct Vector3Df
    property float lengthApprox
    {
       get
-      { 
+      {
          float ix = Abs(x), iy = Abs(y), iz = Abs(z);
          float tmp;
          if(ix < iy) { tmp = ix; ix = iy; iy = tmp; }
index 6901fc5..4f898fd 100644 (file)
@@ -5,7 +5,7 @@ namespace gfx3D::meshes;
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    cube.ec - Translucent Cube 3D Model
 ****************************************************************************/
 import "Display"
@@ -65,11 +65,11 @@ public:
                uint16 indices[6][4] =
                {
                   // up, front, down, back, right, left
-                  { 17,21,20,16 }, 
-                  { 0,3,2,1 }, 
-                  { 22,18,19,23 }, 
-                  { 5,6,7,4 }, 
-                  { 9,10,14,13 }, 
+                  { 17,21,20,16 },
+                  { 0,3,2,1 },
+                  { 22,18,19,23 },
+                  { 5,6,7,4 },
+                  { 9,10,14,13 },
                   { 12,15,11,8 }
                };
 
index 60828db..239d30c 100644 (file)
@@ -5,7 +5,7 @@ namespace gfx3D::meshes;
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    skybox.ec - SkyBox 3D Model
 ****************************************************************************/
 import "Display"
@@ -69,16 +69,16 @@ public:
                // up, front, down, back, right, left
                /*
                { 20,21,16,17 },
-               { 7,6,4,5 }, 
-               { 19,18,23,22 }, 
-               { 2,3,1,0 }, 
+               { 7,6,4,5 },
+               { 19,18,23,22 },
+               { 2,3,1,0 },
                { 14,10,13,9 },
                { 11,15,8,12 }
                */
                { 20,21,17,16 },
-               { 7,6,5,4 }, 
-               { 19,18,22,23 }, 
-               { 2,3,0,1 }, 
+               { 7,6,5,4 },
+               { 19,18,22,23 },
+               { 2,3,0,1 },
                { 14,10,9,13 },
                { 11,15,12,8 }
             };
@@ -139,7 +139,7 @@ public:
             Quaternion iquat;
             iquat.Inverse(camera.cOrientation);
             transform.orientation = iquat;
-         }         
+         }
 
          UpdateTransform();
          display.DrawObject(this);
@@ -158,7 +158,7 @@ private:
    {
       size = { 10000,10000,10000 };
       folder = ":skycube";
-      extension = "pcx";   
+      extension = "pcx";
    }
 
    Vector3Df size;
index 196fd9e..d80a60d 100644 (file)
@@ -32,7 +32,7 @@ public:
                   for(lon = 0; lon < numLon; lon++)
                   {
                      Angle theta, omega, cosOmega;
-                     
+
                      theta = lon * 2 * Pi / (numLon - 1);
 
                      omega = (lat + 1) * Pi / (numLat - 1) - Pi / 2;
@@ -82,7 +82,7 @@ public:
                   pVertices[index].y = (float)  sin(omega);
                   pVertices[index].z = (float) (cos(theta) * cos(omega));
                   pNormals[index] = pVertices[index];
-                  
+
                   omega = (numLat - 2) * Pi / (numLat - 1) - Pi / 2;
                   cosOmega = cos(omega);
                   index += numLon+2;
index 801596e..76b1d2f 100644 (file)
@@ -27,8 +27,8 @@ import "Object"
 #define TRI_VERTEXL           0x4110
 #define TRI_FACEL1            0x4120
 #define TRI_MATERIAL          0x4130
-#define TRI_MAPPINGCOORS      0x4140 
-#define TRI_SMOOTHING         0x4150 
+#define TRI_MAPPINGCOORS      0x4140
+#define TRI_SMOOTHING         0x4150
 #define TRI_LOCAL             0x4160
 
 // Light Chunks
@@ -180,7 +180,7 @@ static bool ReadChunks(bool (* chunkParser)(FileInfo * info, void * data), FileI
       info->f.Seek(info->pos, start);
       childInfo.chunkId = ReadWORD(info->f);
       length = ReadDWORD(info->f);
-       
+
       childInfo.pos += sizeof(uint16) + sizeof(uint);
       childInfo.end = info->pos + length;
 
@@ -249,7 +249,7 @@ static void ComputeNormals(Mesh mesh, FileInfo * info, Object object)
    int * numShared;
 
    VertexConfigList * configLists = new0 VertexConfigList[nVertices];
-   
+
    nNewVertices = nVertices;
    for(c = 0; c<info->nFaces; c++)
    {
@@ -262,7 +262,7 @@ static void ComputeNormals(Mesh mesh, FileInfo * info, Object object)
          int v;
          VertexConfigList * configList = &configLists[index];
          VertexConfig * config = null;
-         for(v = 0; v<configList->numConfig; v++) 
+         for(v = 0; v<configList->numConfig; v++)
          {
             uint smoothGroups = configList->config[v].smoothGroups;
             if(smoothGroups == face->smoothGroups)
@@ -294,7 +294,7 @@ static void ComputeNormals(Mesh mesh, FileInfo * info, Object object)
                configList->config = renew configList->config VertexConfig[configList->numConfig + 1];
                config = &configList->config[configList->numConfig++];
                config->index = index;
-               config->smoothGroups = face->smoothGroups;                  
+               config->smoothGroups = face->smoothGroups;
             }
          }
          else
@@ -344,7 +344,7 @@ static void ComputeNormals(Mesh mesh, FileInfo * info, Object object)
             *normal = { 0,0,0 };
          }
       }
-      
+
       delete oldVertices;
       delete oldTexCoords;
    }
@@ -357,8 +357,8 @@ static void ComputeNormals(Mesh mesh, FileInfo * info, Object object)
       int i;
       Plane plane;
       Vector3Df planeNormal;
-      plane.FromPointsf(mesh.vertices[face->oldIndices[2]], 
-                       mesh.vertices[face->oldIndices[1]], 
+      plane.FromPointsf(mesh.vertices[face->oldIndices[2]],
+                       mesh.vertices[face->oldIndices[1]],
                        mesh.vertices[face->oldIndices[0]]);
       planeNormal = { (float)plane.normal.x, (float)plane.normal.y, (float)plane.normal.z };
       if(face->smoothGroups)
@@ -447,7 +447,7 @@ static bool ReadFacesListChunks(FileInfo * info, Object object)
             {
                int c;
                uint16 count = ReadWORD(info->f);
-               mesh.primitives = renew mesh.primitives PrimitiveSingle[mesh.nPrimitives + count]; 
+               mesh.primitives = renew mesh.primitives PrimitiveSingle[mesh.nPrimitives + count];
                for(c = 0; c<count; c++)
                {
                   uint16 face = ReadWORD(info->f);
@@ -473,7 +473,7 @@ static bool ReadFacesListChunks(FileInfo * info, Object object)
 
                   triangle->material = mat;
 
-                  info->faces[face].done = (byte)bool::true;                  
+                  info->faces[face].done = (byte)bool::true;
                }
                object.flags.translucent = true;
             }
@@ -501,7 +501,7 @@ static bool ReadFacesListChunks(FileInfo * info, Object object)
                         group.indices[c*3+1] = info->faces[face].indices[1];
                         group.indices[c*3+2] = info->faces[face].indices[2];
                      }
-                     info->faces[face].done = (byte)bool::true;   
+                     info->faces[face].done = (byte)bool::true;
                   }
                   mesh.UnlockPrimitiveGroup(group);
                }
@@ -578,7 +578,7 @@ static bool ReadTriMesh(FileInfo * info, Object object)
             int i;
             for(i = 0; i<3; i++)
             {
-               info->faces[c].oldIndices[i] = 
+               info->faces[c].oldIndices[i] =
                info->faces[c].indices[i] = ReadWORD(info->f);
             }
             ReadWORD(info->f);
@@ -595,7 +595,7 @@ static bool ReadTriMesh(FileInfo * info, Object object)
          // Add faces without a material all together
          count = 0;
          for(c = 0; c<nFaces; c++)
-            if(!info->faces[c].done) 
+            if(!info->faces[c].done)
                count++;
          if(count)
          {
@@ -671,8 +671,8 @@ static bool ReadTriMesh(FileInfo * info, Object object)
          zAxis.Normalize(zAxis);
 
          orth.CrossProduct(yAxis, zAxis);
-         if((Abs(orth.x) > 0.00001 && Sgn(orth.x) != Sgn(xAxis.x)) || 
-            (Abs(orth.y) > 0.00001 && Sgn(orth.y) != Sgn(xAxis.y)) || 
+         if((Abs(orth.x) > 0.00001 && Sgn(orth.x) != Sgn(xAxis.x)) ||
+            (Abs(orth.y) > 0.00001 && Sgn(orth.y) != Sgn(xAxis.y)) ||
             (Abs(orth.z) > 0.00001 && Sgn(orth.z) != Sgn(xAxis.z)))
          {
             object.flags.flipWindings ^= true;
@@ -680,8 +680,8 @@ static bool ReadTriMesh(FileInfo * info, Object object)
          }
 
          orth.CrossProduct(zAxis, xAxis);
-         if((Abs(orth.x) > 0.00001 && Sgn(orth.x) != Sgn(yAxis.x)) || 
-            (Abs(orth.y) > 0.00001 && Sgn(orth.y) != Sgn(yAxis.y)) || 
+         if((Abs(orth.x) > 0.00001 && Sgn(orth.x) != Sgn(yAxis.x)) ||
+            (Abs(orth.y) > 0.00001 && Sgn(orth.y) != Sgn(yAxis.y)) ||
             (Abs(orth.z) > 0.00001 && Sgn(orth.z) != Sgn(yAxis.z)))
          {
             object.flags.flipWindings ^= true;
@@ -689,8 +689,8 @@ static bool ReadTriMesh(FileInfo * info, Object object)
          }
 
          orth.CrossProduct(xAxis, yAxis);
-         if((Abs(orth.x) > 0.00001 && Sgn(orth.x) != Sgn(zAxis.x)) || 
-            (Abs(orth.y) > 0.00001 && Sgn(orth.y) != Sgn(zAxis.y)) || 
+         if((Abs(orth.x) > 0.00001 && Sgn(orth.x) != Sgn(zAxis.x)) ||
+            (Abs(orth.y) > 0.00001 && Sgn(orth.y) != Sgn(zAxis.y)) ||
             (Abs(orth.z) > 0.00001 && Sgn(orth.z) != Sgn(zAxis.z)))
          {
             object.flags.flipWindings ^= true;
@@ -742,7 +742,7 @@ static bool ReadTriMesh(FileInfo * info, Object object)
          for(c = 0; c<mesh.nVertices; c++)
          {
             Vector3Df vertex = mesh.vertices[c];
-            
+
             mesh.vertices[c].MultMatrix(vertex, inverse);
 
             mesh.vertices[c].x -= object.pivot.x;
@@ -797,7 +797,7 @@ static bool ReadMap(FileInfo * info, Material mat)
                delete opacityMap;
             }
          }
-         
+
          if(mat.baseMap)
          {
             if(!mat.baseMap.displaySystem && info->parent->chunkId == MAT_MAPOPACITY && opacityMap)
@@ -808,7 +808,7 @@ static bool ReadMap(FileInfo * info, Material mat)
                for(c = 0; c < opacityMap.width * opacityMap.height; c++)
                   picture[c] = ColorAlpha { ((ColorAlpha *)opacityMap.picture)[c].color.r, picture[c].color };
             }
-            mat.diffuse.r = mat.diffuse.g = mat.diffuse.b = 
+            mat.diffuse.r = mat.diffuse.g = mat.diffuse.b =
             mat.ambient.r = mat.ambient.g = mat.ambient.b = 1.0f;
          }
          if(opacityMap != mat.baseMap)
@@ -948,12 +948,12 @@ static bool ReadLight(FileInfo * info, Object object)
       }
       case LIT_ATTENUATION:
       {
-         /* solve ( 
-            { 
-               d = 300, small = 0.001, 
-               Kl = 0, Kc = 0, 
+         /* solve (
+            {
+               d = 300, small = 0.001,
+               Kl = 0, Kc = 0,
                d * (Kl + Kq * d) = (1 / small) - Kc
-            }, 
+            },
             { Kc, Kl, Kq, small, d });
          */
 
@@ -1266,7 +1266,7 @@ static bool ReadFrameInfoBlock(FileInfo * info, ObjectInfoBlock * block)
 
                key->frame = ReadDWORD(info->f);
                accelerationFlags = ReadWORD(info->f);
-               
+
                if(accelerationFlags & ACCFLAG_TENSION)
                   key->tension = ReadFloat(info->f);
                if(accelerationFlags & ACCFLAG_CONTINUITY)
@@ -1292,7 +1292,7 @@ static bool ReadFrameInfoBlock(FileInfo * info, ObjectInfoBlock * block)
                      Vector3Df axis;
                      Angle angle = ReadFloat(info->f);
                      Vector3Df fixedAxis;
-                     
+
                      Read3DVertex(info->f, axis);
                      fixedAxis.x = axis.x;
                      fixedAxis.y = -axis.z;
@@ -1389,7 +1389,7 @@ static bool ReadKeyFrameChunks(FileInfo * info, void * data)
                object = Object { };
                object.name = block.dummyName;
                info->rootObject.children.AddName(object);
-               object.transform.scaling = { 1,1,1 }; 
+               object.transform.scaling = { 1,1,1 };
             }
             else
             {
@@ -1474,7 +1474,7 @@ static bool ReadKeyFrameChunks(FileInfo * info, void * data)
                object = Object { };
                object.name = block.dummyName;
                info->rootObject.children.AddName(object);
-               object.transform.scaling = { 1, 1, 1 }; 
+               object.transform.scaling = { 1, 1, 1 };
                object.flags.camera = true;
             }
             else
@@ -1542,7 +1542,7 @@ static bool ReadKeyFrameChunks(FileInfo * info, void * data)
                object = Object { };
                object.name = block.dummyName;
                info->rootObject.children.AddName(object);
-               object.transform.scaling = { 1,1,1 }; 
+               object.transform.scaling = { 1,1,1 };
             }
             else
             {
@@ -1614,7 +1614,7 @@ static bool ReadKeyFrameChunks(FileInfo * info, void * data)
                object = Object { };
                object.name = block.dummyName;
                info->rootObject.children.AddName(object);
-               object.transform.scaling = { 1, 1, 1 }; 
+               object.transform.scaling = { 1, 1, 1 };
                object.flags.light = true;
             }
             else
@@ -1735,7 +1735,7 @@ static bool ReadKeyFrameChunks(FileInfo * info, void * data)
          info->rootObject.startFrame = ReadDWORD(info->f);
          info->rootObject.endFrame = ReadDWORD(info->f);
          *&(info->rootObject.frame) = info->rootObject.startFrame;
-         break;         
+         break;
       }
    }
    return true;
@@ -1800,7 +1800,7 @@ class Object3DSFormat : ObjectFormat
                result = true;
             }
             delete info.f;
-         }   
+         }
       }
       if(!result)
          object.Free(displaySystem);
index da4aa03..f7c58e8 100644 (file)
@@ -58,7 +58,7 @@ public ColorAlpha * LoadPalette(char * fileName, char * type)
    int typeToTry = -1;
    Bitmap bitmap { };
 
-   if(!type) 
+   if(!type)
    {
       type = GetExtension(fileName, ext);
       strlwr(type);
@@ -83,7 +83,7 @@ public ColorAlpha * LoadPalette(char * fileName, char * type)
       }
       if(!palette)
       {
-         
+
          if(bitmap.Load(fileName, type, null))
          {
             palette = bitmap.Quantize(0, 255);
@@ -320,7 +320,7 @@ public:
          int acrossY = height / size;
 
          for(cy = 0; cy < acrossY; cy++)
-            for(cx = 0; cx < acrossX; cx++)         
+            for(cx = 0; cx < acrossX; cx++)
             {
                int x,y;
                Color in1, in2, res;
@@ -518,7 +518,7 @@ public:
       int typeToTry = -1;
 
       if(!fileName) return false;
-      if(!type) 
+      if(!type)
       {
          type = GetExtension(fileName, ext);
          strlwr(type);
@@ -553,7 +553,7 @@ public:
                   break;
                }
                delete f;
-            }         
+            }
          }
          if(typeToTry == -1) break;
       }
@@ -593,7 +593,7 @@ public:
             Bitmap grayed { };
 
             grayed.Allocate(null, width, height, 0, pixelFormat888, false);
-         
+
             for(y = 0;  y <height - 1; y++)
             {
                for(x = 0; x < width - 1; x++)
@@ -603,23 +603,23 @@ public:
                   if(/*b.a > 128 && */(b.r + b.g + b.b) < TRESHOLD)
                   {
                      // TODO: Precomp syntax error here without brackets
-                     ((ColorAlpha *)grayed.picture)[(y + 1) * grayed.stride + (x + 1)] = 
+                     ((ColorAlpha *)grayed.picture)[(y + 1) * grayed.stride + (x + 1)] =
                         ColorAlpha { b.a, white };
                   }
                }
             }
-            
+
             for(c = 0; c<size; c++)
             {
                ColorRGBA b = ((ColorRGBA *)picture)[c];
                //if(b.a > 128)
                {
-                  ((ColorAlpha *)grayed.picture)[c] = 
-                     (/*b.a > 128 && */b.r + b.g + b.b < TRESHOLD) ? 
+                  ((ColorAlpha *)grayed.picture)[c] =
+                     (/*b.a > 128 && */b.r + b.g + b.b < TRESHOLD) ?
                         ColorAlpha { b.a, { 128, 128, 128 } } : ColorAlpha { b.a, { 212, 208, 200 } };
                }
             }
-            
+
             Free();
 
             pixelFormat = grayed.pixelFormat;
@@ -651,8 +651,8 @@ public:
             Bitmap grayed { };
 
             grayed.Allocate(null, width, height, 0, pixelFormat888, false);
-         
-            
+
+
             for(y = 0;  y <height - 1; y++)
             {
                for(x = 0; x < width - 1; x++)
@@ -662,24 +662,24 @@ public:
                   if(b && (palette[b].color.r + palette[b].color.g + palette[b].color.b) < TRESHOLD)
                   {
                      // TODO: Precomp syntax error here without brackets
-                     ((ColorAlpha *)grayed.picture)[(y + 1) * grayed.stride + (x + 1)] = 
+                     ((ColorAlpha *)grayed.picture)[(y + 1) * grayed.stride + (x + 1)] =
                         ColorAlpha { 255, white };
                   }
                }
             }
-            
+
             for(c = 0; c<size; c++)
             {
                byte b = picture[c];
                if(b)
                {
-                  ((ColorAlpha *)grayed.picture)[c] = 
+                  ((ColorAlpha *)grayed.picture)[c] =
                      //(bitmap.palette[b].color) ? Color { 212, 208, 200 } : Color { 128,128,128 };
-                     (palette[b].color.r + palette[b].color.g + palette[b].color.b < TRESHOLD) ? 
+                     (palette[b].color.r + palette[b].color.g + palette[b].color.b < TRESHOLD) ?
                         ColorAlpha { 255, { 128, 128, 128 } } : ColorAlpha { 255, { 212, 208, 200 } };
                }
             }
-            
+
             Free();
 
             pixelFormat = grayed.pixelFormat;
@@ -718,9 +718,9 @@ public:
          {
             int x, y;
             Bitmap grayed { };
-            
+
             grayed.Allocate(null, width, height, 0, pixelFormat888, false);
-         
+
             for(y = 0; y<height - 1; y++)
             {
                for(x = 0; x<width - 1; x++)
@@ -788,7 +788,7 @@ public:
       char ext[MAX_EXTENSION];
       subclass(BitmapFormat) format;
 
-      if(!type) 
+      if(!type)
       {
          type = GetExtension(fileName, ext);
          strlwr(type);
@@ -905,7 +905,7 @@ public:
 
          c = 0;
          mainNode.AddNodeToColorTable(palette + start, &c);
-         
+
          {
             Bitmap newBitmap { };
             if(newBitmap.Allocate(null, width, height, 0, pixelFormat8, false))
@@ -913,12 +913,12 @@ public:
                int y, x;
                ColorAlpha * picture = (ColorAlpha *)this.picture;
                byte * newPicture = newBitmap.picture;
-            
+
                for(y = 0; y < height; y++)
                   for(x = 0; x < width; x++, picture++, newPicture++)
                   {
                      byte color;
-                     
+
                      if(transparent && start > 0 && !picture->a)
                         color = 0;
                      else
index fb7e94c..495d132 100644 (file)
@@ -56,7 +56,7 @@ public class BitmapResource : Resource
       if(fileName)
       {
          DisplaySystem ds = displaySystem;
-         
+
          bitmap = Bitmap { alphaBlend = (alphaBlend && displaySystem.pixelFormat != pixelFormat8), keepData = keepData };
 #if defined(__WIN32__)
          // if(bitmap.alphaBlend) ds = null;
@@ -91,7 +91,7 @@ public class BitmapResource : Resource
    {
       Window editData = class::OnEdit(window, master, x + 24, y, w - 48, h, userData);
       Button browse
-      { 
+      {
          window, master = editData, inactive = true, text = "...", hotKey = f2,
          position = { Max(x + 24, x + w - 24), y }, size = { 24, h };
 
@@ -108,7 +108,7 @@ public class BitmapResource : Resource
                // TOCHECK: Why do we need to Refresh here?
                master.Refresh();
 
-               // TODO: This is a Button? 
+               // TODO: This is a Button?
                // contents = filePath;
             }
             return true;
@@ -164,7 +164,7 @@ public:
       set
       {
          mono = value;
-      } 
+      }
       get { return this ? mono : false; }
    };
    property bool transparent { set { transparent = value; } get { return this ? transparent : false; } isset { return (this && !transparent) ? true : false; } };
index d219809..628ab93 100644 (file)
@@ -40,7 +40,7 @@ public:
    {
       Size size = { 0 };
       char * string = "";
-      ColorDropBox colorDropBox 
+      ColorDropBox colorDropBox
       {
          dataBox, master = master, editText = true, //position = Point { x + 24, y }, /*clientSize.h = */size.h = h, size.w = w - 24,
          anchor = { left = 24, top = 0, right = 0, bottom = 0 },
@@ -53,7 +53,7 @@ public:
          char tempString[MAX_F_STRING];
          char * result;
          bool needClass = false;
-         tempString[0] = 0;      
+         tempString[0] = 0;
          result = OnGetString(tempString, null, &needClass);
          if(result) string = result;
       }
@@ -104,7 +104,7 @@ public:
    }
 
    bool OnGetDataFromString(char * string)
-   { 
+   {
       if(!atoi(string) && (((DefinedColor)this).class::OnGetDataFromString(string) ||
          ((SystemColor)this).class::OnGetDataFromString(string)))
          return true;
@@ -131,7 +131,7 @@ public:
       surface.Area(x - 4, y, x + 20, y + 15);
 
       surface.SetBackground(this);
-      surface.Area(x, y + 2, x+17, y+13); 
+      surface.Area(x, y + 2, x+17, y+13);
       surface.SetForeground(black);
       surface.Rectangle(x-1, y + 1, x + 18, y + 14);
    }
@@ -150,7 +150,7 @@ public struct ColorHSV
          float minV, maxV, diff,dr,dg,db;
 
          float h, s, v;
-         
+
          minV = Min(r, g);
          minV = Min(minV, b);
 
@@ -167,14 +167,14 @@ public struct ColorHSV
             db = (maxV - b)/diff;
 
             /*
-                if R=V then -- between yellow and magenta [degrees] 
-                  H=60.0*(G-B)/Delta 
-                else if G=V then -- between cyan and yellow 
-                    H=120.0+60.0*(B-R)/Delta 
-                else -- between magenta and cyan 
-                    H=240.0+60.0*(R-G)/Delta 
+                if R=V then -- between yellow and magenta [degrees]
+                  H=60.0*(G-B)/Delta
+                else if G=V then -- between cyan and yellow
+                    H=120.0+60.0*(B-R)/Delta
+                else -- between magenta and cyan
+                    H=240.0+60.0*(R-G)/Delta
             */
-            if(r == maxV) 
+            if(r == maxV)
                h = db - dg;
             else if(g == maxV)
                h = 2 + dr - db;
@@ -203,7 +203,7 @@ public struct ColorHSV
          float q = v*(1-(s*f));
          float t = v*(1-s*(1-f));
          float r,g,b;
-         switch(i) 
+         switch(i)
          {
             case 0: r = v; g = t; b = p; break;
             case 1: r = q; g = v; b = p; break;
@@ -243,7 +243,7 @@ public struct ColorLab
             float x = r * 0.412453f + g * 0.357580f + b * 0.180423f;
             float y = r * 0.212671f + g * 0.715160f + b * 0.072169f;
             float z = r * 0.019334f + g * 0.119193f + b * 0.950227f;
-            
+
             x /= 0.950456f;
             y /= 1;
             z /= 1.088754f;
@@ -266,7 +266,7 @@ public struct ColorLab
          float x,y,z,r,g,b, P;
 
          P = (l + 16)/116;
-         
+
          if(l > 903.3f * 0.008856f)
          {
             y = (l + 16) / 116;
@@ -282,17 +282,17 @@ public struct ColorLab
 
 
          x = a / 500 + P;
-         if(x > 0.206893f) 
+         if(x > 0.206893f)
             x = x*x*x;
          else
             x = (116 * x - 16) / 903.3f;
 
          z = P - this.b / 200;
-         if(z > 0.206893f) 
+         if(z > 0.206893f)
             z = z*z*z;
          else
             z = (116 * z - 16) / 903.3f;
-         
+
 
          x *= 0.950456f;
          y *= 1;
@@ -595,7 +595,7 @@ private class ColorValue : Color
    {
       // surface.WriteTextDots(alignment, x + 24, y + 1, width - 24, string, strlen(string));
       surface.SetBackground(this);
-      surface.Area(x, y + 4, x+19, y+11); 
+      surface.Area(x, y + 4, x+19, y+11);
 
       surface.SetForeground(black);
       surface.Rectangle(x-1, y + 3, x + 20, y + 12);
@@ -625,7 +625,7 @@ private class ColorValue : Color
 
    Window pullDown
    {
-      master = this, interim = true, autoCreate = false, minSize = { 204, 222 }, 
+      master = this, interim = true, autoCreate = false, minSize = { 204, 222 },
       background = formColor, borderStyle = contour|bevel;
 
       bool OnKeyDown(Key key, unichar ch)
@@ -759,7 +759,7 @@ private class ColorValue : Color
       position = Point { 136, 0 },
       isRadio = true,
       bevelOver = true,
-      inactive = true,         
+      inactive = true,
       bitmap = null;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
index 4640dae..00f9971 100644 (file)
@@ -95,7 +95,7 @@ public:
    virtual void ::Scroll(Display, Box, int, int, Extent);
    virtual void ::Update(Display, Box);
    virtual void ::EndUpdate(Display);
-   
+
    // Allocate/free a bitmap
    virtual bool ::AllocateBitmap(DisplaySystem, Bitmap, int, int, int, PixelFormat, bool);
    virtual void ::FreeBitmap(DisplaySystem, Bitmap);
@@ -117,7 +117,7 @@ public:
 
    // Grab from the screen
    virtual bool ::GrabScreen(Display, Bitmap, int, int, unsigned int, unsigned int);
-   
+
    // Converts a bitmap format
    virtual bool ::ConvertBitmap(DisplaySystem, Bitmap, PixelFormat, ColorAlpha *);
 
@@ -207,7 +207,7 @@ public enum PixelFormat // : byte MESSES UP GuiApplication
 };
 public enum Resolution : int
 {
-   resText80x25, res320x200, res320x240, res320x400, res360x480, res400x256, res400x300, res512x256, res512x384, 
+   resText80x25, res320x200, res320x240, res320x400, res360x480, res400x256, res400x300, res512x256, res512x384,
    res640x200, res640x350, res640x400, res640x480,  res720x348, res800x600, res856x480, res960x720, res1024x768,
    res1152x864, res1280x1024, res1600x1200, res768x480
 };
@@ -327,7 +327,7 @@ struct SortPrimitive
          d = - (a * poly2.middle.x + b * poly2.middle.y + c * poly2.middle.z);
       }
 
-       for(v = 0; v < primitive->nIndices; v++) 
+      for(v = 0; v < primitive->nIndices; v++)
       {
          double surface;
          Vector3Df * local = &mesh.vertices[primitive->indices[v]];
@@ -337,7 +337,7 @@ struct SortPrimitive
 
          surface = a * vertex.x + b * vertex.y + c * vertex.z + d;
 
-               if(surface < EPSILON) 
+         if(surface < EPSILON)
          {
                        result = false;
             break;
@@ -366,8 +366,8 @@ struct SortPrimitive
          c*=-1;
          d = - (a * middle.x + b * middle.y + c * middle.z);
       }
-      
-       for(v = 0; v < primitive->nIndices; v++) 
+
+      for(v = 0; v < primitive->nIndices; v++)
       {
          double surface;
          Vector3Df * local = &mesh.vertices[primitive->indices[v]];
@@ -506,7 +506,7 @@ public:
    {
       // Fix for OnLoadGraphics time alpha blended window text extent on GDI
 #if defined(__WIN32__) && !defined(ECERE_NOTRUETYPE)
-      if(this && alphaBlend && pixelFormat == pixelFormat888 && 
+      if(this && alphaBlend && pixelFormat == pixelFormat888 &&
          displaySystem.driver == class(GDIDisplayDriver))
       {
          Surface s = GetSurface(0,0,null);
@@ -527,10 +527,10 @@ public:
    {
        displaySystem.driver.SetPalette(this, palette, colorMatch);
    }
-   
+
    void RestorePalette(void)
    {
-      displaySystem.driver.RestorePalette(this);  
+      displaySystem.driver.RestorePalette(this);
    }
 
    bool Lock(bool render)
@@ -542,7 +542,7 @@ public:
          Log("   ");
       Logf("Locking (%d)\n", current+1);
       */
-      
+
       // TOCHECK: Why is displaySystem null with GISDesigner?
       result = displaySystem && displaySystem.Lock();
       if(result && render)
@@ -565,7 +565,7 @@ public:
          current--;
          /*{
             int c;
-            
+
             for(c = 0; c<current; c++)
                Log("   ");
             Logf("Unlocking (%d)\n", current);
@@ -594,7 +594,7 @@ public:
       {
          if(!display3D.selection)
             displaySystem.driver.SelectMesh(this, null);
+
          display3D.material = null;
          display3D.mesh = null;
       }
@@ -627,12 +627,12 @@ public:
             double r = camera.origin.x - (display3D.pickX + display3D.pickWidth/2.0f);
             double t = (display3D.pickY - display3D.pickHeight/2.0f) - camera.origin.y;
             double b = (display3D.pickY + display3D.pickHeight/2.0f) - camera.origin.y;
-            
+
             fovLeft   = atan(l / camera.focalX);
             fovRight  = atan(r / camera.focalX);
             fovTop    = atan(t / camera.focalY);
             fovBottom = atan(b / camera.focalY);
-      
+
             // --- Left ---
             quat.Yaw(fovLeft - Pi/2);
             quat.ToDirection(normal);
@@ -803,11 +803,11 @@ public:
             Matrix matrix;
             Matrix inverse, inverseTranspose;
             int c;
-         
+
             if(object.flags.viewSpace)
                matrix = object.matrix;
             else
-            {  
+            {
                Camera camera = display3D.camera;
                Matrix temp = object.matrix;
                temp.m[3][0] -= camera.cPosition.x;
@@ -835,9 +835,9 @@ public:
                sort->middle.MultMatrix(triangle->middle, matrix);
                sort->middle.z *= -1;
                // sort->plane.MultMatrix(triangle->plane, inverseTranspose);
-               sort->plane.d = plane->a * inverseTranspose.m[0][3] + 
+               sort->plane.d = plane->a * inverseTranspose.m[0][3] +
                                plane->b * inverseTranspose.m[1][3] +
-                               plane->c * inverseTranspose.m[2][3] + 
+                               plane->c * inverseTranspose.m[2][3] +
                                plane->d * inverseTranspose.m[3][3];
             }
          }
@@ -892,7 +892,7 @@ public:
             planes = object.flags.viewSpace ? display3D.viewPickingPlanes : display3D.worldPickingPlanes;
          else
             planes = object.flags.viewSpace ? camera.viewClippingPlanes : camera.worldClippingPlanes;
-         
+
          visible = object.InsideFrustum(planes);
 
          if(visible || display3D.pickingPlanes)
@@ -1176,11 +1176,11 @@ private class Display3D
 
          if(object.flags.light && !object.light.flags.off)
             display.SetLight(id++, object.light);
-         
+
          for(child = object.children.first; child; child = child.next)
          {
             id = _SetLights(display, child, id);
-         }   
+         }
       }
       return id;
    }
@@ -1195,7 +1195,7 @@ private class Display3D
       int c = 0;
       int nIndex = 1, nPoints = 1;
       int offset = 0;
-      bool result = false;      
+      bool result = false;
       Vector3D * points = this.points;
       Vector3D * newPoints = this.newPoints;
       byte * goodPoints = this.goodPoints;
@@ -1205,7 +1205,7 @@ private class Display3D
       bool i32bit = primitive.type.indices32bit;
       uint32 * indices32 = primitive.indices;
       uint16 * indices16 = primitive.indices;
-      
+
       switch(primitive.type.primitiveType)
       {
          case triangles: nIndex = 3; nPoints = 3; break;
@@ -1220,7 +1220,7 @@ private class Display3D
             points[1] = { (double)tmp.x, (double)tmp.y, (double)tmp.z };
             break;
       }
-      
+
       for(c = offset; c<nVertices; c += nIndex)
       {
          bool outside = false;
@@ -1278,14 +1278,14 @@ private class Display3D
                }
             }
 
-             for(p = 0; p < 6; p++) 
+            for(p = 0; p < 6; p++)
             {
                Plane * plane = &planes[p];
                int i;
                int numGoodPoints = 0;
-       
+
                memset(goodPoints, 0, n);
-                     for(i = 0; i < n; i++) 
+               for(i = 0; i < n; i++)
                {
                   double dot = plane->normal.DotProduct(points[i]);
                   double distance = dot + plane->d;
@@ -1316,7 +1316,7 @@ private class Display3D
                      }
                      else
                      {
-                        Line edge; 
+                        Line edge;
                         int next;
 
                         if(lastGood == -1)
@@ -1474,7 +1474,7 @@ private class Display3D
             if(object.flags.viewSpace)
                matrix = object.matrix;
             else
-            {  
+            {
                Camera camera = this.camera;
                Matrix temp = object.matrix;
                temp.m[3][0] -= camera.cPosition.x;
@@ -1484,7 +1484,7 @@ private class Display3D
             }
          }
 
-          for(v = 0; v<primitive->nIndices; v++) 
+         for(v = 0; v<primitive->nIndices; v++)
          {
             Vector3Df * local = &mesh.vertices[primitive->indices[v]];
             Vector3Df vertex;
@@ -1516,7 +1516,7 @@ private class Display3D
 
          Logf("Triangle %d (%s):\n", c, primitive->material->name);
 
-          for(v = 0; v<primitive->nIndices; v++) 
+         for(v = 0; v<primitive->nIndices; v++)
          {
             Vector3Df * local = &mesh.vertices[primitive->indices[v]];
             Vector3Df vertex;
@@ -1549,7 +1549,7 @@ private class Display3D
 
          Logf("Triangle %d (%s):\n", c, primitive->material->name);
 
-          for(v = 0; v<primitive->nIndices; v++) 
+         for(v = 0; v<primitive->nIndices; v++)
          {
             Vector3Df * local = &mesh.vertices[primitive->indices[v]];
             Vector3Df vertex;
@@ -1572,17 +1572,17 @@ private class Display3D
       //exit(0);
 
    /*
-   If all five tests fail for a particular Q, 
-   then P might obscure Q. Now Q must be tested. 
-   First, the algorithm checks if Q has been "marked." 
-   If Q is marked, then Q was "moved around" in the list 
-   during a previous iteration of the loop. The algorithm 
-   only allows a polygon to be moved once, to avoid the possibility 
-   of infinite loops. If Q is not marked, it is tested to see 
-   if it might obscure P. If Q cannot obscure P, then Q is possibly 
-   behind P and so it is good candidate to be drawn next. 
-   Therefore, the algorithm "abandons" the current P (that is, it 
-   stops testing Q's against the current P) and moves the current 
+   If all five tests fail for a particular Q,
+   then P might obscure Q. Now Q must be tested.
+   First, the algorithm checks if Q has been "marked."
+   If Q is marked, then Q was "moved around" in the list
+   during a previous iteration of the loop. The algorithm
+   only allows a polygon to be moved once, to avoid the possibility
+   of infinite loops. If Q is not marked, it is tested to see
+   if it might obscure P. If Q cannot obscure P, then Q is possibly
+   behind P and so it is good candidate to be drawn next.
+   Therefore, the algorithm "abandons" the current P (that is, it
+   stops testing Q's against the current P) and moves the current
    Q to the end of the list to become the next P.
    */
    /*
@@ -1686,13 +1686,13 @@ private class Display3D
 
    /*
       {
-          for(c=0; c<nTriangles; c++) 
+         for(c=0; c<nTriangles; c++)
          {
             int b;
             SortPrimitive * poly1 = &triangles[c];
 
-            // for(b=0; b<nTriangles; b++) 
-            //for(b=c+1; b<nTriangles; b++) 
+            // for(b=0; b<nTriangles; b++)
+            //for(b=c+1; b<nTriangles; b++)
             b = c+1;
             if(b<this.nTriangles)
             {
index 8ab5f0f..b73a630 100644 (file)
@@ -181,7 +181,7 @@ public:
       current--;
       if(!current)
          driver.UnlockSystem(this);
-     
+
       mutex.Release();
    }
 #if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D)
@@ -211,7 +211,7 @@ public:
          materials.AddName(material);
       else
          materials.Add(material);
-      return true;      
+      return true;
    }
 
    Material GetMaterial(char * name)
index cc17b78..3a64ff7 100644 (file)
@@ -28,12 +28,12 @@ public void PaletteGradient(ColorAlpha * palette, int numColors, ColorKey * keys
 
       while(nextKey && percent > nextKey->percent)
       {
-         key = nextKey; keyNum = nextKeyNum; 
-      
-         if(keyNum < numKeys - 1) 
-         { 
+         key = nextKey; keyNum = nextKeyNum;
+
+         if(keyNum < numKeys - 1)
+         {
             nextKey = key + 1;
-            nextKeyNum = keyNum + 1; 
+            nextKeyNum = keyNum + 1;
          }
          else
             break;
@@ -41,7 +41,7 @@ public void PaletteGradient(ColorAlpha * palette, int numColors, ColorKey * keys
 
       if(nextKey && nextKey->percent != key->percent)
       {
-         float scale = ease((percent - key->percent) / (nextKey->percent - key->percent), 
+         float scale = ease((percent - key->percent) / (nextKey->percent - key->percent),
             smoothness, smoothness);
          int cr = key->color.color.r;
          int cg = key->color.color.g;
@@ -84,13 +84,13 @@ public void PaletteGradient(ColorAlpha * palette, int numColors, ColorKey * keys
    }
 }
 
-float ease(float t, float a, float b) 
+float ease(float t, float a, float b)
 {
    float k;
    float s = a + b;
 
    if (s == 0.0f) return t;
-   if (s > 1.0f) 
+   if (s > 1.0f)
    {
       a /= s;
       b /= s;
@@ -160,7 +160,7 @@ public:
       get
       {
          return ((LFBSurface)driverData).bitmap;
-      }     
+      }
    }
 
    ColorAlpha GetPixel(int x, int y)
@@ -376,7 +376,7 @@ public:
          va_end(args);
       }
    }
-   
+
    void Bevel(bool inner, int x, int y, int w, int h)
    {
       ColorAlpha foreground = this.foreground;
@@ -431,7 +431,7 @@ public:
          if(boxLeft > firstPixel)
          {
             percent = (boxLeft - firstPixel) * inc;
-            firstPixel = boxLeft;            
+            firstPixel = boxLeft;
          }
          if(boxRight < lastPixel)
             lastPixel = boxRight;
@@ -442,12 +442,12 @@ public:
 
             while(nextKey && percent > nextKey->percent)
             {
-               key = nextKey; keyNum = nextKeyNum; 
-            
-               if(keyNum < numKeys - 1) 
-               { 
+               key = nextKey; keyNum = nextKeyNum;
+
+               if(keyNum < numKeys - 1)
+               {
                   nextKey = key + 1;
-                  nextKeyNum = keyNum + 1; 
+                  nextKeyNum = keyNum + 1;
                }
                else
                   break;
@@ -455,7 +455,7 @@ public:
 
             if(nextKey && nextKey->percent != key->percent)
             {
-               float scale = ease((percent - key->percent) / (nextKey->percent - key->percent), 
+               float scale = ease((percent - key->percent) / (nextKey->percent - key->percent),
                   smoothness, smoothness);
                int cr = key->color.color.r;
                int cg = key->color.color.g;
index 68ea6a9..db02627 100644 (file)
@@ -101,7 +101,7 @@ static bool LoadBMP(Bitmap bitmap, File f, BMPHead header, BMPInfo info)
 
       if(info.bitCount == 1)
       {
-         // Bitmap      
+         // Bitmap
          byte * buffer = new byte[info.width >> 3];
          ColorAlpha * dest24=(ColorAlpha *)bitmap.picture + (flip ? 0 : (info.height-1)) * bitmap.stride;
          f.Read(buffer, 1, 8);   // TOCHECK: What are these 8 bytes?
@@ -109,7 +109,7 @@ static bool LoadBMP(Bitmap bitmap, File f, BMPHead header, BMPInfo info)
          {
             if(f.Read(buffer, 1, info.width >> 3) != info.width >> 3)
             {
-               errorReading = true; 
+               errorReading = true;
                break;
             }
             for(x = 0; x < info.width; x++)
@@ -123,7 +123,7 @@ static bool LoadBMP(Bitmap bitmap, File f, BMPHead header, BMPInfo info)
             {
                div = (byte)((info.width>>3) % 4);
                if(div)
-                  for(x=0; x<4-div; x++) 
+                  for(x=0; x<4-div; x++)
                      if(!f.Getc(null)) { errorReading = true; break; }
                if(flip)
                   dest24 += (bitmap.stride - info.width);
@@ -133,19 +133,19 @@ static bool LoadBMP(Bitmap bitmap, File f, BMPHead header, BMPInfo info)
          }
          // bitmap.height = y;
          delete buffer;
-         if(!errorReading) 
+         if(!errorReading)
             result = true;
       }
       else if(info.bitCount == 24)
       {
-         // Bitmap      
+         // Bitmap
          byte * buffer = new byte[info.width * sizeof(Color)];
          ColorAlpha * dest24=(ColorAlpha *)bitmap.picture + (flip ? 0 : (info.height-1)) * bitmap.stride;
          for(y=0; y<info.height && !errorReading; y++)
          {
             if(f.Read( buffer, 3, info.width) != info.width)
             {
-               errorReading = true; 
+               errorReading = true;
                break;
             }
             for(x = 0; x < info.width; x++)
@@ -159,7 +159,7 @@ static bool LoadBMP(Bitmap bitmap, File f, BMPHead header, BMPInfo info)
             {
                div = (byte)((info.width * 3) % 4);
                if(div)
-                  for(x=0; x<4-div; x++) 
+                  for(x=0; x<4-div; x++)
                      if(!f.Getc(null)) { errorReading = true; break; }
                if(flip)
                   dest24 += (bitmap.stride - info.width);
@@ -169,7 +169,7 @@ static bool LoadBMP(Bitmap bitmap, File f, BMPHead header, BMPInfo info)
          }
          // bitmap.height = y;
          delete buffer;
-         if(!errorReading) 
+         if(!errorReading)
             result = true;
       }
       else if(info.bitCount == 8)
@@ -227,7 +227,7 @@ static bool LoadBMP(Bitmap bitmap, File f, BMPHead header, BMPInfo info)
                               if(!f.Getc(dest256 ++))
                                  { errorReading = true; break; }
                            if(!errorReading)
-                              if(count & 0x01) 
+                              if(count & 0x01)
                                  if(!f.Getc(null))
                                     { errorReading = true; break; }
                         }
@@ -247,8 +247,8 @@ static bool LoadBMP(Bitmap bitmap, File f, BMPHead header, BMPInfo info)
                      break;
                   div = (byte)(info.width % 4);
                   if(div)
-                     for(x=0; x<4-div; x++) 
-                        if(!f.Getc(null)) 
+                     for(x=0; x<4-div; x++)
+                        if(!f.Getc(null))
                            break;
 
                   if(flip)
@@ -280,7 +280,7 @@ class MEMORYBMPFormat : BitmapFormat
       if(f.Read(info, sizeof(info), 1))
       {
          BMPHead header;
-      
+
          info.Swap();
          header.type[0] = 'B';
          header.type[1] = 'M';
@@ -301,7 +301,7 @@ class BMPFormat : BitmapFormat
    bool Load(Bitmap bitmap, File f)
    {
       bool result = false;
-      
+
       BMPHead header;
       BMPInfo info;
       // if(f.Read(&header, sizeof(header), 1) && header.type[0] == 'B' && header.type[1] == 'M' && f.Read(info, sizeof(info), 1))
@@ -322,12 +322,12 @@ class BMPFormat : BitmapFormat
       if(bitmap.pixelFormat == pixelFormat8 || bitmap.pixelFormat == pixelFormat888)
       {
          File f = FileOpen(filename, write);
-         if(f) 
+         if(f)
          {
             BMPHead header;
 
             f.buffered = true;
-         
+
             header.type[0] = 'B';
             header.type[1] = 'M';
             header.size=0;
@@ -341,7 +341,7 @@ class BMPFormat : BitmapFormat
             //if(f.Write(&header,sizeof(header),1))
             if(f.Write(&header.type, 2, 1) && f.Write(&header.size,sizeof(header) - (uint)&((BMPHead *)0)->size,1))
             {
-               BMPInfo info;  
+               BMPInfo info;
 
                info.bitCount = (bitmap.pixelFormat == pixelFormat8) ? 8 : 24;
                info.size = sizeof(BMPInfo);
@@ -370,7 +370,7 @@ class BMPFormat : BitmapFormat
                   {
                      ColorAlpha * dest24;
 
-                     // Bitmap      
+                     // Bitmap
                      dest24 = (ColorAlpha *)bitmap.picture + (info.height-1) * bitmap.stride;
                      for(y=0; y<info.height && !errorWriting; y++)
                      {
@@ -386,10 +386,10 @@ class BMPFormat : BitmapFormat
                         {
                            div = (byte)((info.width * 3) % 4);
                            if(div)
-                              for(x=0; x<4-div; x++) 
+                              for(x=0; x<4-div; x++)
                                  if(!f.Putc(0)) { errorWriting = true; break; }
                            dest24-=info.width;
-                           dest24-=bitmap.stride;         
+                           dest24-=bitmap.stride;
                         }
                      }
                      if(!errorWriting)
@@ -479,7 +479,7 @@ class BMPFormat : BitmapFormat
             delete f;
          }
       }
-      return result;   
+      return result;
    }
 
    ColorAlpha * LoadPalette(char * fileName, char * type)
@@ -528,7 +528,7 @@ class BMPFormat : BitmapFormat
             }
          }
          delete f;
-      }   
+      }
       return result;
    }
 }
index 6ed1c04..c81cfb5 100644 (file)
@@ -64,7 +64,7 @@ class GIFFormat : BitmapFormat
                   for(y = 0; y < gifFile->SHeight; y++)
                   {
                      uint x;
-                     for(x = 0; x < gifFile->SWidth; x++) 
+                     for(x = 0; x < gifFile->SWidth; x++)
                      {
                         byte index = image->RasterBits[y*gifFile->SWidth+x];
                         if(index == transparent || index >= colorCount)
@@ -118,7 +118,7 @@ class GIFFormat : BitmapFormat
    bool Save(Bitmap bitmap, char * filename, void * options)
    {
       bool result = false;
-      return result;   
+      return result;
    }
 
    ColorAlpha * LoadPalette(char * fileName, char * type)
index d5eb695..2fa496d 100644 (file)
@@ -23,7 +23,7 @@ static void JPEG_ExitHandler(j_common_ptr cinfo)
 typedef struct
 {
    struct jpeg_source_mgr pub;
-   
+
    File infile;
    byte * buffer;
    boolean startOfFile;
@@ -46,24 +46,24 @@ static boolean JPEG_FillInputBuffer (j_decompress_ptr cinfo)
       if(src->startOfFile)
          ERREXIT(cinfo, JERR_INPUT_EMPTY);
       WARNMS(cinfo, JWRN_JPEG_EOF);
-      
+
       src->buffer[0] = (byte) 0xFF;
       src->buffer[1] = (byte) JPEG_EOI;
       nbytes = 2;
    }
-   
+
    src->pub.next_input_byte = src->buffer;
    src->pub.bytes_in_buffer = nbytes;
    src->startOfFile = FALSE;
-   
+
    return TRUE;
 }
 
 static void JPEG_SkipInputData (j_decompress_ptr cinfo, long num_bytes)
 {
    SourceManager * src = (SourceManager *) cinfo->src;
-   
-   if (num_bytes > 0) 
+
+   if (num_bytes > 0)
    {
       while (num_bytes > (long) src->pub.bytes_in_buffer)
       {
@@ -77,13 +77,13 @@ static void JPEG_SkipInputData (j_decompress_ptr cinfo, long num_bytes)
 
 static void JPEG_TermSource(j_decompress_ptr cinfo)
 {
-   
+
 }
 
 static void JPEG_SetSource(j_decompress_ptr cinfo, File infile)
 {
    SourceManager * src;
-   
+
    if (!cinfo->src)
    {
       cinfo->src = (struct jpeg_source_mgr *)
@@ -94,7 +94,7 @@ static void JPEG_SetSource(j_decompress_ptr cinfo, File infile)
          (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
          INPUT_BUF_SIZE * sizeof(byte));
    }
-   
+
    src = (SourceManager *) cinfo->src;
    src->pub.init_source = JPEG_InitSource;
    src->pub.fill_input_buffer = JPEG_FillInputBuffer;
@@ -110,7 +110,7 @@ static void JPEG_SetSource(j_decompress_ptr cinfo, File infile)
 typedef struct
 {
    struct jpeg_destination_mgr pub;
-   
+
    File outfile;
    byte * buffer;
 } DestinationManager;
@@ -120,11 +120,11 @@ typedef struct
 static void JPEG_InitDestination(j_compress_ptr cinfo)
 {
    DestinationManager * dest = (DestinationManager * ) cinfo->dest;
-   
+
    dest->buffer = (byte *)
       (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
                                  OUTPUT_BUF_SIZE * sizeof(byte));
-   
+
    dest->pub.next_output_byte = dest->buffer;
    dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
 }
@@ -132,14 +132,14 @@ static void JPEG_InitDestination(j_compress_ptr cinfo)
 static boolean JPEG_EmptyOutputBuffer(j_compress_ptr cinfo)
 {
    DestinationManager * dest = (DestinationManager *) cinfo->dest;
-   
+
    if (dest->outfile.Write(dest->buffer, sizeof(byte), OUTPUT_BUF_SIZE) !=
       (uint) OUTPUT_BUF_SIZE)
       ERREXIT(cinfo, JERR_FILE_WRITE);
-   
+
    dest->pub.next_output_byte = dest->buffer;
    dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
-   
+
    return TRUE;
 }
 
@@ -147,7 +147,7 @@ static void JPEG_TermDestination(j_compress_ptr cinfo)
 {
    DestinationManager * dest = (DestinationManager *) cinfo->dest;
    uint datacount = (uint)(OUTPUT_BUF_SIZE - dest->pub.free_in_buffer);
-   
+
    if (datacount > 0)
    {
       if (dest->outfile.Write(dest->buffer, sizeof(byte), datacount) != datacount)
@@ -162,14 +162,14 @@ static void JPEG_TermDestination(j_compress_ptr cinfo)
 static void JPEG_SetDestination(j_compress_ptr cinfo, File outfile)
 {
    DestinationManager * dest;
-   
-   if(!cinfo->dest) 
+
+   if(!cinfo->dest)
    {
       cinfo->dest = (struct jpeg_destination_mgr *)
          (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
          sizeof(DestinationManager));
    }
-   
+
    dest = (DestinationManager *) cinfo->dest;
    dest->pub.init_destination = JPEG_InitDestination;
    dest->pub.empty_output_buffer = JPEG_EmptyOutputBuffer;
@@ -208,7 +208,7 @@ class JPGFormat : BitmapFormat
             jpeg_start_decompress(&cinfo);
             buffer = (*cinfo.mem->alloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, cinfo.output_width * cinfo.output_components, 1);
 
-            for(picture = (ColorAlpha *)bitmap.picture; cinfo.output_scanline < cinfo.output_height; picture += bitmap.stride) 
+            for(picture = (ColorAlpha *)bitmap.picture; cinfo.output_scanline < cinfo.output_height; picture += bitmap.stride)
             {
                int c;
                jpeg_read_scanlines(&cinfo, buffer, 1);
@@ -238,7 +238,7 @@ class JPGFormat : BitmapFormat
       if(bitmap.pixelFormat == pixelFormat888)
       {
          File f = FileOpen(filename, write);
-         if(f) 
+         if(f)
          {
             struct jpeg_compress_struct cinfo;
             struct jpeg_error_mgr jerr;
@@ -257,7 +257,7 @@ class JPGFormat : BitmapFormat
             cinfo.in_color_space = JCS_RGB;
 
             jpeg_set_defaults(&cinfo);
-     
+
             jpeg_set_quality(&cinfo, 100, TRUE);
 
             jpeg_start_compress(&cinfo, TRUE);
@@ -291,9 +291,9 @@ class JPGFormat : BitmapFormat
 
             delete f;
             result = true;
-         }      
+         }
       }
-      return result;   
+      return result;
    }
 
    ColorAlpha * LoadPalette(char * fileName, char * type)
index 6e0eb63..92c778a 100644 (file)
@@ -100,9 +100,9 @@ class PCXFormat : BitmapFormat
                   {
                      switch(colorPlane)
                      {
-                        case 0: 
+                        case 0:
                            ((RGBA32*)bitmap.picture)[iptr].a = 255;
-                           ((RGBA32*)bitmap.picture)[iptr].r = b; 
+                           ((RGBA32*)bitmap.picture)[iptr].r = b;
                            break;
                         case 1: ((RGBA32*)bitmap.picture)[iptr].g = b; break;
                         case 2: ((RGBA32*)bitmap.picture)[iptr].b = b; break;
@@ -127,7 +127,7 @@ class PCXFormat : BitmapFormat
                   x++;
                   iptr++;
                   if(x == header.bytesPerLine)
-                  { 
+                  {
                      iptr+= bitmap.stride - x;
                      x = 0;
                      y++;
@@ -218,7 +218,7 @@ class PCXFormat : BitmapFormat
                            case 0: b = ((RGBA32*)bitmap.picture)[iptr].r; break;
                            case 1: b = ((RGBA32*)bitmap.picture)[iptr].g; break;
                            case 2: b = ((RGBA32*)bitmap.picture)[iptr].b; break;
-                        }  
+                        }
                      }
                      else
                         b = bitmap.picture[iptr];
@@ -232,16 +232,16 @@ class PCXFormat : BitmapFormat
                         last = b;
                      }
                      count++,x++;iptr++;
-            
+
                      if(x==bitmap.width)
                      {
                         x = 0;
                         if(bitmap.pixelFormat == pixelFormat888)
                         {
                            colorPlane ++;
-                           if(colorPlane == 3) 
-                           { 
-                              colorPlane = 0; 
+                           if(colorPlane == 3)
+                           {
+                              colorPlane = 0;
                               y++;
                            }
                         }
@@ -250,7 +250,7 @@ class PCXFormat : BitmapFormat
                         iptr = y*bitmap.stride;
                         if(div)
                         {
-                           if(last == padder && count <= 63-div && 
+                           if(last == padder && count <= 63-div &&
                              (colorPlane || bitmap.pixelFormat == pixelFormat8))
                               count += div;
                            else
@@ -262,7 +262,7 @@ class PCXFormat : BitmapFormat
                         if(!colorPlane)
                            break;
                      }
-                     if(count >= 63) 
+                     if(count >= 63)
                         break;
                   }
                   if((count>1)||(last>=192))
@@ -309,7 +309,7 @@ class PCXFormat : BitmapFormat
                }
             }
             delete f;
-         }      
+         }
       }
       return result;
    }
@@ -341,7 +341,7 @@ class PCXFormat : BitmapFormat
             }
          }
          delete f;
-      }   
+      }
       return result;
    }
 }
index 46b1bd7..ead35a7 100644 (file)
@@ -82,7 +82,7 @@ class PNGFormat : BitmapFormat
                png_read_info(png_ptr, info_ptr);
                channels = png_get_channels(png_ptr, info_ptr);
                if(channels == 3 || channels == 4 || channels == 1 || channels == 2)
-               {            
+               {
                   png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
                       &interlace_type, null, null);
                   numPasses = png_set_interlace_handling(png_ptr);
@@ -261,7 +261,7 @@ class PNGFormat : BitmapFormat
       if(bitmap)
       {
          File f = FileOpen(filename, write);
-         if(f) 
+         if(f)
          {
             png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, null, null, null);
             if(png_ptr)
index 1cfd707..82b1892 100644 (file)
@@ -81,7 +81,7 @@ void *previous;
 void CocoaGlAssert()
 {
     GLenum error = glGetError();
-    
+
     if(error) {
         printf("**** glGetError():%i ****\n", error);
         exit(1);
@@ -123,7 +123,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
    bool CreateDisplaySystem(DisplaySystem displaySystem)
    {
       bool result = true;
-      
+
       SystemData system = SystemData { };
       displaySystem.driverData = system;
 
@@ -142,11 +142,11 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
 
       DisplayData displayData = display.driverData;
       SystemData systemData = display.displaySystem.driverData;
-      
+
       displayData = display.driverData = DisplayData { };
-      
+
       CocoaOpenGLMakeCurrentContext(display.window);
-      
+
       CocoaGlAssert();
       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
       CocoaGlAssert();
@@ -176,7 +176,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       CocoaGlAssert();
       glDisable(GL_MULTISAMPLE_ARB);
       CocoaGlAssert();
-  
+
 #if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
       display.ambient = Color { 50,50,50 };
 #endif
@@ -195,7 +195,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       printf("CocoaOpenGLDisplayDriver:DisplaySize(%i,%i) %s:%i\n", width, height, __FILE__, __LINE__);
 
       CocoaOpenGLMakeCurrentContext(display.window);
-      
+
       glViewport(0,0,width,height);
       CocoaGlAssert();
       glLoadIdentity();
@@ -213,7 +213,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       }
       if(displayData.flippingBuffer)
          result = true;
-         
+
       return result;
    }
 
@@ -274,7 +274,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       bool result = false;
       Bitmap mipMap { };
       int glBitmap = -1;
-      
+
       uint w = pow2i(Min(width, 1024)), h = pow2i(Min(height, 1024));
 
       printf("CocoaOpenGLDisplayDriver:AllocateBitmap %s:%i\n", __FILE__, __LINE__);
@@ -333,7 +333,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
          {
             for(c=0; c<bitmap.size; c++)
             {
-               // TODO: 
+               // TODO:
                ColorAlpha color = ((ColorAlpha *)bitmap.picture)[c];
                ((ColorRGBA *)bitmap.picture)[c] = ColorRGBA { color.color.r, color.color.g, color.color.b, color.a };
             }
@@ -389,7 +389,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
                   delete mipMap;
                }
             }
-            else 
+            else
                mipMap = bitmap;
 
             if(result)
@@ -402,7 +402,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
                   result = false;
                }
             }
-            if(mipMap != bitmap) 
+            if(mipMap != bitmap)
                delete mipMap;
             if(!mipMaps) break;
          }
@@ -431,7 +431,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
    void ReleaseSurface(Display display, Surface surface)
    {
       printf("CocoaOpenGLDisplayDriver:ReleaseSurface %s:%i\n", __FILE__, __LINE__);
-      
+
       glDisable(GL_SCISSOR_TEST);
       CocoaGlAssert();
       delete surface.driverData;
@@ -447,7 +447,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
    bool GetSurface(Display display, Surface surface, int x,int y, Box clip)
    {
       bool result = true;
-      
+
       SurfaceData surfaceData = SurfaceData { };
       surface.driverData = surfaceData;
 
@@ -482,7 +482,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       CocoaGlAssert();
          result = true;
       }
-      
+
       return result;
    }
 
@@ -502,7 +502,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       {
          box = surface.box = surface.unclippedBox;
       }
-      
+
       box.left += surface.offset.x;
       box.top  += surface.offset.y;
       box.right+= surface.offset.x;
@@ -583,10 +583,10 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
 
       glColor4fv(surfaceData.foreground);
       glBegin(GL_LINES);
-      
+
       glVertex2f(x1+surface.offset.x + 0.5f, y1+surface.offset.y + 0.5f);
       glVertex2f(x2+surface.offset.x + 0.5f, y2+surface.offset.y + 0.5f);
-      
+
       glEnd();
       CocoaGlAssert();
    }
@@ -601,7 +601,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       glVertex2f(x1+surface.offset.x + 0.5f, y2+surface.offset.y + 0.5f);
       glVertex2f(x2+surface.offset.x + 0.5f, y2+surface.offset.y + 0.5f);
       glVertex2f(x2+surface.offset.x + 0.5f, y1+surface.offset.y + 0.5f);
-      
+
       glEnd();
       CocoaGlAssert();
    }
@@ -611,7 +611,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       SurfaceData surfaceData = surface.driverData;
 
       printf("CocoaOpenGLDisplayDriver:Area %s:%i\n", __FILE__, __LINE__);
-   
+
       CocoaGlAssert();
       glColor4fv(surfaceData.background);
 
@@ -638,13 +638,13 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       glClear(((type != depthBuffer) ? GL_COLOR_BUFFER_BIT : 0) |
               ((type != colorBuffer) ? GL_DEPTH_BUFFER_BIT : 0));
       CocoaGlAssert();
-      
+
       if(type != colorBuffer && !displayData.depthWrite)
       {
          glDepthMask((byte)bool::false);
       CocoaGlAssert();
       }
-      if(type != depthBuffer) 
+      if(type != depthBuffer)
       {
          glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
       CocoaGlAssert();
@@ -654,11 +654,11 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
          glDepthMask((byte)bool::true);
       CocoaGlAssert();
       }
-   
+
       glClear(((type != depthBuffer) ? GL_COLOR_BUFFER_BIT : 0) |
               ((type != colorBuffer) ? GL_DEPTH_BUFFER_BIT : 0));
       CocoaGlAssert();
-      
+
       if(type != colorBuffer)
       {
          glDepthMask((byte)bool::false);
@@ -672,7 +672,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       bool result = false;
 
       printf("CocoaOpenGLDisplayDriver:ConvertBitmap %s:%i\n", __FILE__, __LINE__);
-      
+
       return result;
    }
 
@@ -680,7 +680,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
    {
       printf("CocoaOpenGLDisplayDriver:Blit %s:%i\n", __FILE__, __LINE__);
       printf("--BLIT(dx:%i, dy:%i, sx:%i, sy:%i, w:%i, h:%i)\n", dx, dy, sx, sy, w, h);
+
       glEnable(GL_TEXTURE_2D);
       glBindTexture(GL_TEXTURE_2D, (uint)bitmap.driverData);
       glBegin(GL_QUADS);
@@ -728,17 +728,17 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       CocoaGlAssert();
          glVertex2i(dx+surface.offset.x, dy+surface.offset.y);
       CocoaGlAssert();
-      
+
          glTexCoord2f((float)(sx+sw) / bitmap.width, (float)(sy+sh)/ bitmap.height);
       CocoaGlAssert();
          glVertex2i(dx+w+surface.offset.x, dy+surface.offset.y);
       CocoaGlAssert();
-      
+
          glTexCoord2f((float)(sx+sw)/ bitmap.width, (float)(sy)/ bitmap.height);
       CocoaGlAssert();
          glVertex2i(dx+w+surface.offset.x, dy-h+surface.offset.y);
       CocoaGlAssert();
-      
+
          glTexCoord2f((float)(sx) / bitmap.width, (float)(sy)/ bitmap.height);
       CocoaGlAssert();
          glVertex2i(dx+surface.offset.x, dy-h+surface.offset.y);
@@ -750,17 +750,17 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       CocoaGlAssert();
          glVertex2i(dx+surface.offset.x, dy+surface.offset.y);
       CocoaGlAssert();
-      
+
          glTexCoord2f((float)(sx+sw)/ bitmap.width, (float)(sy)/ bitmap.height);
       CocoaGlAssert();
          glVertex2i(dx+w+surface.offset.x, dy+surface.offset.y);
       CocoaGlAssert();
-      
+
          glTexCoord2f((float)(sx+sw) / bitmap.width, (float)(sy+sh)/ bitmap.height);
       CocoaGlAssert();
          glVertex2i(dx+w+surface.offset.x, dy+h+surface.offset.y);
       CocoaGlAssert();
-      
+
          glTexCoord2f((float)(sx)/ bitmap.width, (float)(sy+sh)/ bitmap.height);
       CocoaGlAssert();
          glVertex2i(dx+surface.offset.x, dy+h+surface.offset.y);
@@ -790,13 +790,13 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       {
          w = Abs(w);
          sw = Abs(sw);
-         flipX = true; 
+         flipX = true;
       }
       if(Sgn(h) != Sgn(sh))
       {
          h = Abs(h);
          sh = Abs(sh);
-         flipY = true; 
+         flipY = true;
       }
 
       s2dw=(float)w / sw;
@@ -833,7 +833,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       //Clip against the edges of the surfaceination
       if(dx<surface.box.left)
       {
-         //if(!flip) 
+         //if(!flip)
          sx+=(int)((surface.box.left-dx)*d2sw);
          sw-=(int)((surface.box.left-dx)*d2sw);
          w-=surface.box.left-dx;
@@ -910,7 +910,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       //Clip against the edges of the surfaceination
       if(dx<surface.box.left)
       {
-         //if(!flip) 
+         //if(!flip)
          sx+=surface.box.left-dx;
          w-=surface.box.left-dx;
          dx=surface.box.left;
@@ -1141,7 +1141,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
          color[1] = light.diffuse.g * light.multiplier;
          color[2] = light.diffuse.b * light.multiplier;
          glLightfv(GL_LIGHT0 + id, GL_DIFFUSE, color);
-         
+
          color[0] = light.ambient.r * light.multiplier;
          color[1] = light.ambient.g * light.multiplier;
          color[2] = light.ambient.b * light.multiplier;
@@ -1150,7 +1150,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
          color[1] = light.specular.g * light.multiplier;
          color[2] = light.specular.b * light.multiplier;
          glLightfv(GL_LIGHT0 + id, GL_SPECULAR,color);
-         
+
          if(lightObject)
          {
             Vector3D positionVector;
@@ -1188,7 +1188,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
             position[0] = (float)positionVector.x;
             position[1] = (float)positionVector.y;
             position[2] = (float)positionVector.z;
-            
+
             glLightfv(GL_LIGHT0 + id, GL_POSITION, position);
       CocoaGlAssert();
 
@@ -1268,7 +1268,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
          {
             float pickX = display.display3D.pickX + surface.offset.x;
             float pickY = display.height - (display.display3D.pickY + surface.offset.y) - 1;
-            Matrix pickMatrix = 
+            Matrix pickMatrix =
             {
                {
                   w / display.display3D.pickWidth, 0, 0, 0,
@@ -1397,7 +1397,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
             glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, color);
          }
       }
-      {   
+      {
          float color[4] = { material.specular.r, material.specular.g, material.specular.b, 0 };
          glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color);
       }
@@ -1405,7 +1405,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
          float color[4] = { material.emissive.r, material.emissive.g, material.emissive.b, 0 };
          glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, color);
       }
-      
+
       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &material.power);
    }
 
@@ -1473,7 +1473,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
 
       if(!mesh.data)
          mesh.data = MeshData { };
-         
+
       if(mesh.data)
       {
          MeshData meshData = mesh.data;
@@ -1513,7 +1513,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       printf("CocoaOpenGLDisplayDriver: STUB! %s:%i\n", __FILE__, __LINE__);
 
       if(!flags) flags = mesh.flags;
-      
+
       if(glGenBuffersARB)
       {
          if(!(flags.vertices) || meshData.vertices)
@@ -1554,10 +1554,10 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
    void FreeIndices(DisplaySystem displaySystem, IndexData indexData)
    {
       printf("CocoaOpenGLDisplayDriver: STUB! %s:%i\n", __FILE__, __LINE__);
-      
+
       if(indexData)
       {
-         if(indexData.buffer) 
+         if(indexData.buffer)
             glDeleteBuffersARB(1, &indexData.buffer);
          delete indexData.indices;
          delete indexData;
@@ -1584,7 +1584,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
       if(glGenBuffersARB)
       {
          glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, indexData.buffer);
-         glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER_ARB, nIndices * (indices32bit ? sizeof(uint32) : sizeof(uint16)), 
+         glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER_ARB, nIndices * (indices32bit ? sizeof(uint32) : sizeof(uint16)),
             indexData.indices, GL_STATIC_DRAW_ARB);
          glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
       }
@@ -1593,7 +1593,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
    uint16 * LockIndices(DisplaySystem displaySystem, IndexData indexData)
    {
       printf("CocoaOpenGLDisplayDriver: STUB! %s:%i\n", __FILE__, __LINE__);
-      
+
       return indexData.indices;
    }
 
@@ -1603,7 +1603,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
 
       /*if(display.display3D.mesh && glUnlockArraysEXT)
          glUnlockArraysEXT();*/
-      
+
       if(mesh)
       {
          DisplayData displayData = display.driverData;
@@ -1642,7 +1642,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
             {
                glDisableClientState(GL_TEXTURE_COORD_ARRAY);
             }
-               
+
             // *** Color Stream ***
             if(mesh.colors)
             {
@@ -1699,7 +1699,7 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
          glDrawArrays(primitiveTypes[primitive->type.primitiveType], primitive->first, primitive->nVertices);
       else
       {
-         //    *** Hoping the data won't be uploaded at all (Won't really work if another group of the mesh is using the mesh ) *** 
+         //    *** Hoping the data won't be uploaded at all (Won't really work if another group of the mesh is using the mesh ) ***
          // HACK TO SPEED THINGS UP...
          if(primitive->nIndices < (mesh.nVertices >> 2) && !primitive->type.indices32bit)
          {
@@ -1727,15 +1727,15 @@ class CocoaOpenGLDisplayDriver : DisplayDriver
             if(!display.display3D.collectingHits && glBindBufferARB && indexData)
             {
                glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, indexData.buffer);
-               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices, 
+               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices,
                   primitive->type.indices32bit ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, 0);
                glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
             }
             else if(indexData)
-               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices, 
+               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices,
                   primitive->type.indices32bit ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, indexData.indices);
             else
-               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices, 
+               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices,
                   primitive->type.indices32bit ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, primitive->indices);
          }
       }
index 362db21..0cf6510 100644 (file)
@@ -133,7 +133,7 @@ class Direct3D8DisplayDriver : DisplayDriver
       DisplaySystem displaySystem = display.displaySystem;
       D3D8System d3dSystem = displaySystem.driverData;
       D3D8Display d3dDisplay = display.driverData;
-      
+
       //if(!IDirect3DDevice8_GetBackBuffer(d3dSystem.d3dDevice, 0, 0, D3DBACKBUFFER_TYPE_MONO, &d3dDisplay.backBuffer))
       {
          D3DLOCKED_RECT lockedRect;
@@ -164,7 +164,7 @@ class Direct3D8DisplayDriver : DisplayDriver
             lfbBitmap.stride = lockedRect.Pitch >> GetColorDepthShifts(lfbBitmap.pixelFormat);
             lfbBitmap.width = display.width;
             lfbBitmap.height = display.height;
-            
+
             *lfbSurface = lfbBitmap.GetSurface(surface ? surface.offset.x : 0, surface ? surface.offset.y : 0, surface ? &surface.box : null);
             result = true;
          }
@@ -239,7 +239,7 @@ class Direct3D8DisplayDriver : DisplayDriver
       {
          displaySystem.flags.alpha = true;
          //if(displaySystem.flags.fullScreen)
-            displaySystem.flags.flipping = true; 
+            displaySystem.flags.flipping = true;
          displaySystem.pixelFormat = pixelFormat888;
 
          d3dSystem.d3dDll = LoadLibrary("d3d8.dll");
@@ -263,7 +263,7 @@ class Direct3D8DisplayDriver : DisplayDriver
                      }
                      else
                      {
-                        d3dSystem.d3dpp.hDeviceWindow = d3dSystem.hwnd = 
+                        d3dSystem.d3dpp.hDeviceWindow = d3dSystem.hwnd =
                            CreateWindow("static", null, 0,0,0,0,0,null,null,null,null);
                         d3dSystem.d3dpp.Windowed = TRUE;
                      }
@@ -272,7 +272,7 @@ class Direct3D8DisplayDriver : DisplayDriver
                      d3dSystem.format = d3dSystem.d3dpp.BackBufferFormat = d3ddm.Format;
                      d3dSystem.d3dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
 
-                     if(!IDirect3D8_CreateDevice(d3dSystem.direct3D, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, 
+                     if(!IDirect3D8_CreateDevice(d3dSystem.direct3D, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
                         d3dSystem.d3dpp.hDeviceWindow,
                                D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE|D3DCREATE_FPU_PRESERVE,
                                &d3dSystem.d3dpp, &d3dSystem.d3dDevice))
@@ -280,7 +280,7 @@ class Direct3D8DisplayDriver : DisplayDriver
                      else
                      {
                         d3dSystem.usage = D3DUSAGE_SOFTWAREPROCESSING;
-                        if(!IDirect3D8_CreateDevice(d3dSystem.direct3D, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, 
+                        if(!IDirect3D8_CreateDevice(d3dSystem.direct3D, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
                               d3dSystem.d3dpp.hDeviceWindow,
                                   D3DCREATE_SOFTWARE_VERTEXPROCESSING|D3DCREATE_FPU_PRESERVE,
                                   &d3dSystem.d3dpp, &d3dSystem.d3dDevice))
@@ -292,26 +292,26 @@ class Direct3D8DisplayDriver : DisplayDriver
                         DWORD vertexShaders[NUM_VERTEX_SHADERS][7] =
                         {
                            {
-                               D3DVSD_STREAM(0),   
+                               D3DVSD_STREAM(0),
                                D3DVSD_REG(D3DVSDE_POSITION, D3DVSDT_FLOAT3),
                                D3DVSD_END()
                            },
                            {
-                               D3DVSD_STREAM(0),   
+                               D3DVSD_STREAM(0),
                                D3DVSD_REG(D3DVSDE_POSITION, D3DVSDT_FLOAT3),
                                D3DVSD_STREAM(1),
                                D3DVSD_REG(D3DVSDE_NORMAL, D3DVSDT_FLOAT3),
                                D3DVSD_END()
                            },
                            {
-                               D3DVSD_STREAM(0),   
+                               D3DVSD_STREAM(0),
                                D3DVSD_REG(D3DVSDE_POSITION, D3DVSDT_FLOAT3),
                                D3DVSD_STREAM(2),
                                D3DVSD_REG(D3DVSDE_TEXCOORD0, D3DVSDT_FLOAT2),
                                D3DVSD_END()
                            },
                            {
-                               D3DVSD_STREAM(0),   
+                               D3DVSD_STREAM(0),
                                D3DVSD_REG(D3DVSDE_POSITION, D3DVSDT_FLOAT3),
                                D3DVSD_STREAM(1),
                                D3DVSD_REG(D3DVSDE_NORMAL, D3DVSDT_FLOAT3),
@@ -475,19 +475,19 @@ class Direct3D8DisplayDriver : DisplayDriver
             //d3dDisplay.d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
             //d3dDisplay.d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
 
-            result = !IDirect3DDevice8_CreateAdditionalSwapChain(d3dSystem.d3dDevice, 
+            result = !IDirect3DDevice8_CreateAdditionalSwapChain(d3dSystem.d3dDevice,
                &d3dDisplay.d3dpp, &d3dDisplay.swapChain);
 
             if(!result)
             {
                d3dDisplay.d3dpp.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES;
-               result = !IDirect3DDevice8_CreateAdditionalSwapChain(d3dSystem.d3dDevice, 
+               result = !IDirect3DDevice8_CreateAdditionalSwapChain(d3dSystem.d3dDevice,
                   &d3dDisplay.d3dpp, &d3dDisplay.swapChain);
             }
             if(!result)
             {
                d3dDisplay.d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
-               result = !IDirect3DDevice8_CreateAdditionalSwapChain(d3dSystem.d3dDevice, 
+               result = !IDirect3DDevice8_CreateAdditionalSwapChain(d3dSystem.d3dDevice,
                   &d3dDisplay.d3dpp, &d3dDisplay.swapChain);
             }
          }
@@ -495,10 +495,10 @@ class Direct3D8DisplayDriver : DisplayDriver
          if(result)
          {
             if(d3dDisplay.swapChain)
-               result = !IDirect3DSwapChain8_GetBackBuffer(d3dDisplay.swapChain, 
+               result = !IDirect3DSwapChain8_GetBackBuffer(d3dDisplay.swapChain,
                   0, D3DBACKBUFFER_TYPE_MONO, &d3dDisplay.backBuffer);
             else
-               result = !IDirect3DDevice8_GetBackBuffer(d3dSystem.d3dDevice, 
+               result = !IDirect3DDevice8_GetBackBuffer(d3dSystem.d3dDevice,
                   0, D3DBACKBUFFER_TYPE_MONO, &d3dDisplay.backBuffer);
             if(result)
             {
@@ -507,7 +507,7 @@ class Direct3D8DisplayDriver : DisplayDriver
                   d3dSystem.ready = true;
             }
          }
-            
+
          if(d3dSystem.ready)
          {
             float fogDensity = 0;
@@ -590,7 +590,7 @@ class Direct3D8DisplayDriver : DisplayDriver
       {
          //eSystem_Sleep(0.05);
          IDirect3DDevice8_EndScene(d3dSystem.d3dDevice);
-         
+
          if(display.displaySystem.flags.flipping)
          {
             if(d3dDisplay.swapChain)
@@ -680,7 +680,7 @@ class Direct3D8DisplayDriver : DisplayDriver
          IDirect3DTexture8 * texture;
          uint w = pow2i(Min(bitmap.width, 512)), h = pow2i(Min(bitmap.height, 512));
 
-         if(!IDirect3DDevice8_CreateTexture(d3dSystem.d3dDevice, w, h, mipMaps ? log2i(Max(w+1, h+1)) : 1, 0, 
+         if(!IDirect3DDevice8_CreateTexture(d3dSystem.d3dDevice, w, h, mipMaps ? log2i(Max(w+1, h+1)) : 1, 0,
                D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture))
          {
             int level;
@@ -708,7 +708,7 @@ class Direct3D8DisplayDriver : DisplayDriver
                      case D3DFMT_A1R5G5B5: mipMap.pixelFormat = pixelFormat555; break;
                   }
                   mipMap.stride = lockedRect.Pitch >> GetColorDepthShifts(mipMap.pixelFormat);
-               
+
                   mipSurface = mipMap.GetSurface(0,0,null);
                   if(mipSurface)
                   {
@@ -726,7 +726,7 @@ class Direct3D8DisplayDriver : DisplayDriver
                   mipMap.picture = null;
                   delete mipMap;
 
-                  IDirect3DTexture8_UnlockRect(texture, level);            
+                  IDirect3DTexture8_UnlockRect(texture, level);
                }
                if(!mipMaps) break;
             }
@@ -802,7 +802,7 @@ class Direct3D8DisplayDriver : DisplayDriver
 
    void SetBackground(Display display, Surface surface, ColorAlpha color)
    {
-      D3D8Surface d3dSurface = surface.driverData;  
+      D3D8Surface d3dSurface = surface.driverData;
       d3dSurface.background = color;
    }
 
@@ -857,7 +857,7 @@ class Direct3D8DisplayDriver : DisplayDriver
          { (float)x1, (float)y1, 1.0f, surface.foreground, 0, 0 }
       };
 
-      IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_LINESTRIP, 4, 
+      IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_LINESTRIP, 4,
          vertex, sizeof(D3D8Vertex));
 
    }
@@ -876,7 +876,7 @@ class Direct3D8DisplayDriver : DisplayDriver
          { (float)x2 + 1.0f, (float)y2 + 1.0f, 1.0f, d3dSurface.background, 0, 0 }
       };
 
-      IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2, 
+      IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2,
          vertex, sizeof(D3D8Vertex));
 
    }
@@ -889,7 +889,7 @@ class Direct3D8DisplayDriver : DisplayDriver
       D3D8Display d3dDisplay = display.driverData;
       IDirect3DDevice8_Clear(d3dSystem.d3dDevice, 0, null,
          ((type == depthBuffer) ? 0 : D3DCLEAR_TARGET) |
-         ((type == colorBuffer) ? 0 : D3DCLEAR_ZBUFFER), 
+         ((type == colorBuffer) ? 0 : D3DCLEAR_ZBUFFER),
          d3dSurface.background, 1,0);
    }
 
@@ -907,18 +907,18 @@ class Direct3D8DisplayDriver : DisplayDriver
       Color foreground = d3dSurface.writingText ? surface.foreground : white;
       D3D8Vertex vertex[4] =
       {
-         { (float)dx, (float)dy, 1.0f, foreground, 
+         { (float)dx, (float)dy, 1.0f, foreground,
             (float)sx / (src.width-1), (float)sy/ (src.height-1) },
-         { (float)(dx+w), (float)dy, 1.0f, foreground, 
+         { (float)(dx+w), (float)dy, 1.0f, foreground,
             (float)(sx+w)/ (src.width-1), (float)sy/ (src.height-1) },
-         { (float)dx, (float)(dy+h), 1.0f, foreground, 
+         { (float)dx, (float)(dy+h), 1.0f, foreground,
             (float)sx/ (src.width-1), (float)(sy+h)/ (src.height-1) },
-         { (float)(dx+w), (float)(dy+h), 1.0f, foreground, 
+         { (float)(dx+w), (float)(dy+h), 1.0f, foreground,
             (float)(sx+w) / (src.width-1), (float)(sy+h)/ (src.height-1) }
       };
 
       IDirect3DDevice8_SetTexture(d3dSystem.d3dDevice, 0, (IDirect3DBaseTexture8 *)src.picture);
-      IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2, 
+      IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2,
          vertex, sizeof(D3D8Vertex));
       IDirect3DDevice8_SetTexture(d3dSystem.d3dDevice, 0, null);
    }
@@ -931,18 +931,18 @@ class Direct3D8DisplayDriver : DisplayDriver
       D3D8Display d3dDisplay = display.driverData;
       D3D8Vertex vertex[4] =
       {
-         { (float)dx, (float)dy, 1.0f, surface.foreground, 
+         { (float)dx, (float)dy, 1.0f, surface.foreground,
             (float)sx / (src.width-1), (float)sy/ (src.height-1) },
-         { (float)(dx+w), (float)dy, 1.0f, surface.foreground, 
+         { (float)(dx+w), (float)dy, 1.0f, surface.foreground,
             (float)(sx+sw)/ (src.width-1), (float)sy/ (src.height-1) },
-         { (float)dx, (float)(dy+h), 1.0f, surface.foreground, 
+         { (float)dx, (float)(dy+h), 1.0f, surface.foreground,
             (float)sx/ (src.width-1), (float)(sy+sh)/ (src.height-1) },
-         { (float)(dx+w), (float)(dy+h), 1.0f, surface.foreground, 
+         { (float)(dx+w), (float)(dy+h), 1.0f, surface.foreground,
             (float)(sx+sw) / (src.width-1), (float)(sy+sh)/ (src.height-1) }
       };
 
       IDirect3DDevice8_SetTexture(d3dSystem.d3dDevice, 0, (IDirect3DBaseTexture8 *)src.picture);
-      IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2, 
+      IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2,
          vertex, sizeof(D3D8Vertex));
       IDirect3DDevice8_SetTexture(d3dSystem.d3dDevice, 0, null);
    }
@@ -1035,7 +1035,7 @@ class Direct3D8DisplayDriver : DisplayDriver
                { (float)x2 + 1.0f, (float)y2 /*+ 1.5f*/, 1.0f, d3dSurface.background, 0, 0 }
             };
 
-            IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2, 
+            IDirect3DDevice8_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2,
                vertex, sizeof(D3D8Vertex));
          }
          //display.displaySystem.driver.Area(display, surface, x, y, x+w-1, y+h-1);
@@ -1067,7 +1067,7 @@ class Direct3D8DisplayDriver : DisplayDriver
    {
       D3D8Display d3dDisplay = display.driverData;
       /*
-      IDirect3DDevice8_SetRenderState(d3dSystem.d3dDevice, D3DRS_LINEPATTERN, 
+      IDirect3DDevice8_SetRenderState(d3dSystem.d3dDevice, D3DRS_LINEPATTERN,
          stipple?MDWORD(1,stipple):0);
       */
    }
@@ -1083,7 +1083,7 @@ class Direct3D8DisplayDriver : DisplayDriver
             IDirect3DDevice8_SetRenderState(d3dSystem.d3dDevice, D3DRS_MULTISAMPLEANTIALIAS, value ? TRUE : FALSE);
             break;
          case fillMode:
-            IDirect3DDevice8_SetRenderState(d3dSystem.d3dDevice, D3DRS_FILLMODE, 
+            IDirect3DDevice8_SetRenderState(d3dSystem.d3dDevice, D3DRS_FILLMODE,
                ((FillModeValue)value == solid) ? D3DFILL_SOLID : D3DFILL_WIREFRAME);
             break;
          case depthTest:
@@ -1118,9 +1118,9 @@ class Direct3D8DisplayDriver : DisplayDriver
       D3D8Display d3dDisplay = display.driverData;
       if(light != null)
       {
-         D3DLIGHT8 d3dLight = 
+         D3DLIGHT8 d3dLight =
          {
-            D3DLIGHT_DIRECTIONAL, 
+            D3DLIGHT_DIRECTIONAL,
             // Opacity on the light?
             { light.diffuse.r, light.diffuse.g, light.diffuse.b,    1.0f },
             { light.specular.r, light.specular.g, light.specular.b, 1.0f },
@@ -1146,7 +1146,7 @@ class Direct3D8DisplayDriver : DisplayDriver
          }
 
          d3dDisplay.lights[id] = d3dLight;
-         
+
          IDirect3DDevice8_LightEnable(d3dSystem.d3dDevice, id, TRUE);
          IDirect3DDevice8_SetLight(d3dSystem.d3dDevice, id, &d3dDisplay.lights[id]);
 
@@ -1370,7 +1370,7 @@ class Direct3D8DisplayDriver : DisplayDriver
       D3D8System d3dSystem = displaySystem.driverData;
       bool result = false;
       IDirect3DDevice8 * d3dDevice = d3dSystem.d3dDevice;
-      
+
       if(!mesh.data)
          mesh.data = D3D8Mesh { };
       if(mesh.data)
@@ -1380,21 +1380,21 @@ class Direct3D8DisplayDriver : DisplayDriver
          if((mesh.flags .vertices) && !d3dMesh.vertices)
          {
             mesh.vertices = new Vector3Df[mesh.nVertices];
-            if(IDirect3DDevice8_CreateVertexBuffer(d3dDevice, sizeof(Vector3Df) * mesh.nVertices, 
+            if(IDirect3DDevice8_CreateVertexBuffer(d3dDevice, sizeof(Vector3Df) * mesh.nVertices,
                d3dSystem.usage, 0, D3DPOOL_MANAGED, &d3dMesh.vertices))
                result = false;
          }
          if((mesh.flags.normals) && !d3dMesh.normals)
          {
             mesh.normals = new Vector3Df[mesh.nVertices];
-            if(IDirect3DDevice8_CreateVertexBuffer(d3dDevice, sizeof(Vector3Df) * mesh.nVertices, 
+            if(IDirect3DDevice8_CreateVertexBuffer(d3dDevice, sizeof(Vector3Df) * mesh.nVertices,
                d3dSystem.usage, 0, D3DPOOL_MANAGED, &d3dMesh.normals))
                result = false;
          }
          if((mesh.flags.texCoords1) && !d3dMesh.texCoords)
          {
             mesh.texCoords = new Pointf[mesh.nVertices];
-            if(IDirect3DDevice8_CreateVertexBuffer(d3dDevice, sizeof(Pointf) * mesh.nVertices, 
+            if(IDirect3DDevice8_CreateVertexBuffer(d3dDevice, sizeof(Pointf) * mesh.nVertices,
                d3dSystem.usage, 0, D3DPOOL_MANAGED, &d3dMesh.texCoords))
                result = false;
          }
@@ -1424,7 +1424,7 @@ class Direct3D8DisplayDriver : DisplayDriver
          {
             memcpy(normals, mesh.normals, mesh.nVertices * sizeof(Vector3Df));
             IDirect3DVertexBuffer8_Unlock(d3dMesh.normals);
-         }      
+         }
       }
       if(flags.texCoords1 && mesh.texCoords)
       {
@@ -1433,7 +1433,7 @@ class Direct3D8DisplayDriver : DisplayDriver
          {
             memcpy(texCoords, mesh.texCoords, mesh.nVertices * sizeof(Pointf));
             IDirect3DVertexBuffer8_Unlock(d3dMesh.texCoords);
-         }      
+         }
       }
    }
 
@@ -1462,7 +1462,7 @@ class Direct3D8DisplayDriver : DisplayDriver
       if(d3dIndices && nIndices)
       {
          d3dIndices.indices = (void *)(indices32bit ? new uint32[nIndices] : new uint16[nIndices]);
-         IDirect3DDevice8_CreateIndexBuffer(d3dDevice, (indices32bit ? sizeof(uint32) : sizeof(uint16)) * nIndices, 0, indices32bit ? D3DFMT_INDEX32 : D3DFMT_INDEX16, 
+         IDirect3DDevice8_CreateIndexBuffer(d3dDevice, (indices32bit ? sizeof(uint32) : sizeof(uint16)) * nIndices, 0, indices32bit ? D3DFMT_INDEX32 : D3DFMT_INDEX16,
             D3DPOOL_MANAGED, &d3dIndices.buffer);
          d3dIndices.nIndices = nIndices;
       }
@@ -1531,12 +1531,12 @@ class Direct3D8DisplayDriver : DisplayDriver
          {
             case lines:     numPrimitives /= 2; break;
             case triangles: numPrimitives /= 3; break;
-            case triStrip: 
+            case triStrip:
             case triFan:
-               numPrimitives -= 2; 
+               numPrimitives -= 2;
                break;
             case lineStrip:
-               numPrimitives --; 
+               numPrimitives --;
                break;
             case quads:
                numPrimitives /= 4;
@@ -1620,7 +1620,7 @@ class Direct3D8DisplayDriver : DisplayDriver
       D3D8Display d3dDisplay = display.driverData;
       DisplaySystem displaySystem = display.displaySystem;
       D3D8System d3dSystem = displaySystem.driverData;
-      
+
       d3dDisplay.worldMatrix--;
       if(setMatrix)
          SetTransformMatrix(d3dSystem.d3dDevice, d3dDisplay.worldMatrix);
@@ -1644,7 +1644,7 @@ class Direct3D8DisplayDriver : DisplayDriver
       else
       {
          if(camera)
-            matrix.Translate( 
+            matrix.Translate(
                - camera.cPosition.x,
                - camera.cPosition.y,
                - camera.cPosition.z);
index 20d9a13..ebbfa81 100644 (file)
@@ -63,7 +63,7 @@ static class D3DSystem : struct
    IDirect3D9 * (WINAPI * direct3DCreate9)(UINT);
    uint usage;
    D3DPRESENT_PARAMETERS d3dpp;
-   
+
    IDirect3DVertexDeclaration9 * decls[NUM_VERTEX_DECLS], * decl2D;
    bool ready;
    HWND hwnd;
@@ -136,7 +136,7 @@ class Direct3D9DisplayDriver : DisplayDriver
       DisplaySystem displaySystem = display.displaySystem;
       D3DSystem d3dSystem = displaySystem.driverData;
       D3DDisplay d3dDisplay = display.driverData;
-      
+
       //if(!IDirect3DDevice9_GetBackBuffer(d3dSystem.d3dDevice, 0, 0, D3DBACKBUFFER_TYPE_MONO, &d3dDisplay.backBuffer))
       {
          D3DLOCKED_RECT lockedRect;
@@ -167,7 +167,7 @@ class Direct3D9DisplayDriver : DisplayDriver
             lfbBitmap.stride = lockedRect.Pitch >> GetColorDepthShifts(lfbBitmap.pixelFormat);
             lfbBitmap.width = display.width;
             lfbBitmap.height = display.height;
-            
+
             *lfbSurface = lfbBitmap.GetSurface(surface ? surface.offset.x : 0, surface ? surface.offset.y : 0, surface ? surface.box : null);
             result = true;
          }
@@ -266,7 +266,7 @@ class Direct3D9DisplayDriver : DisplayDriver
                      }
                      else
                      {
-                        d3dSystem.d3dpp.hDeviceWindow = d3dSystem.hwnd = 
+                        d3dSystem.d3dpp.hDeviceWindow = d3dSystem.hwnd =
                            CreateWindow("static", null, 0,0,0,0,0,null,null,null,null);
                         d3dSystem.d3dpp.Windowed = TRUE;
                      }
@@ -275,7 +275,7 @@ class Direct3D9DisplayDriver : DisplayDriver
                      d3dSystem.format = d3dSystem.d3dpp.BackBufferFormat = d3ddm.Format;
                      d3dSystem.d3dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
 
-                     if(!IDirect3D9_CreateDevice(d3dSystem.direct3D, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, 
+                     if(!IDirect3D9_CreateDevice(d3dSystem.direct3D, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
                         d3dSystem.d3dpp.hDeviceWindow,
                                D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_PUREDEVICE|D3DCREATE_FPU_PRESERVE,
                                &d3dSystem.d3dpp, &d3dSystem.d3dDevice))
@@ -283,7 +283,7 @@ class Direct3D9DisplayDriver : DisplayDriver
                      else
                      {
                         d3dSystem.usage = D3DUSAGE_SOFTWAREPROCESSING;
-                        if(!IDirect3D9_CreateDevice(d3dSystem.direct3D, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, 
+                        if(!IDirect3D9_CreateDevice(d3dSystem.direct3D, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
                               d3dSystem.d3dpp.hDeviceWindow,
                                   D3DCREATE_SOFTWARE_VERTEXPROCESSING|D3DCREATE_FPU_PRESERVE,
                                   &d3dSystem.d3dpp, &d3dSystem.d3dDevice))
@@ -471,26 +471,26 @@ class Direct3D9DisplayDriver : DisplayDriver
             //d3dDisplay.d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
             //d3dDisplay.d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
 
-            result = !IDirect3DDevice9_CreateAdditionalSwapChain(d3dSystem.d3dDevice, 
+            result = !IDirect3DDevice9_CreateAdditionalSwapChain(d3dSystem.d3dDevice,
                &d3dDisplay.d3dpp, &d3dDisplay.swapChain);
 
             if(!result)
             {
                d3dDisplay.d3dpp.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES;
-               result = !IDirect3DDevice9_CreateAdditionalSwapChain(d3dSystem.d3dDevice, 
+               result = !IDirect3DDevice9_CreateAdditionalSwapChain(d3dSystem.d3dDevice,
                   &d3dDisplay.d3dpp, &d3dDisplay.swapChain);
             }
             if(!result)
             {
                d3dDisplay.d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
-               result = !IDirect3DDevice9_CreateAdditionalSwapChain(d3dSystem.d3dDevice, 
+               result = !IDirect3DDevice9_CreateAdditionalSwapChain(d3dSystem.d3dDevice,
                   &d3dDisplay.d3dpp, &d3dDisplay.swapChain);
             }
          }
 
          if(result)
          {
-            if(!IDirect3DSwapChain9_GetBackBuffer(d3dDisplay.swapChain, 
+            if(!IDirect3DSwapChain9_GetBackBuffer(d3dDisplay.swapChain,
                0, D3DBACKBUFFER_TYPE_MONO, &d3dDisplay.backBuffer))
             {
                if(!IDirect3DDevice9_CreateDepthStencilSurface(d3dSystem.d3dDevice, width, height,
@@ -501,7 +501,7 @@ class Direct3D9DisplayDriver : DisplayDriver
                }
             }
          }
-            
+
          if(d3dSystem.ready)
          {
             float fogDensity = 0;
@@ -584,7 +584,7 @@ class Direct3D9DisplayDriver : DisplayDriver
       {
          //eSystem_Sleep(0.05);
          IDirect3DDevice9_EndScene(d3dSystem.d3dDevice);
-         
+
          if(display.displaySystem.flags.flipping)
          {
             // IDirect3DDevice9_Present(d3dSystem.d3dDevice, null, null, null, null);
@@ -674,7 +674,7 @@ class Direct3D9DisplayDriver : DisplayDriver
          IDirect3DTexture9 * texture;
          uint w = pow2i(Min(bitmap.width, 512)), h = pow2i(Min(bitmap.height, 512));
 
-         if(!IDirect3DDevice9_CreateTexture(d3dSystem.d3dDevice, w, h, mipMaps ? log2i(Max(w+1, h+1)) : 1, 0, 
+         if(!IDirect3DDevice9_CreateTexture(d3dSystem.d3dDevice, w, h, mipMaps ? log2i(Max(w+1, h+1)) : 1, 0,
                D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture, null))
          {
             int level;
@@ -702,7 +702,7 @@ class Direct3D9DisplayDriver : DisplayDriver
                      case D3DFMT_A1R5G5B5: mipMap.pixelFormat = pixelFormat555; break;
                   }
                   mipMap.stride = lockedRect.Pitch >> GetColorDepthShifts(mipMap.pixelFormat);
-               
+
                   mipSurface = mipMap.GetSurface(0,0,null);
                   if(mipSurface)
                   {
@@ -716,7 +716,7 @@ class Direct3D9DisplayDriver : DisplayDriver
                      delete mipSurface;
                   }
 
-                  IDirect3DTexture9_UnlockRect(texture, level);            
+                  IDirect3DTexture9_UnlockRect(texture, level);
 
                   mipMap.picture = null;
                   delete mipMap;
@@ -795,7 +795,7 @@ class Direct3D9DisplayDriver : DisplayDriver
 
    void SetBackground(Display display, Surface surface, ColorAlpha color)
    {
-      D3DSurface d3dSurface = surface.driverData;  
+      D3DSurface d3dSurface = surface.driverData;
       d3dSurface.background = color;
    }
 
@@ -828,7 +828,7 @@ class Direct3D9DisplayDriver : DisplayDriver
          { (float)x2, (float)y2, 1.0f, surface.foreground, 0, 0 }
       };
 
-      if(x1 == x2) 
+      if(x1 == x2)
       {
          /*
          vertex[0].y-= 0.5f;
@@ -836,7 +836,7 @@ class Direct3D9DisplayDriver : DisplayDriver
          */
          vertex[1].y+= 1.0f;
       }
-      else if(y1 == y2) 
+      else if(y1 == y2)
       {
          /*
          vertex[0].x-= 0.5f;
@@ -864,7 +864,7 @@ class Direct3D9DisplayDriver : DisplayDriver
          { (float)x1, (float)y1, 1.0f, surface.foreground, 0, 0 }
       };
 
-      IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_LINESTRIP, 4, 
+      IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_LINESTRIP, 4,
          vertex, sizeof(Vertex));
 
    }
@@ -889,7 +889,7 @@ class Direct3D9DisplayDriver : DisplayDriver
          { (float)x2 + 1.0f, (float)y2 + 1.5f, 1.0f, d3dSurface.background, 0, 0 }
       };
 
-      IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2, 
+      IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2,
          vertex, sizeof(Vertex));
    }
 
@@ -901,7 +901,7 @@ class Direct3D9DisplayDriver : DisplayDriver
       D3DDisplay d3dDisplay = display.driverData;
       IDirect3DDevice9_Clear(d3dSystem.d3dDevice, 0, null,
          ((type == depthBuffer) ? 0 : D3DCLEAR_TARGET) |
-         ((type == colorBuffer) ? 0 : D3DCLEAR_ZBUFFER), 
+         ((type == colorBuffer) ? 0 : D3DCLEAR_ZBUFFER),
          d3dSurface.background, 1,0);
    }
 
@@ -919,18 +919,18 @@ class Direct3D9DisplayDriver : DisplayDriver
       Color foreground = d3dSurface.writingText ? surface.foreground : white;
       Vertex vertex[4] =
       {
-         { (float)dx, (float)dy, 1.0f, foreground, 
+         { (float)dx, (float)dy, 1.0f, foreground,
             (float)sx / (src.width-1), (float)sy/ (src.height-1) },
-         { (float)(dx+w), (float)dy, 1.0f, foreground, 
+         { (float)(dx+w), (float)dy, 1.0f, foreground,
             (float)(sx+w)/ (src.width-1), (float)sy/ (src.height-1) },
-         { (float)dx, (float)(dy+h), 1.0f, foreground, 
+         { (float)dx, (float)(dy+h), 1.0f, foreground,
             (float)sx/ (src.width-1), (float)(sy+h)/ (src.height-1) },
-         { (float)(dx+w), (float)(dy+h), 1.0f, foreground, 
+         { (float)(dx+w), (float)(dy+h), 1.0f, foreground,
             (float)(sx+w) / (src.width-1), (float)(sy+h)/ (src.height-1) }
       };
 
       IDirect3DDevice9_SetTexture(d3dSystem.d3dDevice, 0, (IDirect3DBaseTexture9 *)src.picture);
-      IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2, 
+      IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2,
          vertex, sizeof(Vertex));
       IDirect3DDevice9_SetTexture(d3dSystem.d3dDevice, 0, null);
    }
@@ -943,18 +943,18 @@ class Direct3D9DisplayDriver : DisplayDriver
       D3DDisplay d3dDisplay = display.driverData;
       Vertex vertex[4] =
       {
-         { (float)dx, (float)dy, 1.0f, surface.foreground, 
+         { (float)dx, (float)dy, 1.0f, surface.foreground,
             (float)sx / (src.width-1), (float)sy/ (src.height-1) },
-         { (float)(dx+w), (float)dy, 1.0f, surface.foreground, 
+         { (float)(dx+w), (float)dy, 1.0f, surface.foreground,
             (float)(sx+sw)/ (src.width-1), (float)sy/ (src.height-1) },
-         { (float)dx, (float)(dy+h), 1.0f, surface.foreground, 
+         { (float)dx, (float)(dy+h), 1.0f, surface.foreground,
             (float)sx/ (src.width-1), (float)(sy+sh)/ (src.height-1) },
-         { (float)(dx+w), (float)(dy+h), 1.0f, surface.foreground, 
+         { (float)(dx+w), (float)(dy+h), 1.0f, surface.foreground,
             (float)(sx+sw) / (src.width-1), (float)(sy+sh)/ (src.height-1) }
       };
 
       IDirect3DDevice9_SetTexture(d3dSystem.d3dDevice, 0, (IDirect3DBaseTexture9 *)src.picture);
-      IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2, 
+      IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2,
          vertex, sizeof(Vertex));
       IDirect3DDevice9_SetTexture(d3dSystem.d3dDevice, 0, null);
    }
@@ -1046,7 +1046,7 @@ class Direct3D9DisplayDriver : DisplayDriver
                { (float)x2 + 1.0f, (float)y2 /*+ 1.5f*/, 1.0f, d3dSurface.background, 0, 0 }
             };
 
-            IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2, 
+            IDirect3DDevice9_DrawPrimitiveUP(d3dSystem.d3dDevice, D3DPT_TRIANGLESTRIP, 2,
                vertex, sizeof(Vertex));
          }
          //display.displaySystem.driver.Area(display, surface, x, y, x+w-1, y+h-1);
@@ -1079,7 +1079,7 @@ class Direct3D9DisplayDriver : DisplayDriver
    {
       D3DDisplay d3dDisplay = display.driverData;
       /*
-      IDirect3DDevice9_SetRenderState(d3dSystem.d3dDevice, D3DRS_LINEPATTERN, 
+      IDirect3DDevice9_SetRenderState(d3dSystem.d3dDevice, D3DRS_LINEPATTERN,
          stipple?Muint(1,stipple):0);
       */
    }
@@ -1096,7 +1096,7 @@ class Direct3D9DisplayDriver : DisplayDriver
             IDirect3DDevice9_SetRenderState(d3dSystem.d3dDevice, D3DRS_MULTISAMPLEANTIALIAS, value ? TRUE : FALSE);
             break;
          case fillMode:
-            IDirect3DDevice9_SetRenderState(d3dSystem.d3dDevice, D3DRS_FILLMODE, 
+            IDirect3DDevice9_SetRenderState(d3dSystem.d3dDevice, D3DRS_FILLMODE,
                ((FillModeValue)value == solid) ? D3DFILL_SOLID : D3DFILL_WIREFRAME);
             break;
          case depthTest:
@@ -1140,10 +1140,10 @@ class Direct3D9DisplayDriver : DisplayDriver
       D3DDisplay d3dDisplay = display.driverData;
       if(light != null)
       {
-         D3DLIGHT9 d3dLight = 
+         D3DLIGHT9 d3dLight =
          {
             // Opacity on the light?
-            D3DLIGHT_DIRECTIONAL, 
+            D3DLIGHT_DIRECTIONAL,
             { light.diffuse.r, light.diffuse.g, light.diffuse.b,     1.0f },
             { light.specular.r, light.specular.g, light.specular.b,  1.0f },
             { light.ambient.r, light.ambient.g, light.ambient.b,     1.0f },
@@ -1169,7 +1169,7 @@ class Direct3D9DisplayDriver : DisplayDriver
          }
 
          d3dDisplay.lights[id] = d3dLight;
-         
+
          IDirect3DDevice9_LightEnable(d3dSystem.d3dDevice, id, TRUE);
          IDirect3DDevice9_SetLight(d3dSystem.d3dDevice, id, &d3dDisplay.lights[id] /*d3dLight*/);
 
@@ -1404,21 +1404,21 @@ class Direct3D9DisplayDriver : DisplayDriver
          if((mesh.flags.vertices) && !d3dMesh.vertices)
          {
             mesh.vertices = new Vector3Df[mesh.nVertices];
-            if(IDirect3DDevice9_CreateVertexBuffer(d3dDevice, sizeof(Vector3Df) * mesh.nVertices, 
+            if(IDirect3DDevice9_CreateVertexBuffer(d3dDevice, sizeof(Vector3Df) * mesh.nVertices,
                d3dSystem.usage, 0, D3DPOOL_MANAGED, &d3dMesh.vertices, null))
                result = false;
          }
          if((mesh.flags.normals) && !d3dMesh.normals)
          {
             mesh.normals = new Vector3Df[mesh.nVertices];
-            if(IDirect3DDevice9_CreateVertexBuffer(d3dDevice, sizeof(Vector3Df) * mesh.nVertices, 
+            if(IDirect3DDevice9_CreateVertexBuffer(d3dDevice, sizeof(Vector3Df) * mesh.nVertices,
                d3dSystem.usage, 0, D3DPOOL_MANAGED, &d3dMesh.normals, null))
                result = false;
          }
          if((mesh.flags.texCoords1) && !d3dMesh.texCoords)
          {
             mesh.texCoords = new Pointf[mesh.nVertices];
-            if(IDirect3DDevice9_CreateVertexBuffer(d3dDevice, sizeof(Pointf) * mesh.nVertices, 
+            if(IDirect3DDevice9_CreateVertexBuffer(d3dDevice, sizeof(Pointf) * mesh.nVertices,
                d3dSystem.usage, 0, D3DPOOL_MANAGED, &d3dMesh.texCoords, null))
                result = false;
          }
@@ -1448,7 +1448,7 @@ class Direct3D9DisplayDriver : DisplayDriver
          {
             memcpy(normals, mesh.normals, mesh.nVertices * sizeof(Vector3Df));
             IDirect3DVertexBuffer9_Unlock(d3dMesh.normals);
-         }      
+         }
       }
       if(flags.texCoords1 && mesh.texCoords)
       {
@@ -1457,7 +1457,7 @@ class Direct3D9DisplayDriver : DisplayDriver
          {
             memcpy(texCoords, mesh.texCoords, mesh.nVertices * sizeof(Pointf));
             IDirect3DVertexBuffer9_Unlock(d3dMesh.texCoords);
-         }      
+         }
       }
    }
 
@@ -1486,7 +1486,7 @@ class Direct3D9DisplayDriver : DisplayDriver
       if(d3dIndices && nIndices)
       {
          d3dIndices.indices = (void *)(indices32bit ? new uint32[nIndices] : new uint16[nIndices]);
-         IDirect3DDevice9_CreateIndexBuffer(d3dDevice, (indices32bit ? sizeof(uint32) : sizeof(uint16)) * nIndices, 0, indices32bit ? D3DFMT_INDEX32 : D3DFMT_INDEX16, 
+         IDirect3DDevice9_CreateIndexBuffer(d3dDevice, (indices32bit ? sizeof(uint32) : sizeof(uint16)) * nIndices, 0, indices32bit ? D3DFMT_INDEX32 : D3DFMT_INDEX16,
             D3DPOOL_MANAGED, &d3dIndices.buffer, null);
          d3dIndices.nIndices = nIndices;
       }
@@ -1546,7 +1546,7 @@ class Direct3D9DisplayDriver : DisplayDriver
       D3DSystem d3dSystem = displaySystem.driverData;
       D3DDisplay d3dDisplay = display.driverData;
       IDirect3DDevice9 * d3dDevice = d3dSystem.d3dDevice;
-      
+
       if(primitiveTypes[primitive->type.primitiveType])
       {
          int numPrimitives = (primitive->type.vertexRange) ? primitive->nVertices : primitive->nIndices;
@@ -1556,17 +1556,17 @@ class Direct3D9DisplayDriver : DisplayDriver
          {
             case lines:     numPrimitives /= 2; break;
             case triangles: numPrimitives /= 3; break;
-            case triStrip: 
+            case triStrip:
             case triFan:
-               numPrimitives -= 2; 
+               numPrimitives -= 2;
                break;
             case lineStrip:
-               numPrimitives --; 
+               numPrimitives --;
                break;
             case quads:
                numPrimitives /= 4;
                break;
-         }     
+         }
          if(primitive->type.vertexRange)
          {
             if(primitive->type.primitiveType == quads)
index a4235eb..6e25446 100644 (file)
@@ -64,24 +64,24 @@ class DDrawDisplay : LFBDisplay
          uint ddrawResult = IDirectDrawSurface_Lock(back, null, &backDesc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, null);
          if(ddrawResult == DDERR_SURFACELOST) // !display.full_screen
          {
-         
+
             IDirectDrawSurface_Restore(back);
             ddrawResult = IDirectDrawSurface_Lock(back, null, &backDesc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, null);
          }
-         if(!ddrawResult) 
+         if(!ddrawResult)
          {
             bool validFormat = true;
             switch(backDesc.ddpfPixelFormat.dwRGBBitCount)
             {
                case 8: bitmap.pixelFormat = pixelFormat8; break;
                case 15: bitmap.pixelFormat = pixelFormat555; break;
-               case 16: 
+               case 16:
                   if(backDesc.ddpfPixelFormat.dwGBitMask == 0x3E0)
                      bitmap.pixelFormat = pixelFormat555;
                   else
                      bitmap.pixelFormat = pixelFormat565;
                   break;
-               case 32: 
+               case 32:
                   bitmap.pixelFormat = pixelFormat888; break;
                default:
                   validFormat = false;
@@ -210,7 +210,7 @@ class DirectDrawDisplayDriver : DisplayDriver
             for(c=0; c<256; c++)
                realPalette[c] = ColorAlpha { 255, { realPalette[c].color.b, realPalette[c].color.g, realPalette[c].color.r } };
             ReleaseDC(display.window,hdc);
-         
+
             // *** Reserved Palette Handling ***
             if(!palette)
             {
@@ -352,7 +352,7 @@ class DirectDrawDisplayDriver : DisplayDriver
             {
                ddrawDisplay.frontDesc.dwSize = ddrawDisplay.backDesc.dwSize = sizeof(DDSURFACEDESC);
 
-               if(!IDirectDraw_SetCooperativeLevel( directDraw, display.window, 
+               if(!IDirectDraw_SetCooperativeLevel( directDraw, display.window,
                   (display.displaySystem.flags.fullScreen) ? (DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) : DDSCL_NORMAL))
                {
                   ddrawDisplay.frontDesc.dwFlags = DDSD_CAPS;
@@ -463,7 +463,7 @@ class DirectDrawDisplayDriver : DisplayDriver
    #ifdef USE_GDI_FONT
       DDrawDisplay ddrawDisplay = display.driverData;
       COLORREF rgb;
-      
+
       if(ddrawDisplay.bitmap.pixelFormat == pixelFormat8)
          color = ddrawDisplay.bitmap.palette[ddrawDisplay.rgbLookup[(uint16)(Color555) color]];
       rgb = RGB(color.color.r, color.color.g, color.color.b);
@@ -550,11 +550,11 @@ class DirectDrawDisplayDriver : DisplayDriver
       {
          if(!gdiFont.font)
          {
-            gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem, 
-               gdiFont.faceName, gdiFont.size, gdiFont.flags);         
+            gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem,
+               gdiFont.faceName, gdiFont.size, gdiFont.flags);
          }
-         ((subclass(DisplayDriver))class(LFBDisplayDriver)).TextFont(display, surface, gdiFont.font);          
-      } 
+         ((subclass(DisplayDriver))class(LFBDisplayDriver)).TextFont(display, surface, gdiFont.font);
+      }
       else */
          SelectObject(ddrawDisplay.hdc, font);
    #else
@@ -643,8 +643,8 @@ class DirectDrawDisplayDriver : DisplayDriver
          GDIFont gdiFont = (GDIFont)surface.font;
          if(!gdiFont.font)
          {
-            gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem, 
-               gdiFont.faceName, gdiFont.size, gdiFont.flags);         
+            gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem,
+               gdiFont.faceName, gdiFont.size, gdiFont.flags);
          }
          if(surface.textOpacity)
          {
@@ -703,7 +703,7 @@ class DirectDrawDisplayDriver : DisplayDriver
             if(width) *width = 0;
             if(height) *height = 0;
          }
-      }      
+      }
       /*
       HDC hdc = tmpDC;
       SIZE space, size;
@@ -715,7 +715,7 @@ class DirectDrawDisplayDriver : DisplayDriver
       GetTextExtentPoint32(hdc,text,realLen,&size);
 
       if(width) *width = size.cx + (len - realLen) * space.cx;
-      if(height) 
+      if(height)
       {
          if(realLen)
             *height = size.cy;
@@ -734,7 +734,7 @@ class DirectDrawDisplayDriver : DisplayDriver
       /*if(display && display.alphaBlend)
          ((subclass(DisplayDriver))class(LFBDisplayDriver)).TextExtent(display, surface, text, len, width, height);
       else*/
-      
+
       {
          DDrawDisplay ddrawDisplay = display ? display.driverData : null;
          HDC hdc = ddrawDisplay ? ddrawDisplay.hdc : tmpDC;
@@ -750,7 +750,7 @@ class DirectDrawDisplayDriver : DisplayDriver
 
          // UNICODE FIX: proper space computation
          if(width) *width = size.cx + (wordCount - realLen) * space.cx;
-         if(height) 
+         if(height)
          {
             if(realLen)
                *height = size.cy;
@@ -762,13 +762,13 @@ class DirectDrawDisplayDriver : DisplayDriver
       HDC hdc = ddrawDisplay.hdc;
       SIZE space, size;
       uint realLen;
-      
+
       for(realLen = 0; realLen<len && text[realLen]; realLen++);
       GetTextExtentPoint32(hdc," ",1,&space);
       GetTextExtentPoint32(hdc,text,realLen,&size);
 
       if(width) *width = size.cx + (len - realLen) * space.cx;
-      if(height) 
+      if(height)
       {
          if(realLen)
             *height = size.cy;
index 45ea116..fe5e472 100644 (file)
@@ -35,7 +35,7 @@ class GDIDisplay : LFBDisplay
    ~GDIDisplay()
    {
       if(memDC) DeleteDC(memDC);
-      if(memBitmap) DeleteObject(memBitmap); 
+      if(memBitmap) DeleteObject(memBitmap);
       if(palette) DeleteObject(palette);
       delete logPalette;
    }
@@ -51,7 +51,7 @@ class GDISystem : LFBSystem
 
    ~GDISystem()
    {
-      if(tmpDC)                                                                           
+      if(tmpDC)
          ReleaseDC(0, tmpDC);
    }
 };
@@ -81,11 +81,11 @@ static class GDIFont
 
 static PixelFormat GetColorFormat(int depth)
 {
-   if(depth == 8) 
+   if(depth == 8)
       return pixelFormat8;
-   else if(depth == 16) 
+   else if(depth == 16)
       return pixelFormat555;
-   else 
+   else
       return pixelFormat888;
 }
 
@@ -279,7 +279,7 @@ class GDIDisplayDriver : DisplayDriver
             info->bmiHeader.biBitCount = (uint16)gdiSystem.depth;
             info->bmiHeader.biWidth = gdiDisplay.bitmap.stride;
             info->bmiHeader.biHeight = -height;
-    
+
             for(c=0; c<256; c++)
             {
                info->bmiColors[c].rgbReserved = 0;
@@ -364,7 +364,7 @@ class GDIDisplayDriver : DisplayDriver
          ScrollDC(gdiDisplay.hdc, -x, -y, (RECT *)&box, (RECT *)&box, gdiDisplay.rgn, null);
       }
       ScrollDC(gdiDisplay.memDC, -x, -y, (RECT *)&box, (RECT *)&box, null, null);
+
       numBytes = GetRegionData(gdiDisplay.rgn, 0, null);
       gdiDisplay.data = (RGNDATA *) new0 byte[numBytes];
       GetRegionData(gdiDisplay.rgn, numBytes, gdiDisplay.data);
@@ -416,8 +416,8 @@ class GDIDisplayDriver : DisplayDriver
       }
       else
       {
-         BitBlt(gdiDisplay.hdc, 
-            updateBox.left,updateBox.top, 
+         BitBlt(gdiDisplay.hdc,
+            updateBox.left,updateBox.top,
             updateBox.right - updateBox.left + 1, updateBox.bottom - updateBox.top + 1,
             gdiDisplay.memDC, updateBox.left, updateBox.top, SRCCOPY);
       }
@@ -503,7 +503,7 @@ class GDIDisplayDriver : DisplayDriver
                surface.offset.x = x;
                surface.offset.y = y;
                surface.unclippedBox = surface.box = clip;
-         
+
                result = true;
             }
          }
@@ -531,7 +531,7 @@ class GDIDisplayDriver : DisplayDriver
                surface.offset.x = x;
                surface.offset.y = y;
                surface.unclippedBox = surface.box = clip;
-         
+
                SetDCBrushColor(gdiSurface.hdc, RGB(0,0,0));
                SetDCPenColor(gdiSurface.hdc, RGB(255,255,255));
 
@@ -545,7 +545,7 @@ class GDIDisplayDriver : DisplayDriver
    void Clip(Display display, Surface surface, Box clip)
    {
       GDISurface gdiSurface = surface.driverData;
-      HRGN clippedRgn = null; 
+      HRGN clippedRgn = null;
       if(clip != null)
       {
          Box box = clip;
@@ -564,7 +564,7 @@ class GDIDisplayDriver : DisplayDriver
          }
          else
             clippedRgn = CreateRectRgn(0, 0, 0, 0);
-         
+
          if(clippedRgn)
             SelectClipRgn(gdiSurface.hdc,clippedRgn);
       }
@@ -597,7 +597,7 @@ class GDIDisplayDriver : DisplayDriver
             HBITMAP screenBmp = CreateCompatibleBitmap(hdc, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
             HBITMAP back = SelectObject(memDC, screenBmp);
             uint16 depth;
-            
+
             switch(format)
             {
                case pixelFormat8: depth = 8; break;
@@ -627,7 +627,7 @@ class GDIDisplayDriver : DisplayDriver
             DeleteDC(memDC);
 
             result = true;
-         }   
+         }
       }
       return result;
    }
@@ -640,7 +640,7 @@ class GDIDisplayDriver : DisplayDriver
          GDISurface gdiSurface = surface.driverData;
          GDIDisplay gdiDisplay = display ? display.driverData : null;
          COLORREF rgb = RGB(color.color.r, color.color.g, color.color.b);
-         
+
          SetTextColor(gdiSurface.hdc, rgb);
          gdiSurface.color = rgb;
       }
@@ -651,11 +651,11 @@ class GDIDisplayDriver : DisplayDriver
       ((subclass(DisplayDriver))class(LFBDisplayDriver)).SetBackground(display, surface, color);
 
       if(display && (!display.alphaBlend || display.pixelFormat != pixelFormat888))
-      { 
+      {
          GDISurface gdiSurface = surface.driverData;
          GDIDisplay gdiDisplay = display ? display.driverData : null;
          COLORREF rgb;
-         
+
          if(gdiSurface.bitmap.pixelFormat == pixelFormat8 && display)
             color = gdiSurface.bitmap.palette[gdiDisplay.rgbLookup[(uint16)(Color555) color]];
          rgb = RGB(color.color.r, color.color.g, color.color.b);
@@ -723,7 +723,7 @@ class GDIDisplayDriver : DisplayDriver
       else
       {
          return ((subclass(DisplayDriver))class(LFBDisplayDriver)).ConvertBitmap(displaySystem, src, format, palette);
-      } 
+      }
    }
 
    bool AllocateBitmap(DisplaySystem displaySystem, Bitmap bitmap, int width, int height, int stride, PixelFormat format, bool allocatePalette)
@@ -763,7 +763,7 @@ class GDIDisplayDriver : DisplayDriver
                   }
                }
 
-               bitmap.stride=stride;   
+               bitmap.stride=stride;
                bitmap.width=width;
                bitmap.height=height;
                bitmap.size=(uint)stride*(uint)height;
@@ -788,7 +788,7 @@ class GDIDisplayDriver : DisplayDriver
                info->bmiHeader.biBitCount = depth;
                info->bmiHeader.biWidth = bitmap.stride;
                info->bmiHeader.biHeight = -height;
-    
+
                for(c=0; c<256; c++)
                {
                   info->bmiColors[c].rgbReserved = 0;
@@ -880,9 +880,9 @@ class GDIDisplayDriver : DisplayDriver
       {
          if(gdiFont.gdiFont)
             DeleteObject(gdiFont.gdiFont);
-         if(gdiFont.font) 
+         if(gdiFont.font)
             ((subclass(DisplayDriver))class(LFBDisplayDriver)).UnloadFont(displaySystem, gdiFont.font);
-         delete gdiFont; 
+         delete gdiFont;
       }
    }
 
@@ -893,16 +893,16 @@ class GDIDisplayDriver : DisplayDriver
       {
          if(!gdiFont.font)
          {
-            gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem, 
-               gdiFont.faceName, gdiFont.size, gdiFont.flags);         
+            gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem,
+               gdiFont.faceName, gdiFont.size, gdiFont.flags);
          }
-         ((subclass(DisplayDriver))class(LFBDisplayDriver)).TextFont(display, surface, gdiFont.font);          
-      } 
-      else 
+         ((subclass(DisplayDriver))class(LFBDisplayDriver)).TextFont(display, surface, gdiFont.font);
+      }
+      else
       {
          GDISurface gdiSurface = surface.driverData;
          SelectObject(gdiSurface.hdc, gdiFont.gdiFont);
-      }      
+      }
    }
 
    void TextOpacity(Display display, Surface surface, bool opaque)
@@ -912,7 +912,7 @@ class GDIDisplayDriver : DisplayDriver
       {
          GDISurface gdiSurface = surface.driverData;
          SetBkMode(gdiSurface.hdc, opaque ? OPAQUE : TRANSPARENT);
-      }      
+      }
    }
 
    void WriteText(Display display, Surface surface, int x, int y, char * text, int len)
@@ -922,8 +922,8 @@ class GDIDisplayDriver : DisplayDriver
          GDIFont gdiFont = (GDIFont)surface.font;
          if(!gdiFont.font)
          {
-            gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem, 
-               gdiFont.faceName, gdiFont.size, gdiFont.flags);         
+            gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem,
+               gdiFont.faceName, gdiFont.size, gdiFont.flags);
          }
          if(surface.textOpacity)
          {
@@ -973,14 +973,14 @@ class GDIDisplayDriver : DisplayDriver
 
          // UNICODE FIX: proper space computation
          if(width) *width = size.cx + (wordCount - realLen) * space.cx;
-         if(height) 
+         if(height)
          {
             if(realLen)
                *height = size.cy;
             else
                *height = wordCount ? space.cy : 0;
          }
-      }      
+      }
    }
 
    void FontExtent(DisplaySystem displaySystem, Font font, char * text, int len, int * width, int * height)
@@ -1010,7 +1010,7 @@ class GDIDisplayDriver : DisplayDriver
             if(width) *width = 0;
             if(height) *height = 0;
          }
-      }      
+      }
    }
 
    void DrawingChar(Display display, Surface surface, byte character)
index 3b820ac..1ffa693 100644 (file)
@@ -265,7 +265,7 @@ static int numFonts;
 #undef CompareString
 static BinaryTree loadedFonts
 {
-   CompareKey = (void *)BinaryTree::CompareString 
+   CompareKey = (void *)BinaryTree::CompareString
 };
 
 class FontEntry : BTNode
@@ -276,7 +276,7 @@ class FontEntry : BTNode
 
    int used;
    byte * buffer;
-   
+
    //If we don't save the FT_Stream before sacrificing it to FreeType, the garbage collector (if one is used) will destroy it prematurely
    FT_Stream stream;
    Font font;
@@ -373,7 +373,7 @@ class GlyphPack : BTNode
                // printf("\nRendering arabic in %s (%d)\n", font.faceName, key & 0xFFFFFF);
                break;
             case HB_Script_Devanagari:
-               testChar = 0x905; 
+               testChar = 0x905;
                break;
             case 60: testChar = 'あ'; break;
             case 61: testChar = 0x3400; break;
@@ -395,7 +395,7 @@ class GlyphPack : BTNode
       FT_Set_Char_Size( fontEntry.face, (int)(font.size * 64), (int)(font.size * 64), 96, 96);
       */
 
-      maxWidth = 0; 
+      maxWidth = 0;
       maxHeight = 0;
 
       for(c = 0; c < MAX_FONT_LINK_ENTRIES; c++)
@@ -405,7 +405,7 @@ class GlyphPack : BTNode
          {
             FT_Matrix matrix;
             FT_Vector pen = { 0, 0 };
-            
+
             if(font.fakeItalic)
             {
                matrix.xx = (FT_Fixed)( 1.0 * 0x10000L );
@@ -499,13 +499,13 @@ class GlyphPack : BTNode
             int glyphNo = isGlyph ? (((uint)key | c) & 0x00FFFFFF) : FT_Get_Char_Index(faces[c], (uint)key | c);
 
             FT_Load_Glyph(faces[c], glyphNo, /*FT_LOAD_DEFAULT | FT_LOAD_FORCE_AUTOHINT*/ FT_LOAD_DEFAULT /*FT_LOAD_NO_HINTING*/); // FT_LOAD_RENDER // FT_LOAD_NO_HINTING
-            
+
             FT_Render_Glyph(slot, FT_RENDER_MODE_NORMAL);
 
             x = sx;
             y = sy;
             //printf("%d, %d\n", maxHeight, faces[c]->size->metrics.height >> 6);
-            
+
             glyph->left = slot->bitmap_left;
             // glyph->top = ((64 + (64 - faces[c]->glyph->metrics.height & 0x3F)) >> 6) + (int)(ascender - slot->bitmap_top) + font.height - (faces[c]->size->metrics.height >> 6);
             // glyph->top = (int)(ascender - slot->bitmap_top) + 2 * (font.height - maxHeight);
@@ -519,7 +519,7 @@ class GlyphPack : BTNode
 
             //glyph->top = (int)(ascender - slot->bitmap_top); // + ((faces[c]->size->metrics.height >> 6) - (faces[0]->size->metrics.height >> 6)) + (font.height - (faces[c]->size->metrics.height >> 6));
             //glyph->top = (int)(ascender - slot->bitmap_top); // + ((faces[c]->size->metrics.height >> 6) - (faces[0]->size->metrics.height >> 6)) + (font.height - (faces[c]->size->metrics.height >> 6));
-            
+
             //glyph->top = (int)(ascender - slot->bitmap_top);// + (font.height - maxHeight);
             glyph->top = (int)(ascender - slot->bitmap_top) + (int)(font.height - (faces[c]->size->metrics.height >> 6)) / 2;
 
@@ -558,7 +558,7 @@ class GlyphPack : BTNode
                      {
                         picture[j * bitmap.stride + i] = (slot->bitmap.buffer[q + p] & bit) ? 255 : 0;
                         bit >>= 1;
-                        if(!bit) { bit = 0x80; p++; }                     
+                        if(!bit) { bit = 0x80; p++; }
                      }
                      else
                      {
@@ -589,7 +589,7 @@ class GlyphPack : BTNode
             for(c = 0; c<256; c++)
                bitmap.palette[c] = ColorAlpha { 255, { (byte)c,(byte)c,(byte)c } };
             bitmap.pixelFormat = pixelFormat8;
-            
+
             /*
             //strcpy(fileName, faceName);
             if(flags)
@@ -644,14 +644,14 @@ static uint * shaping(FontEntry entry, uint16 * string, int len, HB_Script scrip
    shaper_item.num_glyphs = shaper_item.item.length;
    shaper_item.glyphIndicesPresent = 0;
    shaper_item.initialGlyphCount = 0;
-   shaper_item.num_glyphs = 0;   
-   shaper_item.glyphs = null;   
+   shaper_item.num_glyphs = 0;
+   shaper_item.glyphs = null;
 
    while(!HB_ShapeItem(&shaper_item))
    {
       if(shaper_item.num_glyphs > maxGlyphs)
       {
-         maxGlyphs = shaper_item.num_glyphs;                                                                                                            
+         maxGlyphs = shaper_item.num_glyphs;
          glyphs = shaper_item.glyphs = renew0 glyphs HB_Glyph[maxGlyphs];
          shaper_item.attributes   = renew0 shaper_item.attributes HB_GlyphAttributes[maxGlyphs];
          shaper_item.advances     = renew0 shaper_item.advances HB_Fixed[maxGlyphs];
@@ -662,7 +662,7 @@ static uint * shaping(FontEntry entry, uint16 * string, int len, HB_Script scrip
       {
          shaper_item.glyphs = glyphs;
          shaper_item.num_glyphs = maxGlyphs;
-      } 
+      }
   }
 
    *numGlyphs = shaper_item.num_glyphs;
@@ -827,7 +827,7 @@ static int CALLBACK MyFontProc(ENUMLOGFONTEX * font, NEWTEXTMETRICEX *lpntme, in
       {
          if(!RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts",0,KEY_READ,&key) ||
             !RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Fonts",0,KEY_READ,&key))
-         {  
+         {
             int value = 0;
             while(true)
             {
@@ -863,14 +863,14 @@ static int CALLBACK MyFontProc(ENUMLOGFONTEX * font, NEWTEXTMETRICEX *lpntme, in
                   strcpy(fileName, fontFileName);
                   RegCloseKey(key);
                   return 0;
-               }               
+               }
             }
             RegCloseKey(key);
             return 1;
          }
       }
    }
-   return 1;   
+   return 1;
 }
 #endif
 
@@ -911,7 +911,7 @@ public class LFBDisplayDriver : DisplayDriver
             case 2: stride = width;                    break;
          }
       }
-      bitmap.stride = stride;   
+      bitmap.stride = stride;
       bitmap.width = width;
       bitmap.height = height;
       bitmap.size = (uint32) stride * (uint32)height;
@@ -948,7 +948,7 @@ public class LFBDisplayDriver : DisplayDriver
    }
 
    bool ConvertBitmap(DisplaySystem displaySystem, Bitmap src, PixelFormat format, ColorAlpha * palette)
-   {  
+   {
       bool result = false;
       LFBSystem lfbSystem = displaySystem ? displaySystem.driverData : null;
 
@@ -961,7 +961,7 @@ public class LFBDisplayDriver : DisplayDriver
                /*
                DWORD c;
                DWORD * picture = (DWORD *)src.picture;
-               
+
                for(c = 0; c<src.size; c++, picture++)
                {
                   if(*picture & 0xFFFFFF)
@@ -1254,7 +1254,7 @@ public class LFBDisplayDriver : DisplayDriver
          case pixelFormat565:  lfbSurface.foreground = (Color565)color; break;
          case pixelFormat888:  lfbSurface.foreground = color; break;
          case pixelFormatRGBA: lfbSurface.foreground = (ColorRGBA)color; break;
-         case pixelFormatText: 
+         case pixelFormatText:
             if(display)
                lfbSurface.foreground = BestColorMatch(lfbDisplay.bitmap.palette,0,15,color) << 8;
             else
@@ -1281,7 +1281,7 @@ public class LFBDisplayDriver : DisplayDriver
          case pixelFormat565:  lfbSurface.background = (Color565)color; break;
          case pixelFormat888:  lfbSurface.background = color; break;
          case pixelFormatRGBA: lfbSurface.background = (ColorRGBA)color; break;
-         case pixelFormatText: 
+         case pixelFormatText:
             if(display)
                lfbSurface.background = BestColorMatch(lfbDisplay.bitmap.palette,0,15,color) << 12;
             else
@@ -1481,7 +1481,7 @@ public class LFBDisplayDriver : DisplayDriver
                         ((uint16 *)lfbSurface.bitmap.picture)[offset]=(uint16)color;
                      else
                      {
-                        ((uint16 *)lfbSurface.bitmap.picture)[offset] = 
+                        ((uint16 *)lfbSurface.bitmap.picture)[offset] =
                            (((uint16 *)lfbSurface.bitmap.picture)[offset] & 0xF000) | (uint16)color;
                      }
                   }
@@ -1512,7 +1512,7 @@ public class LFBDisplayDriver : DisplayDriver
                break;
          }
       }
-      else 
+      else
       {
          if(x2 >= x1)
          {
@@ -1697,14 +1697,14 @@ public class LFBDisplayDriver : DisplayDriver
    void memset_32_aligned(void *buf, int val, int dwords)
    {
             // Qword align
-            if ((int)(buf) & 4) 
+            if ((int)(buf) & 4)
             {
                     *((uint32 *)(buf)) = val;
                     buf = ((uint32 *)(buf))+1;
                     dwords--;
             }
-    
-            if (dwords > 1) 
+
+            if (dwords > 1)
             {
                     __asm {
                             cld
@@ -1724,7 +1724,7 @@ public class LFBDisplayDriver : DisplayDriver
                             emms
                     };
             }
-    
+
             // Final dword
             if (dwords & 1) *((int*)(buf)) = val;
    }*/
@@ -1816,21 +1816,21 @@ public class LFBDisplayDriver : DisplayDriver
    void memset_32(void *buf, uint32 val, uint32 dwords)
    {
       int align = 0;
-      if ((uint32)(buf) & 3) 
+      if ((uint32)(buf) & 3)
       {
          align = 4;
          dwords--;
-         
+
          if (((uint32)(buf) & 1))
          {
-            *(byte *)(buf) = (byte)(val&0xFF); 
+            *(byte *)(buf) = (byte)(val&0xFF);
             buf = ((byte *)(buf))+1;
             val = ((val& 0xFF) << 24) || ((val& 0xFFFFFF00) >> 8);
             align --;
          }
          if (((uint32)(buf) & 2))
          {
-            *(uint16 *)(buf) = (uint16)(val&0xFFFF); 
+            *(uint16 *)(buf) = (uint16)(val&0xFFFF);
             buf = ((uint16 *)(buf))+1;
             val = ((val& 0xFFFF) << 16) || ((val& 0xFFFF0000) >> 16);
             align-=2;
@@ -1841,12 +1841,12 @@ public class LFBDisplayDriver : DisplayDriver
       {
          if (align == 1)
          {
-            *(byte *)(buf) = (byte)(val&0xFF); 
+            *(byte *)(buf) = (byte)(val&0xFF);
          }
          else
          {
-            *(uint16 *)(buf) = (uint16)(val&0xFFFF); 
-            if (align & 1) *((byte *)(buf)+2) = (byte)((val>>16)&0xFF); 
+            *(uint16 *)(buf) = (uint16)(val&0xFFFF);
+            if (align & 1) *((byte *)(buf)+2) = (byte)((val>>16)&0xFF);
          }
       }
    }
@@ -1877,7 +1877,7 @@ public class LFBDisplayDriver : DisplayDriver
       {
          int w,y;
          byte * theOffset;
-         
+
          w = x2-x1+1;
          if(w<1) return;
 
@@ -1952,14 +1952,14 @@ public class LFBDisplayDriver : DisplayDriver
                               mov eax,color
                               mov edx,y
                               mov ecx,w
-                              
+
                               start:
                                  push ecx
-                                 
+
                                  rep stosd
                                  add edi,ebx
                                  pop ecx
-                                 dec edx                        
+                                 dec edx
                                  jnz start
                               pop edx
                               pop ebx
@@ -1998,7 +1998,7 @@ public class LFBDisplayDriver : DisplayDriver
                         {
                            int c;
                            for(c = 0; c < w; c++, dest++)
-                           {                              
+                           {
                               Color destColor;
                               if(pixelFormat == pixelFormat565)      { destColor = (Color)*(Color565 *)dest; }
                               else if(pixelFormat == pixelFormat555) { destColor = (Color)*(Color555 *)dest; }
@@ -2036,7 +2036,7 @@ public class LFBDisplayDriver : DisplayDriver
                         {
                            int c;
                            for(c = 0; c < w; c++, dest++)
-                           {                              
+                           {
                               int dr = dest->color.r;
                               int dg = dest->color.g;
                               int db = dest->color.b;
@@ -2352,7 +2352,7 @@ public class LFBDisplayDriver : DisplayDriver
       if(bitmap.pixelFormat != lfbDisplay.bitmap.pixelFormat || bitmap.width < w || bitmap.height < h)
       {
          bitmap.Free();
-         bitmap.Allocate(null, w,h,w, lfbDisplay.bitmap.pixelFormat, 
+         bitmap.Allocate(null, w,h,w, lfbDisplay.bitmap.pixelFormat,
             (lfbDisplay.bitmap.pixelFormat == pixelFormat8)?true:false);
       }
       if(bitmap)
@@ -2383,7 +2383,7 @@ public class LFBDisplayDriver : DisplayDriver
       {
          w = Abs(w);
          sw = Abs(sw);
-         flip = true; 
+         flip = true;
       }
 
       s2dw=(float)w / sw;
@@ -2527,7 +2527,7 @@ public class LFBDisplayDriver : DisplayDriver
       {
          w = Abs(w);
          sw = Abs(sw);
-         flip = true; 
+         flip = true;
       }
 
       s2dw=(float)w / sw;
@@ -2665,12 +2665,12 @@ public class LFBDisplayDriver : DisplayDriver
                         else if(alphaWrite)
                            dest->a = (byte)a;
                      }
-                  } 
+                  }
                   dest += adddest;
                }
             }
-            else 
-            { 
+            else
+            {
                int y;
                for (y = 0; y < h; y++)
                {
@@ -2694,7 +2694,7 @@ public class LFBDisplayDriver : DisplayDriver
                            g += pixel.color.g;
                            b += pixel.color.b;
                            numPixels++;
-                        } 
+                        }
                      a /= numPixels;
                      r /= numPixels;
                      g /= numPixels;
@@ -2720,7 +2720,7 @@ public class LFBDisplayDriver : DisplayDriver
                      }
                   }
                   dest += adddest;
-               } 
+               }
             }
          }
          else if(!src.paletteShades && src.pixelFormat == lfbSurface.bitmap.pixelFormat)
@@ -2768,7 +2768,7 @@ public class LFBDisplayDriver : DisplayDriver
                   delete fontEntry;
                }
             }
-         } 
+         }
 #endif
          delete font;
       }
@@ -2849,13 +2849,13 @@ public class LFBDisplayDriver : DisplayDriver
                FontData fontData = { { 0 } };
                LOGFONT logFont = { 0 };
                HDC hdc = GetDC(0);
-      
+
                fakeItalic = false;
-      
+
                logFont.lfCharSet = DEFAULT_CHARSET;
                strcpy(logFont.lfFaceName, faceName);
                fontData.flags = flags;
-                  
+
                EnumFontFamiliesEx(hdc, &logFont, (void *)MyFontProc, (DWORD)&fontData, 0);
                if(!fontData.fileName[0] && flags.bold)
                {
@@ -2869,7 +2869,7 @@ public class LFBDisplayDriver : DisplayDriver
                   EnumFontFamiliesEx(hdc, &logFont, (void *)MyFontProc, (DWORD)&fontData, 0);
                   fakeItalic = true;
                }
-      
+
                if(fontData.fileName[0])
                {
                   GetWindowsDirectory(fileName, MAX_LOCATION);
@@ -2877,7 +2877,7 @@ public class LFBDisplayDriver : DisplayDriver
                   PathCat(fileName, fontData.fileName);
                }
                ReleaseDC(0, hdc);
-            }  
+            }
    #elif !defined(ECERE_NOFONTCONFIG)
             {
                char * fileName2;
@@ -2899,7 +2899,7 @@ public class LFBDisplayDriver : DisplayDriver
 
                if(testChar)
                   FcCharSetAddChar(charSet, testChar);
-   
+
                pattern = FcPatternBuild(null,
                                //FC_SOURCE, FcTypeString, "freetype",
                                FC_FAMILY, FcTypeString, faceName,
@@ -2956,7 +2956,7 @@ public class LFBDisplayDriver : DisplayDriver
             links[0] = 0;
             if(!RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontLink\\SystemLink",0,KEY_READ,&key) ||
                !RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\FontLink\\SystemLink",0,KEY_READ,&key))
-            {  
+            {
                // int value = 0;
                uint32 type;
                int size = 1024;
@@ -3002,7 +3002,7 @@ public class LFBDisplayDriver : DisplayDriver
                      FT_Open_Args args = { 0 };
                      FT_Parameter param = { FT_PARAM_TAG_UNPATENTED_HINTING };
                      FT_Stream stream = new0 FT_StreamRec[1];
-                     
+
                      if(!ftLibrary)
                         FT_Init_FreeType( &ftLibrary );
 
@@ -3149,7 +3149,7 @@ public class LFBDisplayDriver : DisplayDriver
                         }
                      }
 #endif
-                     
+
                   }
                   linksPos += c;
                   while(links[linksPos] && links[linksPos] != ',') linksPos++;
@@ -3157,7 +3157,7 @@ public class LFBDisplayDriver : DisplayDriver
                }
             }
          }
-            
+
          if(!result)
             UnloadFont(displaySystem, font);
          else
@@ -3173,7 +3173,7 @@ public class LFBDisplayDriver : DisplayDriver
    }
 
 #if !defined(ECERE_NOTRUETYPE)
-   void ::ProcessString(Font font, DisplaySystem displaySystem, byte * text, int len, 
+   void ::ProcessString(Font font, DisplaySystem displaySystem, byte * text, int len,
                         void (* callback)(Surface surface, Display display, int x, int y, GlyphInfo * glyph, Bitmap bitmap),
                         Surface surface, Display display, int * x, int y)
    {
@@ -3191,7 +3191,7 @@ public class LFBDisplayDriver : DisplayDriver
          int fontEntryNum = 0;
          int glyphScript = 0;
          FontEntry curFontEntry;
-         
+
          pack.bitmap.alphaBlend = true;
 
          for(c = 0; c < len || (numGlyphs && (rightToLeft ? (glyphIndex >= 0) : (glyphIndex < numGlyphs)));)
@@ -3212,7 +3212,7 @@ public class LFBDisplayDriver : DisplayDriver
                unichar ahead = 0;
                unichar testChar = 0;
                char * testLang = null;
-               
+
                while(true)
                {
                   HB_Script script = HB_Script_Common;
@@ -3236,7 +3236,7 @@ public class LFBDisplayDriver : DisplayDriver
                            int nb;
                            unichar ahead = UTF8GetChar((char *)text + a, &nb);
                            if((ahead >= 0x590 && ahead <= 0x7C0) || (ahead >= 0xFB1D && ahead <= 0xFB4F) || (ahead >= 0xFB50 && ahead <= 0xFDFF))
-                              script = curScript;                           
+                              script = curScript;
                         }
                         else
                            script = curScript;
@@ -3285,7 +3285,7 @@ public class LFBDisplayDriver : DisplayDriver
                      if(c >= len)
                         break;
                   }
-                  else 
+                  else
                   {
                      if(!script || script > HB_ScriptCount) { c += nb; if(script > HB_ScriptCount) curScript = script; break; }
                      if(!script) { c += nb; break; }
@@ -3318,7 +3318,7 @@ public class LFBDisplayDriver : DisplayDriver
                   case HB_Script_Arabic:        testChar = 0x621; /*testLang = "ar"; */
                      //printf("Arabic ");
                      break;
-                  case HB_Script_Devanagari:    testChar = 0x905; testLang = "sa"; 
+                  case HB_Script_Devanagari:    testChar = 0x905; testLang = "sa";
                      //printf("Devanagari ");
                      break;
                   case HB_Script_Hebrew:        testChar = 0x05EA /*'ת'*/; /*testLang = "he"; */
@@ -3343,8 +3343,8 @@ public class LFBDisplayDriver : DisplayDriver
                         printf("Not found in %s\n", (char *)font.fontEntries[fontEntryNum].key);*/
                   }
                }
-               
-               if(fontEntryNum == MAX_FONT_LINK_ENTRIES) 
+
+               if(fontEntryNum == MAX_FONT_LINK_ENTRIES)
                {
 #if !defined(__WIN32__) && !defined(ECERE_NOFONTCONFIG)
                   int fontID = 0;
@@ -3363,7 +3363,7 @@ public class LFBDisplayDriver : DisplayDriver
                   if(fontEntryNum == MAX_FONT_LINK_ENTRIES)
 #endif
                      continue;
-            
+
 #if !defined(__WIN32__) && !defined(ECERE_NOFONTCONFIG)
                   {
                      charSet = FcCharSetCreate();
@@ -3411,16 +3411,16 @@ public class LFBDisplayDriver : DisplayDriver
                         if(file)
                         {
                            FileSize fileSize = file.GetSize();
-                           FT_Open_Args args = { 0 };                            
+                           FT_Open_Args args = { 0 };
                            FT_Parameter param = { FT_PARAM_TAG_UNPATENTED_HINTING };
                            FT_Stream stream = new0 FT_StreamRec[1];
-                           
+
                            if(!ftLibrary)
                               FT_Init_FreeType( &ftLibrary );
 
                            fontEntry = FontEntry { key = (uintptr)CopyString(fileName) };
                            fontEntry.stream = stream;
-                                                
+
                            //args.num_params = 1;
                            args.params = &param;
 
@@ -3441,7 +3441,7 @@ public class LFBDisplayDriver : DisplayDriver
                            // delete file;
                            if(fontEntry.face)
                            {
-                              fontEntry.hbFace = HB_NewFace(fontEntry.face, hb_getSFntTable);            
+                              fontEntry.hbFace = HB_NewFace(fontEntry.face, hb_getSFntTable);
                               fontEntry.hbFont.klass = &hb_fontClass;
                               fontEntry.hbFont.userData = fontEntry; //.face;
 
@@ -3463,7 +3463,7 @@ public class LFBDisplayDriver : DisplayDriver
                         fontEntry.used++;
                      }
                   }
-                  if(pattern) FcPatternDestroy(pattern);          
+                  if(pattern) FcPatternDestroy(pattern);
                   if(matched) FcPatternDestroy(matched);
                   if(charSet) FcCharSetDestroy(charSet);
 #endif
@@ -3488,7 +3488,7 @@ public class LFBDisplayDriver : DisplayDriver
 
             if(packNo != lastPack)
             {
-               if(glyphNo < 128) 
+               if(glyphNo < 128)
                   pack = font.asciiPack;
                else
                {
@@ -3548,7 +3548,7 @@ public class LFBDisplayDriver : DisplayDriver
    {
       if(displaySystem && displaySystem.flags.text && len)
       {
-         if(width) 
+         if(width)
          {
             int num = len;
             *width = num * textCellW;
@@ -3595,7 +3595,7 @@ public class LFBDisplayDriver : DisplayDriver
          x /= textCellW;
          y /= textCellH;
 
-         if(y > surface.box.bottom || y < surface.box.top) 
+         if(y > surface.box.bottom || y < surface.box.top)
             return;
          coffset += (y+surface.offset.y) * lfbSurface.bitmap.stride + x + surface.offset.x;
          for(c=0; (c<len && x < surface.box.left); c++, x++,coffset++);
@@ -3607,7 +3607,7 @@ public class LFBDisplayDriver : DisplayDriver
                *coffset = (uint16) (((*coffset)&0xF000)|lfbSurface.foreground|text[c]);
          }
       }
-      else 
+      else
       {
          lfbSurface.writingText = true;
 #if !defined(ECERE_NOTRUETYPE)
@@ -3617,7 +3617,7 @@ public class LFBDisplayDriver : DisplayDriver
          lfbSurface.writingText = false;
       }
    }
-   
+
    void TextFont(Display display, Surface surface, Font font)
    {
       LFBSurface lfbSurface = surface.driverData;
index 2047275..eb0ca12 100644 (file)
@@ -27,16 +27,16 @@ static int CC(int color)
       character == 141 || character == 142 || character == 143 || character == 155 ||
       character == 156)
       character = 32;
-   else if(character < 32) 
+   else if(character < 32)
    {
       character += 95;
       result |= A_ALTCHARSET;
    }
    if(color == 0x0800)
-      result |= A_DIM; 
-   else if(color & 0x0800) 
+      result |= A_DIM;
+   else if(color & 0x0800)
       result |= A_BOLD;
-   if(color & 0x8000) 
+   if(color & 0x8000)
       result |= A_BLINK;
    result |= character;
    return result;
@@ -101,7 +101,7 @@ class NCursesDisplayDriver : DisplayDriver
 
       cursesDisplay.bitmap.picture = new0 byte[2 * width / textCellW * height / textCellW];
       if(cursesDisplay.bitmap.picture)
-      {  
+      {
          cursesDisplay.bitmap.stride = width / textCellW;
          cursesDisplay.bitmap.pixelFormat = pixelFormatText;
          cursesDisplay.bitmap.size = width / textCellW * height / textCellH;
@@ -188,12 +188,12 @@ class NCursesDisplayDriver : DisplayDriver
 
          if(lfbSurface.opaqueText)
          {
-            mvaddch((y+surface.offset.y),x+surface.offset.x, 
+            mvaddch((y+surface.offset.y),x+surface.offset.x,
                CC(lfbSurface.background|lfbSurface.foreground|lfbSurface.drawingChar));
          }
          else
          {
-            mvaddch((y+surface.offset.y),x+surface.offset.x, 
+            mvaddch((y+surface.offset.y),x+surface.offset.x,
               CC(lfbSurface.background|lfbSurface.foreground|lfbSurface.drawingChar));
          }
       }
@@ -224,7 +224,7 @@ class NCursesDisplayDriver : DisplayDriver
          }
          else
          {
-            uint16 * lfbPtr = ((uint16 *)lfbSurface.bitmap.picture) + 
+            uint16 * lfbPtr = ((uint16 *)lfbSurface.bitmap.picture) +
                (y1+surface.offset.y)*lfbSurface.bitmap.stride+x1+surface.offset.x;
             int y;
             for(y=y1;y<=y2; y++, lfbPtr += lfbSurface.bitmap.stride)
@@ -252,7 +252,7 @@ class NCursesDisplayDriver : DisplayDriver
          }
          else
          {
-            uint16 * lfbPtr = ((uint16 *)lfbSurface.bitmap.picture) + 
+            uint16 * lfbPtr = ((uint16 *)lfbSurface.bitmap.picture) +
                (y1+surface.offset.y)*display.width / textCellW+x1+surface.offset.x;
             int x;
             for(x=x1;x<=x2; x++, lfbPtr++)
@@ -292,7 +292,7 @@ class NCursesDisplayDriver : DisplayDriver
          for(y=y1;y<=y2; y++)
          {
             mvhline(y+surface.offset.y,x1+surface.offset.x,
-               CC(lfbSurface.background | lfbSurface.foreground | lfbSurface.drawingChar),x2-x1+1); 
+               CC(lfbSurface.background | lfbSurface.foreground | lfbSurface.drawingChar),x2-x1+1);
          }
       }
    }
@@ -373,7 +373,7 @@ class NCursesDisplayDriver : DisplayDriver
       x /= textCellW;
       y /= textCellH;
 
-      if(y > surface.box.bottom || y < surface.box.top) 
+      if(y > surface.box.bottom || y < surface.box.top)
          return;
       y += surface.offset.y;
       lfbPtr = ((uint16 *)lfbSurface.bitmap.picture) + y * lfbSurface.bitmap.stride + x + surface.offset.x;
index c6ecad0..026b3fc 100644 (file)
@@ -149,160 +149,160 @@ static double nearPlane = 1;
 #define WGL_SAMPLE_BUFFERS_ARB              0x2041
 #define WGL_SAMPLES_ARB                     0x2042
 
-#define  WGL_WGLEXT_VERSION   1 
-#define  WGL_FRONT_COLOR_BUFFER_BIT_ARB   0x00000001 
-#define  WGL_BACK_COLOR_BUFFER_BIT_ARB   0x00000002 
-#define  WGL_DEPTH_BUFFER_BIT_ARB   0x00000004 
-#define  WGL_STENCIL_BUFFER_BIT_ARB   0x00000008 
-#define  WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000 
-#define  WGL_DRAW_TO_WINDOW_ARB   0x2001 
-#define  WGL_DRAW_TO_BITMAP_ARB   0x2002 
-#define  WGL_ACCELERATION_ARB   0x2003 
-#define  WGL_NEED_PALETTE_ARB   0x2004 
-#define  WGL_NEED_SYSTEM_PALETTE_ARB   0x2005 
-#define  WGL_SWAP_LAYER_BUFFERS_ARB   0x2006 
-#define  WGL_SWAP_METHOD_ARB   0x2007 
-#define  WGL_NUMBER_OVERLAYS_ARB   0x2008 
-#define  WGL_NUMBER_UNDERLAYS_ARB   0x2009 
-#define  WGL_TRANSPARENT_ARB   0x200A 
-#define  WGL_TRANSPARENT_RED_VALUE_ARB   0x2037 
-#define  WGL_TRANSPARENT_GREEN_VALUE_ARB   0x2038 
-#define  WGL_TRANSPARENT_BLUE_VALUE_ARB   0x2039 
-#define  WGL_TRANSPARENT_ALPHA_VALUE_ARB   0x203A 
-#define  WGL_TRANSPARENT_INDEX_VALUE_ARB   0x203B 
-#define  WGL_SHARE_DEPTH_ARB   0x200C 
-#define  WGL_SHARE_STENCIL_ARB   0x200D 
-#define  WGL_SHARE_ACCUM_ARB   0x200E 
-#define  WGL_SUPPORT_GDI_ARB   0x200F 
-#define  WGL_SUPPORT_OPENGL_ARB   0x2010 
-#define  WGL_DOUBLE_BUFFER_ARB   0x2011 
-#define  WGL_STEREO_ARB   0x2012 
-#define  WGL_PIXEL_TYPE_ARB   0x2013 
-#define  WGL_COLOR_BITS_ARB   0x2014 
-#define  WGL_RED_BITS_ARB   0x2015 
-#define  WGL_RED_SHIFT_ARB   0x2016 
-#define  WGL_GREEN_BITS_ARB   0x2017 
-#define  WGL_GREEN_SHIFT_ARB   0x2018 
-#define  WGL_BLUE_BITS_ARB   0x2019 
-#define  WGL_BLUE_SHIFT_ARB   0x201A 
-#define  WGL_ALPHA_BITS_ARB   0x201B 
-#define  WGL_ALPHA_SHIFT_ARB   0x201C 
-#define  WGL_ACCUM_BITS_ARB   0x201D 
-#define  WGL_ACCUM_RED_BITS_ARB   0x201E 
-#define  WGL_ACCUM_GREEN_BITS_ARB   0x201F 
-#define  WGL_ACCUM_BLUE_BITS_ARB   0x2020 
-#define  WGL_ACCUM_ALPHA_BITS_ARB   0x2021 
-#define  WGL_DEPTH_BITS_ARB   0x2022 
-#define  WGL_STENCIL_BITS_ARB   0x2023 
-#define  WGL_AUX_BUFFERS_ARB   0x2024 
-#define  WGL_NO_ACCELERATION_ARB   0x2025 
-#define  WGL_GENERIC_ACCELERATION_ARB   0x2026 
-#define  WGL_FULL_ACCELERATION_ARB   0x2027 
-#define  WGL_SWAP_EXCHANGE_ARB   0x2028 
-#define  WGL_SWAP_COPY_ARB   0x2029 
-#define  WGL_SWAP_UNDEFINED_ARB   0x202A 
-#define  WGL_TYPE_RGBA_ARB   0x202B 
-#define  WGL_TYPE_COLORINDEX_ARB   0x202C 
-#define  ERROR_INVALID_PIXEL_TYPE_ARB   0x2043 
-#define  ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB   0x2054 
-#define  WGL_DRAW_TO_PBUFFER_ARB   0x202D 
-#define  WGL_MAX_PBUFFER_PIXELS_ARB   0x202E 
-#define  WGL_MAX_PBUFFER_WIDTH_ARB   0x202F 
-#define  WGL_MAX_PBUFFER_HEIGHT_ARB   0x2030 
-#define  WGL_PBUFFER_LARGEST_ARB   0x2033 
-#define  WGL_PBUFFER_WIDTH_ARB   0x2034 
-#define  WGL_PBUFFER_HEIGHT_ARB   0x2035 
-#define  WGL_PBUFFER_LOST_ARB   0x2036 
-#define  ERROR_INVALID_PIXEL_TYPE_EXT   0x2043 
-#define  WGL_NUMBER_PIXEL_FORMATS_EXT   0x2000 
-#define  WGL_DRAW_TO_WINDOW_EXT   0x2001 
-#define  WGL_DRAW_TO_BITMAP_EXT   0x2002 
-#define  WGL_ACCELERATION_EXT   0x2003 
-#define  WGL_NEED_PALETTE_EXT   0x2004 
-#define  WGL_NEED_SYSTEM_PALETTE_EXT   0x2005 
-#define  WGL_SWAP_LAYER_BUFFERS_EXT   0x2006 
-#define  WGL_SWAP_METHOD_EXT   0x2007 
-#define  WGL_NUMBER_OVERLAYS_EXT   0x2008 
-#define  WGL_NUMBER_UNDERLAYS_EXT   0x2009 
-#define  WGL_TRANSPARENT_EXT   0x200A 
-#define  WGL_TRANSPARENT_VALUE_EXT   0x200B 
-#define  WGL_SHARE_DEPTH_EXT   0x200C 
-#define  WGL_SHARE_STENCIL_EXT   0x200D 
-#define  WGL_SHARE_ACCUM_EXT   0x200E 
-#define  WGL_SUPPORT_GDI_EXT   0x200F 
-#define  WGL_SUPPORT_OPENGL_EXT   0x2010 
-#define  WGL_DOUBLE_BUFFER_EXT   0x2011 
-#define  WGL_STEREO_EXT   0x2012 
-#define  WGL_PIXEL_TYPE_EXT   0x2013 
-#define  WGL_COLOR_BITS_EXT   0x2014 
-#define  WGL_RED_BITS_EXT   0x2015 
-#define  WGL_RED_SHIFT_EXT   0x2016 
-#define  WGL_GREEN_BITS_EXT   0x2017 
-#define  WGL_GREEN_SHIFT_EXT   0x2018 
-#define  WGL_BLUE_BITS_EXT   0x2019 
-#define  WGL_BLUE_SHIFT_EXT   0x201A 
-#define  WGL_ALPHA_BITS_EXT   0x201B 
-#define  WGL_ALPHA_SHIFT_EXT   0x201C 
-#define  WGL_ACCUM_BITS_EXT   0x201D 
-#define  WGL_ACCUM_RED_BITS_EXT   0x201E 
-#define  WGL_ACCUM_GREEN_BITS_EXT   0x201F 
-#define  WGL_ACCUM_BLUE_BITS_EXT   0x2020 
-#define  WGL_ACCUM_ALPHA_BITS_EXT   0x2021 
-#define  WGL_DEPTH_BITS_EXT   0x2022 
-#define  WGL_STENCIL_BITS_EXT   0x2023 
-#define  WGL_AUX_BUFFERS_EXT   0x2024 
-#define  WGL_NO_ACCELERATION_EXT   0x2025 
-#define  WGL_GENERIC_ACCELERATION_EXT   0x2026 
-#define  WGL_FULL_ACCELERATION_EXT   0x2027 
-#define  WGL_SWAP_EXCHANGE_EXT   0x2028 
-#define  WGL_SWAP_COPY_EXT   0x2029 
-#define  WGL_SWAP_UNDEFINED_EXT   0x202A 
-#define  WGL_TYPE_RGBA_EXT   0x202B 
-#define  WGL_TYPE_COLORINDEX_EXT   0x202C 
-#define  WGL_DRAW_TO_PBUFFER_EXT   0x202D 
-#define  WGL_MAX_PBUFFER_PIXELS_EXT   0x202E 
-#define  WGL_MAX_PBUFFER_WIDTH_EXT   0x202F 
-#define  WGL_MAX_PBUFFER_HEIGHT_EXT   0x2030 
-#define  WGL_OPTIMAL_PBUFFER_WIDTH_EXT   0x2031 
-#define  WGL_OPTIMAL_PBUFFER_HEIGHT_EXT   0x2032 
-#define  WGL_PBUFFER_LARGEST_EXT   0x2033 
-#define  WGL_PBUFFER_WIDTH_EXT   0x2034 
-#define  WGL_PBUFFER_HEIGHT_EXT   0x2035 
-#define  WGL_DEPTH_FLOAT_EXT   0x2040 
-#define  WGL_SAMPLE_BUFFERS_3DFX   0x2060 
-#define  WGL_SAMPLES_3DFX   0x2061 
-#define  WGL_SAMPLE_BUFFERS_EXT   0x2041 
-#define  WGL_SAMPLES_EXT   0x2042 
-#define  WGL_GENLOCK_SOURCE_MULTIVIEW_I3D   0x2044 
-#define  WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D   0x2045 
-#define  WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D   0x2046 
-#define  WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D   0x2047 
-#define  WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D   0x2048 
-#define  WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D   0x2049 
-#define  WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D   0x204A 
-#define  WGL_GENLOCK_SOURCE_EDGE_RISING_I3D   0x204B 
-#define  WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D   0x204C 
-#define  WGL_GAMMA_TABLE_SIZE_I3D   0x204E 
-#define  WGL_GAMMA_EXCLUDE_DESKTOP_I3D   0x204F 
-#define  WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D   0x2050 
-#define  WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D   0x2051 
-#define  WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D   0x2052 
-#define  WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D   0x2053 
-#define  WGL_ARB_buffer_region   1 
-#define  WGL_ARB_extensions_string   1 
-#define  WGL_ARB_pixel_format   1 
-#define  WGL_ARB_make_current_read   1 
-#define  WGL_ARB_pbuffer   1 
-#define  WGL_EXT_display_color_table   1 
-#define  WGL_EXT_extensions_string   1 
-#define  WGL_EXT_make_current_read   1 
-#define  WGL_EXT_pbuffer   1 
-#define  WGL_EXT_pixel_format   1 
-#define  WGL_EXT_swap_control   1 
-#define  WGL_WGL_EXT_depth_float   1 
-#define  WGL_WGL_3DFX_multisample   1 
-#define  WGL_WGL_EXT_multisample   1 
-#define  WGL_NV_allocate_memory   1 
+#define  WGL_WGLEXT_VERSION   1
+#define  WGL_FRONT_COLOR_BUFFER_BIT_ARB   0x00000001
+#define  WGL_BACK_COLOR_BUFFER_BIT_ARB   0x00000002
+#define  WGL_DEPTH_BUFFER_BIT_ARB   0x00000004
+#define  WGL_STENCIL_BUFFER_BIT_ARB   0x00000008
+#define  WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000
+#define  WGL_DRAW_TO_WINDOW_ARB   0x2001
+#define  WGL_DRAW_TO_BITMAP_ARB   0x2002
+#define  WGL_ACCELERATION_ARB   0x2003
+#define  WGL_NEED_PALETTE_ARB   0x2004
+#define  WGL_NEED_SYSTEM_PALETTE_ARB   0x2005
+#define  WGL_SWAP_LAYER_BUFFERS_ARB   0x2006
+#define  WGL_SWAP_METHOD_ARB   0x2007
+#define  WGL_NUMBER_OVERLAYS_ARB   0x2008
+#define  WGL_NUMBER_UNDERLAYS_ARB   0x2009
+#define  WGL_TRANSPARENT_ARB   0x200A
+#define  WGL_TRANSPARENT_RED_VALUE_ARB   0x2037
+#define  WGL_TRANSPARENT_GREEN_VALUE_ARB   0x2038
+#define  WGL_TRANSPARENT_BLUE_VALUE_ARB   0x2039
+#define  WGL_TRANSPARENT_ALPHA_VALUE_ARB   0x203A
+#define  WGL_TRANSPARENT_INDEX_VALUE_ARB   0x203B
+#define  WGL_SHARE_DEPTH_ARB   0x200C
+#define  WGL_SHARE_STENCIL_ARB   0x200D
+#define  WGL_SHARE_ACCUM_ARB   0x200E
+#define  WGL_SUPPORT_GDI_ARB   0x200F
+#define  WGL_SUPPORT_OPENGL_ARB   0x2010
+#define  WGL_DOUBLE_BUFFER_ARB   0x2011
+#define  WGL_STEREO_ARB   0x2012
+#define  WGL_PIXEL_TYPE_ARB   0x2013
+#define  WGL_COLOR_BITS_ARB   0x2014
+#define  WGL_RED_BITS_ARB   0x2015
+#define  WGL_RED_SHIFT_ARB   0x2016
+#define  WGL_GREEN_BITS_ARB   0x2017
+#define  WGL_GREEN_SHIFT_ARB   0x2018
+#define  WGL_BLUE_BITS_ARB   0x2019
+#define  WGL_BLUE_SHIFT_ARB   0x201A
+#define  WGL_ALPHA_BITS_ARB   0x201B
+#define  WGL_ALPHA_SHIFT_ARB   0x201C
+#define  WGL_ACCUM_BITS_ARB   0x201D
+#define  WGL_ACCUM_RED_BITS_ARB   0x201E
+#define  WGL_ACCUM_GREEN_BITS_ARB   0x201F
+#define  WGL_ACCUM_BLUE_BITS_ARB   0x2020
+#define  WGL_ACCUM_ALPHA_BITS_ARB   0x2021
+#define  WGL_DEPTH_BITS_ARB   0x2022
+#define  WGL_STENCIL_BITS_ARB   0x2023
+#define  WGL_AUX_BUFFERS_ARB   0x2024
+#define  WGL_NO_ACCELERATION_ARB   0x2025
+#define  WGL_GENERIC_ACCELERATION_ARB   0x2026
+#define  WGL_FULL_ACCELERATION_ARB   0x2027
+#define  WGL_SWAP_EXCHANGE_ARB   0x2028
+#define  WGL_SWAP_COPY_ARB   0x2029
+#define  WGL_SWAP_UNDEFINED_ARB   0x202A
+#define  WGL_TYPE_RGBA_ARB   0x202B
+#define  WGL_TYPE_COLORINDEX_ARB   0x202C
+#define  ERROR_INVALID_PIXEL_TYPE_ARB   0x2043
+#define  ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB   0x2054
+#define  WGL_DRAW_TO_PBUFFER_ARB   0x202D
+#define  WGL_MAX_PBUFFER_PIXELS_ARB   0x202E
+#define  WGL_MAX_PBUFFER_WIDTH_ARB   0x202F
+#define  WGL_MAX_PBUFFER_HEIGHT_ARB   0x2030
+#define  WGL_PBUFFER_LARGEST_ARB   0x2033
+#define  WGL_PBUFFER_WIDTH_ARB   0x2034
+#define  WGL_PBUFFER_HEIGHT_ARB   0x2035
+#define  WGL_PBUFFER_LOST_ARB   0x2036
+#define  ERROR_INVALID_PIXEL_TYPE_EXT   0x2043
+#define  WGL_NUMBER_PIXEL_FORMATS_EXT   0x2000
+#define  WGL_DRAW_TO_WINDOW_EXT   0x2001
+#define  WGL_DRAW_TO_BITMAP_EXT   0x2002
+#define  WGL_ACCELERATION_EXT   0x2003
+#define  WGL_NEED_PALETTE_EXT   0x2004
+#define  WGL_NEED_SYSTEM_PALETTE_EXT   0x2005
+#define  WGL_SWAP_LAYER_BUFFERS_EXT   0x2006
+#define  WGL_SWAP_METHOD_EXT   0x2007
+#define  WGL_NUMBER_OVERLAYS_EXT   0x2008
+#define  WGL_NUMBER_UNDERLAYS_EXT   0x2009
+#define  WGL_TRANSPARENT_EXT   0x200A
+#define  WGL_TRANSPARENT_VALUE_EXT   0x200B
+#define  WGL_SHARE_DEPTH_EXT   0x200C
+#define  WGL_SHARE_STENCIL_EXT   0x200D
+#define  WGL_SHARE_ACCUM_EXT   0x200E
+#define  WGL_SUPPORT_GDI_EXT   0x200F
+#define  WGL_SUPPORT_OPENGL_EXT   0x2010
+#define  WGL_DOUBLE_BUFFER_EXT   0x2011
+#define  WGL_STEREO_EXT   0x2012
+#define  WGL_PIXEL_TYPE_EXT   0x2013
+#define  WGL_COLOR_BITS_EXT   0x2014
+#define  WGL_RED_BITS_EXT   0x2015
+#define  WGL_RED_SHIFT_EXT   0x2016
+#define  WGL_GREEN_BITS_EXT   0x2017
+#define  WGL_GREEN_SHIFT_EXT   0x2018
+#define  WGL_BLUE_BITS_EXT   0x2019
+#define  WGL_BLUE_SHIFT_EXT   0x201A
+#define  WGL_ALPHA_BITS_EXT   0x201B
+#define  WGL_ALPHA_SHIFT_EXT   0x201C
+#define  WGL_ACCUM_BITS_EXT   0x201D
+#define  WGL_ACCUM_RED_BITS_EXT   0x201E
+#define  WGL_ACCUM_GREEN_BITS_EXT   0x201F
+#define  WGL_ACCUM_BLUE_BITS_EXT   0x2020
+#define  WGL_ACCUM_ALPHA_BITS_EXT   0x2021
+#define  WGL_DEPTH_BITS_EXT   0x2022
+#define  WGL_STENCIL_BITS_EXT   0x2023
+#define  WGL_AUX_BUFFERS_EXT   0x2024
+#define  WGL_NO_ACCELERATION_EXT   0x2025
+#define  WGL_GENERIC_ACCELERATION_EXT   0x2026
+#define  WGL_FULL_ACCELERATION_EXT   0x2027
+#define  WGL_SWAP_EXCHANGE_EXT   0x2028
+#define  WGL_SWAP_COPY_EXT   0x2029
+#define  WGL_SWAP_UNDEFINED_EXT   0x202A
+#define  WGL_TYPE_RGBA_EXT   0x202B
+#define  WGL_TYPE_COLORINDEX_EXT   0x202C
+#define  WGL_DRAW_TO_PBUFFER_EXT   0x202D
+#define  WGL_MAX_PBUFFER_PIXELS_EXT   0x202E
+#define  WGL_MAX_PBUFFER_WIDTH_EXT   0x202F
+#define  WGL_MAX_PBUFFER_HEIGHT_EXT   0x2030
+#define  WGL_OPTIMAL_PBUFFER_WIDTH_EXT   0x2031
+#define  WGL_OPTIMAL_PBUFFER_HEIGHT_EXT   0x2032
+#define  WGL_PBUFFER_LARGEST_EXT   0x2033
+#define  WGL_PBUFFER_WIDTH_EXT   0x2034
+#define  WGL_PBUFFER_HEIGHT_EXT   0x2035
+#define  WGL_DEPTH_FLOAT_EXT   0x2040
+#define  WGL_SAMPLE_BUFFERS_3DFX   0x2060
+#define  WGL_SAMPLES_3DFX   0x2061
+#define  WGL_SAMPLE_BUFFERS_EXT   0x2041
+#define  WGL_SAMPLES_EXT   0x2042
+#define  WGL_GENLOCK_SOURCE_MULTIVIEW_I3D   0x2044
+#define  WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D   0x2045
+#define  WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D   0x2046
+#define  WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D   0x2047
+#define  WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D   0x2048
+#define  WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D   0x2049
+#define  WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D   0x204A
+#define  WGL_GENLOCK_SOURCE_EDGE_RISING_I3D   0x204B
+#define  WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D   0x204C
+#define  WGL_GAMMA_TABLE_SIZE_I3D   0x204E
+#define  WGL_GAMMA_EXCLUDE_DESKTOP_I3D   0x204F
+#define  WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D   0x2050
+#define  WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D   0x2051
+#define  WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D   0x2052
+#define  WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D   0x2053
+#define  WGL_ARB_buffer_region   1
+#define  WGL_ARB_extensions_string   1
+#define  WGL_ARB_pixel_format   1
+#define  WGL_ARB_make_current_read   1
+#define  WGL_ARB_pbuffer   1
+#define  WGL_EXT_display_color_table   1
+#define  WGL_EXT_extensions_string   1
+#define  WGL_EXT_make_current_read   1
+#define  WGL_EXT_pbuffer   1
+#define  WGL_EXT_pixel_format   1
+#define  WGL_EXT_swap_control   1
+#define  WGL_WGL_EXT_depth_float   1
+#define  WGL_WGL_3DFX_multisample   1
+#define  WGL_WGL_EXT_multisample   1
+#define  WGL_NV_allocate_memory   1
 
 /*
 typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum target);
@@ -525,7 +525,7 @@ static bool egl_init_display(ANativeWindow* window)
 
    currentVertexBuffer = 0;
    return true;
-}  
+}
 
 static void egl_term_display()
 {
@@ -604,7 +604,7 @@ void glesTexCoord2f(float x, float y)
       vertexPointer[count*(2+numVertexCoords)+1] = vertexPointer[(count-3)*(2+numVertexCoords)+1];
       count++;
    }
-} 
+}
 void glesTexCoord2i(int x, int y)       { glesTexCoord2f((float)x, (float)y); }
 void glesTexCoord2d(double x, double y) { glesTexCoord2f((float)x, (float)y); }
 void glesTexCoord2fv(float * a)         { glesTexCoord2f(a[0], a[1]); }
@@ -914,7 +914,7 @@ void glesOrtho( double l, double r, double b, double t, double n, double f )
 {
    float matrix[4][4] =
    {
-      { (float)(2 / (r - l)), 0, 0, 0 }, 
+      { (float)(2 / (r - l)), 0, 0, 0 },
       { 0, (float)(2 / (t - b)), 0, 0 },
       { 0, 0, (float)(-2 / (f - n)), 0 },
       { (float)(-(r + l) / (r - l)), (float)(-(t + b) / (t - b)), (float)(-(f + n) / (f - n)), 1 }
@@ -1352,20 +1352,20 @@ class OpenGLDisplayDriver : DisplayDriver
    #if defined(__WIN32__)
          wglMakeCurrent( null, null );
 
-         if(oglDisplay.glrc) 
+         if(oglDisplay.glrc)
             wglDeleteContext(oglDisplay.glrc);
-      
+
          if(oglDisplay.hdc && oglDisplay.pBuffer)
             wglReleasePbufferDCARB(oglDisplay.pBuffer, oglDisplay.hdc);
 
          if(oglDisplay.pBuffer)
             wglDestroyPbufferARB(oglDisplay.pBuffer);
 
-         if(oglDisplay.hdc) 
+         if(oglDisplay.hdc)
             ReleaseDC(display.window, oglDisplay.hdc);
 
          if(oglDisplay.memDC) DeleteDC(oglDisplay.memDC);
-         if(oglDisplay.memBitmap) DeleteObject(oglDisplay.memBitmap); 
+         if(oglDisplay.memBitmap) DeleteObject(oglDisplay.memBitmap);
 
    #elif defined(__unix__) || defined(__APPLE__)
       #if defined(__ANDROID__)
@@ -1392,14 +1392,14 @@ class OpenGLDisplayDriver : DisplayDriver
                if(oglDisplay.shminfoShape.shmaddr != (void *)-1)
                   shmdt(oglDisplay.shminfoShape.shmaddr);
                shmctl(oglDisplay.shminfoShape.shmid, IPC_RMID, 0);
-            }                  
+            }
             XDestroyImage(oglDisplay.shapeImage);
             oglDisplay.shapeImage = None;
          }
 
          glXMakeCurrent(xGlobalDisplay, None, null);
-      
-         if(oglDisplay.glContext) 
+
+         if(oglDisplay.glContext)
             glXDestroyContext(xGlobalDisplay, oglDisplay.glContext);
       #endif
    #endif
@@ -1428,7 +1428,7 @@ class OpenGLDisplayDriver : DisplayDriver
       oglSystem.hdc = GetDC(oglSystem.hwnd);
       if(oglSystem.hdc)
       {
-          
+
          oglSystem.pfd.nSize = (short)sizeof(oglSystem.pfd);
          oglSystem.pfd.nVersion = 1;
          oglSystem.pfd.dwFlags = PFD_DRAW_TO_WINDOW /*PFD_DRAW_TO_BITMAP*/ | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
@@ -1486,7 +1486,7 @@ class OpenGLDisplayDriver : DisplayDriver
                    int numFormats;
                    float fAttributes[] = {0,0};
                    int iAttributes[] =
-                  { 
+                  {
                      WGL_DRAW_TO_WINDOW_ARB,GL_TRUE,
                            WGL_SUPPORT_OPENGL_ARB,GL_TRUE,
                            WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB,
@@ -1604,10 +1604,10 @@ class OpenGLDisplayDriver : DisplayDriver
    #if defined(__WIN32__)
       wglMakeCurrent( null, null );
 
-      if(oglSystem.glrc) 
+      if(oglSystem.glrc)
          wglDeleteContext(oglSystem.glrc);
-      
-      if(oglSystem.hdc) 
+
+      if(oglSystem.hdc)
          ReleaseDC(oglSystem.hwnd, oglSystem.hdc);
       DestroyWindow(oglSystem.hwnd);
 
@@ -1763,7 +1763,7 @@ class OpenGLDisplayDriver : DisplayDriver
          {
             /*WGL_TEXTURE_FORMAT_ARB, WGL_TEXTURE_RGBA_ARB,
             WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_2D_ARB, */0
-         }; 
+         };
          int pixelFormat = 0;
          if(wglChoosePixelFormatARB)
          {
@@ -1771,7 +1771,7 @@ class OpenGLDisplayDriver : DisplayDriver
             int numFormats;
             float fAttributes[] = {0,0};
             int iAttributes[] =
-            { 
+            {
                //WGL_DRAW_TO_BITMAP_ARB, GL_TRUE,
                WGL_DRAW_TO_PBUFFER_ARB,GL_TRUE,
                    WGL_SUPPORT_OPENGL_ARB,GL_TRUE,
@@ -1785,7 +1785,7 @@ class OpenGLDisplayDriver : DisplayDriver
                    WGL_SAMPLES_ARB, 4,                                         // Check For 4x Multisampling
                    0,0
             };
-            
+
             //Log("Found wglChoosePixelFormatARB\n");
 
             valid = wglChoosePixelFormatARB(oglSystem.hdc,iAttributes,fAttributes,1,&pixelFormat,&numFormats);
@@ -1820,7 +1820,7 @@ class OpenGLDisplayDriver : DisplayDriver
             {
                wglMakeCurrent(null, null);
             }
-         }  
+         }
 
          wglMakeCurrent( null, null );
          wglMakeCurrent( oglDisplay.hdc, oglDisplay.glrc );
@@ -1831,8 +1831,8 @@ class OpenGLDisplayDriver : DisplayDriver
 
          if(!useSingleGLContext)
             wglMakeCurrent( null, null );
-           
-         if(oglDisplay.glrc) 
+
+         if(oglDisplay.glrc)
             wglDeleteContext(oglDisplay.glrc);
 
          oglDisplay.pBuffer = wglCreatePbufferARB(oglSystem.hdc, pixelFormat, width, height, attributes);
@@ -1846,8 +1846,8 @@ class OpenGLDisplayDriver : DisplayDriver
             wglMakeCurrent(oglDisplay.hdc, oglDisplay.glrc);
 
             //wglQueryPbufferARB(pBuffer, WGL_PBUFFER_WIDTH_ARB, &width);
-            //wglQueryPbufferARB(pBuffer, WGL_PBUFFER_HEIGHT_ARB, &height); 
-            
+            //wglQueryPbufferARB(pBuffer, WGL_PBUFFER_HEIGHT_ARB, &height);
+
             // glDeleteBuffersARB(2, oglDisplay.imageBuffers);
 
             if((info = (BITMAPINFO *)new0 byte[sizeof(BITMAPINFOHEADER)+sizeof(RGBQUAD)*256]))
@@ -1977,7 +1977,7 @@ class OpenGLDisplayDriver : DisplayDriver
                   if(oglDisplay.shminfoShape.shmaddr != (void *)-1)
                      shmdt(oglDisplay.shminfoShape.shmaddr);
                   shmctl(oglDisplay.shminfoShape.shmid, IPC_RMID, 0);
-               }                  
+               }
                XDestroyImage(oglDisplay.shapeImage);
                oglDisplay.shapeImage = None;
             }
@@ -2005,11 +2005,11 @@ class OpenGLDisplayDriver : DisplayDriver
                   glXMakeCurrent(xGlobalDisplay, (int)display.window, oglDisplay.glContext);
 
                   // Initialize Shared Memory Pixmap
-                  oglDisplay.image = XShmCreateImage(xGlobalDisplay, DefaultVisual(xGlobalDisplay, DefaultScreen(xGlobalDisplay)), 32, 
+                  oglDisplay.image = XShmCreateImage(xGlobalDisplay, DefaultVisual(xGlobalDisplay, DefaultScreen(xGlobalDisplay)), 32,
                      ZPixmap, null, &oglDisplay.shminfo, width, height);
                   if(oglDisplay.image)
                   {
-                     oglDisplay.shminfo.shmid = shmget(IPC_PRIVATE, 
+                     oglDisplay.shminfo.shmid = shmget(IPC_PRIVATE,
                         oglDisplay.image->bytes_per_line * oglDisplay.image->height, IPC_CREAT|0777);
                      if(oglDisplay.shminfo.shmid != -1)
                      {
@@ -2019,15 +2019,15 @@ class OpenGLDisplayDriver : DisplayDriver
                            oglDisplay.shminfo.readOnly = False;
                            if(XShmAttach(xGlobalDisplay, &oglDisplay.shminfo))
                            {
-                              oglDisplay.pixmap = XShmCreatePixmap(xGlobalDisplay, (X11Window)display.window, oglDisplay.shminfo.shmaddr, 
+                              oglDisplay.pixmap = XShmCreatePixmap(xGlobalDisplay, (X11Window)display.window, oglDisplay.shminfo.shmaddr,
                                  &oglDisplay.shminfo, width, height, 32);
 
                               // Initialize Shared Memory Shape Pixmap
-                              oglDisplay.shapeImage = XShmCreateImage(xGlobalDisplay, DefaultVisual(xGlobalDisplay, DefaultScreen(xGlobalDisplay)), 1, 
+                              oglDisplay.shapeImage = XShmCreateImage(xGlobalDisplay, DefaultVisual(xGlobalDisplay, DefaultScreen(xGlobalDisplay)), 1,
                                  ZPixmap, null, &oglDisplay.shminfoShape, width, height);
                               if(oglDisplay.shapeImage)
                               {
-                                 oglDisplay.shminfoShape.shmid = shmget(IPC_PRIVATE, 
+                                 oglDisplay.shminfoShape.shmid = shmget(IPC_PRIVATE,
                                     oglDisplay.shapeImage->bytes_per_line * oglDisplay.shapeImage->height, IPC_CREAT|0777);
                                  if(oglDisplay.shminfoShape.shmid != -1)
                                  {
@@ -2037,7 +2037,7 @@ class OpenGLDisplayDriver : DisplayDriver
                                        oglDisplay.shminfoShape.readOnly = False;
                                        if(XShmAttach(xGlobalDisplay, &oglDisplay.shminfoShape))
                                        {
-                                          oglDisplay.shapePixmap = XShmCreatePixmap(xGlobalDisplay, (X11Window)display.window, oglDisplay.shminfoShape.shmaddr, 
+                                          oglDisplay.shapePixmap = XShmCreatePixmap(xGlobalDisplay, (X11Window)display.window, oglDisplay.shminfoShape.shmaddr,
                                              &oglDisplay.shminfoShape, width, height, 1);
                                           //oglDisplay.shapePixmap = XCreatePixmap(xGlobalDisplay, (X11Window)display.window, width, height, 1);
 
@@ -2051,9 +2051,9 @@ class OpenGLDisplayDriver : DisplayDriver
                                              #endif
                                              oglDisplay.pixmapPicture = XRenderCreatePicture(xGlobalDisplay, oglDisplay.pixmap, format, CPRepeat, &attributes);
                                              oglDisplay.windowPicture = XRenderCreatePicture(xGlobalDisplay, (X11Window)display.window, format, 0, &attributes);
-                                             oglDisplay.shapePicture = XRenderCreatePicture(xGlobalDisplay, oglDisplay.shapePixmap, 
+                                             oglDisplay.shapePicture = XRenderCreatePicture(xGlobalDisplay, oglDisplay.shapePixmap,
                                                 XRenderFindStandardFormat(xGlobalDisplay, PictStandardA1), 0, &attributes);
-                                          }  
+                                          }
 
                                           oglDisplay.picture = oglDisplay.shminfo.shmaddr;
                                           oglDisplay.stride = oglDisplay.image->bytes_per_line / 4;
@@ -2094,7 +2094,7 @@ class OpenGLDisplayDriver : DisplayDriver
       }
       if(!result)
          return false;
-         
+
       result = false;
 
       glViewport(0,0,width,height);
@@ -2111,7 +2111,7 @@ class OpenGLDisplayDriver : DisplayDriver
       }
       if(oglDisplay.flippingBuffer || !width || !height)
          result = true;
-         
+
       return result;
    }
 
@@ -2178,15 +2178,15 @@ class OpenGLDisplayDriver : DisplayDriver
             // outstanding DMA transfers into the buffer to finish.
             glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, oglDisplay.imageBuffers[0]);
             oglDisplay.pboMemory1 = (byte *)glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY);
-           
+
             // glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, oglDisplay.imageBuffers[1]);
             // oglDisplay.pboMemory2 = (byte *)glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB,GL_READ_ONLY);
 
-           
+
             memcpy(oglDisplay.picture, oglDisplay.pboMemory1, display.width * display.height * 4);
             //memcpy(oglDisplay.picture + display.width * display.height * 4 / 2, oglDisplay.pboMemory2, display.width * display.height * 4/ 2);
             */
-            
+
             UpdateLayeredWindow(display.window, hdc, &point, &size, oglDisplay.memDC, &srcPoint, 0, &blend, ULW_ALPHA);
             /*
 
@@ -2196,7 +2196,7 @@ class OpenGLDisplayDriver : DisplayDriver
 
             // glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, oglDisplay.imageBuffers[1]);
             // glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);
-           
+
             // Bind two different buffer objects and start the glReadPixels
             // asynchronously. Each call will return directly after
             // starting the DMA transfer.
@@ -2211,7 +2211,7 @@ class OpenGLDisplayDriver : DisplayDriver
 #elif defined(__unix__) || defined(__APPLE__)
       #if defined(__ANDROID__)
       #else
-            XTransform transform = 
+            XTransform transform =
             {
                {
                   { (int)(1.0f * (1<<16)), (int)(0.0f * (1<<16)),  (int)(0 * (1 << 16)) },
@@ -2231,12 +2231,12 @@ class OpenGLDisplayDriver : DisplayDriver
      #endif
 #endif
          }
-      } 
+      }
       else
 #endif
       {
 #if defined(__WIN32__)
-         //wglSwapLayerBuffers(oglDisplay.hdc,WGL_SWAP_MAIN_PLANE); 
+         //wglSwapLayerBuffers(oglDisplay.hdc,WGL_SWAP_MAIN_PLANE);
          SwapBuffers(oglDisplay.hdc);
 #elif defined(__unix__) || defined(__APPLE__)
       #if defined(__ANDROID__)
@@ -2263,7 +2263,7 @@ class OpenGLDisplayDriver : DisplayDriver
       bool result = false;
       Bitmap mipMap { };
       int glBitmap = -1;
-      
+
       uint w = width, h = height;
       if(oglSystem.pow2textures)
       {
@@ -2327,7 +2327,7 @@ class OpenGLDisplayDriver : DisplayDriver
             for(c=0; c<bitmap.size; c++)
             {
                // ((ColorRGBA *)bitmap.picture)[c] = ((ColorAlpha *)bitmap.picture)[c];
-               // TODO: 
+               // TODO:
                ColorAlpha color = ((ColorAlpha *)bitmap.picture)[c];
                ((ColorRGBA *)bitmap.picture)[c] = ColorRGBA { color.color.r, color.color.g, color.color.b, color.a };
             }
@@ -2378,7 +2378,7 @@ class OpenGLDisplayDriver : DisplayDriver
                   delete mipMap;
                }
             }
-            else 
+            else
                mipMap = bitmap;
 
             if(result)
@@ -2398,7 +2398,7 @@ class OpenGLDisplayDriver : DisplayDriver
                   result = false;
                }
             }
-            if(mipMap != bitmap) 
+            if(mipMap != bitmap)
                delete mipMap;
             if(!mipMaps) break;
          }
@@ -2499,7 +2499,7 @@ class OpenGLDisplayDriver : DisplayDriver
       bool result = false;
       OGLDisplay oglDisplay = display.driverData;
       ColorAlpha * flippingBuffer = oglDisplay.flippingBuffer;
-      
+
       if(oglDisplay.flippingBuffer)
       {
          if(bitmap.pixelFormat != pixelFormat888 || bitmap.width < w || bitmap.height < h)
@@ -2579,7 +2579,7 @@ class OpenGLDisplayDriver : DisplayDriver
       glBegin(GL_POINTS);
       // glVertex2i(x+surface.offset.x, y+surface.offset.y);
       glVertex2f(x+surface.offset.x + 0.5f, y+surface.offset.y + 0.5f);
-       
+
       glEnd();
    }
 
@@ -2615,7 +2615,7 @@ class OpenGLDisplayDriver : DisplayDriver
          glVertex2f(x1 + 0.5f, y1 + 0.5f);
          glVertex2f(x2 + 0.5f, y2 + 0.5f);
       }
-      
+
       glEnd();
    }
 
@@ -2681,7 +2681,7 @@ class OpenGLDisplayDriver : DisplayDriver
       glColor4fv(oglSurface.background);
       glRecti(x1+surface.offset.x, y1+surface.offset.y,
               x2+surface.offset.x + 1, y2+surface.offset.y + 1);
-              
+
       /*
       glRectf(x1+surface.offset.x, y1+surface.offset.y,
               x2+surface.offset.x + 1, y2+surface.offset.y + 1);
@@ -2731,7 +2731,7 @@ class OpenGLDisplayDriver : DisplayDriver
       }
       else if(oglSurface.xOffset)
          glTranslated(oglSurface.xOffset / 64.0/*-0.375*/, 0.0, 0.0);
-         
+
       glBindTexture(GL_TEXTURE_2D, (uint)bitmap.driverData);
       glBegin(GL_QUADS);
 
@@ -2809,13 +2809,13 @@ class OpenGLDisplayDriver : DisplayDriver
       {
          glTexCoord2f((float)(sx)/ bitmap.width, (float)(sy+sh)/ bitmap.height);
          glVertex2i(dx+surface.offset.x, dy+surface.offset.y);
-      
+
          glTexCoord2f((float)(sx+sw) / bitmap.width, (float)(sy+sh)/ bitmap.height);
          glVertex2i(dx+w+surface.offset.x, dy+surface.offset.y);
-      
+
          glTexCoord2f((float)(sx+sw)/ bitmap.width, (float)(sy)/ bitmap.height);
          glVertex2i(dx+w+surface.offset.x, dy-h+surface.offset.y);
-      
+
          glTexCoord2f((float)(sx) / bitmap.width, (float)(sy)/ bitmap.height);
          glVertex2i(dx+surface.offset.x, dy-h+surface.offset.y);
       }
@@ -2823,13 +2823,13 @@ class OpenGLDisplayDriver : DisplayDriver
       {
          glTexCoord2f((float)(sx) / bitmap.width, (float)(sy)/ bitmap.height);
          glVertex2i(dx+surface.offset.x, dy+surface.offset.y);
-      
+
          glTexCoord2f((float)(sx+sw)/ bitmap.width, (float)(sy)/ bitmap.height);
          glVertex2i(dx+w+surface.offset.x, dy+surface.offset.y);
-      
+
          glTexCoord2f((float)(sx+sw) / bitmap.width, (float)(sy+sh)/ bitmap.height);
          glVertex2i(dx+w+surface.offset.x, dy+h+surface.offset.y);
-      
+
          glTexCoord2f((float)(sx)/ bitmap.width, (float)(sy+sh)/ bitmap.height);
          glVertex2i(dx+surface.offset.x, dy+h+surface.offset.y);
       }
@@ -2862,13 +2862,13 @@ class OpenGLDisplayDriver : DisplayDriver
       {
          w = Abs(w);
          sw = Abs(sw);
-         flipX = true; 
+         flipX = true;
       }
       if(Sgn(h) != Sgn(sh))
       {
          h = Abs(h);
          sh = Abs(sh);
-         flipY = true; 
+         flipY = true;
       }
 
       s2dw=(float)w / sw;
@@ -2905,7 +2905,7 @@ class OpenGLDisplayDriver : DisplayDriver
       //Clip against the edges of the surfaceination
       if(dx<surface.box.left)
       {
-         //if(!flip) 
+         //if(!flip)
          sx+=(int)((surface.box.left-dx)*d2sw);
          sw-=(int)((surface.box.left-dx)*d2sw);
          w-=surface.box.left-dx;
@@ -2975,7 +2975,7 @@ class OpenGLDisplayDriver : DisplayDriver
       //Clip against the edges of the surfaceination
       if(dx<surface.box.left)
       {
-         //if(!flip) 
+         //if(!flip)
          sx+=surface.box.left-dx;
          w-=surface.box.left-dx;
          dx=surface.box.left;
@@ -3203,7 +3203,7 @@ class OpenGLDisplayDriver : DisplayDriver
          color[1] = light.diffuse.g * light.multiplier;
          color[2] = light.diffuse.b * light.multiplier;
          glLightfv(GL_LIGHT0 + id, GL_DIFFUSE, color);
-         
+
          color[0] = light.ambient.r * light.multiplier;
          color[1] = light.ambient.g * light.multiplier;
          color[2] = light.ambient.b * light.multiplier;
@@ -3212,7 +3212,7 @@ class OpenGLDisplayDriver : DisplayDriver
          color[1] = light.specular.g * light.multiplier;
          color[2] = light.specular.b * light.multiplier;
          glLightfv(GL_LIGHT0 + id, GL_SPECULAR,color);
-         
+
          if(lightObject)
          {
             Vector3D positionVector;
@@ -3250,7 +3250,7 @@ class OpenGLDisplayDriver : DisplayDriver
             position[0] = (float)positionVector.x;
             position[1] = (float)positionVector.y;
             position[2] = (float)positionVector.z;
-            
+
             glLightfv(GL_LIGHT0 + id, GL_POSITION, position);
 
             /*
@@ -3264,7 +3264,7 @@ class OpenGLDisplayDriver : DisplayDriver
             glEnd();
             glEnable(GL_DEPTH_TEST);
             glEnable(GL_LIGHTING);
-                     
+
 
             // Display Target
             if(lightObject.flags.root || !lightObject.parent)
@@ -3274,7 +3274,7 @@ class OpenGLDisplayDriver : DisplayDriver
             }
             else
             {
-               positionVector.MultMatrix(light.target.transform.position, 
+               positionVector.MultMatrix(light.target.transform.position,
                   lightObject.light.target.parent.matrix);
                positionVector.Subtract(positionVector, display.camera.cPosition);
             }
@@ -3316,7 +3316,7 @@ class OpenGLDisplayDriver : DisplayDriver
          }
          else
          {
-            
+
             Vector3Df vector { 0,0,-1 };
             Vector3Df direction;
             Matrix mat;
@@ -3365,7 +3365,7 @@ class OpenGLDisplayDriver : DisplayDriver
          {
             float pickX = display.display3D.pickX + surface.offset.x;
             float pickY = display.height - (display.display3D.pickY + surface.offset.y) - 1;
-            Matrix pickMatrix = 
+            Matrix pickMatrix =
             {
                {
                   w / display.display3D.pickWidth, 0, 0, 0,
@@ -3496,7 +3496,7 @@ class OpenGLDisplayDriver : DisplayDriver
             glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, color);
          }
       }
-      {   
+      {
          float color[4] = { material.specular.r, material.specular.g, material.specular.b, 0 };
          glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color);
       }
@@ -3504,7 +3504,7 @@ class OpenGLDisplayDriver : DisplayDriver
          float color[4] = { material.emissive.r, material.emissive.g, material.emissive.b, 0 };
          glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, color);
       }
-      
+
       glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, &material.power);
    }
 
@@ -3606,7 +3606,7 @@ class OpenGLDisplayDriver : DisplayDriver
    {
       OGLMesh oglMesh = mesh.data;
       if(!flags) flags = mesh.flags;
-      
+
       if(vboAvailable)
       {
          if(!(flags.vertices) || oglMesh.vertices)
@@ -3648,7 +3648,7 @@ class OpenGLDisplayDriver : DisplayDriver
    {
       if(oglIndices)
       {
-         if(oglIndices.buffer) 
+         if(oglIndices.buffer)
             GLDeleteBuffers(1, &oglIndices.buffer);
          delete oglIndices.indices;
          delete oglIndices;
@@ -3672,7 +3672,7 @@ class OpenGLDisplayDriver : DisplayDriver
       if(vboAvailable)
       {
          GLBindBuffer( GL_ELEMENT_ARRAY_BUFFER_ARB, oglIndices.buffer);
-         GLBufferData( indices32bit ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, GL_ELEMENT_ARRAY_BUFFER_ARB, nIndices * (indices32bit ? sizeof(uint32) : sizeof(uint16)), 
+         GLBufferData( indices32bit ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, GL_ELEMENT_ARRAY_BUFFER_ARB, nIndices * (indices32bit ? sizeof(uint32) : sizeof(uint16)),
             oglIndices.indices, GL_STATIC_DRAW_ARB);
          GLBindBuffer( GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
       }
@@ -3680,7 +3680,7 @@ class OpenGLDisplayDriver : DisplayDriver
 
    uint16 * LockIndices(DisplaySystem displaySystem, OGLIndices oglIndices)
    {
-      
+
       return oglIndices.indices;
    }
 
@@ -3689,7 +3689,7 @@ class OpenGLDisplayDriver : DisplayDriver
       //Logf("SelectMesh\n");
 
 #if !defined( __ANDROID__) && !defined(__APPLE__)
-      if(display.display3D.mesh && glUnlockArraysEXT)   
+      if(display.display3D.mesh && glUnlockArraysEXT)
          glUnlockArraysEXT();
 #endif
       if(mesh)
@@ -3779,7 +3779,7 @@ class OpenGLDisplayDriver : DisplayDriver
          glDrawArrays(primitiveTypes[primitive->type.primitiveType], primitive->first, primitive->nVertices);
       else
       {
-         //    *** Hoping the data won't be uploaded at all (Won't really work if another group of the mesh is using the mesh ) *** 
+         //    *** Hoping the data won't be uploaded at all (Won't really work if another group of the mesh is using the mesh ) ***
          // HACK TO SPEED THINGS UP...
 #ifndef __ANDROID__
          GLBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
@@ -3810,12 +3810,12 @@ class OpenGLDisplayDriver : DisplayDriver
             if(!display.display3D.collectingHits && vboAvailable && oglIndices)
             {
                GLBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, oglIndices.buffer);
-               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices, 
+               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices,
                   primitive->type.indices32bit ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, 0);
                GLBindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
             }
             else
-               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices, 
+               glDrawElements(primitiveTypes[primitive->type.primitiveType], primitive->nIndices,
                   primitive->type.indices32bit ? GL_UNSIGNED_INT : GL_UNSIGNED_SHORT, oglIndices ? oglIndices.indices : primitive->indices);
          }
       }
index 5c6af17..61ba12f 100644 (file)
@@ -45,7 +45,7 @@ class Win32BitmapPrinterDisplay : LFBDisplay
    ~Win32BitmapPrinterDisplay()
    {
       if(memDC) DeleteDC(memDC);
-      if(memBitmap) DeleteObject(memBitmap); 
+      if(memBitmap) DeleteObject(memBitmap);
       if(palette) DeleteObject(palette);
       delete logPalette;
    }
@@ -62,7 +62,7 @@ class Win32BitmapPrinterSystem : LFBSystem
 
    ~Win32BitmapPrinterSystem()
    {
-      if(hdc)                                                                           
+      if(hdc)
          ReleaseDC(0, tmpDC);
    }
 };
@@ -85,11 +85,11 @@ class Win32BitmapPrinterBitmap : struct
 
 static PixelFormat GetColorFormat(int depth)
 {
-   if(depth == 8) 
+   if(depth == 8)
       return pixelFormat8;
-   else if(depth == 16) 
+   else if(depth == 16)
       return pixelFormat555;
-   else 
+   else
       return pixelFormat888;
 }
 
@@ -314,7 +314,7 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
             info->bmiHeader.biBitCount = (uint16)gdiSystem.depth;
             info->bmiHeader.biWidth = gdiDisplay.bitmap.stride;
             info->bmiHeader.biHeight = -gdiDisplay.height;
-    
+
             for(c=0; c<256; c++)
             {
                info->bmiColors[c].rgbReserved = 0;
@@ -401,8 +401,8 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
    {
       Win32BitmapPrinterDisplay gdiDisplay = display.driverData;
       /*
-      BitBlt(gdiDisplay.hdc, 
-         updateBox.left,updateBox.top, 
+      BitBlt(gdiDisplay.hdc,
+         updateBox.left,updateBox.top,
          updateBox.right - updateBox.left + 1, updateBox.bottom - updateBox.top + 1,
          gdiDisplay.memDC, updateBox.left, updateBox.top, SRCCOPY);
       */
@@ -433,7 +433,7 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
       Win32BitmapPrinterDisplay gdiDisplay = display.driverData;
       gdiDisplay.completed = false;
       EndPage(gdiDisplay.hdc);
-      StartPage(gdiDisplay.hdc);      
+      StartPage(gdiDisplay.hdc);
    }
 
    void FreeBitmap(DisplaySystem displaySystem, Bitmap bitmap)
@@ -504,14 +504,14 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
                surface.height = gdiDisplay.height - y + 1;
                surface.offset.x = x * gdiDisplay.width / display.width;
                surface.offset.y = y * gdiDisplay.height / display.height;
-               surface.unclippedBox = surface.box = 
+               surface.unclippedBox = surface.box =
                {
                   left = clip.left * gdiDisplay.width / display.width,
                   top = clip.top * gdiDisplay.height / display.height,
                   right = (clip.right+1) * gdiDisplay.width / display.width-1,
                   bottom = (clip.bottom+1) * gdiDisplay.height / display.height-1
                };
-         
+
                gdiSurface.rgn = CreateRectRgn(
                   surface.offset.x + surface.box.left,
                   surface.offset.y + surface.box.top,
@@ -537,7 +537,7 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
    {
       Win32BitmapPrinterDisplay gdiDisplay = display.driverData;
       Win32BitmapPrinterSurface gdiSurface = surface.driverData;
-      HRGN clippedRgn = null; 
+      HRGN clippedRgn = null;
       if(clip != null)
       {
          Box box = clip;
@@ -545,7 +545,7 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
          box.Clip(gdiSurface.unclippedBox);
 
          gdiSurface.box = box;
-         surface.box = 
+         surface.box =
          {
             left = box.left * gdiDisplay.width / display.width,
             top = box.top * gdiDisplay.height / display.height,
@@ -570,7 +570,7 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
          }
          else
             clippedRgn = CreateRectRgn(0, 0, 0, 0);
-         
+
          if(clippedRgn)
             SelectClipRgn(gdiSurface.hdc, clippedRgn);
       }
@@ -630,11 +630,11 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
       Color back = surface.background;
       surface.background = surface.foreground;
       //SetPixel(gdiSurface.hdc, x + gdiSurface.offset.x, y + gdiSurface.offset.y, gdiSurface.color);
-      
-      ((subclass(DisplayDriver))class(LFBDisplayDriver)).Area(display, surface, 
-         (int)((float)x * gdiDisplay.width / display.width), 
+
+      ((subclass(DisplayDriver))class(LFBDisplayDriver)).Area(display, surface,
+         (int)((float)x * gdiDisplay.width / display.width),
          (int)((float)y * gdiDisplay.height / display.height),
-         (int)((float)(x+1) * gdiDisplay.width / display.width)-1, 
+         (int)((float)(x+1) * gdiDisplay.width / display.width)-1,
          (int)((float)(y+1) * gdiDisplay.height / display.height)-1
          );
       surface.background = back;
@@ -663,7 +663,7 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
          MoveToEx(gdiSurface.hdc, x1, y1, null);
          LineTo(gdiSurface.hdc, x2, y2);
          */
-         
+
          if(x1 == x2)
          {
             ((subclass(DisplayDriver))class(LFBDisplayDriver)).DrawLine(display, surface, x1,y1,x2,y2+(int)((float)gdiDisplay.width / display.width + 0.5));
@@ -690,8 +690,8 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
       Win32BitmapPrinterSurface gdiSurface = surface.driverData;
       Win32BitmapPrinterDisplay gdiDisplay = display ? display.driverData : null;
       /*
-      ((subclass(DisplayDriver))class(LFBDisplayDriver)).Rectangle(display, surface, 
-         ((float)x1 * gdiDisplay.width / display.width) + 0.5, 
+      ((subclass(DisplayDriver))class(LFBDisplayDriver)).Rectangle(display, surface,
+         ((float)x1 * gdiDisplay.width / display.width) + 0.5,
          ((float)y1 * gdiDisplay.height / display.height) + 0.5,
          ((float)x2 * gdiDisplay.width / display.width) + 0.5,
          ((float)y2 * gdiDisplay.height / display.height) + 0.5);
@@ -724,14 +724,14 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
    {
       Win32BitmapPrinterDisplay gdiDisplay = display ? display.driverData : null;
       Win32BitmapPrinterSurface gdiSurface = surface.driverData;
-     
-      ((subclass(DisplayDriver))class(LFBDisplayDriver)).Area(display, surface, 
-         (int)((float)x1 * gdiDisplay.width / display.width), 
+
+      ((subclass(DisplayDriver))class(LFBDisplayDriver)).Area(display, surface,
+         (int)((float)x1 * gdiDisplay.width / display.width),
          (int)((float)y1 * gdiDisplay.height / display.height),
          (int)(((float)(x2+1) * gdiDisplay.width / display.width) + 0.5),
          (int)(((float)(y2+1) * gdiDisplay.height / display.height) + 0.5));
-      
-      /* 
+
+      /*
       x1 += gdiSurface.offset.x;
       x2 += gdiSurface.offset.x;
       y1 += gdiSurface.offset.y;
@@ -774,7 +774,7 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
    {
       Win32BitmapPrinterDisplay gdiDisplay = display ? display.driverData : null;
       ((subclass(DisplayDriver))class(LFBDisplayDriver)).Filter(display, surface, src,
-         dx * gdiDisplay.width / display.width, 
+         dx * gdiDisplay.width / display.width,
          dy * gdiDisplay.height / display.height,
          sx, sy,
          (w+1) * gdiDisplay.width / display.width-1,
@@ -853,7 +853,7 @@ class Win32BitmapPrinterDisplayDriver : DisplayDriver
 
       // UNICODE FIX: proper space computation
       if(width) *width = size.cx + (wordCount - realLen) * space.cx;
-      if(height) 
+      if(height)
       {
          if(realLen)
             *height = size.cy;
index 6531683..d5c06e0 100644 (file)
@@ -57,7 +57,7 @@ class Win32ConsoleDisplayDriver : DisplayDriver
       {
          if(((subclass(DisplayDriver))class(LFBDisplayDriver)).CreateDisplay(display))
          {
-            
+
             conDisplay.bitmap.pixelFormat = pixelFormatText;
             result = true;
          }
@@ -214,7 +214,7 @@ class Win32ConsoleDisplayDriver : DisplayDriver
          if(y2>surface.box.bottom)y2=surface.box.bottom;
          if(y2 < y1) return;
 
-         lfbPtr = conDisplay.charInfo + 
+         lfbPtr = conDisplay.charInfo +
             (y1+surface.offset.y)*display.width / textCellW+x1+surface.offset.x;
          for(y = y1; y <= y2; y++)
          {
@@ -238,7 +238,7 @@ class Win32ConsoleDisplayDriver : DisplayDriver
          if(x2>surface.box.right)x2=surface.box.right;
          if(x2 < x1) return;
 
-         lfbPtr = conDisplay.charInfo + 
+         lfbPtr = conDisplay.charInfo +
             (y1+surface.offset.y)*display.width / textCellW+x1+surface.offset.x;
 
          if(conSurface.opaqueText)
@@ -366,7 +366,7 @@ class Win32ConsoleDisplayDriver : DisplayDriver
       x /= textCellW;
       y /= textCellH;
 
-      if(y > surface.box.bottom || y < surface.box.top) 
+      if(y > surface.box.bottom || y < surface.box.top)
          return;
       lfbPtr += (y+surface.offset.y) * display.width / textCellW + x + surface.offset.x;
       for(c=0; (c<len && x < surface.box.left); c++, x++,lfbPtr++);
index 9254cf6..38f2f0e 100644 (file)
@@ -44,7 +44,7 @@ class Win32PrinterDisplay : struct
    ~Win32PrinterDisplay()
    {
       //if(memDC) DeleteDC(memDC);
-      //if(memBitmap) DeleteObject(memBitmap); 
+      //if(memBitmap) DeleteObject(memBitmap);
       if(palette) DeleteObject(palette);
       delete logPalette;
    }
@@ -84,11 +84,11 @@ class Win32PrinterBitmap : struct
 
 static PixelFormat GetColorFormat(int depth)
 {
-   if(depth == 8) 
+   if(depth == 8)
       return pixelFormat8;
-   else if(depth == 16) 
+   else if(depth == 16)
       return pixelFormat555;
-   else 
+   else
       return pixelFormat888;
 }
 
@@ -373,7 +373,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
       Win32PrinterDisplay gdiDisplay = display.driverData;
       gdiDisplay.completed = false;
       EndPage(gdiDisplay.hdc);
-      StartPage(gdiDisplay.hdc);      
+      StartPage(gdiDisplay.hdc);
    }
 
    void FreeBitmap(DisplaySystem displaySystem, Bitmap bitmap)
@@ -438,7 +438,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
             SetBkColor(gdiSystem.bmpDC, RGB(0,0,0));
             BitBlt(gdiSystem.bmpDC, 0, 0, bitmap.width, bitmap.height, gdiSystem.tmpDC, 0, 0, SRCAND);
             SelectObject(gdiSystem.tmpDC, prevDC2);
-            SelectObject(gdiSystem.bmpDC, prevDC);            
+            SelectObject(gdiSystem.bmpDC, prevDC);
             SetTextColor(gdiSystem.bmpDC, RGB(0,0,0));
             SetBkColor(gdiSystem.bmpDC, RGB(255,255,255));
             SetBkColor(gdiSystem.tmpDC, RGB(255,255,255));
@@ -449,7 +449,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
          {
             gdiBitmap.bmp = CreateDIBitmap(gdiSystem.hdc, (LPBITMAPINFOHEADER)info, CBM_INIT, bitmap.picture, info, DIB_RGB_COLORS);
          }
-         
+
          delete bitmap.picture;
          delete info;
 
@@ -505,14 +505,14 @@ class Win32PrinterDisplayDriver : DisplayDriver
                surface.height = gdiDisplay.height - y + 1;
                surface.offset.x = x * gdiDisplay.width / display.width;
                surface.offset.y = y * gdiDisplay.height / display.height;
-               surface.unclippedBox = surface.box = 
+               surface.unclippedBox = surface.box =
                {
                   left = clip.left * gdiDisplay.width / display.width,
                   top = clip.top * gdiDisplay.height / display.height,
                   right = (clip.right+1) * gdiDisplay.width / display.width-1,
                   bottom = (clip.bottom+1) * gdiDisplay.height / display.height-1
                };
-         
+
                gdiSurface.rgn = CreateRectRgn(
                   surface.offset.x + surface.box.left,
                   surface.offset.y + surface.box.top,
@@ -540,7 +540,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
    {
       Win32PrinterDisplay gdiDisplay = display.driverData;
       Win32PrinterSurface gdiSurface = surface.driverData;
-      HRGN clippedRgn = null; 
+      HRGN clippedRgn = null;
       if(clip != null)
       {
          Box box = clip;
@@ -548,7 +548,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
          box.Clip(gdiSurface.unclippedBox);
 
          gdiSurface.box = box;
-         surface.box = 
+         surface.box =
          {
             left = box.left * gdiDisplay.width / display.width,
             top = box.top * gdiDisplay.height / display.height,
@@ -573,7 +573,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
          }
          else
             clippedRgn = CreateRectRgn(0, 0, 0, 0);
-         
+
          if(clippedRgn)
             SelectClipRgn(gdiSurface.hdc, clippedRgn);
       }
@@ -638,7 +638,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
       PatBlt(gdiSurface.hdc,
          (int)((float)x * gdiDisplay.width / display.width) + surface.offset.x,
          (int)((float)y * gdiDisplay.height / display.height) + surface.offset.y,
-         (int)((float)(x+1) * gdiDisplay.width / display.width)-1 + surface.offset.x+1, 
+         (int)((float)(x+1) * gdiDisplay.width / display.width)-1 + surface.offset.x+1,
          (int)((float)(y+1) * gdiDisplay.height / display.height)-1 + surface.offset.y+1,
          PATCOPY);
       SetBkColor(gdiSurface.hdc, gdiSurface.backColor);
@@ -706,7 +706,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
    {
       Win32PrinterDisplay gdiDisplay = display ? display.driverData : null;
       Win32PrinterSurface gdiSurface = surface.driverData;
-     
+
       x1 = (int)((float)x1 * gdiDisplay.width / display.width) + surface.offset.x;
       y1 = (int)((float)y1 * gdiDisplay.height / display.height) + surface.offset.y;
       x2 = (int)(((float)(x2+1) * gdiDisplay.width / display.width) + 0.5) + surface.offset.x;
@@ -759,30 +759,30 @@ class Win32PrinterDisplayDriver : DisplayDriver
          SelectObject(gdiSystem.tmpDC, gdiBitmap.mask);
 
          SetStretchBltMode(gdiSurface.hdc, HALFTONE); //COLORONCOLOR);
-         
+
          SetBkColor(gdiSurface.hdc, 0xFFFFFF);
          SetTextColor(gdiSurface.hdc, 0);
-         StretchBlt(gdiSurface.hdc, 
-            dx * gdiDisplay.width / display.width + surface.offset.x, 
+         StretchBlt(gdiSurface.hdc,
+            dx * gdiDisplay.width / display.width + surface.offset.x,
             dy * gdiDisplay.height / display.height + surface.offset.y,
             (w) * gdiDisplay.width / display.width,
             (h) * gdiDisplay.height / display.height,
             gdiSystem.tmpDC, sx, sy,sw,sh, SRCAND);
-         StretchBlt(gdiSurface.hdc, 
-            dx * gdiDisplay.width / display.width + surface.offset.x, 
+         StretchBlt(gdiSurface.hdc,
+            dx * gdiDisplay.width / display.width + surface.offset.x,
             dy * gdiDisplay.height / display.height + surface.offset.y,
             (w) * gdiDisplay.width / display.width,
             (h) * gdiDisplay.height / display.height,
             gdiSystem.bmpDC, sx, sy,sw,sh, SRCPAINT);
          /*
-         StretchBlt(gdiSurface.hdc, 
-            dx * gdiDisplay.width / display.width + surface.offset.x, 
+         StretchBlt(gdiSurface.hdc,
+            dx * gdiDisplay.width / display.width + surface.offset.x,
             dy * gdiDisplay.height / display.height + surface.offset.y,
             (w+1) * gdiDisplay.width / display.width-1,
             (h+1) * gdiDisplay.height / display.height-1,
             gdiSystem.tmpDC, sx, sy,sw,sh, SRCAND);
-         StretchBlt(gdiSurface.hdc, 
-            dx * gdiDisplay.width / display.width + surface.offset.x, 
+         StretchBlt(gdiSurface.hdc,
+            dx * gdiDisplay.width / display.width + surface.offset.x,
             dy * gdiDisplay.height / display.height + surface.offset.y,
             (w+1) * gdiDisplay.width / display.width-1,
             (h+1) * gdiDisplay.height / display.height-1,
@@ -794,8 +794,8 @@ class Win32PrinterDisplayDriver : DisplayDriver
       {
          SetStretchBltMode(gdiSurface.hdc, HALFTONE); //COLORONCOLOR);
          SelectObject(gdiSystem.bmpDC, gdiBitmap.bmp);
-         StretchBlt(gdiSurface.hdc, 
-            dx * gdiDisplay.width / display.width + surface.offset.x, 
+         StretchBlt(gdiSurface.hdc,
+            dx * gdiDisplay.width / display.width + surface.offset.x,
             dy * gdiDisplay.height / display.height + surface.offset.y,
             (w+1) * gdiDisplay.width / display.width-1,
             (h+1) * gdiDisplay.height / display.height-1,
@@ -904,7 +904,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
           *width = size.cx + (wordCount - realLen) * space.cx;
           *width = *width * resX / GetDeviceCaps(hdc, HORZRES);
       }
-      if(height) 
+      if(height)
       {
          if(realLen)
             *height = size.cy;
@@ -913,7 +913,7 @@ class Win32PrinterDisplayDriver : DisplayDriver
          *height = *height * resY / GetDeviceCaps(hdc, VERTRES);
       }
    }
-   
+
    void TextExtent(Display display, Surface surface, char * text, int len, int * width, int * height)
    {
       Win32PrinterDisplay gdiDisplay = display ? display.driverData : null;
index 2bdc7e4..91f6a76 100644 (file)
@@ -98,12 +98,12 @@ XRenderPictFormat * GetXRenderFormat(PixelFormat pixelFormat, bool alphaBlend)
          break;
       case pixelFormat888:
          format = XRenderFindStandardFormat(xGlobalDisplay, alphaBlend ? PictStandardARGB32 : PictStandardRGB24);
-         // printf("R: %d G: %d B: %d\n", format->direct.red, format->direct.green, format->direct.blue); 
+         // printf("R: %d G: %d B: %d\n", format->direct.red, format->direct.green, format->direct.blue);
          break;
       case pixelFormat555:
       {
          XRenderPictFormat info = { 0 };
-         
+
          info.depth = 16;
          info.type = PictTypeDirect;
          info.direct.red = 10;
@@ -112,7 +112,7 @@ XRenderPictFormat * GetXRenderFormat(PixelFormat pixelFormat, bool alphaBlend)
          info.direct.redMask   = 0x1F;
          info.direct.greenMask = 0x1F;
          info.direct.blueMask  = 0x1F;
-         
+
          format = XRenderFindFormat(xGlobalDisplay,
             /*PictFormatDepth|*/PictFormatType| PictFormatAlpha|PictFormatRed|PictFormatGreen|PictFormatBlue|
             PictFormatRedMask|PictFormatGreenMask|PictFormatBlueMask|PictFormatAlphaMask, &info, 0);
@@ -133,8 +133,8 @@ XRenderPictFormat * GetXRenderFormat(PixelFormat pixelFormat, bool alphaBlend)
          info.direct.blueMask  = 0x1F;
          info.direct.alphaMask = 0;
          info.id = 0xba;
-         
-         format = XRenderFindFormat(xGlobalDisplay, 
+
+         format = XRenderFindFormat(xGlobalDisplay,
             /*PictFormatDepth|*/PictFormatType|PictFormatAlpha|PictFormatRed|PictFormatGreen|PictFormatBlue|
             PictFormatRedMask|PictFormatGreenMask|PictFormatBlueMask|PictFormatAlphaMask, &info, 0);
          break;
@@ -204,7 +204,7 @@ static bool ClipStretchCoords(Surface surface, Bitmap src, int *dx, int *dy, int
    {
       *w = Abs(*w);
       *sw = Abs(*sw);
-      *flip = true; 
+      *flip = true;
    }
 
    s2dw=(float)*w / *sw;
@@ -273,16 +273,16 @@ static void PutBitmapMask(Pixmap mask, Bitmap bitmap) {
    XImage image = {0};
    GC maskGC = XCreateGC(xGlobalDisplay, mask, 0, null);
    uint wordWidth = (bitmap.width+31) >> 5;
-   
+
    uint x,y;
    uint32 *b = new0 uint32[wordWidth * bitmap.height];
    uint32 f = 1;
-   
+
    XSetGraphicsExposures(xGlobalDisplay, maskGC, False);
-   
+
    image.width = bitmap.width;
    image.height = bitmap.height;
-   
+
    image.format = XYBitmap;
    #ifdef __BIG_ENDIAN__
    image.byte_order = MSBFirst;
@@ -294,18 +294,18 @@ static void PutBitmapMask(Pixmap mask, Bitmap bitmap) {
    image.bitmap_pad = 32;
    image.depth = 1;
    image.bytes_per_line = wordWidth << 2;
-   
+
    image.data = (char*)b;
-   
+
    XInitImage(&image);
-   
+
    switch(bitmap.pixelFormat) {
       case pixelFormat4: {
-         
+
       } break;
       case pixelFormat8: {
          byte *p = (byte*)bitmap.picture;
-         
+
          for(y = 0; y<bitmap.height; y++, p+=bitmap.stride) {
             for(x = 0; x<bitmap.width; x++) {
                if(p[x])
@@ -349,23 +349,23 @@ static void PutBitmapMask(Pixmap mask, Bitmap bitmap) {
          }
       } break;
       case pixelFormatAlpha: {
-         
+
       } break;
       case pixelFormatText: {
-         
+
       } break;
       case pixelFormatRGBA: {
-         
+
       } break;
    }
-   
+
    XSetForeground(xGlobalDisplay, maskGC, 1);
    XSetBackground(xGlobalDisplay, maskGC, 0);
-   
+
    XPutImage(xGlobalDisplay, mask, maskGC, &image,
       0, 0, 0, 0, //coordinates
       bitmap.width, bitmap.height);
-   
+
    XFreeGC(xGlobalDisplay, maskGC);
    delete image.data;
 }
@@ -414,7 +414,7 @@ class XDisplayDriver : DisplayDriver
             if(xDisplay.shminfoShape.shmaddr != (void *)-1)
                shmdt(xDisplay.shminfoShape.shmaddr);
             shmctl(xDisplay.shminfoShape.shmid, IPC_RMID, 0);
-         }                  
+         }
          XDestroyImage(xDisplay.shapeImage);
          xDisplay.shapeImage = None;
       }
@@ -502,7 +502,7 @@ class XDisplayDriver : DisplayDriver
                   if(xDisplay.shminfoShape.shmaddr != (void *)-1)
                      shmdt(xDisplay.shminfoShape.shmaddr);
                   shmctl(xDisplay.shminfoShape.shmid, IPC_RMID, 0);
-               }                  
+               }
                XDestroyImage(xDisplay.shapeImage);
                xDisplay.shapeImage = None;
             }
@@ -552,7 +552,7 @@ class XDisplayDriver : DisplayDriver
                      if(xDisplay.shminfo.shmaddr != (void *)-1)
                         shmdt(xDisplay.shminfo.shmaddr);
                      shmctl(xDisplay.shminfo.shmid, IPC_RMID, 0);
-                  }                  
+                  }
                   XDestroyImage(xDisplay.image);
                   xDisplay.image = None;
                }
@@ -587,7 +587,7 @@ class XDisplayDriver : DisplayDriver
                      if(xDisplay.shminfoShape.shmaddr != (void *)-1)
                         shmdt(xDisplay.shminfoShape.shmaddr);
                      shmctl(xDisplay.shminfoShape.shmid, IPC_RMID, 0);
-                  }                  
+                  }
                   XDestroyImage(xDisplay.shapeImage);
                   xDisplay.shapeImage = None;
                }
@@ -659,11 +659,11 @@ class XDisplayDriver : DisplayDriver
 
       //bitmap.Convert(null, pixelFormatRGBA, null);
       //bitmap.Convert(null, pixelFormat888, null);
-      xBitmap.pixmap = 
-         XCreatePixmap(xGlobalDisplay, confineWindow /*(X11Window)display.window*/, bitmap.width, bitmap.height, 
+      xBitmap.pixmap =
+         XCreatePixmap(xGlobalDisplay, confineWindow /*(X11Window)display.window*/, bitmap.width, bitmap.height,
             (bitmap.pixelFormat == pixelFormatAlpha) ? 8 : (bitmap.alphaBlend ? 32 : ((bitmap.pixelFormat == pixelFormat888) ? 24 : xSystemDepth)));
       if(bitmap.transparent)
-         xBitmap.mask = 
+         xBitmap.mask =
             XCreatePixmap(xGlobalDisplay, confineWindow /*(X11Window)display.window*/, bitmap.width, bitmap.height, 1);
 
       {
@@ -683,7 +683,7 @@ class XDisplayDriver : DisplayDriver
 
       image.width = bitmap.width;
       image.height = bitmap.height;
-      
+
       if(bitmap.pixelFormat == pixelFormatAlpha)
       {
          image.depth = 8;
@@ -710,7 +710,7 @@ class XDisplayDriver : DisplayDriver
       image.green_mask = 0x7E0;
       image.blue_mask  = 0x1F;
       */
-      
+
       /*
       image.red_mask   = 0x0000FF;
       image.green_mask = 0x00FF00;
@@ -737,12 +737,12 @@ class XDisplayDriver : DisplayDriver
          }
       }
 
-      XPutImage(xGlobalDisplay, (Pixmap)xBitmap.pixmap, gc, &image, 
+      XPutImage(xGlobalDisplay, (Pixmap)xBitmap.pixmap, gc, &image,
          0, 0, 0, 0, bitmap.width,bitmap.height);
 
       if(bitmap.transparent && !bitmap.alphaBlend && bitmap.pixelFormat != pixelFormatAlpha)
          PutBitmapMask(xBitmap.mask, bitmap);
-      
+
       XFreeGC(xGlobalDisplay, gc);
 
       if(!bitmap.keepData)
@@ -788,7 +788,7 @@ class XDisplayDriver : DisplayDriver
          surface.unclippedBox = surface.box = clip;
 
          xSurface.pixmap = xBitmap.pixmap;
-         
+
          result = true;
       }
       return result;
@@ -854,14 +854,14 @@ class XDisplayDriver : DisplayDriver
       }
       if(changed)
       {
-         XRectangle rectangle = 
+         XRectangle rectangle =
          {
             (short)(surface.box.left + surface.offset.x),
             (short)(surface.box.top + surface.offset.y),
             (short)(surface.box.right - surface.box.left + 1),
             (short)(surface.box.bottom - surface.box.top + 1)
          };
-         XSetClipRectangles(xGlobalDisplay, xDisplay.gc, 
+         XSetClipRectangles(xGlobalDisplay, xDisplay.gc,
             0,0, &rectangle, 1, YXBanded);
       }
    }
@@ -899,7 +899,7 @@ class XDisplayDriver : DisplayDriver
 
       if(display)
          xImage = XGetImage(xGlobalDisplay, xDisplay.pixmap, sx, sy, sw, sh, MAXDWORD, ZPixmap);
-      else 
+      else
          xImage = XGetImage(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay), sx, sy, sw, sh, MAXDWORD, ZPixmap);
 
       source.pixelFormat = format;
@@ -956,7 +956,7 @@ class XDisplayDriver : DisplayDriver
       // xSurface.foreground = ARGB(A(color),B(color),G(color),R(color));
       xSurface.foreground = color;
 
-      XSetForeground(xGlobalDisplay, xDisplay.gc, (xSystemPixelFormat == pixelFormat888) ? xSurface.foreground : 
+      XSetForeground(xGlobalDisplay, xDisplay.gc, (xSystemPixelFormat == pixelFormat888) ? xSurface.foreground :
          ((xSystemPixelFormat == pixelFormat565) ? ((Color565)xSurface.foreground) : ((Color555)xSurface.foreground)));
    }
 
@@ -967,12 +967,12 @@ class XDisplayDriver : DisplayDriver
       // xSurface.background = ARGB(A(color),B(color),G(color),R(color));
       xSurface.background = color;
 
-      XSetBackground(xGlobalDisplay, xDisplay.gc, (xSystemPixelFormat == pixelFormat888) ? xSurface.background : 
+      XSetBackground(xGlobalDisplay, xDisplay.gc, (xSystemPixelFormat == pixelFormat888) ? xSurface.background :
          ((xSystemPixelFormat == pixelFormat565) ? ((Color565)xSurface.background) : ((Color555)xSurface.background)));
    }
 
    ColorAlpha GetPixel(Display display, Surface surface, int x, int y)
-   {          
+   {
       return 0;
    }
 
@@ -1087,7 +1087,7 @@ class XDisplayDriver : DisplayDriver
                   traps[1] = trap2;
                   traps[2] = trap3;
                   nTraps = 3;
-               }   
+               }
             }
             else
             {
@@ -1121,21 +1121,21 @@ class XDisplayDriver : DisplayDriver
                   traps[1] = trap2;
                   traps[2] = trap3;
                   nTraps = 3;
-               }   
+               }
             }
             /*
             printf("Line: (%d, %d)-(%d, %d)\n", x1,y1, x2,y2);
             printf("Line: A = (%.2f, %.2f), B = (%.2f, %.2f), C = (%.2f, %.2f)\n", A.x,A.y, B.x,B.y, C.x,C.y);
             printf("Line: D = (%.2f, %.2f), E = (%.2f, %.2f), F = (%.2f, %.2f)\n", D.x,D.y, E.x,E.y, F.x,F.y);
-            printf("Trap1: top = %.2f, bottom = %.2f, left = (%.2f, %.2f)-(%.2f, %.2f), right = (%.2f, %.2f)-(%.2f, %.2f)\n", 
+            printf("Trap1: top = %.2f, bottom = %.2f, left = (%.2f, %.2f)-(%.2f, %.2f), right = (%.2f, %.2f)-(%.2f, %.2f)\n",
                traps[0].top / 65536.0, traps[0].bottom / 65536.0,
                traps[0].left.p1.x / 65536.0, traps[0].left.p1.y / 65536.0, traps[0].left.p2.x / 65536.0, traps[0].left.p2.y / 65536.0,
                traps[0].right.p1.x / 65536.0, traps[0].right.p1.y / 65536.0, traps[0].right.p2.x / 65536.0, traps[0].right.p2.y / 65536.0);
-            printf("Trap2: top = %.2f, bottom = %.2f, left = (%.2f, %.2f)-(%.2f, %.2f), right = (%.2f, %.2f)-(%.2f, %.2f)\n", 
+            printf("Trap2: top = %.2f, bottom = %.2f, left = (%.2f, %.2f)-(%.2f, %.2f), right = (%.2f, %.2f)-(%.2f, %.2f)\n",
                traps[1].top / 65536.0, traps[1].bottom / 65536.0,
                traps[1].left.p1.x / 65536.0,  traps[1].left.p1.y / 65536.0,  traps[1].left.p2.x / 65536.0,  traps[1].left.p2.y / 65536.0,
                traps[1].right.p1.x / 65536.0, traps[1].right.p1.y / 65536.0, traps[1].right.p2.x / 65536.0, traps[1].right.p2.y / 65536.0);
-            printf("Trap3: top = %.2f, bottom = %.2f, left = (%.2f, %.2f)-(%.2f, %.2f), right = (%.2f, %.2f)-(%.2f, %.2f)\n", 
+            printf("Trap3: top = %.2f, bottom = %.2f, left = (%.2f, %.2f)-(%.2f, %.2f), right = (%.2f, %.2f)-(%.2f, %.2f)\n",
                traps[2].top / 65536.0, traps[2].bottom / 65536.0,
                traps[2].left.p1.x / 65536.0,  traps[2].left.p1.y / 65536.0,  traps[2].left.p2.x / 65536.0,  traps[2].left.p2.y / 65536.0,
                traps[2].right.p1.x / 65536.0, traps[2].right.p1.y / 65536.0, traps[2].right.p2.x / 65536.0, traps[2].right.p2.y / 65536.0);
@@ -1156,7 +1156,7 @@ class XDisplayDriver : DisplayDriver
    {
       XDisplay xDisplay = display.driverData;
       XSurface xSurface = surface.driverData;
-      
+
       if(xSurface.foreground.a < 255)
       {
          DrawLine(display, surface,x1,y1,x2-1,y1);
@@ -1192,17 +1192,17 @@ class XDisplayDriver : DisplayDriver
       }
       else
       {
-         XSetForeground(xGlobalDisplay, xDisplay.gc, (xSystemPixelFormat == pixelFormat888) ? xSurface.background : 
+         XSetForeground(xGlobalDisplay, xDisplay.gc, (xSystemPixelFormat == pixelFormat888) ? xSurface.background :
             ((xSystemPixelFormat == pixelFormat565) ? ((Color565)xSurface.background) : ((Color555)xSurface.background)));
          XFillRectangle(xGlobalDisplay, (Pixmap) xDisplay.pixmap, xDisplay.gc,
             x1 + surface.offset.x,
             y1 + surface.offset.y,
             x2 - x1 + 1, y2 - y1 + 1);
-         XSetForeground(xGlobalDisplay, xDisplay.gc, (xSystemPixelFormat == pixelFormat888) ? xSurface.foreground : 
+         XSetForeground(xGlobalDisplay, xDisplay.gc, (xSystemPixelFormat == pixelFormat888) ? xSurface.foreground :
             ((xSystemPixelFormat == pixelFormat565) ? ((Color565)xSurface.foreground) : ((Color555)xSurface.foreground)));
       }
    }
-   
+
    void Clear(Display display, Surface surface, ClearType flags)
    {
       if(flags != depthBuffer)
@@ -1230,7 +1230,7 @@ class XDisplayDriver : DisplayDriver
          }
          else
             Area(display, surface,surface.box.left,surface.box.top,surface.box.right,surface.box.bottom);
-      }  
+      }
    }
 
    bool ConvertBitmap(DisplaySystem displaySystem, Bitmap src, PixelFormat format, ColorAlpha * palette)
@@ -1254,7 +1254,7 @@ class XDisplayDriver : DisplayDriver
             }
          }
 
-         bitmap.stride = stride;   
+         bitmap.stride = stride;
          bitmap.width = width;
          bitmap.height = height;
          bitmap.size = (uint)stride * (uint)height;
@@ -1301,7 +1301,7 @@ class XDisplayDriver : DisplayDriver
          }
          if(xSurface.xOffset)
          {
-            XTransform transform = 
+            XTransform transform =
             {
                {
                   { (int)(1.0f * (1<<16)), (int)(0.0f * (1<<16)), -(xSurface.xOffset << 10) },
@@ -1310,7 +1310,7 @@ class XDisplayDriver : DisplayDriver
                }
             };
             // printf("XOffset: %d\n", xSurface.xOffset);
-            XRenderSetPictureTransform(xGlobalDisplay, xBitmap.picture, &transform);            
+            XRenderSetPictureTransform(xGlobalDisplay, xBitmap.picture, &transform);
          }
 
          if(src.alphaBlend || display.alphaBlend)
@@ -1325,7 +1325,7 @@ class XDisplayDriver : DisplayDriver
                XRenderComposite(xGlobalDisplay, PictOpOver, xBitmap.picture, xBitmap.maskPicture, xSurface.picture, sx, sy, sx, sy, dx, dy, w, h);
          }
          else
-            XCopyArea(xGlobalDisplay, (Pixmap)xBitmap.pixmap, (Pixmap)xSurface.pixmap, xDisplay.gc, 
+            XCopyArea(xGlobalDisplay, (Pixmap)xBitmap.pixmap, (Pixmap)xSurface.pixmap, xDisplay.gc,
                sx, sy, w, h, dx, dy);
 
          if(xSurface.xOffset)
@@ -1364,7 +1364,7 @@ class XDisplayDriver : DisplayDriver
       XBitmap xBitmap = src.driverData;
       if(xBitmap)
       {
-         XTransform transform = 
+         XTransform transform =
          {
             {
                { (int)((float)sw / w * (1<<16)), (int)(0.0f * (1<<16)), (int)(0.0f * (1<<16)) },
@@ -1434,7 +1434,7 @@ class XDisplayDriver : DisplayDriver
          image.data = src.picture;
          XInitImage(&image);
 
-         XPutImage(xGlobalDisplay, (Pixmap)xSurface.pixmap, xDisplay.gc, &image, 
+         XPutImage(xGlobalDisplay, (Pixmap)xSurface.pixmap, xDisplay.gc, &image,
             sx, sy, dx + surface.offset.x, dy + surface.offset.y, w,h);
       }
       else
@@ -1460,7 +1460,7 @@ class XDisplayDriver : DisplayDriver
          if(!src.transparent)
          {
             // printf("Stride: %d, dx: %d, dy: %d, w: %d, h: %d, %d\n", temp.stride, dx + surface.offset.x, dy + surface.offset.y, w,h, xSystemDepth);
-            XPutImage(xGlobalDisplay, (Pixmap)xSurface.pixmap, xDisplay.gc, &image, 
+            XPutImage(xGlobalDisplay, (Pixmap)xSurface.pixmap, xDisplay.gc, &image,
                0, 0, dx + surface.offset.x, dy + surface.offset.y, w,h);
          }
          else
@@ -1517,7 +1517,7 @@ class XDisplayDriver : DisplayDriver
                   }
                }
             }
-         
+
             XFreeGC(xGlobalDisplay, maskGC);
          #else
          GC gc = 0;
@@ -1530,7 +1530,7 @@ class XDisplayDriver : DisplayDriver
             XSetGraphicsExposures(xGlobalDisplay, gc, False);
 
             XPutImage(xGlobalDisplay, pixmap, gc, &image, 0, 0, 0, 0, w,h);
-            
+
          PutBitmapMask(mask, temp);
          #endif
 
@@ -1583,9 +1583,9 @@ class XDisplayDriver : DisplayDriver
 
          image.data = temp.picture;
          XInitImage(&image);
-         
+
          // printf("Blitting DI\n");
-         XPutImage(xGlobalDisplay, (Pixmap)xSurface.pixmap, xDisplay.gc, &image, 
+         XPutImage(xGlobalDisplay, (Pixmap)xSurface.pixmap, xDisplay.gc, &image,
             0, 0, dx + surface.offset.x, dy + surface.offset.y, w,h);
 
          delete s;
@@ -1618,9 +1618,9 @@ class XDisplayDriver : DisplayDriver
 
          image.data = temp.picture;
          XInitImage(&image);
-         
+
          // printf("Blitting DI\n");
-         XPutImage(xGlobalDisplay, (Pixmap)xSurface.pixmap, xDisplay.gc, &image, 
+         XPutImage(xGlobalDisplay, (Pixmap)xSurface.pixmap, xDisplay.gc, &image,
             0, 0, dx + surface.offset.x, dy + surface.offset.y, w,h);
 
          delete s;
@@ -1660,7 +1660,7 @@ class XDisplayDriver : DisplayDriver
       XSurface xSurface = surface.driverData;
       XDisplay xDisplay = display.driverData;
       int tw, th;
-    
+
       ((subclass(DisplayDriver))class(LFBDisplayDriver)).TextExtent(display, surface, text, len, &tw, &th);
       if(xSurface.opaque)
       {
@@ -1682,11 +1682,11 @@ class XDisplayDriver : DisplayDriver
             (uint16)xSurface.background.a
          };
          //printf("Filling rectangle\n");
-         XRenderFillRectangle(xGlobalDisplay, PictOpSrc /*PictOpOver*/, xSurface.picture, &renderColor, 
+         XRenderFillRectangle(xGlobalDisplay, PictOpSrc /*PictOpOver*/, xSurface.picture, &renderColor,
             x + surface.offset.x, y + surface.offset.y, tw, th);
       }
       /*
-      XDrawString(xGlobalDisplay, (Pixmap)xDisplay.pixmap, xDisplay.gc, 
+      XDrawString(xGlobalDisplay, (Pixmap)xDisplay.pixmap, xDisplay.gc,
          x + surface.offset.x, y + surface.offset.y + 12, text, len);
       */
 
@@ -1797,19 +1797,19 @@ class XDisplayDriver : DisplayDriver
          XSetClipRectangles(xGlobalDisplay, xDisplay.gc, 0,0, &rectangle, 1, YXBanded);
       }
       /*if(display.alphaBlend)
-         XRenderComposite(xGlobalDisplay, PictOpSrc, xDisplay.picture, None, xDisplay.windowPicture, box->left, box->top, 0, 0, box->left, box->top, 
+         XRenderComposite(xGlobalDisplay, PictOpSrc, xDisplay.picture, None, xDisplay.windowPicture, box->left, box->top, 0, 0, box->left, box->top,
             box->right - box->left + 1, box->bottom - box->top + 1);
       else*/
-         XCopyArea(xGlobalDisplay, (Pixmap)xDisplay.pixmap, (X11Window)display.window, xDisplay.gc /*windowGC*/, 
-            box->left, box->top, 
-            box->right - box->left + 1, 
+         XCopyArea(xGlobalDisplay, (Pixmap)xDisplay.pixmap, (X11Window)display.window, xDisplay.gc /*windowGC*/,
+            box->left, box->top,
+            box->right - box->left + 1,
             box->bottom - box->top + 1,
             box->left, box->top);
 
       if(display.alphaBlend)
       {
          Box * box = &xDisplay.updateBox;
-         XRenderComposite(xGlobalDisplay, PictOpSrc, xDisplay.picture, None, xDisplay.shapePicture, box->left, box->top, 0, 0, box->left, box->top, 
+         XRenderComposite(xGlobalDisplay, PictOpSrc, xDisplay.picture, None, xDisplay.shapePicture, box->left, box->top, 0, 0, box->left, box->top,
             box->right - box->left + 1, box->bottom - box->top + 1);
          #if !defined(__APPLE__) && !defined(__OLDX__)
          XShapeCombineMask(xGlobalDisplay, (X11Window)display.window, ShapeInput, 0, 0, xDisplay.shapePixmap, ShapeSet);
index 4e5d53c..852a08e 100644 (file)
@@ -18,7 +18,7 @@ static void BLIT_##suffix(BLIT_ARGS) \
    init                                                                 \
    for(y=0; y<h; y++) { xloop; source+=addsource; dest+=adddest; }      \
 }
-   
+
 #define BLIT_INIT_DEC   \
    int x;               \
    dest += w-1;         \
@@ -29,7 +29,7 @@ static void BLIT_##suffix(BLIT_ARGS) \
    int x;               \
    adddest -= w;        \
    addsource -= w;
-   
+
 #define FLIP(copy) for(x=0; x<w; x++) { copy source++; dest--; }
 #define NOFLIP(copy) for(x=0; x<w; x++) { copy source++; dest++; }
 #define TRANSPUT(result)  if(*source) *dest=(result);
@@ -75,28 +75,28 @@ BLIT(B888F, byte, ColorAlpha,PALINIT BLIT_INIT_DEC,   FLIP(OPAQUEPUT(palette[*so
 
 static void BLIT_BRGBA(Bitmap src, Bitmap dst, int dx, int dy, int sx, int sy, int w, int h)
 {
-   int y;                                                              
-   uint32 adddest = dst.stride, addsource = src.stride;               
-   byte * source = (byte *) src.picture + sy * addsource + sx;  
-   ColorRGBA * dest   = (ColorRGBA *) dst.picture + dy * adddest   + dx;  
+   int y;
+   uint32 adddest = dst.stride, addsource = src.stride;
+   byte * source = (byte *) src.picture + sy * addsource + sx;
+   ColorRGBA * dest   = (ColorRGBA *) dst.picture + dy * adddest   + dx;
    ColorAlpha * palette = src.palette;
-   int x;             
-   adddest -= w;       
+   int x;
+   adddest -= w;
    addsource -= w;
 
-   for(y=0; y<h; y++) 
-   { 
-      for(x=0; x<w; x++) 
-      { 
+   for(y=0; y<h; y++)
+   {
+      for(x=0; x<w; x++)
+      {
          ColorAlpha value = palette[*source];
          ColorRGBA color = (ColorRGBA)(value);
          *dest=color;
-         source++; 
-         dest++; 
+         source++;
+         dest++;
       }
 
-      source+=addsource; 
-      dest+=adddest; 
+      source+=addsource;
+      dest+=adddest;
    }
 }
 
@@ -115,7 +115,7 @@ BLIT(B888TF,byte, ColorAlpha,PALINIT BLIT_INIT_DEC,   FLIP(TRANSPUT(palette[*sou
 BLIT(BRGBAT, byte, ColorRGBA,PALINIT BLIT_INIT_INC, NOFLIP(TRANSPUT((ColorRGBA)(palette[*source]))))
 BLIT(BRGBATF,byte, ColorRGBA,PALINIT BLIT_INIT_DEC,   FLIP(TRANSPUT((ColorRGBA)(palette[*source]))))
 
-void (* blits_8bit_table[PixelFormat][2][2]) (BLIT_ARGS) = 
+void (* blits_8bit_table[PixelFormat][2][2]) (BLIT_ARGS) =
 {
    { { null, null }, { null, null } },
    { { BLIT_B8,   BLIT_B8F },   { BLIT_B8T,   BLIT_B8TF } },
@@ -145,7 +145,7 @@ BLIT(BI888F, byte, ColorAlpha,PALSHADEINIT PALINIT BLIT_INIT_DEC,   FLIP(TRANSPU
 BLIT(BIRGBA, byte, ColorRGBA, PALSHADEINIT PALINIT BLIT_INIT_INC, NOFLIP(TRANSPUT((ColorRGBA)(palette[SHADESRC]))))
 BLIT(BIRGBAF,byte, ColorRGBA, PALSHADEINIT PALINIT BLIT_INIT_DEC,   FLIP(TRANSPUT((ColorRGBA)(palette[SHADESRC]))))
 
-void (* shades_blit_table[PixelFormat][2]) (BLIT_ARGS) = 
+void (* shades_blit_table[PixelFormat][2]) (BLIT_ARGS) =
 {
    { null, null },
    { BLIT_BI8,  BLIT_BI8F },
@@ -441,7 +441,7 @@ FILTER(AT,  byte, byte, 1, 1, color, (byte)color)
 FILTER(AF,  byte, byte,-1, 1, color, (byte)color)
 
 void (* filters_table[PixelFormat][2][2]) (FILTER_ARGS) =
-{ 
+{
    { { null, null },              { null, null} },
    { { FILTER_8, FILTER_8F },     { FILTER_8T, FILTER_8TF } },
    { { FILTER_444, FILTER_444F }, { FILTER_444T, FILTER_444TF } },
index 1e40119..e08747d 100644 (file)
@@ -29,12 +29,12 @@ static void BMP8_8(LFBSystem lfbSystem, Bitmap src, Bitmap dst)
    {
       if(lfbSystem && lfbSystem.palette == dst.palette)
          CONVERT(
-            pixel ? 
-               ( (pixel = lfbSystem.rgbLookup[(uint16)(Color555)(src.palette[pixel])]) ? 
+            pixel ?
+               ( (pixel = lfbSystem.rgbLookup[(uint16)(Color555)(src.palette[pixel])]) ?
                   pixel
-               : 
-                  lfbSystem.rgbLookup[0x421]) 
-            : 
+               :
+                  lfbSystem.rgbLookup[0x421])
+            :
                0,
             byte,byte)
       else
@@ -109,11 +109,11 @@ static void BMP444_8(LFBSystem lfbSystem, Bitmap src, Bitmap dst)
    {
       if(lfbSystem && lfbSystem.palette == dst.palette)
          CONVERT(
-            pixel ? 
-               ( (pixel = lfbSystem.rgbLookup[(uint16)(Color555)(pixel)]) ? 
-                  pixel 
-               : 
-                  lfbSystem.rgbLookup[0x421]) 
+            pixel ?
+               ( (pixel = lfbSystem.rgbLookup[(uint16)(Color555)(pixel)]) ?
+                  pixel
+               :
+                  lfbSystem.rgbLookup[0x421])
             :
                0,
             Color444, byte)
@@ -167,11 +167,11 @@ static void BMP555_8(LFBSystem lfbSystem, Bitmap src, Bitmap dst)
    {
       if(lfbSystem && lfbSystem.palette == dst.palette)
          CONVERT(
-            pixel ? 
-               ( (pixel = lfbSystem.rgbLookup[pixel]) ? 
-                  pixel 
-               : 
-                  lfbSystem.rgbLookup[0x421]) 
+            pixel ?
+               ( (pixel = lfbSystem.rgbLookup[pixel]) ?
+                  pixel
+               :
+                  lfbSystem.rgbLookup[0x421])
             :
                0,
             Color555, byte)
@@ -225,11 +225,11 @@ static void BMP565_8(LFBSystem lfbSystem, Bitmap src, Bitmap dst)
    {
       if(lfbSystem && lfbSystem.palette == dst.palette)
          CONVERT(
-            pixel ? 
-               ( (pixel = lfbSystem.rgbLookup[(uint16)(Color555)(pixel)]) ? 
-                  pixel 
-               : 
-                  lfbSystem.rgbLookup[0x421]) 
+            pixel ?
+               ( (pixel = lfbSystem.rgbLookup[(uint16)(Color555)(pixel)]) ?
+                  pixel
+               :
+                  lfbSystem.rgbLookup[0x421])
             :
                0,
             Color565, byte)
@@ -283,11 +283,11 @@ static void BMP888_8(LFBSystem lfbSystem, Bitmap src, Bitmap dst)
    {
       if(lfbSystem && lfbSystem.palette == dst.palette)
          CONVERT(
-            (pixel & 0xFFFFFF) ? 
-               ( (pixel = lfbSystem.rgbLookup[(Color555)(pixel)]) ? 
-                  pixel 
-               : 
-                  lfbSystem.rgbLookup[0x421]) 
+            (pixel & 0xFFFFFF) ?
+               ( (pixel = lfbSystem.rgbLookup[(Color555)(pixel)]) ?
+                  pixel
+               :
+                  lfbSystem.rgbLookup[0x421])
             :
                0,
             ColorAlpha,byte)
@@ -384,19 +384,19 @@ static void BMPRGBA_8(LFBSystem lfbSystem, Bitmap src, Bitmap dst)
    {
       if(lfbSystem && lfbSystem.palette == dst.palette)
          CONVERT(
-            //(pixel & 0xFF000000) ? 
-            (pixel.a) ? 
-               ( (pixel = lfbSystem.rgbLookup[(uint16)(Color555)(pixel)]) ? 
+            //(pixel & 0xFF000000) ?
+            (pixel.a) ?
+               ( (pixel = lfbSystem.rgbLookup[(uint16)(Color555)(pixel)]) ?
                   pixel
-               : 
-                  lfbSystem.rgbLookup[0x421]) 
+               :
+                  lfbSystem.rgbLookup[0x421])
             :
                0,
             ColorRGBA, byte)
       else
       {
-         //CONVERT((pixel & 0xFF000000) ? 
-         CONVERT((pixel.a > 192) ? 
+         //CONVERT((pixel & 0xFF000000) ?
+         CONVERT((pixel.a > 192) ?
             (BestColorMatch(dst.palette,1,255, (ColorAlpha)(pixel))) : 0, ColorRGBA, byte)
       }
    }
index a85c9cd..55ef738 100644 (file)
@@ -9,7 +9,7 @@ public struct AnchorValue
    union
    {
       int distance;
-      float percent;      
+      float percent;
    };
    property int
    {
@@ -36,7 +36,7 @@ public struct AnchorValue
          c = strlen(stringOutput)-1;
          for( ; c >= 0; c--)
          {
-            if(stringOutput[c] != '0') 
+            if(stringOutput[c] != '0')
                last = Max(last, c);
             if(stringOutput[c] == '.')
             {
@@ -61,7 +61,7 @@ public struct AnchorValue
       if(strchr(stringOutput, '.'))
       {
          float percent = (float)strtod(stringOutput, &end);
-         
+
          if(end != stringOutput)
          {
             this.percent = percent;
@@ -96,7 +96,7 @@ public struct MiddleAnchorValue
    union
    {
       int distance;
-      float percent;      
+      float percent;
    };
    property int
    {
@@ -119,7 +119,7 @@ public struct MiddleAnchorValue
          c = strlen(stringOutput)-1;
          for( ; c >= 0; c--)
          {
-            if(stringOutput[c] != '0') 
+            if(stringOutput[c] != '0')
                last = Max(last, c);
             if(stringOutput[c] == '.')
             {
@@ -164,7 +164,7 @@ public struct Anchor
 {
    union { AnchorValue left; MiddleAnchorValue horz; };
    union { AnchorValue top; MiddleAnchorValue vert; };
-   AnchorValue right, bottom;      
+   AnchorValue right, bottom;
 
    char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
    {
@@ -175,7 +175,7 @@ public struct Anchor
       tempString[0] = '\0';
       anchorValue = left.OnGetString(tempString, null, &subNeedClass);
       if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "left = "); strcat(stringOutput, anchorValue); }
-      
+
       //if(((!left.type && !right.type) && horz.distance) || horz.type == middleRelative)
       if(!right.type && ((!left.type && horz.distance) || horz.type == middleRelative))
       {
@@ -183,11 +183,11 @@ public struct Anchor
          anchorValue = horz.OnGetString(tempString, null, &subNeedClass);
          if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "horz = "); strcat(stringOutput, anchorValue); }
       }
-      
+
       tempString[0] = '\0';
       anchorValue = top.OnGetString(tempString, null, &subNeedClass);
       if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "top = "); strcat(stringOutput, anchorValue); }
-      
+
       tempString[0] = '\0';
       anchorValue = right.OnGetString(tempString, null, &subNeedClass);
       if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "right = "); strcat(stringOutput, anchorValue); }
@@ -199,11 +199,11 @@ public struct Anchor
          anchorValue = vert.OnGetString(tempString, null, &subNeedClass);
          if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "vert = "); strcat(stringOutput, anchorValue); }
       }
-      
+
       tempString[0] = '\0';
       anchorValue = bottom.OnGetString(tempString, null, &subNeedClass);
       if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "bottom = "); strcat(stringOutput, anchorValue); }
-      
+
       return stringOutput;
    }
 
@@ -234,7 +234,7 @@ public struct Anchor
          control = control;
          borderStyle = 0;
       };
-      
+
       comboBox.Create();
 
       {
@@ -379,7 +379,7 @@ private class AnchorRelButton : Button
    {
       int cw = clientSize.w;
       int ch = clientSize.h;
-      
+
       if(checked)
       {
          surface.SetForeground(black);
@@ -470,7 +470,7 @@ private class AnchorRelButton : Button
             //anchor.horz.type = anchor.horz.distance ? offset : none;
          }
          else if(anchor.horz.type == middleRelative) anchor.horz.percent = (float) ((x + w / 2) - (vpw / 2)) / vpw;
-         if(!anchor.top.type && !anchor.bottom.type) 
+         if(!anchor.top.type && !anchor.bottom.type)
          {
             anchor.vert.distance = (y + h / 2) - (vph / 2);
             //anchor.vert.type = anchor.vert.distance ? offset : none;
@@ -528,8 +528,8 @@ private class AnchorDropBox : DropBox
       };
       for(c = 0; c<4; c++)
       {
-         Button button = buttons[c] = AnchorButton 
-         { 
+         Button button = buttons[c] = AnchorButton
+         {
             anchorEditor, id = c,
             size = Size { (c%2)?10:28, (c%2)?28:10 }
          };
@@ -543,7 +543,7 @@ private class AnchorDropBox : DropBox
             case 0:
                if(anchorValue.left.type && anchorValue.left.type != middleRelative) button.checked = true;
                if(anchorValue.left.type == relative || anchorValue.horz.type == middleRelative) relButton.checked = true;
-               
+
                button.anchor = Anchor { left = 0 };
                relButton.anchor = Anchor { left = 5, vert = 16 };
                break;
@@ -554,14 +554,14 @@ private class AnchorDropBox : DropBox
                button.anchor = Anchor { top = 0 };
                relButton.anchor = Anchor { top = 5, horz = 16 };
                break;
-            case 2: 
+            case 2:
                if(anchorValue.right.type && anchorValue.right.type != middleRelative) button.checked = true;
                if(anchorValue.right.type == relative || anchorValue.horz.type == middleRelative) relButton.checked = true;
-               
+
                button.anchor = Anchor { right = 0 };
                relButton.anchor = Anchor { right = 5, vert = 16 };
                break;
-            case 3: 
+            case 3:
                if(anchorValue.bottom.type && anchorValue.bottom.type != middleRelative) button.checked = true;
                if(anchorValue.bottom.type == relative || anchorValue.vert.type == middleRelative) relButton.checked = true;
 
@@ -573,7 +573,7 @@ private class AnchorDropBox : DropBox
       anchorEditor.Create();
       return anchorEditor;
    }
-      
+
    void OnCloseDropDown(Window anchorEditor)
    {
       // TOFIX: Patch for update bug
index 36d60aa..25d7199 100644 (file)
@@ -70,7 +70,7 @@ static bool Window3D_Setup(Window window, bool positionChildren)
    for(child = window.children.first; child; child = child.next)
    {
       if(!Window3D_Setup(child, false))
-         result = false; 
+         result = false;
    }
    return result;
 }
@@ -226,12 +226,12 @@ public bool Desktop3DUpdateDisplay()
                }
             }
          }
-      
+
          // Comment out fullScreen check here and dirty = true up there for ITV update
          if(/*!fullScreenWindow && */(virtualDesktopDirty || virtualDesktop.dirty))
          {
             if(virtualDesktopDirty)
-               virtualDesktop.Update(null);         
+               virtualDesktop.Update(null);
             virtualDesktop.UpdateDisplay();
             virtualDesktopDirty = false;
          }
@@ -292,7 +292,7 @@ static void _SetMouseRange(Window window, Box box)
    }
 }
 
-public void Desktop3DInitialize(Window window, 
+public void Desktop3DInitialize(Window window,
                                             void * (* setup)(Window window, int w, int h),
                                             void (* update)(Window window, Box box))
 {
index 7eb57fc..8a786db 100644 (file)
@@ -36,7 +36,7 @@ class FormDesigner : ClassDesignerBase
          if(form)
             form.visible = true;
       }
-      
+
       selected = control;
       Update(null);
       //activeDesigner.Update(null);
@@ -61,7 +61,7 @@ class FormDesigner : ClassDesignerBase
       else
       {
          // instance.parent = _class;
-      }   
+      }
    }
 
    void ::PostCreateObject(Window instance, ObjectInfo object, bool isClass, Window _class)
@@ -149,21 +149,21 @@ class FormDesigner : ClassDesignerBase
    void ::FixProperty(Property prop, Window object)
    {
       FormDesigner designer = (FormDesigner)activeDesigner.classDesigner;
-      
+
       if(!strcmp(prop.name, "parent"))
       {
          if(object.parent == guiApp.desktop)
             object.parent = designer.form;
 
          if(object.parent == designer.form)
-         {  
+         {
             ObjectInfo previous = object.object;
             while((previous = previous.prev) && ((Window)previous.instance).parent != designer.form);
             if(previous)
                object.parent.children.Move(object, (Window)previous.instance);
          }
       }
-      
+
       if(!strcmp(prop.name, "master") && !object.master)
          object.master = designer.form;
 
@@ -191,10 +191,10 @@ class FormDesigner : ClassDesignerBase
       editBox.Printf("import \"ecere\"\n\n");
       editBox.Printf("class %s : %s\n", name, inherit);
       editBox.Printf("{\n");
-      
+
       editBox.Printf("   caption = \"%s\";\n", name);
       //editBox.Printf("   background = Color { 212, 208, 200 };\n");
-      
+
       editBox.Printf("   background = formColor;\n");
       editBox.Printf("   borderStyle = sizable;\n");
       editBox.Printf("   hasMaximize = true;\n");
@@ -202,8 +202,8 @@ class FormDesigner : ClassDesignerBase
       editBox.Printf("   hasClose = true;\n");
       //editBox.Printf("   position = { 20, 20 };\n");
       editBox.Printf("   clientSize = { %d, %d };\n", w, h);
-      
-      
+
+
       //editBox.Printf("   Button ok { parent = this, position = { 100, 100 }, size = { 80, 20 } };\n");
 
       //editBox.Printf("\n   Button ok\n   {\n      parent = this;\n\n      bool NotifyClicked()\n      {\n      }\n   };\n");
@@ -256,7 +256,7 @@ class FormDesigner : ClassDesignerBase
                int h = moved.size.h;
                Box box;
                Anchor anchor = moved.anchor;
-               
+
                x = xBefore + parentBefore.absPosition.x - curParent.absPosition.x + parentBefore.clientStart.x - curParent.clientStart.x;
                y = yBefore + parentBefore.absPosition.y - curParent.absPosition.y + parentBefore.clientStart.y - curParent.clientStart.y;
 
@@ -279,9 +279,9 @@ class FormDesigner : ClassDesignerBase
                   }
                   else if(resizeX > 0)
                   {
-                     w += dx;            
+                     w += dx;
                   }
-            
+
                   if(resizeY < 0)
                   {
                      y += dy;
@@ -291,12 +291,12 @@ class FormDesigner : ClassDesignerBase
                   {
                      h += dy;
                   }
-                  if(resizeX) 
+                  if(resizeX)
                   {
                      w = Max(w, GridSnap);
                      moved.size.w = w;
                   }
-                  if(resizeY) 
+                  if(resizeY)
                   {
                      h = Max(h, GridSnap);
                      moved.size.h = h;
@@ -317,7 +317,7 @@ class FormDesigner : ClassDesignerBase
 
                      moved.parent = parent;
                      if(parent == form)
-                     {  
+                     {
                         ObjectInfo previous = moved.object;
                         while((previous = previous.prev) && ((Window)previous.instance).parent != form);
                         if(previous)
@@ -329,7 +329,7 @@ class FormDesigner : ClassDesignerBase
                   x -= x % GridSnap;
                   y -= y % GridSnap;
                }
-               
+
                activeDesigner.ModifyCode();
 
                moved.Move(x, y, w, h);
@@ -351,7 +351,7 @@ class FormDesigner : ClassDesignerBase
 
                {
                   int vpw, vph;
-                  
+
                   // Fix Anchor
                   x = moved.position.x;
                   y = moved.position.y;
@@ -388,7 +388,7 @@ class FormDesigner : ClassDesignerBase
                      //anchor.horz.type = anchor.horz.distance ? offset : 0;
                   }
                   else if(anchor.horz.type == middleRelative) anchor.horz.percent = (float) ((x + w / 2) - (vpw / 2)) / vpw;
-                  if(!anchor.top.type && !anchor.bottom.type) 
+                  if(!anchor.top.type && !anchor.bottom.type)
                   {
                      anchor.vert.distance = (y + h / 2) - (vph / 2);
                      //anchor.vert.type = anchor.vert.distance ? offset : 0;
@@ -412,7 +412,7 @@ class FormDesigner : ClassDesignerBase
                box.top -= 7;
                box.right += 7;
                box.bottom += 7;
-         
+
                Update(box);
                //activeDesigner.Update(box);
 
@@ -544,7 +544,7 @@ class FormDesigner : ClassDesignerBase
                ((control == form) ? (Window)this : form).SetMouseRangeToWindow();
             else
                ((control == form) ? (Window)this : form).SetMouseRangeToClient();
-            
+
             xClicked = x;
             yClicked = y;
 
@@ -593,7 +593,7 @@ class FormDesigner : ClassDesignerBase
 
                   activeDesigner.CodeAddObject(control, &object);
 
-                  while(!parent.name) 
+                  while(!parent.name)
                   {
                      x += parent.position.x + parent.clientStart.x;
                      y += parent.position.y + parent.clientStart.y;
@@ -616,7 +616,7 @@ class FormDesigner : ClassDesignerBase
 
                   control.Create();
                   if(parent == form)
-                  {  
+                  {
                      ObjectInfo previous = control.object;
                      while((previous = previous.prev) && ((Window)previous.instance).parent != form);
                      if(previous)
@@ -657,7 +657,7 @@ class FormDesigner : ClassDesignerBase
          window.OnSysKeyDown = ecere::gui::OnSysKey;
          window.OnSysKeyHit = ecere::gui::OnSysKey;
          window.OnSysKeyUp = ecere::gui::OnSysKey;
-            
+
          if(object != object.oClass)
          {
             window.OnActivate = Control_OnActivate;
@@ -859,7 +859,7 @@ static bool OnKeyDown(Window window, Key key, unichar ch)
          if(!confirmation)
          {
             activeDesigner.ModifyCode();
-         
+
             designer.selected.Destroy(0);
             //activeDesigner.Update(null);
             designer.Update(null);
index adf6aff..0189419 100644 (file)
@@ -185,7 +185,7 @@ public class GuiApplication : Application
    char appName[1024];
    uint timerResolution;
 
-   Size virtualScreen;   
+   Size virtualScreen;
    Point virtualScreenPos;
 
    int64 mainThread;
@@ -193,7 +193,7 @@ public class GuiApplication : Application
    GuiApplication()
    {
       SystemCursor c;
-      
+
       mainThread = GetCurrentThreadID();
       if(!guiApp)
          guiApp = this;
@@ -396,7 +396,7 @@ public class GuiApplication : Application
    bool IsModeSwitching()
    {
       return modeSwitching;
-   }  
+   }
 
    public bool SetDesktopPosition(int x, int y, int w, int h, bool moveChildren)
    {
@@ -435,11 +435,11 @@ public class GuiApplication : Application
                {
                   child.x = desktop.x;
                   child.y = desktop.y;
-                  child.ComputeAnchors(, 
-                     A_LEFT,A_LEFT,A_OFFSET,A_OFFSET, 
+                  child.ComputeAnchors(,
+                     A_LEFT,A_LEFT,A_OFFSET,A_OFFSET,
                      &x, &y, &w, &h);
                   child.Position(, x, y, w, h, false, true, true, true, false);
-               }           
+               }
             }
          }*/
          if(desktop.display)
@@ -466,7 +466,7 @@ public class GuiApplication : Application
    }
 
    void SetAppFocus(bool state)
-   {  
+   {
       // Shouldn't be property here
       desktop.active = state;
    }
@@ -476,7 +476,7 @@ public class GuiApplication : Application
       bool result = false;
       subclass(Skin) skin;
       OldLink link;
-      
+
       for(link = class(Skin).derivatives.first; link; link = link.next)
       {
          skin = link.data;
@@ -484,7 +484,7 @@ public class GuiApplication : Application
             break;
       }
       if(!link) skin = null;
-      
+
       if(skin)
       {
          if(skin != currentSkin || !currentSkin)
@@ -506,7 +506,7 @@ public class GuiApplication : Application
                }
 
                UnapplySkin(class(Window));
-               
+
                currentSkin = skin;
 
                ApplySkin(class(Window), skin.name, null);
@@ -717,7 +717,7 @@ public:
                if(!Cycle(wait))
                   wait = false;
 
-               if(wait) 
+               if(wait)
                   Wait();
                else
                {
@@ -795,7 +795,7 @@ public:
          result |= UpdateTimers();
          result |= ProcessFileNotifications();
          */
-         
+
          result |= ProcessFileNotifications();
          result |= UpdateTimers();
          result |= interfaceDriver.ProcessInput(useProcessAll && processAll);
@@ -810,7 +810,7 @@ public:
 #if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D)
       if(Desktop3DUpdateDisplay()) return;
 #endif
-      
+
       if(interfaceDriver)
       {
          if(fullScreenMode && desktop.display)
@@ -895,7 +895,7 @@ public:
 
          PauseNetworkEvents();
          network.mutex.Wait();
-         
+
    #ifdef DEBUG_SOCKETS
          if(network.connectEvent || network.networkEvent)
             Log("[P] [NProcess]\n");
@@ -1008,7 +1008,7 @@ public:
                         FD_SET(socket.s, &network.readSet);
                         FD_SET(socket.s, &network.exceptSet);
                         network.mutex.Release();
-                        
+
                         // printf("Calling OnConnect on %s\n", socket._class.name);
                         socket.OnConnect();
                         network.mutex.Wait();
@@ -1109,7 +1109,7 @@ public:
       if(skinName)
       {
          OldLink link;
-         
+
          for(link = class(Skin).derivatives.first; link; link = link.next)
          {
             skin = link.data;
@@ -1155,12 +1155,12 @@ public:
                break;
          }
          if(!link)
-            inter = null;      
+            inter = null;
       }
-   
+
       /*
       if(driverName)
-      {   
+      {
 #if defined(__WIN32__)
 #if !defined(ECERE_VANILLA)
          if(!strcmp(driverName, "Win32Console")) inter = (subclass(Interface))class(Win32ConsoleInterface); else
@@ -1173,7 +1173,7 @@ public:
       }
       */
 
-      if(interfaceDriver && (!driverName || (fbDriver && !strcmp(fbDriver, driverName))) && 
+      if(interfaceDriver && (!driverName || (fbDriver && !strcmp(fbDriver, driverName))) &&
          fullScreen == fbFullScreen &&
          (!resolution || resolution == fbResolution) &&
          (!colorDepth || colorDepth == fbColorDepth) &&
@@ -1215,7 +1215,7 @@ public:
             {
                if(!fbDriver || (driverName && strcmp(fbDriver, driverName)))
                   defaultDisplayDriver = driverName;
-      
+
                if(!skinName || !SelectSkin(skinName))
                {
                   if(!currentSkin || currentSkin.textMode != textMode ||
@@ -1223,7 +1223,7 @@ public:
                   {
                      OldLink link;
                      subclass(Skin) skin = null;
-                     
+
                      for(link = class(Skin).derivatives.first; link; link = link.next)
                      {
                         skin = link.data;
@@ -1244,7 +1244,7 @@ public:
                if(currentSkin && desktop.SetupDisplay())
                {
                   desktop.active = true;
-               
+
                   if(fullScreen)
                   {
                      desktop.display.Lock(false);
@@ -1285,7 +1285,7 @@ public:
       bool activity = false;
       FileMonitor monitor, next;
       static int reentrant = 0;
-      
+
       // Reentrant FileNotification is asking for trouble since each monitor is spawning a Modal() MessageBox
       if(reentrant) return false;
       // printf("[%d] Waiting in ProcessFileNotifications for fileMonitor Mutex %x...\n", (int)GetCurrentThreadID(), globalSystem.fileMonitorMutex);
@@ -1299,7 +1299,7 @@ public:
          incref monitor;
          if(next)
             incref next;
-         
+
          if(!monitor.reentrant && !monitor.toBeFreed)
          {
             monitor.reentrant = true;
@@ -1381,7 +1381,7 @@ public:
    {
       return interfaceDriver.GetMouseState(buttons, x, y);
    }
-   
+
    // Properties
    property char * appName
    {
@@ -1401,7 +1401,7 @@ public:
    {
       set
       {
-         SwitchMode(value, defaultDisplayDriver, resolution, 
+         SwitchMode(value, defaultDisplayDriver, resolution,
             pixelFormat, refreshRate, currentSkin ? currentSkin.name : null, true);
       }
       get { return this ? fullScreen : false; }
@@ -1410,16 +1410,16 @@ public:
    {
       set
       {
-         SwitchMode( fullScreen, value, resolution, pixelFormat, refreshRate, 
+         SwitchMode( fullScreen, value, resolution, pixelFormat, refreshRate,
             currentSkin ? currentSkin.name : null, true);
-       } 
+       }
        get { return this ? defaultDisplayDriver : null; }
    };
    property Resolution resolution
    {
       set
       {
-         SwitchMode(fullScreen, defaultDisplayDriver, value, pixelFormat, refreshRate, 
+         SwitchMode(fullScreen, defaultDisplayDriver, value, pixelFormat, refreshRate,
             currentSkin ? currentSkin.name : null, true);
       }
       get { return this ? resolution : 0; }
@@ -1428,7 +1428,7 @@ public:
    {
       set
       {
-         SwitchMode(fullScreen, defaultDisplayDriver, resolution, 
+         SwitchMode(fullScreen, defaultDisplayDriver, resolution,
             pixelFormat, refreshRate, currentSkin ? currentSkin.name : null, true);
       }
       get { return this ? pixelFormat : 0; }
@@ -1437,7 +1437,7 @@ public:
    {
       set
       {
-         SwitchMode(fullScreen, defaultDisplayDriver, resolution, 
+         SwitchMode(fullScreen, defaultDisplayDriver, resolution,
             pixelFormat, refreshRate, currentSkin ? currentSkin.name : null, true);
       }
       get { return this ? refreshRate : 0; }
@@ -1460,6 +1460,6 @@ public:
    property int numSkins { get { return 0; } };
    property uint timerResolution
    {
-      set { timerResolution = value; if(interfaceDriver) interfaceDriver.SetTimerResolution(value); } 
+      set { timerResolution = value; if(interfaceDriver) interfaceDriver.SetTimerResolution(value); }
    };
 };
index 8e57e2e..072c489 100644 (file)
@@ -154,7 +154,7 @@ public:
                surface.WriteText(x+1,y+1, text,tab-text);
                surface.WriteText(surface.width - 3 - tw - 12 + 1, y + 1,tab+1,len);
                surface.SetForeground(guiApp.currentSkin.disabledFrontColor );
-               
+
                surface.TextOpacity(false);
             }
             surface.TextOpacity(false);
@@ -180,7 +180,7 @@ public:
             int c;
             bool firstLetter;
             char * tab = strchr(text, '\t');
-            
+
             // Look for an uppercase letter starting a word
             firstLetter = true;
             ch = isalpha(characters[1][hotKey.code]) ? characters[1][hotKey.code] : characters[0][hotKey.code];
index c8edb74..f3d18c5 100644 (file)
@@ -15,7 +15,7 @@ public:
          SmartKey result = SmartKey { modifiers = modifiers };
          switch(code)
          {
-            case keyPadEnter: 
+            case keyPadEnter:
                return enter | result;
             case keyPadLeft: return left | result;
             case keyPadRight: return right | result;
@@ -60,7 +60,7 @@ public:
    }
 
    bool OnGetDataFromString(char * string)
-   { 
+   {
       if(((PredefinedKey)this).class::OnGetDataFromString(string))
          return true;
       else
@@ -159,7 +159,7 @@ public enum KeyCode : Key
 
    capsLock          = 0x3A,
 
-   // Function keys 1-10 
+   // Function keys 1-10
    f1                = 0x3B,
    f2                = 0x3C,
    f3                = 0x3D,
@@ -386,7 +386,7 @@ public enum PredefinedKey : Key
    ctrlPageDown = Key { pageDown, ctrl = true },
    ctrlInsert = Key { insert, ctrl = true },
    ctrlSpace = Key { space, ctrl = true },
-   
+
    shiftTab = Key { tab, shift = true },
    shiftF1 = Key { f1, shift = true },
    shiftF2 = Key { f2, shift = true },
index 3454741..d34d8c7 100644 (file)
@@ -140,7 +140,7 @@ private struct FastList
       {
          int c;
          int newSize;
-               
+
          if(size)
          {
             newSize = (size + (size >> 1));
@@ -255,10 +255,10 @@ public /*private */struct Extent : OldList //FastList
 
       temp.Copy(this);
       Empty();
-      
+
       for(extentBox = (BoxItem)temp.first; extentBox; extentBox = (BoxItem)extentBox.next)
       {
-         if(extentBox.box.left < box.right && extentBox.box.right > box.left && 
+         if(extentBox.box.left < box.right && extentBox.box.right > box.left &&
             extentBox.box.top < box.bottom && extentBox.box.bottom > box.top)
          {
             // Top box
@@ -266,7 +266,7 @@ public /*private */struct Extent : OldList //FastList
             {
                Box newBox
                {
-                  extentBox.box.left, extentBox.box.top, 
+                  extentBox.box.left, extentBox.box.top,
                   extentBox.box.right, Min(extentBox.box.bottom, box.top -1)
                };
                AddBox(newBox);
@@ -324,14 +324,14 @@ public /*private */struct Extent : OldList //FastList
       // First pass: check if this box is not already covered by one of the extent's box
       for(extentBox = (BoxItem)this.first; extentBox; extentBox = (BoxItem)extentBox.next)
       {
-         if(extentBox.box.left <= box.left && extentBox.box.right >= box.right && 
+         if(extentBox.box.left <= box.left && extentBox.box.right >= box.right &&
             extentBox.box.top <= box.top && extentBox.box.bottom >= box.bottom)
          {
             // No change
             return;
          }
       }
-        
+
       // Second pass: only keep boxes not completely covered in the new box
       for(extentBox = (BoxItem)this.first; extentBox; extentBox = next)
       {
@@ -377,7 +377,7 @@ public /*private */struct Extent : OldList //FastList
                }
             }
          }
-         
+
          // Else, add it
          if(!extentBox)
             AddBox(box);
@@ -411,7 +411,7 @@ public /*private */struct Extent : OldList //FastList
 
    void Exclusion(Extent b, Extent temp)
    {
-      BoxItem extentBox;   
+      BoxItem extentBox;
       for(extentBox = (BoxItem)b.first; extentBox; extentBox = (BoxItem)extentBox.next)
          ExcludeBox(extentBox.box, temp);
    }
@@ -436,7 +436,7 @@ private define CASCADE_SPACE = 16;
 
 private class ScrollFlags
 {
-   bool snapX:1, snapY:1, dontHide:1;   
+   bool snapX:1, snapY:1, dontHide:1;
 };
 
 public class BorderBits { public: bool contour:1, fixed:1, sizable:1, deep:1, bevel:1, thin:1; };
@@ -527,7 +527,7 @@ private:
             }
          }
       }
-      
+
       //tempExtents[0] = { /*first = -1, last = -1, free = -1*/ };
       //tempExtents[1] = { /*first = -1, last = -1, free = -1*/ };
       //tempExtents[2] = { /*first = -1, last = -1, free = -1*/ };
@@ -544,7 +544,7 @@ private:
       maxSize = Size { MAXINT, MAXINT };
       background = white;
       foreground = black;
-      
+
       //style.isActiveClient = true;
       mergeMenus = true;
       autoCreate = true;
@@ -578,7 +578,7 @@ private:
       }
 
       if(!destroyed)
-      { 
+      {
          // Prevent destructor from being called again...
          incref this;
          incref this;
@@ -695,7 +695,7 @@ private:
    {
       if(this == activeDesigner)
          return "(Desktop)";
-      else 
+      else
       {
          char * name = property::name;
          return name ? name : "";
@@ -981,7 +981,7 @@ private:
             ph = vph = box.bottom - box.top + 1;
          }
       }
-      
+
       if(!parent)
       {
          *ow = w;
@@ -1028,7 +1028,7 @@ private:
 
          if(anchor.top.type)
          {
-            SNAPUP(y, textCellH);   
+            SNAPUP(y, textCellH);
          }
          else if(anchor.bottom.type)
          {
@@ -1077,7 +1077,7 @@ private:
          pw = hiX - loX;
          ph = hiY - loY;
 
-         if(parent.sbv && !parent.sbv.style.hidden) 
+         if(parent.sbv && !parent.sbv.style.hidden)
             pw += guiApp.currentSkin.VerticalSBW();
          if(parent.sbh && !parent.sbh.style.hidden)
             ph += guiApp.currentSkin.HorizontalSBH();
@@ -1143,7 +1143,7 @@ private:
       {
          if(sizeAnchor.isClientW) w += ew;
          if(sizeAnchor.isClientH) h += eh;
-         
+
          if(anchor.left.type == offset)
             x = anchor.left.distance;
          else if(anchor.left.type == relative)
@@ -1168,8 +1168,8 @@ private:
          {
             switch(anchor.right.type)
             {
-               case relative: 
-                  ex = pw * (1.0f-anchor.right.percent); 
+               case relative:
+                  ex = pw * (1.0f-anchor.right.percent);
                   w = Max((int)(ex + 0.5) - x, 0);
                   break;
                case offset:
@@ -1195,7 +1195,7 @@ private:
       }
 
       w -= ew;
-      h -= eh; 
+      h -= eh;
 
       if(state == normal /*|| state == Hidden*/)
       {
@@ -1209,12 +1209,12 @@ private:
          w = Min(w, maxSize.w);
          h = Min(h, maxSize.h);
 
-         if((sizeAnchor.isClientW || !w || (anchor.left.type && anchor.right.type)) && reqScrollArea.h > h /*&& w*/ && sbv) 
+         if((sizeAnchor.isClientW || !w || (anchor.left.type && anchor.right.type)) && reqScrollArea.h > h /*&& w*/ && sbv)
          {
             if(w) w -= guiApp.currentSkin.VerticalSBW();
             addSbV = true;
          }
-         if((sizeAnchor.isClientH || !h ||  (anchor.top.type && anchor.bottom.type)) && reqScrollArea.w > w /*&& h*/ && sbh) 
+         if((sizeAnchor.isClientH || !h ||  (anchor.top.type && anchor.bottom.type)) && reqScrollArea.w > w /*&& h*/ && sbh)
          {
             if(h) h -= guiApp.currentSkin.HorizontalSBH();
             addSbH = true;
@@ -1226,7 +1226,7 @@ private:
             h = clientSize.h;
          }
 
-         if((addSbV)) // || reqScrollArea.h > h) && sbv) 
+         if((addSbV)) // || reqScrollArea.h > h) && sbv)
             w += guiApp.currentSkin.VerticalSBW();
          if((addSbH)) // || reqScrollArea.w > w) && sbh)
             h += guiApp.currentSkin.HorizontalSBH();
@@ -1241,7 +1241,7 @@ private:
       }
 
       w += ew;
-      h += eh; 
+      h += eh;
 
       if(guiApp.textMode)
       {
@@ -1254,9 +1254,9 @@ private:
          if(parent.numIcons) ph -= guiApp.textMode ? 16 : 24;
 
          numCascade = Min(
-            (pw - w) / CASCADE_SPACE, 
+            (pw - w) / CASCADE_SPACE,
             (ph - h) / CASCADE_SPACE);
-         
+
          if(guiApp.textMode)
          {
                int cascW, cascH;
@@ -1302,7 +1302,7 @@ private:
                if(anchor.vert.type == middleRelative)
                   y = (int)(vph * (0.5 + anchor.vert.percent) - h / 2);
                else
-                  y = vph / 2 + anchor.vert.distance - h / 2;      
+                  y = vph / 2 + anchor.vert.distance - h / 2;
             }
             else
                y = (int)(ey - h);
@@ -1348,13 +1348,13 @@ private:
          int y = caretPos.y - scroll.y;
 
          if((erase || this.caretSize) &&
-            x >= clientArea.left && x <= clientArea.right && 
+            x >= clientArea.left && x <= clientArea.right &&
             y >= clientArea.top  && y <= clientArea.bottom)
          {
             if(!erase)
             {
                guiApp.interfaceDriver.SetCaret(
-                  x + absPosition.x + clientStart.x, 
+                  x + absPosition.x + clientStart.x,
                   y + absPosition.y + clientStart.y, this.caretSize);
                guiApp.caretEnabled = true;
             }
@@ -1453,7 +1453,7 @@ private:
                //if((w > reqScrollArea.w) || (h > reqScrollArea.w))
                {
                   int stepX = sbStep.x, stepY = sbStep.y;
-                  // Needed to make snapped down position match the skin's check of client area 
+                  // Needed to make snapped down position match the skin's check of client area
                   // against realvirtual
                   if(guiApp.textMode)
                   {
@@ -1483,7 +1483,7 @@ private:
       // Automatic MDI Client Scrolling Area Adjustment
       if(parent && !parent.noAutoScrollArea)
       {
-         if(modifyArea && modifyVirtArea /*&& !anchored*/ && (parent.sbv || parent.sbh) && 
+         if(modifyArea && modifyVirtArea /*&& !anchored*/ && (parent.sbv || parent.sbh) &&
             !style.dontScrollHorz && !style.dontScrollVert && !style.nonClient)
          {
             Window parent = this.parent;
@@ -1499,12 +1499,12 @@ private:
             else if(stateAnchor.bottom.type == none && stateAnchor.top.type == none)
                h = Max(h, Max(position.y, 0) + size.h);
 
-            if((w > parent.clientSize.w && w > parent.reqScrollArea.w) || 
+            if((w > parent.clientSize.w && w > parent.reqScrollArea.w) ||
                (h > parent.clientSize.h && h > parent.reqScrollArea.h))
             {
                /*bool resize = false;
                int stepX = parent.sbStep.x, stepY = parent.sbStep.y;
-               // Needed to make snapped down position match the skin's check of client area 
+               // Needed to make snapped down position match the skin's check of client area
                // against realvirtual
                if(guiApp.textMode)
                {
@@ -1523,12 +1523,12 @@ private:
                   parent.reqScrollArea.h = h;*/
 
                  // parent.UpdateScrollBars(true, true);
-                  parent.Position(parent.position.x, parent.position.y, parent.size.w, parent.size.h, 
+                  parent.Position(parent.position.x, parent.position.y, parent.size.w, parent.size.h,
                      false, true, true, true, false, false);
                   return;
                //}
             }
-            else 
+            else
                GetRidOfVirtualArea();
          }
       }
@@ -1620,7 +1620,7 @@ private:
             {
                Window parent = this.parent;
                parent.Position(
-                  parent.position.x, parent.position.y, parent.size.w, parent.size.h, 
+                  parent.position.x, parent.position.y, parent.size.w, parent.size.h,
                   false, true, true, true, false, false);
                /*
                parent.SetScrollArea(0,0,true);
@@ -1652,16 +1652,16 @@ private:
 
       // windowResized = realResized || force;
       windowResized = size.w != w || size.h != h || force;
-     
+
       if(rootWindow != this && display && !display.flags.flipping && scrolledPos.x != MININT)
       {
          if(style.nonClient)
          {
             Box box
-            { 
-               scrolledPos.x - parent.clientStart.x + this.box.left, scrolledPos.y - parent.clientStart.y + this.box.top, 
+            {
+               scrolledPos.x - parent.clientStart.x + this.box.left, scrolledPos.y - parent.clientStart.y + this.box.top,
                scrolledPos.x - parent.clientStart.x + this.box.right,
-               scrolledPos.y - parent.clientStart.y + this.box.bottom 
+               scrolledPos.y - parent.clientStart.y + this.box.bottom
             };
             parent.Update(box);
          }
@@ -1706,7 +1706,7 @@ private:
                   int x,y,w,h;
                   for(child = children.first; child; child = child.next)
                   {
-                     if(child.created && 
+                     if(child.created &&
                      ((child.stateAnchor.left.type != offset ||
                        child.stateAnchor.top.type != offset ||
                        child.stateAnchor.right.type != none ||
@@ -1786,12 +1786,12 @@ private:
                else if(clientResized)
                   Update(clientArea);
                // --- Major Slow Down / Fix OpenGL Resizing Main Window Lag
-               
+
                /*
                if(!guiApp.fullScreenMode && !guiApp.modeSwitching && this == rootWindow)
                   UpdateDisplay();
                */
-               
+
                if(windowMoved || windowResized)
                {
                   display.Unlock();
@@ -1801,7 +1801,7 @@ private:
             {
                if(windowResized || windowMoved)
                   if(!display || display.flags.memBackBuffer)
-                     guiApp.interfaceDriver.PositionRootWindow(this, 
+                     guiApp.interfaceDriver.PositionRootWindow(this,
                         x, y, w, h, windowMoved, windowResized);
                guiApp.interfaceDriver.UpdateRootWindow(this);
             }
@@ -1973,7 +1973,7 @@ private:
             if(flag && (resizeH || resizeV) && fullThing)
             {
                Position(position.x, position.y, size.w, size.h, false, true, false, false, false, false);
-               
+
                if(!positioned)
                {
                   positioned = true;
@@ -1981,7 +1981,7 @@ private:
                   positioned = false;
                }
             }
-      
+
             if(resizeH && sbh)
                sbh.visible = sbhVisible;
             if(resizeV && sbv)
@@ -2226,7 +2226,7 @@ private:
                Update(null);
                break;
             }
-         }         
+         }
       }
    }
 
@@ -2286,7 +2286,7 @@ private:
       {
          if(!sysButtons[2])
          {
-            sysButtons[2] = 
+            sysButtons[2] =
                Button
                {
                   parent, master = this,
@@ -2304,7 +2304,7 @@ private:
                sysButtons[2].hotKey = ctrlF4;
             sysButtons[2].Create();
          }
-         
+
          sysButtons[2].symbol = 'X';
          sysButtons[2].disabled = !style.hasClose;
       }
@@ -2314,7 +2314,7 @@ private:
          SkinBitmap skin;
          unichar symbol;
          bool (* method)(Window window, Button button, int x, int y, Modifiers mods);
-         if(state == maximized) 
+         if(state == maximized)
          {
             skin = restore;
             method = RestoreButtonClicked;
@@ -2347,7 +2347,7 @@ private:
          SkinBitmap skin;
          unichar symbol;
          bool (* method)(Window window, Button button, int x, int y, Modifiers mods);
-         if (state == minimized) 
+         if (state == minimized)
          {
             skin = restore;
             method = RestoreButtonClicked;
@@ -2421,9 +2421,9 @@ private:
       }
       if(scrollBarChanged)
       {
-         SetScrollLineStep(sbStep.x, sbStep.y);   
+         SetScrollLineStep(sbStep.x, sbStep.y);
          UpdateScrollBars(true, true);
-      }   
+      }
       UpdateNonClient();
 
       if(scrollBarChanged)
@@ -2500,10 +2500,10 @@ private:
                      char name[2048], caption[2048];
                      document.FigureCaption(caption);
                      sprintf(name, "%d %s", id+1, caption);
-                     windowMenu.AddDynamic(MenuItem 
-                        { 
-                           copyText = true, text = name, hotKey = Key { k1 + id }, id = id++, 
-                           NotifySelect = MenuWindowSelectWindow 
+                     windowMenu.AddDynamic(MenuItem
+                        {
+                           copyText = true, text = name, hotKey = Key { k1 + id }, id = id++,
+                           NotifySelect = MenuWindowSelectWindow
                         }, this, false);
                   }
                   cycle = cycle.next;
@@ -2511,7 +2511,7 @@ private:
                }
             }
          }
-         
+
          if((!previous && activeClient) || !activeClient)
          {
             if(!activeClient)
@@ -2534,7 +2534,7 @@ private:
             if(item) item.disabled = false;
             item = menu.FindItem(MenuWindowWindows, 0);
             if(item) item.disabled = false;
-         }      
+         }
 
          item = menu.FindItem(MenuFileClose, 0);
          if(item) item.disabled = !activeClient || !activeClient.style.hasClose;
@@ -2572,7 +2572,7 @@ private:
          {
             char caption[2048];
             FigureCaption(caption);
-            
+
             if(post)
                ShowDecorations(captionFont.font,
                   surface,
@@ -2585,7 +2585,7 @@ private:
                   caption,
                   active, //parent.activeClient == this
                   guiApp.windowMoving == this);
-               
+
             delete surface;
          }
       }
@@ -2598,9 +2598,9 @@ private:
       if(!manageDisplay) { OnRedraw(null);return; }
       _ShowDecorations(refresh, false);
 
-      surface = Redraw(refresh);               
+      surface = Redraw(refresh);
       // Opaque background: just fill before EW_REDRAW (clear?)
-      if(surface) 
+      if(surface)
       {
          surface.SetBackground(background);
          surface.SetForeground(foreground);
@@ -2662,8 +2662,8 @@ private:
 
    void DrawOverChildren(Box refresh)
    {
-      Surface surface = Redraw(refresh);               
-      if(surface) 
+      Surface surface = Redraw(refresh);
+      if(surface)
       {
          // Default Settings
          surface.DrawingChar(' ');
@@ -2687,12 +2687,12 @@ private:
       Extent clipExtent { /*first = -1, last = -1, free = -1*/ };
 
       clipExtent.Copy(this.clipExtent);
-      
+
       for(child = children.last; child; child = child.prev)
       {
          if(!child.style.hidden && child.created && !child.is3D && child.rootWindow)
          {
-            bool opaque = child.IsOpaque(); // TODO: acess background directly 
+            bool opaque = child.IsOpaque(); // TODO: acess background directly
             int dx = child.absPosition.x - absPosition.x, dy = child.absPosition.y - absPosition.y;
 
             child.clipExtent.Copy(clipExtent);
@@ -2707,7 +2707,7 @@ private:
                Box box { child.box.left + dx, child.box.top + dy, child.box.right + dx, child.box.bottom + dy };
                clipExtent.ExcludeBox(box, rootWindow.tempExtents[0]);
             }
-            
+
          }
       }
       // ??? Only do this for overlapped window or if parent has with clip children flag
@@ -2751,7 +2751,7 @@ private:
 
                /*
                Extent childRenderArea;
-               
+
                if(backBufferUpdate != null)
                {
                   childRenderArea.Copy(backBufferUpdate);
@@ -2843,16 +2843,16 @@ private:
       {
          renderArea.Copy(backBufferUpdate);
          renderArea.Offset(-offsetX, -offsetY);
-         
+
          overRenderArea.Copy(backBufferUpdate);
          overRenderArea.Offset(-offsetX, -offsetY);
-         
-         
+
+
       }
       else
       {
          renderArea.Copy(dirtyArea);
-         
+
          overRenderArea.Copy(dirtyArea);
       }
 
@@ -2889,8 +2889,8 @@ private:
                FASTLIST_LOOP(renderArea, extentBox)
                {
       #ifdef _DEBUG
-                  printf("(%d, %d) - (%d, %d)\n", 
-                     extentBox.box.left, extentBox.box.top, 
+                  printf("(%d, %d) - (%d, %d)\n",
+                     extentBox.box.left, extentBox.box.top,
                      extentBox.box.right, extentBox.box.bottom);
       #endif
                }
@@ -2900,7 +2900,7 @@ private:
          }
       }
       */
-      
+
       // WHY WAS THIS COMMENTED ??
 
       // Add extent forced by DrawOverChildren to the dirty area, adjusting dirty extent to the window
@@ -2911,7 +2911,7 @@ private:
 
       // Intersect with the clip extent
       overRenderArea.Intersection(clipExtent, rootWindow.tempExtents[0], rootWindow.tempExtents[1], rootWindow.tempExtents[2]);
-      
+
 
       if(opaque)
       {
@@ -2964,17 +2964,17 @@ private:
          dirtyExtent.Union(renderArea);
          renderArea.Free();
       }*/
-      
-      
+
+
       {
          Extent renderArea { };
-         
+
          renderArea.Copy(overRenderArea);
          renderArea.Offset(offsetX, offsetY);
          overDirtyExtent.Union(renderArea, rootWindow.tempExtents[0]);
          renderArea.Empty();
       }
-      
+
 
       if(backBufferUpdate != null)
       {
@@ -3018,22 +3018,22 @@ private:
          foreground = (background.color.r > 128 || background.color.g > 128) ? black : white;
          */
 #endif
-            
+
 #ifdef _DEBUG
          /*if(renderArea.count)
             printf("\n\nRendering %s (%x):\n------------------------------------------\n", _class.name, this);*/
 #endif
-            
+
          for(extentBox = (BoxItem)renderArea.first; extentBox; extentBox = (BoxItem)extentBox.next)
          {
             Box box = extentBox.box;
 
 #ifdef _DEBUG
-               /*printf("(%d, %d) - (%d, %d)\n", 
-                  extentBox.box.left, extentBox.box.top, 
+               /*printf("(%d, %d) - (%d, %d)\n",
+                  extentBox.box.left, extentBox.box.top,
                   extentBox.box.right, extentBox.box.bottom);*/
 #endif
-               
+
             UpdateExtent(box);
 
             box.left += offsetX;
@@ -3083,7 +3083,7 @@ private:
    public void UpdateDisplay(void)
    {
       if(!manageDisplay) { OnRedraw(null);return; }
-      if(rootWindow && this != rootWindow) 
+      if(rootWindow && this != rootWindow)
          rootWindow.UpdateDisplay();
       else if(display)
       {
@@ -3105,7 +3105,7 @@ private:
             ComputeRenderArea(dirtyExtent, overExtent, null);
          }
          else
-            clipExtent.Free(null);                     
+            clipExtent.Free(null);
 
          dirtyExtent.Free(null);
          overExtent.Free(null);
@@ -3123,22 +3123,22 @@ private:
             Render(updateExtent);
             if(fullRender)
                updateExtent.UnionBox(this.box, tempExtents[0]);
-            
+
 #ifdef _DEBUG
             //printf("\n\nUpdate:\n------------------------------------------\n");
 #endif
-            
+
             //FASTLIST_LOOP(updateExtent, extentBox)
             for(extentBox = (BoxItem)updateExtent.first; extentBox; extentBox = (BoxItem)extentBox.next)
             {
 #ifdef _DEBUG
-               /*printf("Updating (%d, %d) - (%d, %d)\n", 
-                  extentBox.box.left, extentBox.box.top, 
+               /*printf("Updating (%d, %d) - (%d, %d)\n",
+                  extentBox.box.left, extentBox.box.top,
                   extentBox.box.right, extentBox.box.bottom);*/
 #endif
-               
+
                display.Update(extentBox.box);
-               
+
             }
             updateExtent.Free(null);
          }
@@ -3166,12 +3166,12 @@ private:
          {
             intersection.Copy(dirtyBack);
             intersection.IntersectBox(box);
-         
+
             dirtyExtent.Clear();
             overExtent.Clear();
 
             clipExtent.AddBox(box);
-         
+
             if(!rootWindow.fullRender)
             {
                ComputeClipExtents();
@@ -3259,7 +3259,7 @@ private:
                   if(child != statusBar && child.rootWindow == rootWindow)
                   {
                      Window childResult = child.GetAtPosition(x, y, clickThru, acceptDisabled, last);
-                     if(childResult) 
+                     if(childResult)
                         return childResult;
                   }
                }
@@ -3423,7 +3423,7 @@ private:
    bool AcquireInputEx(bool state)
    {
       bool result;
-      if(state) 
+      if(state)
       {
          guiApp.interfaceDriver.GetMousePosition(&guiApp.acquiredMouseX, &guiApp.acquiredMouseY);
          guiApp.interfaceDriver.SetMousePosition(clientSize.w/2 + absPosition.x, clientSize.h/2 + absPosition.y);
@@ -3486,11 +3486,11 @@ private:
                   {
                      if(guiApp.caretOwner)
                      {
-                        Box extent 
+                        Box extent
                         {
-                           guiApp.caretOwner.caretPos.x - guiApp.caretOwner.scroll.x + 1, 
+                           guiApp.caretOwner.caretPos.x - guiApp.caretOwner.scroll.x + 1,
                            guiApp.caretOwner.caretPos.y - guiApp.caretOwner.scroll.y + 1,
-                           guiApp.caretOwner.caretPos.x - guiApp.caretOwner.scroll.x + 2, 
+                           guiApp.caretOwner.caretPos.x - guiApp.caretOwner.scroll.x + 2,
                            guiApp.caretOwner.caretPos.y - guiApp.caretOwner.scroll.y + guiApp.caretOwner.caretSize - 1
                         };
                         guiApp.caretOwner.Update(extent);
@@ -3595,8 +3595,8 @@ private:
          {
             if(!active)
                StopMoving();
-            if(activateParent && 
-               (parent.activeChild != this || 
+            if(activateParent &&
+               (parent.activeChild != this ||
                (guiApp.interimWindow && !IsDescendantOf(guiApp.interimWindow))) &&
                active && _isModal &&
                parent != master && master)
@@ -3609,8 +3609,8 @@ private:
                   bool real = parent.activeChild != this;
 
                   // TEST THIS: New activateParent check here!!! CAUSED MENUS NOT GOING AWAY
-                  if(!style.inactive && /*activateParent && */guiApp.interimWindow && 
-                     !IsDescendantOf(guiApp.interimWindow) && 
+                  if(!style.inactive && /*activateParent && */guiApp.interimWindow &&
+                     !IsDescendantOf(guiApp.interimWindow) &&
                      !IsSlaveOf(guiApp.interimWindow))
                   {
                      Window interimWindow = guiApp.interimWindow;
@@ -3674,7 +3674,7 @@ private:
                         {
                            bool goOn = true;
                            result = PropagateActive(true, swap, &goOn, true);
-                           if(!result && !goOn) 
+                           if(!result && !goOn)
                            {
                               delete this;
                               return false;
@@ -3742,14 +3742,14 @@ private:
                         }
                      }
                   }
-               
+
                   if(result && real && (!style.inactive || moveInactive) && parent)
                   {
                      Window last = parent.children.last;
 
                      if(!style.stayOnTop)
                         for(; last && last.style.stayOnTop; last = last.prev);
-                     
+
                      parent.children.Move(this, last);
 
                      // Definitely don't want that:   why not?
@@ -3760,7 +3760,7 @@ private:
                   }
                }
             }
-            else 
+            else
             {
                if(!parent || style.interim || (parent.activeChild == this && !style.inactive))
                {
@@ -3817,9 +3817,9 @@ private:
       if(guiApp.windowScrolling && !consequential)
       {
          guiApp.windowScrolling.SetScrollPosition(
-            (guiApp.windowScrolling.sbh) ? 
+            (guiApp.windowScrolling.sbh) ?
                (guiApp.windowScrollingBefore.x - mouseX + guiApp.windowScrollingStart.x) : 0,
-            (guiApp.windowScrolling.sbv) ? 
+            (guiApp.windowScrolling.sbv) ?
                (guiApp.windowScrollingBefore.y - mouseY + guiApp.windowScrollingStart.y) : 0);
       }
       if(guiApp.windowMoving)
@@ -3912,7 +3912,7 @@ private:
                   h = guiApp.windowResizingBefore.h - ry;
                }
             }
-         
+
             // Position
             if(!guiApp.windowIsResizing || guiApp.resizeX)
                x = guiApp.windowMovingBefore.x + rx;
@@ -3966,7 +3966,7 @@ private:
 
             // Break the anchors for moveable/resizable windows
             // Will probably cause problem with IDE windows... Will probably need a way to specify if anchors should break
-            if(window.style.fixed) 
+            if(window.style.fixed)
             {
                if(window.state == normal)
                {
@@ -4006,7 +4006,7 @@ private:
          w = msgWindow;
          if(w) incref w;
          window = (w && !w.disabled) ? w : null;
-         
+
          if(trueWindow) incref trueWindow;
 
          if(consequential) mods->isSideEffect = true;
@@ -4031,9 +4031,9 @@ private:
             {
                Window moved = trueWindow;
                for(moved = trueWindow; moved; moved = moved.parent)
-                  if(method == __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonDown || ((moved.style.fixed || moved.moveable) && moved.state != maximized)) 
+                  if(method == __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonDown || ((moved.style.fixed || moved.moveable) && moved.state != maximized))
                      break;
-               if(moved) 
+               if(moved)
                {
                   window = moved;
                   windowDragged = true;
@@ -4056,9 +4056,9 @@ private:
             {
                Window moved = window;
                for(moved = window; moved; moved = moved.parent)
-                  if(method == OnRightButtonDown || ((moved.style.fixed || moved.moveable) && moved.state != maximized)) 
+                  if(method == OnRightButtonDown || ((moved.style.fixed || moved.moveable) && moved.state != maximized))
                      break;
-               if(moved) 
+               if(moved)
                {
                   window = moved;
                   windowDragged = true;
@@ -4092,7 +4092,7 @@ private:
                      doActivation = false;
                   */
 
-                  if((doActivation && (activateWindow.parent != guiApp.desktop || guiApp.fullScreen)) || 
+                  if((doActivation && (activateWindow.parent != guiApp.desktop || guiApp.fullScreen)) ||
                      (guiApp.interimWindow && !window.IsDescendantOf(guiApp.interimWindow)))
                   {
                      // Let the OnLeftButtonDown do the activating instead
@@ -4161,7 +4161,7 @@ private:
                   else if(method == __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonDown)
                   {
                      if(window.style.fixed &&
-                        (windowDragged || 
+                        (windowDragged ||
                         window.IsMouseMoving(
                            x - window.absPosition.x, y - window.absPosition.y, window.size.w, window.size.h)))
                      {
@@ -4183,8 +4183,8 @@ private:
                   }
                   else if(method == __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftDoubleClick)
                   {
-                     if(window.style.hasMaximize && 
-                        window.IsMouseMoving( 
+                     if(window.style.hasMaximize &&
+                        window.IsMouseMoving(
                            x - window.absPosition.x, y - window.absPosition.y, window.size.w, window.size.h))
                      {
                         window.SetState(
@@ -4196,7 +4196,7 @@ private:
             }
             else
                window = null;
-            if(guiApp.windowMoving) 
+            if(guiApp.windowMoving)
             {
                if(guiApp.windowMoving.parent)
                {
@@ -4233,7 +4233,7 @@ private:
 
          if(trueWindow && trueWindow.FindModal())
             delete trueWindow;
-         
+
          /*if(trueWindow)
             incref trueWindow;
          */
@@ -4357,7 +4357,7 @@ private:
          if(status && !destroyed && menuBar && state != minimized)
          {
             // Disable the ALT
-            if((SmartKey)key != alt) 
+            if((SmartKey)key != alt)
                menuBar.KeyMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown, 0, 0);
             if(menuBar.focus)
             {
@@ -4430,7 +4430,7 @@ private:
 
                         if(!guiApp.windowIsResizing || guiApp.resizeY)
                            y = (y - guiApp.windowMovingBefore.y) + guiApp.windowMovingStart.y;
-                        else                           
+                        else
                            y = (h - guiApp.windowResizingBefore.h) + guiApp.windowMovingStart.y;
 
                         guiApp.interfaceDriver.SetMousePosition(x, y);
@@ -4446,7 +4446,7 @@ private:
                      {
                         guiApp.windowMoving.StopMoving();
                         ConsequentialMouseMove(false);
-                  
+
                         status = false;
                      }
                      break;
@@ -4488,7 +4488,7 @@ private:
                   if((defaultControl.active ||
                      defaultControl.ActivateEx(true, true, false, true, null, null)) && !defaultControl.disabled)
                      defaultControl.KeyMessage(method, defaultKey, character);
-                  status = false;                       
+                  status = false;
                }
             }
          }
@@ -4541,7 +4541,7 @@ private:
                         Window cycleParent = this;
                         if(this == guiApp.interimWindow && master && !master.style.interim && !cycleParent.style.tabCycle && master.parent)
                            cycleParent = master.parent;
-                        
+
                         if(!guiApp.windowCaptured && cycleParent.style.tabCycle)
                         {
                            if(cycleParent.CycleChildren(!key.shift, false, false, true))
@@ -4553,7 +4553,7 @@ private:
                               if(cycleParent.sbh && !child.style.dontScrollHorz)
                               {
                                  if(child.scrolledPos.x < 0)
-                                    cycleParent.sbh.Action(Position, 
+                                    cycleParent.sbh.Action(Position,
                                        cycleParent.scroll.x + child.scrolledPos.x, 0);
                                  else if(child.scrolledPos.x + child.size.w > cycleParent.clientSize.w)
                                     cycleParent.sbh.Action(Position,
@@ -4562,7 +4562,7 @@ private:
                               if(cycleParent.sbv && !child.style.dontScrollVert)
                               {
                                  if(child.scrolledPos.y < 0)
-                                    cycleParent.sbv.Action(Position, 
+                                    cycleParent.sbv.Action(Position,
                                        cycleParent.scroll.y + child.scrolledPos.y, 0);
                                  else if(child.scrolledPos.y + child.size.w > window.clientSize.h)
                                     cycleParent.sbv.Action(Position,
@@ -4632,7 +4632,7 @@ private:
                               }
                            }
                         }
-                        break;            
+                        break;
                      }
                      */
                   }
@@ -4783,7 +4783,7 @@ private:
       Window child;
 
       // Setup relationship with outside world (bb root || !bb)
-      if((!guiApp.fullScreenMode && parent == guiApp.desktop) || this == guiApp.desktop || 
+      if((!guiApp.fullScreenMode && parent == guiApp.desktop) || this == guiApp.desktop ||
          (_displayDriver && parent.dispDriver && dispDriver != parent.dispDriver))
       {
          rootWindow = this;
@@ -4861,7 +4861,7 @@ private:
       for(child = children.first; child; child = child.next)
       {
          if(child.created && !child.Setup(false))
-            result = false; 
+            result = false;
       }
       return result;
    }
@@ -4869,8 +4869,8 @@ private:
    bool SetupDisplay(void)
    {
 #if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
-      if(is3D) return Window3D_SetupDisplay(this); else 
-#endif   
+      if(is3D) return Window3D_SetupDisplay(this); else
+#endif
       if(SetupRoot())
          return Setup(true);
       return false;
@@ -4917,7 +4917,7 @@ private:
             }
          }
       }
-      
+
       if(guiApp.fullScreenMode || this != guiApp.desktop)
       {
          SetWindowMinimum(&skinMinSize.w, &skinMinSize.h);
@@ -4956,7 +4956,7 @@ private:
                      }
                   for(cursor = guiApp.customCursors.first; cursor; cursor = cursor.next)
                   {
-                     cursor.bitmap = eBitmap_LoadT(cursor.bitmapName, null, 
+                     cursor.bitmap = eBitmap_LoadT(cursor.bitmapName, null,
                         cursor.paletteShades ? null : guiApp.desktop.display.displaySystem);
                      if(cursor.bitmap)
                         cursor.bitmap.paletteShades = cursor.paletteShades;
@@ -4973,7 +4973,7 @@ private:
             }
 
             // Load Window Graphic Resources
-            
+
             /*
             if(usedFont == setFont || usedFont == window.systemFont)
                RemoveResource(usedFont);
@@ -4983,7 +4983,7 @@ private:
 
             if(systemFont)
                RemoveResource(systemFont);
-            
+
             if(captionFont)
                RemoveResource(captionFont);
 
@@ -5035,7 +5035,7 @@ private:
                display.Unlock();
 
                //SetScrollLineStep(sbStep.x, sbStep.y);
-               
+
                if(this != guiApp.desktop)
                {
                   if(resetAnchors)
@@ -5059,22 +5059,22 @@ private:
                   switch(state)
                   {
                      case maximized:
-                     
+
                         stateAnchor = Anchor { left = 0, top = 0, right = 0, bottom = 0 };
                         stateSizeAnchor = SizeAnchor {};
                         break;
-                     
+
                      case minimized:
                      {
                         int maxIcons = parent.clientSize.w / MINIMIZED_WIDTH;
 
-                        stateAnchor = 
-                           Anchor 
+                        stateAnchor =
+                           Anchor
                            {
                               left = (iconID % maxIcons) * MINIMIZED_WIDTH,
                               bottom = (iconID / maxIcons) * (guiApp.textMode ? 16 : 24)
                            };
-                        
+
                         stateSizeAnchor = SizeAnchor { size.w = MINIMIZED_WIDTH };
                         break;
                      }
@@ -5321,7 +5321,7 @@ private:
       /* WTH is this doing here?
       while(swap && swap.activeChild)
       {
-         swap = swap.activeChild;         
+         swap = swap.activeChild;
       }
       */
       // TESTING THIS BEFORE...
@@ -5371,7 +5371,7 @@ private:
       OldLink prevOrder = null;
       Window client = null;
 
-      if(parent) stopwatching(parent, font); 
+      if(parent) stopwatching(parent, font);
 
       // if(window.modalSlave) return false;
       if(destroyed || !created)
@@ -5407,7 +5407,7 @@ private:
          guiApp.prevWindow = null;
          OnMouseLeave(0);
       }
-      if(guiApp.caretOwner == this) 
+      if(guiApp.caretOwner == this)
       {
          guiApp.interfaceDriver.SetCaret(0,0,0);
          UpdateCaret(false, true);
@@ -5447,7 +5447,7 @@ private:
                if(client == this) { client = null; break; }
                if(client && (client.style.nonClient || !client.style.isActiveClient || client.style.hidden || client.destroyed || !client.created))
                   tmpPrev = client.order.prev;
-               else 
+               else
                {
                   if(client)
                      prevOrder = tmpPrev;
@@ -5497,7 +5497,7 @@ private:
                   parent.UpdateActiveDocument(null);
                }
             }
-            else 
+            else
             {
                if(guiApp.interimWindow == this)
                {
@@ -5872,7 +5872,7 @@ private:
          {
             guiApp.desktop.mutex.Wait();
             guiApp.desktop.display.Lock(true);
-         
+
             Update(extent);
             if(guiApp.desktop.active)
             {
@@ -5892,7 +5892,7 @@ private:
                   guiApp.RestoreCursorBackground();
                }
             }
-         
+
             guiApp.desktop.display.Unlock();
             guiApp.desktop.mutex.Release();
          }
@@ -5901,7 +5901,7 @@ private:
             Window rootWindow = this.rootWindow;
             rootWindow.mutex.Wait();
             display.Lock(true);
-         
+
             Update(extent);
             if(guiApp.waiting)
                guiApp.SignalEvent();
@@ -5955,7 +5955,7 @@ private:
          isForegroundWindow = true;
          ActivateEx(active, active, false, false, null, null);
          isForegroundWindow = false;
-      }  
+      }
    }
    */
 
@@ -6025,7 +6025,7 @@ private:
          guiApp.windowMovingBefore = scrolledPos;
          guiApp.windowResizingBefore = size;
          guiApp.windowMoving.UpdateDecorations();
-         if(guiApp.windowIsResizing) 
+         if(guiApp.windowIsResizing)
             guiApp.resizeEndX = guiApp.resizeEndY = true;
 
          if(setCursorPosition)
@@ -6036,7 +6036,7 @@ private:
             guiApp.interfaceDriver.GetMousePosition(&x, &y);
             guiApp.windowMovingStart.x += x - absPosition.x;
             guiApp.windowMovingStart.y += y - absPosition.y;
-         } 
+         }
 
          if(guiApp.windowMoving)
          {
@@ -6068,7 +6068,7 @@ public:
          Window last;
          bool visible = !style.hidden;
 
-         if(style.embedded) 
+         if(style.embedded)
          {
             systemParent = parent;
             parent = guiApp.desktop;
@@ -6148,7 +6148,7 @@ public:
 
             this.visible = false;
             style.hidden = true;
-    
+
             //created = true;
             // autoCreate = true;
             wasCreated = true;
@@ -6178,7 +6178,7 @@ public:
 
                      if(style.hasMenuBar /*&& menu*/)
                      {
-                        menuBar = 
+                        menuBar =
                            PopupMenu
                            {
                               this,
@@ -6190,7 +6190,7 @@ public:
 
                      if(statusBar)
                         statusBar.Create();
-                     
+
                      // Create the system buttons
                      CreateSystemChildren();
 
@@ -6326,7 +6326,7 @@ public:
          {
             Window child;
             Box realBox;
-            
+
             // Testing this to avoid repetitve full update to take time...
             if(dirtyArea.count == 1)
             {
@@ -6351,7 +6351,7 @@ public:
                   return;
                }
             }
-            
+
             rootWindow.dirty = true;
 
             if(region != null)
@@ -6366,7 +6366,7 @@ public:
             else
                realBox = box;
 
-            if(realBox.right >= realBox.left && 
+            if(realBox.right >= realBox.left &&
                realBox.bottom >= realBox.top)
             {
                // if(!rootWindow.fullRender)
@@ -6415,7 +6415,7 @@ public:
                      childBox.top     -= window.absPosition.y - guiApp.desktop.absPosition.y;
                      childBox.right   -= window.absPosition.x - guiApp.desktop.absPosition.x;
                      childBox.bottom  -= window.absPosition.y - guiApp.desktop.absPosition.y;
-       
+
                      window.Update(childBox);
                   }
                   else
@@ -6500,7 +6500,7 @@ public:
       if(snapToStep)
       {
          int stepX = sbStep.x, stepY = sbStep.y;
-         // Needed to make snapped down position match the skin's check of client area 
+         // Needed to make snapped down position match the skin's check of client area
          // against realvirtual
          if(guiApp.textMode)
          {
@@ -6616,7 +6616,7 @@ public:
             // This has the effect of activating the window through the system...
             if(rootWindow == this)
                guiApp.interfaceDriver.SetRootWindowState(this, newState, !style.hidden);
-      
+
             SetStateEx(newState, activate);
 
             if(rootWindow == this && !rootWindow.nativeDecorations)
@@ -6647,15 +6647,15 @@ public:
                parent.UpdateScrollBars(true, true);
 
             /*
-            // Do we really need this stuff here? 
-            // Shouldn't the Activate stuff take care of it?              
+            // Do we really need this stuff here?
+            // Shouldn't the Activate stuff take care of it?
             if(parent.rootWindow == parent && style)
             {
                char caption[2048];
                parent.FigureCaption(caption);
                guiApp.interfaceDriver.SetRootWindowCaption(parent, caption);
                parent.UpdateDecorations();
-            }         
+            }
             */
 
             rootWindow.ConsequentialMouseMove(false);
@@ -6723,32 +6723,32 @@ public:
       PopupMenu windowMenu { master = this, interim = true, position = { x + 1 - guiApp.desktop.position.x, y + 1 - guiApp.desktop.position.y }, menu = menu };
       MenuItem
       {
-         menu, $"Restore", r, NotifySelect = MenuWindowRestore, 
+         menu, $"Restore", r, NotifySelect = MenuWindowRestore,
          disabled = (!style.hasMaximize && !style.hasMinimize) || state == normal, bitmap = guiApp.currentSkin.GetBitmap(restore)
       };
       MenuItem
       {
-         menu, $"Move", m, NotifySelect = MenuWindowMove, 
+         menu, $"Move", m, NotifySelect = MenuWindowMove,
          disabled = !style.fixed || state == maximized
       };
       MenuItem
       {
-         menu, $"Size", s, NotifySelect = MenuWindowSize, 
+         menu, $"Size", s, NotifySelect = MenuWindowSize,
          disabled = !style.sizable || state != normal
       };
       MenuItem
       {
-         menu, $"Minimize", n, NotifySelect = MenuWindowMinimize, 
+         menu, $"Minimize", n, NotifySelect = MenuWindowMinimize,
          disabled = !style.hasMinimize || state == minimized, bitmap = guiApp.currentSkin.GetBitmap(minimize)
       };
       MenuItem
       {
-         menu, $"Maximize", KeyCode::x, NotifySelect = MenuWindowMaximize, 
+         menu, $"Maximize", KeyCode::x, NotifySelect = MenuWindowMaximize,
          disabled = !style.hasMaximize || state == maximized, bitmap = guiApp.currentSkin.GetBitmap(maximize)
       };
       MenuItem
       {
-         menu, $"Stay On Top", t, NotifySelect = MenuWindowStayOnTop, 
+         menu, $"Stay On Top", t, NotifySelect = MenuWindowStayOnTop,
          disabled = !style.fixed, checkable = true, checked = style.stayOnTop
       };
       MenuDivider { menu };
@@ -6819,7 +6819,7 @@ public:
             }
          }
          /*
-         if(!clientOnly && child.cycle == (backward ? childrenCycle.first : childrenCycle.last) && 
+         if(!clientOnly && child.cycle == (backward ? childrenCycle.first : childrenCycle.last) &&
             parent.tabCycle && parent.CycleChildren(backward, false, false))
             return true;
          */
@@ -7084,12 +7084,12 @@ public:
          {
             Window window { };
             window.Create();
-            result = window.display.displaySystem.driver.GrabScreen(null, bitmap, clip.left, clip.top, 
+            result = window.display.displaySystem.driver.GrabScreen(null, bitmap, clip.left, clip.top,
                clip.right - clip.left + 1, clip.bottom - clip.top + 1);
             delete window;
          }
          else
-            result = display.Grab(bitmap, clip.left, clip.top, 
+            result = display.Grab(bitmap, clip.left, clip.top,
                clip.right - clip.left + 1, clip.bottom - clip.top + 1);
 
          if(bitmap.pixelFormat != pixelFormat888 && bitmap.pixelFormat != pixelFormat8)
@@ -7217,7 +7217,7 @@ public:
          return false;
       if(terminateX > 1)
          return true;
-         
+
       closing = true;
 
       if(!OnClose(parentClosing))
@@ -7367,7 +7367,7 @@ public:
                   MessageBox dialog { master = master.parent ? master : this, type = yesNoCancel, text = $"Error writing file", contents = $"Save as a different file?" };
                   DialogResult answer = dialog.Modal();
                   saving = false;
-                  if(answer != yes) 
+                  if(answer != yes)
                   {
                      result = answer;
                      break;
@@ -7576,7 +7576,7 @@ public:
       }
       document = cycle.data;
       document.Activate();
-      
+
       //if(activeChild.state == maximized)
       //  document.SetState(maximized, false, mods);
       //else if(document.state == minimized)
@@ -7788,7 +7788,7 @@ public:
    virtual void SetWindowArea(int * x, int * y, MinMaxValue * w, MinMaxValue * h, MinMaxValue * cw, MinMaxValue * ch)
    {
       *cw = *w;
-      *ch = *h;      
+      *ch = *h;
    }
    virtual void ShowDecorations(Font captionFont, Surface surface, char * name, bool active, bool moving);
    virtual void PreShowDecorations(Font captionFont, Surface surface, char * name, bool active, bool moving);
@@ -7839,7 +7839,7 @@ public:
 
             if(!master || (master == this.parent && master == guiApp.desktop))
                property::master = value;
-            
+
             if(parent)
             {
                parent.children.Remove(this);
@@ -7895,12 +7895,12 @@ public:
                if(created)
                {
                   int x = position.x, y = position.y, w = size.w, h = size.h;
-                  
+
                   int vpw, vph;
 
                   x += parent.absPosition.x - value.absPosition.x + parent.clientStart.x - value.clientStart.x;
                   y += parent.absPosition.y - value.absPosition.y + parent.clientStart.y - value.clientStart.y;
-                  
+
                   vpw = value.clientSize.w;
                   vph = value.clientSize.h;
                   if(style.nonClient)
@@ -7949,11 +7949,11 @@ public:
                   if(!style.noCycle)
                      parent.childrenCycle.Insert(
                         // Note: changed to 'null' to fix broken tab cycling in WSMS custom reports
-                        //(parent.activeChild && parent.activeChild.cycle) ? parent.activeChild.cycle.prev : null, 
+                        //(parent.activeChild && parent.activeChild.cycle) ? parent.activeChild.cycle.prev : null,
                         null,
                         cycle = OldLink { data = this });
                   parent.childrenOrder.Insert(
-                     (parent.activeChild && parent.activeChild.order) ? parent.activeChild.order.prev : parent.childrenOrder.last, 
+                     (parent.activeChild && parent.activeChild.order) ? parent.activeChild.order.prev : parent.childrenOrder.last,
                      order = OldLink { data = this });
                }
 
@@ -7965,7 +7965,7 @@ public:
                }
 
                // *** FONT INHERITANCE ***
-               if(!setFont && oldParent) 
+               if(!setFont && oldParent)
                   stopwatching(oldParent, font);
 
                if(systemFont)
@@ -7998,21 +7998,21 @@ public:
                         Update(null);
                      }
                   };
-               
+
                firewatchers font;
 
 
                if(value.rootWindow && value.rootWindow.display && rootWindow)
                {
-                  bool reloadGraphics = (oldParent.rootWindow == oldParent && value.rootWindow) || (!value.rootWindow && rootWindow == this) || 
+                  bool reloadGraphics = (oldParent.rootWindow == oldParent && value.rootWindow) || (!value.rootWindow && rootWindow == this) ||
                         (value.rootWindow.display && value.rootWindow.display.displaySystem != rootWindow.display.displaySystem);
-                  
+
                   if(reloadGraphics)
                      UnloadGraphics(false);
                   SetupDisplay();
                   if(reloadGraphics)
                      LoadGraphics(false, false);
-                     
+
                   /*
                   if(value.rootWindow != rootWindow)
                      DisplayModeChanged();
@@ -8200,7 +8200,7 @@ public:
             CreateSystemChildren();
          }
       }
-      get { return (BorderStyle)style.borderBits; } 
+      get { return (BorderStyle)style.borderBits; }
    };
 
    property Size minClientSize
@@ -8277,7 +8277,7 @@ public:
       }
       get { return style.hasClose; }
    };
-   
+
    property bool nonClient
    {
       property_category $"Layout"
@@ -8295,7 +8295,7 @@ public:
       property_category $"Behavior"
       set
       {
-         if(value) 
+         if(value)
          {
             // *** NEW HERE: ***
             if(!style.inactive)
@@ -8325,7 +8325,7 @@ public:
                {
                   parent.childrenCycle.Insert(
                      // Note: changed to 'null' to fix broken tab cycling in WSMS custom reports
-                     //(parent.activeChild && parent.activeChild.cycle) ? parent.activeChild.cycle.prev : null, 
+                     //(parent.activeChild && parent.activeChild.cycle) ? parent.activeChild.cycle.prev : null,
                      null,
                      cycle = OldLink { data = this });
                }
@@ -8380,7 +8380,7 @@ public:
       set { style.tabCycle = value; }
       get { return style.tabCycle; }
    };
-     
+
    property bool isDefault
    {
       property_category $"Behavior"
@@ -8422,7 +8422,7 @@ public:
       property_category $"Window Style"
       set
       {
-         if(value) 
+         if(value)
          {
             if(!menu)
             {
@@ -8432,13 +8432,13 @@ public:
             if(created && !menuBar)
             {
                menuBar =
-                  PopupMenu 
+                  PopupMenu
                   {
                      this, menu = menu,
                      isMenuBar = true,
                      anchor = Anchor { top = 23, left = 1, right = 1 },
                      size.h = 24,
-                     inactive = true, nonClient = true                            
+                     inactive = true, nonClient = true
                   };
                menuBar.Create();
             }
@@ -8505,14 +8505,14 @@ public:
                   if(order)
                   {
                      OldLink order;
-                     for(order = (this.order == parent.childrenOrder.first) ? null : this.order.prev; 
+                     for(order = (this.order == parent.childrenOrder.first) ? null : this.order.prev;
                          order && ((Window)order.data).style.stayOnTop;
                          order = (order == parent.childrenOrder.first) ? null : order.prev);
                       last = order ? order.data : null;
                   }
                   else
                   {
-                     for(last = parent.children.last; 
+                     for(last = parent.children.last;
                          last && last.style.stayOnTop;
                          last = last.prev);
                   }
@@ -8549,9 +8549,9 @@ public:
             if(!menuBar && style.hasMenuBar && value)
             {
                menuBar = PopupMenu
-                         { 
-                            this, menu = value, isMenuBar = true, 
-                            anchor = Anchor { left = 1, top = 23, right = 1 }, size.h = 24, 
+                         {
+                            this, menu = value, isMenuBar = true,
+                            anchor = Anchor { left = 1, top = 23, right = 1 }, size.h = 24,
                             inactive = true, nonClient = true
                          };
                 menuBar.Create();
@@ -8624,7 +8624,7 @@ public:
       property_category $"Layout"
       isset
       {
-         return ((anchor.left.type == none || anchor.left.type == middleRelative || anchor.right.type == none) || 
+         return ((anchor.left.type == none || anchor.left.type == middleRelative || anchor.right.type == none) ||
                 (anchor.top.type == none || anchor.top.type == middleRelative || anchor.bottom.type == none)) &&
             sizeAnchor.isClientW != sizeAnchor.isClientH;
       }
@@ -8665,7 +8665,7 @@ public:
          bool leftRight = (anchor.left.type == none || anchor.left.type == middleRelative || anchor.right.type == none);
          bool topBottom = (anchor.top.type == none || anchor.top.type == middleRelative || anchor.bottom.type == none);
          bool isClient = !sizeAnchor.isClientW && !sizeAnchor.isClientH;
-         return ((anchor.left.type == none || anchor.left.type == middleRelative || anchor.right.type == none) || 
+         return ((anchor.left.type == none || anchor.left.type == middleRelative || anchor.right.type == none) ||
                 (anchor.top.type == none || anchor.top.type == middleRelative || anchor.bottom.type == none)) &&
             !sizeAnchor.isClientW && !sizeAnchor.isClientH && sizeAnchor.size.w && sizeAnchor.size.h;
       }
@@ -8697,7 +8697,7 @@ public:
       property_category $"Layout"
       isset
       {
-         return ((anchor.left.type == none || anchor.left.type == middleRelative || anchor.right.type == none) || 
+         return ((anchor.left.type == none || anchor.left.type == middleRelative || anchor.right.type == none) ||
                 (anchor.top.type == none || anchor.top.type == middleRelative || anchor.bottom.type == none)) &&
             sizeAnchor.isClientW && sizeAnchor.isClientH && sizeAnchor.size.w && sizeAnchor.size.h;
       }
@@ -8746,7 +8746,7 @@ public:
             }
             anchor = value;
 
-            if(anchor.right.type && (anchor.horz.type == middleRelative || !anchor.left.type)) 
+            if(anchor.right.type && (anchor.horz.type == middleRelative || !anchor.left.type))
             {
                anchor.left.distance = 0;
                anchor.horz.type = 0;
@@ -8764,7 +8764,7 @@ public:
                int x, y, w, h;
 
                normalAnchor = anchor;
-               
+
                // Break the anchors for moveable/resizable windows
                /*if(style.fixed ) //&& value.left.type == cascade)
                {
@@ -8943,7 +8943,7 @@ public:
                         {
                            tmpPrev = client.order.prev;
                         }
-                        else 
+                        else
                         {
                            if(client)
                               prevOrder = tmpPrev;
@@ -8983,7 +8983,7 @@ public:
                cycle = null;
                order = null;
                */
-               
+
                SetVisibility(!parent.style.hidden && (style.hidden ? false : true));
             }
 
@@ -9015,7 +9015,7 @@ public:
                   if(!(style.noCycle))
                   {
                      cycle = parent.childrenCycle.AddAfter(
-                        (parent.activeChild && parent.activeChild.cycle) ? 
+                        (parent.activeChild && parent.activeChild.cycle) ?
                            parent.activeChild.cycle.prev : null, sizeof(OldLink));
                      cycle.data = this;
                   }
@@ -9025,7 +9025,7 @@ public:
                   order.data = this;
                }
                */
-     
+
                /*
                if(true || !parent.activeChild)
                   ActivateEx(true, false, true, true, null, null);
@@ -9033,7 +9033,7 @@ public:
                if(creationActivation == activate)
                   ActivateEx(true, false, true, true, null, null);
                else if(creationActivation == flash && !object)
-                  Flash();               
+                  Flash();
 
                //SetVisibility(!parent.style.hidden && (style.hidden ? false : true));
                Update(null);
@@ -9050,7 +9050,7 @@ public:
 
       get { return (style.hidden || !setVisible) ? false : true; }
    };
-    
+
    property bool isDocument
    {
       property_category $"Document"
@@ -9074,7 +9074,7 @@ public:
          {
             if(!style.hasHorzScroll && created)
             {
-               CreateSystemChildren();         
+               CreateSystemChildren();
                Position(position.x, position.y, size.w, size.h, false, true, false, false, false, true);
             }
          }
@@ -9273,7 +9273,7 @@ public:
          SelectMouseCursor();
       }
       get { return cursor; }
-   };      
+   };
 
 //#if !defined(ECERE_VANILLA)
    property char * name
@@ -9330,7 +9330,7 @@ public:
    };
 
    // Runtime Only Properties (No Set, can display the displayable ones depending on the type?)
-                                                                                                            
+
    // Will be merged with font later
    property Font fontObject { get { return usedFont ? usedFont.font : null; } };
    property Point clientStart { get { value = clientStart; } };
@@ -9341,8 +9341,8 @@ public:
    property bool created { get { return (bool)created; } };
    property bool destroyed { get { return (bool)destroyed; } };
    property Window firstSlave { get { return slaves.first ? ((OldLink)slaves.first).data : null; } };
-   property Window firstChild { get { return children.first; } };   
-   property Window lastChild { get { return children.last; } };   
+   property Window firstChild { get { return children.first; } };
+   property Window lastChild { get { return children.last; } };
    property Window activeClient { get { return activeClient; } };
    property Window activeChild { get { return activeChild; } };
    property Display display  { get { return display ? display : ((parent && parent.rootWindow) ? parent.rootWindow.display : null); } };
@@ -9350,7 +9350,7 @@ public:
    property ScrollBar horzScroll { get { return sbh; } };
    property ScrollBar vertScroll { get { return sbv; } };
    property StatusBar statusBar { get { return statusBar; } };
-   property Window rootWindow { get { return rootWindow; } };   
+   property Window rootWindow { get { return rootWindow; } };
    property bool closing { get { return (bool)closing; } set { closing = value; } };
    property int documentID { get { return documentID; } };
    property Window previous { get { return prev; } }
@@ -9362,7 +9362,7 @@ public:
    property bool fullRender { set { fullRender = value; } get { return (bool)fullRender; } }
    property void * systemHandle { get { return windowHandle; } }
    property Button minimizeButton { get { return sysButtons[0]; } };
-   property Button maximizeButton { get { return sysButtons[1]; } };   
+   property Button maximizeButton { get { return sysButtons[1]; } };
    property Button closeButton { get { return sysButtons[2]; } };
    property BitmapResource icon
    {
@@ -9468,7 +9468,7 @@ private:
    void * windowHandle;    // System window handle
 
    DialogResult returnCode;// Return code for modal windows
-  
+
    Point sbStep;           // Scrollbar line scrolling steps
 
    Anchor stateAnchor;
@@ -9570,7 +9570,7 @@ private:
       bool nativeDecorations:1;
       bool manageDisplay:1;
       bool formDesigner:1; // True if we this is running in the form editor
-   }; 
+   };
 
    // Checks used internally for them not to take effect in FormDesigner
    property bool _isModal        { get { return !formDesigner ? style.modal : false; } }
@@ -9630,7 +9630,7 @@ public class Percentage : float
       c = strlen(string)-1;
       for( ; c >= 0; c--)
       {
-         if(string[c] != '0') 
+         if(string[c] != '0')
             last = Max(last, c);
          if(string[c] == '.')
          {
@@ -9660,7 +9660,7 @@ public void ApplySkin(Class c, char * name, void ** vTbl)
    c._vTbl = new void *[c.vTblSize];
    memcpy(c._vTbl, wc.pureVTbl, c.vTblSize * sizeof(void *));
    sc = eSystem_FindClass(c.module.application, className);
-   
+
    if(vTbl)
    {
       for(m = 0; m < c.base.vTblSize; m++)
@@ -9677,7 +9677,7 @@ public void ApplySkin(Class c, char * name, void ** vTbl)
             c._vTbl[m] = sc._vTbl[m];
       }
    }
-      
+
    for(d = c.derivatives.first; d; d = d.next)
    {
       ApplySkin(d.data, name, c._vTbl);
@@ -9930,7 +9930,7 @@ public:
    virtual void V::OnUnloadGraphics(WindowController controller);
 
 private:
-   int (** windowVTbl)();   
+   int (** windowVTbl)();
    V controlled;
    Window window;
 
index f15ee45..56d5862 100644 (file)
@@ -85,7 +85,7 @@ public class Button : CommonControl
       buttonStyle.offset = true;
 
       // SetCursor(eInterface_GetCursor(__ecereModule->app, CUR_ARROW));
-      
+
       alignment = center;
       state = up;
       hint = false;
@@ -123,9 +123,9 @@ public class Button : CommonControl
       int isDefault = this.isDefault;
       int tw = 0, th = 0;
       int bw = 0, bh = 0;
-      
+
       if(!backColor) backColor = colors[up];
-      
+
       font = fontObject;
       surface.TextFont(font);
       if(text)
@@ -218,13 +218,13 @@ public class Button : CommonControl
                x, y,
                0,0,buttonBitmap.width,buttonBitmap.height);
          }
-         else 
+         else
          {
             // Push Buttons
             if(buttonStyle.scale)
             {
                if(buttonStyle.bevel || buttonStyle.offset)
-                  surface.Stretch(buttonBitmap, 
+                  surface.Stretch(buttonBitmap,
                      1 + offset, 1 + offset,0,0,
                      clientSize.w-3,clientSize.h-3,buttonBitmap.width,buttonBitmap.height);
                else
@@ -236,7 +236,7 @@ public class Button : CommonControl
                int x, y;
                bw = buttonBitmap.width;
                bh = buttonBitmap.height;
-               
+
                if(bitmapAlignment == left || bitmapAlignment == right)
                {
                   if(bitmapAlignment == left)
@@ -269,8 +269,8 @@ public class Button : CommonControl
       }
 
       // Shadows
-      if(buttonStyle.bevel || 
-         (buttonStyle.bevelOver && 
+      if(buttonStyle.bevel ||
+         (buttonStyle.bevelOver &&
             (state == down || state == over || checked)))
       {
          if(state == down || checked)
@@ -306,9 +306,9 @@ public class Button : CommonControl
       if(text)
       {
          if((buttonStyle.radio || buttonStyle.checkBox) && !(buttonStyle.bevelOver))
-            WriteCaption(surface, /*clientSize.h +*/ CAPTION_DISTANCE + 3, 
+            WriteCaption(surface, /*clientSize.h +*/ CAPTION_DISTANCE + 3,
                (clientSize.h - th - 4)/2);
-         else 
+         else
          {
             int x, y;
 
@@ -472,7 +472,7 @@ public class Button : CommonControl
       {
          if(symbol)
          {
-            tw = textCellW; th = textCellH;   
+            tw = textCellW; th = textCellH;
             surface.WriteTextf((clientSize.w - tw)/2 + offset, (clientSize.h - th - 2)/2 + offset.%c = symbol);
          }
       }
@@ -637,7 +637,7 @@ public class Button : CommonControl
    {
       if(!key)
       {
-         if( (!buttonStyle.stayDown || !hint) /*&&  !buttonStyle.toggle */) 
+         if( (!buttonStyle.stayDown || !hint) /*&&  !buttonStyle.toggle */)
          {
             if(!(buttonStyle.toggle) || state == over)
                state = up;
@@ -859,7 +859,7 @@ public:
    // Properties
    property bool isRadio
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          if(value)
@@ -912,7 +912,7 @@ public:
    };
    property bool isCheckbox
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          if(value)
@@ -935,7 +935,7 @@ public:
    };
    property bool bevel
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          if(value)
@@ -959,7 +959,7 @@ public:
    };
    property bool bevelOver
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          if(value)
@@ -979,14 +979,14 @@ public:
    property bool toggle { property_category $"Behavior" set { buttonStyle.toggle = value; } get { return buttonStyle.toggle; } };
    property bool checked
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       set
       {
          if(buttonStyle.toggle)
          {
             state = value ? down : up;
          }
-         else 
+         else
          {
             if(buttonStyle.radio && value)
             {
@@ -1014,7 +1014,7 @@ public:
    property Alignment alignment { property_category $"Appearance" set { alignment = value; } get { return alignment; } };
    property BitmapResource bitmap
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       set
       {
          AddResource(value);
@@ -1028,7 +1028,7 @@ public:
          RemoveResource(bitmaps[overChecked]);
          RemoveResource(bitmaps[downChecked]);
          RemoveResource(bitmaps[disabledChecked]);
-         
+
          bitmaps[over] = null;
          bitmaps[down] = null;
          bitmaps[disabled] = null;
index 0a656fc..c010e85 100644 (file)
@@ -15,7 +15,7 @@ public class CalendarControl : CommonControl
    class_property(icon) = "<:ecere>controls/calendar.png";
 
 public:
-   virtual void Window::NotifyChanged(bool close);      
+   virtual void Window::NotifyChanged(bool close);
    Date dateValue;
    Month shownMonth;
    int shownYear;
@@ -34,14 +34,14 @@ private:
          dateValue.day = now.day;
          dateValue.month = now.month;
          shownYear = dateValue.year = now.year;
-         shownMonth = dateValue.month;         
+         shownMonth = dateValue.month;
       }
       return true;
    }
-   
+
    RepButton leftArrow
    {
-      this, 
+      this,
       position = { 3, 8 };
       size = { 16, 16 };
       bevel = false;
@@ -52,12 +52,12 @@ private:
       offset = false;
       text = "«";
       hotKey = pageUp;
-      
+
       bool NotifyClicked(Button button, int x, int y, ecere::gui::Modifiers mods)
       {
          shownMonth--;
          if(shownMonth < january) { shownMonth = december; shownYear--; yearBox.Refresh(); }
-         monthBox.Refresh();         
+         monthBox.Refresh();
          Update(null);
          dateBox.Activate();
          return true;
@@ -65,7 +65,7 @@ private:
    };
    RepButton rightArrow
    {
-      this, 
+      this,
       anchor = { right = 8, top = 8 };
       size = { 16, 16 };
       bevel = false;
@@ -86,7 +86,7 @@ private:
          dateBox.Activate();
          return true;
       }
-   };   
+   };
 
    DataBox monthBox
    {
@@ -126,7 +126,7 @@ private:
          }
          return true;
       }
-      
+
       bool OnPostCreate()
       {
          DataBox::OnPostCreate();
@@ -143,7 +143,7 @@ private:
             shownYear += (time.year / 100) * 100;
             if(Abs(shownYear - time.year) >= 50)
                shownYear -= 100;
-            yearBox.Refresh();           
+            yearBox.Refresh();
          }
          Update(null);
          dateBox.Activate();
@@ -208,7 +208,7 @@ private:
       {
          if(mods.left && !mods.isSideEffect)
             ((CalendarControl)master).FindDate(x, y, false, false);
-         return true;         
+         return true;
       }
       bool OnLeftButtonDown(int x, int y, Modifiers mods)
       {
@@ -252,7 +252,7 @@ private:
          surface.SetBackground(Color { 238, 238, 238 } /*whiteSmoke*/);
          surface.Area(0, Height, Width, clientSize.h);
          surface.Area(6 * Width, Height, 7*Width, clientSize.h);
-         
+
          surface.SetForeground(lightGray);
          surface.DrawLine(0, Height, clientSize.w, Height);
          surface.DrawLine(0, Height, 0, clientSize.h);
@@ -290,7 +290,7 @@ private:
                   }
                }
             }
-         }      
+         }
       }
    };
 
index b422867..de490e6 100644 (file)
@@ -104,8 +104,8 @@ private:
          (type.type == normalClass || type.type == noHeadClass || data))
       {
          // IMPORTANT FIX: If keepEditor is true, we were passing editor rather than the editor's current master
-         editor = ((Window (*)(void *, void *, DataBox, void *, int, int, int, int, void*))(void *)type._vTbl[__ecereVMethodID_class_OnEdit])(type, 
-            (type.type == normalClass || type.type == noHeadClass) ? (data ? (*(void **)data) : null) : data, 
+         editor = ((Window (*)(void *, void *, DataBox, void *, int, int, int, int, void*))(void *)type._vTbl[__ecereVMethodID_class_OnEdit])(type,
+            (type.type == normalClass || type.type == noHeadClass) ? (data ? (*(void **)data) : null) : data,
             this, (keepEditor && editor) ? editor.master : this, 0, 0, clientSize.w, clientSize.h, fieldData);// null);
          if(editor)
          {
index 3e23913..8a791ea 100644 (file)
@@ -44,7 +44,7 @@ public class DropBox : CommonControl
 public:
    property bool activeStipple
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       set
       {
          style.noStipple = !value;
@@ -54,7 +54,7 @@ public:
    };
    property bool showButton
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       set
       {
          button.visible = value;
@@ -64,7 +64,7 @@ public:
    };
    property Alignment alignment
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       set
       {
          alignment = value;
@@ -75,7 +75,7 @@ public:
    };
    property bool noHighlight
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       set
       {
          if(this)
@@ -89,7 +89,7 @@ public:
    };
    property bool activeColor
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       set
       {
          if(this)
@@ -102,7 +102,7 @@ public:
    };
    property DataRow currentRow
    {
-      property_category $"Private" 
+      property_category $"Private"
       set
       {
          if(this)
@@ -116,7 +116,7 @@ public:
                   editBox.contents = ((char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
                else
                   editBox.contents = "";
-            }                  
+            }
             Update(null);
             if(style.editText)
             {
@@ -135,7 +135,7 @@ public:
    property char * contents { property_category $"Data" set { if(editBox) editBox.contents = value; } get { return editBox ? editBox.contents : null; } };
    property bool editText
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          if(this)
@@ -153,7 +153,7 @@ public:
                   incref editBox;
                   editBox.Create();
                   button.inactive = false;
-               }      
+               }
                style.editText = true;
                tabCycle = false;
             }
@@ -176,7 +176,7 @@ public:
    property int rowHeight { property_category $"Appearance" set { listBox.rowHeight = value; } get { return listBox.rowHeight; } };
    property int maxShown
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          listBoxMaxShown = value;
@@ -236,7 +236,7 @@ public:
 
       ResizeListbox();
       // listBox.visible = true;
-      return listBox;   
+      return listBox;
    }
 
    virtual void OnCloseDropDown(Window pullDown)
@@ -330,7 +330,7 @@ public:
       {
          if(!field)
             field = DataField { alignment = alignment };
-         
+
          listBox.AddField(field);
          this.field = listBox.firstField;
          dataType = this.field.dataType;
@@ -416,7 +416,7 @@ public:
                editBox.contents = ((char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
             else
                editBox.contents = "";
-         }                  
+         }
          listBox.SelectRow(currentRow ? currentRow : (style.showNone ? noneRow : null));
 
          Update(null);
@@ -475,7 +475,7 @@ private:
             if(ly + height > availHeight)
                height = ((availHeight - ly) / ROW_HEIGHT) * ROW_HEIGHT;
          }
-            
+
          if(!pulledWindow.initSize.w)
             pulledWindow.size.w = size.w;
          else
@@ -547,8 +547,8 @@ private:
                OnPosition(position.x, position.y, clientSize.w, clientSize.h);
                if(pulledWindow) pulledWindow.visible = true;
                button.checked = true;
-            }         
-            Update(null);         
+            }
+            Update(null);
             return false;
          case enter:
          case keyPadEnter:
@@ -575,7 +575,7 @@ private:
                pulledWindow = null;
                button.checked = false;
                Update(null);
-               
+
                if(!NotifyClose(master, this))
                {
                   delete this;
@@ -592,11 +592,11 @@ private:
                      editBox.contents = ((char *(*)(void *, void *, char *, void *, bool *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, currentRow.GetData(null), tempString, null, null);
                   else
                      editBox.contents = "";
-               }                  
+               }
 
                NotifySelect(master, this, currentRow, key.modifiers | { closingDropDown = true });
-               
-               delete this;               
+
+               delete this;
                return false;
             }
             return false;
@@ -611,7 +611,7 @@ private:
       button.anchor = { right = 0, top = 0, bottom = 0 };
       button.size = { guiApp.textMode ? 8 : BTN_WIDTH, 0 };
    }
-   
+
    /*Timer timer
    {
       window = this, delay = 0.01;
@@ -650,8 +650,8 @@ private:
          if(currentRow)
          {
             DataDisplayFlags displayFlags { active = active, current = true, dropBox = true, selected = true, fullRow = true };
-            ((void (*)(void *, void *, void *, int, int, int, void *, uint, uint))(void *)dataType._vTbl[__ecereVMethodID_class_OnDisplay])(dataType, currentRow.GetData(null), surface, 3, 
-               1+(clientSize.h - listBox.rowHeight) / 2, clientSize.w - (button.visible ? button.size.w : 0) - 3, 
+            ((void (*)(void *, void *, void *, int, int, int, void *, uint, uint))(void *)dataType._vTbl[__ecereVMethodID_class_OnDisplay])(dataType, currentRow.GetData(null), surface, 3,
+               1+(clientSize.h - listBox.rowHeight) / 2, clientSize.w - (button.visible ? button.size.w : 0) - 3,
                field.userData, alignment, displayFlags);
          }
          else
@@ -676,7 +676,7 @@ private:
    {
       int rowHeight = 0;
 
-      display.FontExtent(fontObject, "W", 1, null, &rowHeight); 
+      display.FontExtent(fontObject, "W", 1, null, &rowHeight);
       rowHeight = Max(rowHeight, 16);
 
       if(!*width) *width = Max(*width, rowHeight * 100 / 16);
@@ -703,7 +703,7 @@ private:
          OnCloseDropDown(pulledWindow);
          button.checked = false;
          pulledWindow = null;
-      
+
          if(!NotifyClose(master, this))
             return false;
       }
@@ -723,7 +723,7 @@ private:
    bool OnKeyHit(Key key, unichar ch)
    {
       DataRow currentRow = this.currentRow;
-      
+
       if(!pulledWindow /*listBox.visible*/)
       {
          int c;
@@ -891,7 +891,7 @@ private:
                editBox.contents = "";
             if(active)
                editBox.SelectAll();
-         }                  
+         }
          button.Deactivate();
          return NotifySelect(master, this, currentRow, mods);
       }
index dec9ec9..368f9c2 100644 (file)
@@ -103,7 +103,7 @@ class EditBoxBits
 
    bool recomputeSyntax:1;
    bool cursorFollowsView:1;
-   
+
    // bool lineNumbers:1;
    bool autoSize:1;
 };
@@ -146,7 +146,7 @@ public class OldArray
       delete ((ArrayImpl)this).array;
    }
 
-public:   
+public:
    Class type;
    property uint size
    {
@@ -154,7 +154,7 @@ public:
       {
          if(((ArrayImpl)this).array)
          {
-            if(value == size) 
+            if(value == size)
                return;
             ((ArrayImpl)this).array = renew0 ((ArrayImpl)this).array byte[type.typeSize * value];
          }
@@ -207,7 +207,7 @@ public:
    {
       actions.Free();
    }
-   
+
    void Undo()
    {
       dontRecord++;
@@ -356,7 +356,7 @@ static class DelTextAction : UndoAction
 #ifdef _DEBUG
    void Print(EditBox editBox)
    {
-      PrintLn("DelText: y1 = ", y1, "x1 = ", x1, ", y2 = ", y2, ", x2 = ", x2, ", string = ", string, ", addedSpaces = ", addedSpaces, ", placeAfter = ", placeAfter);   
+      PrintLn("DelText: y1 = ", y1, "x1 = ", x1, ", y2 = ", y2, ", x2 = ", x2, ", string = ", string, ", addedSpaces = ", addedSpaces, ", placeAfter = ", placeAfter);
    }
 #endif
    void Undo(EditBox editBox)
@@ -376,10 +376,10 @@ static class DelTextAction : UndoAction
             editBox.DelCh(editBox.line, y1, x1 - addedSpaces, editBox.line, y1, x1, false);
       }
       else
-      {  
+      {
          editBox.selY = y1;
          editBox.selX = x1;
-         { int c; editBox.selLine = editBox.lines.first; for(c = 0; c < editBox.selY && editBox.selLine; c++, editBox.selLine = editBox.selLine.next); }         
+         { int c; editBox.selLine = editBox.lines.first; for(c = 0; c < editBox.selY && editBox.selLine; c++, editBox.selLine = editBox.selLine.next); }
          //editBox.SetViewToCursor(true);
 
          if(addedSpaces)
@@ -422,7 +422,7 @@ static class ReplaceTextAction : UndoAction
 #ifdef _DEBUG
    void Print(EditBox editBox)
    {
-      PrintLn("ReplaceText: y1 = ", y1, "x1 = ", x1, ", y2 = ", y2, ", x2 = ", x2, ", y3 = ", y3, ", x3 = ", x3, ", oldString = ", oldString, ", newString = ", newString, ", addedSpaces = ", addedSpaces, ", addedTabs = ", addedTabs, ", placeAfter = ", placeAfter);   
+      PrintLn("ReplaceText: y1 = ", y1, "x1 = ", x1, ", y2 = ", y2, ", x2 = ", x2, ", y3 = ", y3, ", x3 = ", x3, ", oldString = ", oldString, ", newString = ", newString, ", addedSpaces = ", addedSpaces, ", addedTabs = ", addedTabs, ", placeAfter = ", placeAfter);
    }
 #endif
    void Undo(EditBox editBox)
@@ -481,7 +481,7 @@ static class ReplaceTextAction : UndoAction
 /*
 static class MoveTextAction : UndoAction
 {
-   int fy1, fx1, fy2, fx2; 
+   int fy1, fx1, fy2, fx2;
    int ty, tx;
    type = class(MoveTextAction);
 
@@ -530,7 +530,7 @@ private:
    {
       char * buffer;
       int newSize;
-      
+
       // Adds '\0' byte
       count = count+1;
 
@@ -592,7 +592,7 @@ public struct BufferLocation
             if(y > end.y)
                y -= end.y - start.y;
             // Location is the last touched line
-            else 
+            else
             {
                if(x >= end.x)
                {
@@ -624,7 +624,7 @@ public struct BufferLocation
                for(c = 0, line = start.line; c<numLines; c++)
                   line = line.next;
                y += numLines;
-               //x += numLines ? end.x : (end.x - start.x);            
+               //x += numLines ? end.x : (end.x - start.x);
                x += end.x - start.x;
             }
          }
@@ -735,7 +735,7 @@ public:
    property bool textVertScroll { property_category $"Behavior" set { style.vScroll = value; } get { return style.vScroll; } };
    property bool readOnly
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          style.readOnly = value;
@@ -771,7 +771,7 @@ public:
    property EditLine line { get { return this.line; } }; // TODO: Add Set   this.line = this.lines[10]
    property char * contents
    {
-      property_category $"Data" 
+      property_category $"Data"
       set
       {
          if(this)
@@ -796,7 +796,7 @@ public:
             /* Can't implement this right now because of memory leak... Need string reference counting...
             if(style.multiLine)
             {
-               
+
                EditLine line;
                int len = 0;
 
@@ -829,7 +829,7 @@ public:
          char * buffer = null;
          if(style.multiLine)
          {
-            
+
             EditLine line;
             int len = 0;
 
@@ -845,7 +845,7 @@ public:
                len += lineLen;
                if(line.next) buffer[len++] = '\n';
             }
-            buffer[len] = '\0';         
+            buffer[len] = '\0';
          }
          return buffer;
       }
@@ -887,7 +887,7 @@ private:
    int lineCount;
    // Font Space size
    Size space, large;
-   
+
    // Position of Caret (Not necessarily displayed position)
    int x,y;
    int col;
@@ -903,7 +903,7 @@ private:
    // ViewX is x offset in pixels, ViewY is y offset in lines
    int viewX, viewY;
    // viewLine is first displayed line
-   EditLine viewLine; 
+   EditLine viewLine;
 
    // start and end of area to redraw
    int startY, endY;
@@ -976,7 +976,7 @@ private:
    MenuItem itemEditPaste
    {
       editMenu, $"Paste\tCtrl+V", p;
-   
+
       bool NotifySelect(MenuItem item, Modifiers mods)
       {
          if(!(style.readOnly))
@@ -1091,7 +1091,7 @@ private:
       {
          ReplaceDialog dialog
          {
-            master = master, 
+            master = master,
             isModal = true,
             searchString = searchString,
             replaceString = replaceString,
@@ -1148,7 +1148,7 @@ private:
    EditBox()
    {
       static bool syntaxInit = false;
-      if(!syntaxInit) 
+      if(!syntaxInit)
       {
          int g,c;
          syntaxInit = true;
@@ -1186,7 +1186,7 @@ private:
       maxLineSize = MAXINT;
 
       tabSize = 3;
-      
+
       overwrite = false;
       mouseSelect = this.mouseMove = false;
       line = null;
@@ -1195,7 +1195,7 @@ private:
       col = 0;
       y = -1;
       line = selLine = null;
-      viewX = 0;   
+      viewX = 0;
       viewY = 0;
       maxLength = 0;
       maxLine = null;
@@ -1251,13 +1251,13 @@ private:
                   surface.Area(XOFFSET + *x - 1, y, XOFFSET + *x + w, y + space.h-1);
                   // WHATS UP WITH THIS...  surface.Area(XOFFSET + *x, y, XOFFSET + *x + w, y + space.h-1);
                *x += w;
-            }      
+            }
          }
          *renderStart = wc;
       }
    }
 
-   int CheckColors(EditLine line, int wc, bool selection, int selX, int editX, bool *selected, 
+   int CheckColors(EditLine line, int wc, bool selection, int selX, int editX, bool *selected,
                    Color selectionForeground, Color selectionBackground, Color textColor, Color *foreground, Color *background, bool *opacity, bool *overwrite)
    {
       bool flush = false;
@@ -1384,7 +1384,7 @@ private:
             }
             continuedSingleLineComment = inSingleLineComment && (line.count && line.text[line.count - 1] == '\\');
          }
-         
+
          style.continuedSingleLineComment = continuedSingleLineComment;
          style.inMultiLineComment = inMultiLineComment;
          style.wasInMultiLine = wasInMultiLine;
@@ -1392,7 +1392,7 @@ private:
          style.escaped = escaped;
       }
    }
-   
+
    /*void OnDrawOverChildren(Surface surface)
    {
       if(style.lineNumbers)
@@ -1410,13 +1410,13 @@ private:
             else
                surface.SetBackground(Color{230, 230, 230});
             surface.textOpacity = true;
-            
+
             sprintf(lineText,"%5u ", currentLineNumber % 100000);
             if(currentLineNumber > this.lineCount)
                surface.WriteText(0,i*space.h+1,"      ",6);
             else
                surface.WriteText(0,i*space.h+1,lineText,6);
-            
+
             currentLineNumber++;
          }
       }
@@ -1434,7 +1434,7 @@ private:
       Color textColor;
       Box box;
       int maxW = clientSize.w;
-      
+
       Color foreground, background;
       bool opacity;
 
@@ -1459,8 +1459,8 @@ private:
       textColor = defaultTextColor;
 
       if(
-         Abs(selectionBackground.r - property::background.r) + 
-         Abs(selectionBackground.g - property::background.g) + 
+         Abs(selectionBackground.r - property::background.r) +
+         Abs(selectionBackground.g - property::background.g) +
          Abs(selectionBackground.b - property::background.b) < 92)
       {
          selectionBackground = formColor;
@@ -1488,7 +1488,7 @@ private:
          selX  = this.selX;
       }
       else
-      {  
+      {
          editX = Min(this.x,this.line.count);
          selX  = Min(this.selX,this.selLine.count);
       }
@@ -1516,7 +1516,7 @@ private:
          int start = 0;
          Color newTextColor = textColor = defaultTextColor;
          bool lineComplete = false;
-        
+
 
          // ****** SYNTAX HIGHLIGHTING ******
          bool lastWasStar = false;
@@ -1541,7 +1541,7 @@ private:
             surface.SetBackground(selected ? SELECTION_COLOR|0xFF000000 : BLACK|0xFF000000);
          }
    */
-         
+
          if(line == this.selLine && line == this.line)
          {
             end = Max(line.count, this.x);
@@ -1568,7 +1568,7 @@ private:
                y += space.h;
                lineComplete = false;
             }
-            
+
             textColor = newTextColor;
             if(!selected)
             {
@@ -1598,7 +1598,7 @@ private:
                   unichar bf = (wordLen == 1) ? line.buffer[c-1] : 0;
                   //if(ch == ' ' || ch == '\t' || (wordLen && (ch == '(' || ch == ')' || ch == ';' || ch == ':')) || (wordLen == 1 && line.buffer[c-1] == '('))
                   if(CharMatchCategories(ch, separators) || /*ch == ' ' ||*/ ch == '\t' ||
-                     (wordLen && !CharMatchCategories(ch, numbers|letters|marks|connector) && ch != '#' /*&& ch != '_'*/) || 
+                     (wordLen && !CharMatchCategories(ch, numbers|letters|marks|connector) && ch != '#' /*&& ch != '_'*/) ||
                      (bf && !CharMatchCategories(bf, numbers|letters|separators|marks|connector) && bf != '#' && bf != '\t' /*&& bf != '_' && bf != ' '*/))
                      break;
                   wordLen++;
@@ -1606,7 +1606,7 @@ private:
 
                if(!wordLen)
                {
-               
+
                   for(; c<line.count; c++)
                   {
                      unichar ch = line.buffer[c];
@@ -1757,7 +1757,7 @@ private:
                               if(firstWord)
                               {
                                  inPrep = true;
-                                 newTextColor = colorScheme.preprocessorColor; 
+                                 newTextColor = colorScheme.preprocessorColor;
                               }
                            }
                            if(!inQuotes && !inString && !inMultiLineComment && !inSingleLineComment)
@@ -1810,7 +1810,7 @@ private:
                         }
                      }
                   }
-               
+
                   // If we're not breaking, this can't be rendered as spacing anymore
                   spacing = false;
 
@@ -1925,11 +1925,11 @@ private:
             surface.Area(x + XOFFSET - 1,y,clientSize.w-1,y+this.space.h-1);
          }
          */
-         
+
          continuedSingleLineComment = inSingleLineComment && (line.count && line.text[line.count - 1] == '\\');
 
          y+=this.space.h;
-         if(y > box.bottom) // >=clientSize.h) 
+         if(y > box.bottom) // >=clientSize.h)
             break;
       }
 
@@ -2007,7 +2007,7 @@ private:
                len = 1;
             }
             else
-               FontExtent(display, font, line.buffer + start, len, &w, null); 
+               FontExtent(display, font, line.buffer + start, len, &w, null);
          }
          else
          {
@@ -2015,7 +2015,7 @@ private:
             c++;
          }
          x += w;
-      }               
+      }
       line.length = x;
 
       if(line.length > this.maxLength)
@@ -2050,7 +2050,7 @@ private:
    {
       if(this.selY != this.y)
          DirtyAll();
-      else if(this.selX != this.x)  // commented out to erase caret: if(this.selX != this.x) 
+      else if(this.selX != this.x)  // commented out to erase caret: if(this.selX != this.x)
          DirtyLine(this.y);
    }
 
@@ -2076,12 +2076,12 @@ private:
    {
       return _DelCh(l1, y1, c1, l2, y2, c2, placeAfter, null);
    }
-   
+
    bool HasCommentOrEscape(EditLine line)
    {
       bool hadComment = strstr(line.buffer, "/*") || strstr(line.buffer, "*/");
       int c;
-      
+
       if(!hadComment)
       {
          for(c = line.count-1; c >= 0; c--)
@@ -2098,7 +2098,7 @@ private:
       }
       return hadComment;
    }
-   
+
    int _DelCh(EditLine l1, int y1, int c1, EditLine l2, int y2, int c2, bool placeAfter, int * addedSpacesPtr)
    {
       EditLine line = l1, next;
@@ -2128,7 +2128,7 @@ private:
       {
          byte ch = buffer[c1];
          if(UTF8_IS_FIRST(ch)) break;
-         c1--;         
+         c1--;
          extras++;
       }
       oldCount2 = l2.count;
@@ -2145,7 +2145,7 @@ private:
       {
          int len;
          char * string;
-         
+
          len = GetText(null, l1, y1, start, l2, y2, c2, false, false);
          string = new char[len];
          action = DelTextAction { y1 = y1, x1 = start, y2 = y2, x2 = c2, string = string, placeAfter = placeAfter };
@@ -2179,7 +2179,7 @@ private:
       else
          buffer = l2.buffer;
 
-      if(!line.AdjustBuffer(newLineCount)) 
+      if(!line.AdjustBuffer(newLineCount))
          return;
 
 #ifdef _DEBUG
@@ -2232,7 +2232,7 @@ private:
          {
             this.lineCount--;
             delete line.buffer;
-       
+
             if(line == this.viewLine)
             {
                if(this.viewLine.next)
@@ -2241,7 +2241,7 @@ private:
                   //this.viewY++;
                   style.recomputeSyntax = true;
                }
-               else 
+               else
                {
                   this.viewLine = this.viewLine.prev;
                   this.viewY--;
@@ -2258,7 +2258,7 @@ private:
                   this.x = this.line.count;
                   //this.y++;
                }
-               else 
+               else
                {
                   this.line = this.line.prev;
                   this.x = this.line.count;
@@ -2275,7 +2275,7 @@ private:
                   this.dropLine = this.dropLine.next;
                   this.dropX = this.dropLine.count;
                }
-               else 
+               else
                {
                   this.dropLine = this.dropLine.prev;
                   this.dropX = this.dropLine.count;
@@ -2291,7 +2291,7 @@ private:
                   this.selLine = this.selLine.next;
                   this.selX = this.selLine.count;
                }
-               else 
+               else
                {
                   this.selLine = this.selLine.prev;
                   this.selX = this.selLine.count;
@@ -2357,7 +2357,7 @@ private:
       bool hadComment = false;
       // Add the line here
       EditLine line = this.line;
-         
+
       // The purpose of this is solely to lock a max number of characters if no HSCROLLING is present
       if(!style.hScroll && created)
       {
@@ -2399,7 +2399,7 @@ private:
             }
             x += w;
 
-            if(x >= clientSize.w) 
+            if(x >= clientSize.w)
             {
                count = c - max;
                break;
@@ -2412,7 +2412,7 @@ private:
       {
          int addedSpaces = 0;
          int addedTabs = 0;
-         
+
          // Add blank spaces if EES_FREECARET
          if(this.x > line.count)
          {
@@ -2469,7 +2469,7 @@ private:
          {
             BufferLocation before = { this.line, this.y, this.x }, after = { this.line, this.y, this.x };
             bool hasComment;
-         
+
             memmove(line.buffer+this.x+count, line.buffer+this.x,line.count-this.x);
             CopyBytes(line.buffer + this.x + addedTabs + addedSpaces, stringLine, count);
             if(addedTabs)
@@ -2493,7 +2493,7 @@ private:
 #endif
                line.count += addedSpaces;
                if(addedSpacesPtr) *addedSpacesPtr = addedSpaces;
-            }      
+            }
             else if(addedSpacesPtr)
                *addedSpacesPtr = 0;
 #ifdef _DEBUG
@@ -2511,7 +2511,7 @@ private:
             ComputeLength(line);
             ComputeColumn();
 
-            after.x = this.x; 
+            after.x = this.x;
 
             hasComment = HasCommentOrEscape(line);
             if(!undoBuffer.insideRedo)
@@ -2643,7 +2643,7 @@ private:
       this.endY = clientSize.h-1;
       //ErrorLog("DirtyEnd %d\n", y);
    }
-        
+
    void DirtyLine(int y)
    {
       if(y >= this.viewY)
@@ -2765,7 +2765,7 @@ private:
                         len = 1;
                      }
                      else
-                        FontExtent(display, this.font, line.buffer + start, len, &w, null); 
+                        FontExtent(display, this.font, line.buffer + start, len, &w, null);
                   }
                   else
                   {
@@ -2773,7 +2773,7 @@ private:
                      c++;
                   }
                   x += w;
-               }               
+               }
             }
             if(setCaret)
                caretX = x;
@@ -2867,20 +2867,20 @@ private:
                len = 1;
             }
             else
-               FontExtent(display, font, line.buffer + start, len, &w, null); 
+               FontExtent(display, font, line.buffer + start, len, &w, null);
          }
-         else 
+         else
          {
             if(style.freeCaret && c < max)
                w = space.w;
-            else 
+            else
             {
                if(px) *px = x;
                return c;
             }
             c++;
          }
-         if(x + (((half && len == 1) ? (w / 2) : w)) >= position) 
+         if(x + (((half && len == 1) ? (w / 2) : w)) >= position)
          {
             int lastW;
             while(len > 0)
@@ -2915,7 +2915,7 @@ private:
       if(this.x < c)
          this.x = x;
       else
-      { 
+      {
          c = AdjustXPosition(line, viewX + clientSize.w - 1, false, &x, MAXINT, c);
          if(this.x > c)
             this.x = c;
@@ -2938,7 +2938,7 @@ private:
    {
       int c, numLines;
       EditLine oldLine = this.line;
-      
+
       bool selecting = this.x != this.selX || this.y != this.selY;
 
       numLines = clientSize.h / this.space.h;
@@ -3094,7 +3094,7 @@ private:
 
          popup = PopupMenu { master = this, menu = contextMenu,
    /*
-            nonClient = true, interim = false, parent = parent, 
+            nonClient = true, interim = false, parent = parent,
             position = { x + clientStart.x + parent.clientStart.x + position.x, y + cientStart.y + parent.sy + clientStart.y + position.y };
    */
             position = { x + clientStart.x + absPosition.x - guiApp.desktop.position.x, y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
@@ -3161,7 +3161,7 @@ private:
          }
          ComputeColumn();
       }
-      
+
       UpdateDirty();
       UpdateCaretPosition(true);
       return true;
@@ -3173,9 +3173,9 @@ private:
 
       mouseSelect = false;
       wordSelect = false;
-      
+
       x -= XOFFSET;
-      
+
       ReleaseCapture();
       if(!style.readOnly)
       {
@@ -3280,10 +3280,10 @@ private:
       EditLine line;
       bool needScroll;
 
-      if(mods != -1 && mods.isSideEffect) 
-      { 
-         SetSelectCursor(); 
-         return true; 
+      if(mods != -1 && mods.isSideEffect)
+      {
+         SetSelectCursor();
+         return true;
       }
       if(style.noSelect) return true;
       if(wordSelect) return true;
@@ -3296,11 +3296,11 @@ private:
       {
          if(!needScroll)
             timer.Stop();
-         else 
+         else
          {
             if(needScroll)
                timer.Start();
-            if(mods != -1 && 
+            if(mods != -1 &&
                ((style.hScroll) || (style.vScroll)))
                return true;
          }
@@ -3544,7 +3544,7 @@ private:
                         if(!IS_ALUNDER(this.line.buffer[i]))
                            break;
                      }
-                     
+
                      for(; i < this.line.count; i++)
                      {
                         //Delete trailing whitespace
@@ -3562,7 +3562,7 @@ private:
                      Modified();
                   }
                }
-               else 
+               else
                {
                   if(!(style.freeCaret))
                   {
@@ -3612,7 +3612,7 @@ private:
 
                if(this.x < this.line.count)
                   stuffAfter = true;
-                  
+
                //If last character is a { indent one tab
                if(this.line.buffer[this.x - 1] == '{')
                {
@@ -3725,10 +3725,10 @@ private:
                      {
                         byte ch = line.buffer[c];
                         if(UTF8_IS_FIRST(ch)) break;
-                     } 
+                     }
 
                   }
-                  // No next word found, 
+                  // No next word found,
                   if(!found && ( this.x > 0 || (!line.count && this.x)))
                   {
                      foundAlpha = true;
@@ -3759,7 +3759,7 @@ private:
                      {
                         byte ch = buffer[x];
                         if(UTF8_IS_FIRST(ch)) break;
-                     } 
+                     }
                   }
                   else
                      x--;
@@ -3807,7 +3807,7 @@ private:
                   EditLine line, lastLine;
                   int y = this.y;
                   int lastC, lastY, lastNumBytes;
-                  
+
                   for(line = this.line; (line && !found); line = line.next, y++)
                   {
                      int start = (line == this.line) ? this.x : 0;
@@ -3839,7 +3839,7 @@ private:
                         lastY = y;
                         break;
                      }
-                  }  
+                  }
                   if(found)
                   {
                      DirtyLine(this.y);
@@ -3879,7 +3879,7 @@ private:
                            break;
                         }
                      }
-                     // No next word found, 
+                     // No next word found,
                      if(!found && (c != this.x || line != this.line))
                      {
                         found = true;
@@ -3905,7 +3905,7 @@ private:
                      {
                         byte ch = buffer[x];
                         if(UTF8_IS_FIRST(ch)) break;
-                     } 
+                     }
                   }
                   else
                      x++;
@@ -3940,7 +3940,7 @@ private:
             else
             {
                if(style.stuckCaret) break;
-               
+
                if(!shift) SelDirty();
                DirtyLine(this.y);
 
@@ -3953,7 +3953,7 @@ private:
                   this.y--;
                   this.x = AdjustXPosition(line, caretX, true, null, MAXINT, 0);
                }
-               
+
                DirtyLine(this.y);
                if(!shift) _Deselect();
                ComputeColumn();
@@ -4006,7 +4006,7 @@ private:
                            len = (nextSpace - (text + textPos));
                         else
                            len = line.count - textPos;
-                        
+
                         if(textPos < line.count)
                         {
                            display.FontExtent(font, text + textPos, len, &w, null);
@@ -4075,7 +4075,7 @@ private:
                   return false;
                }
                */
-               
+
                // PREVIOUS CODE
                /*
                if(this.line.prev)
@@ -4119,7 +4119,7 @@ private:
 
                   if(!shift) SelDirty();
                   DirtyLine(this.y);
-                  
+
                   if(style.wrap)
                   {
                      /*
@@ -4140,7 +4140,7 @@ private:
                   if(!shift) _Deselect();
                   ComputeColumn();
                   SetViewToCursor(false);
-                  
+
                   /*
                   while(!textPos || (style.freeCaret || textPos<line.count))
                   {
@@ -4163,7 +4163,7 @@ private:
                            len = (nextSpace - (text + textPos));
                         else
                            len = line.count - textPos;
-                        
+
                         if(textPos < line.count)
                         {
                            display.FontExtent(font, text + textPos, len, &w, &th);
@@ -4192,11 +4192,11 @@ private:
                                  this.x--;
                               else
                                  while(this.x > 0 && !UTF8_IS_FIRST(text[--this.x]));
-                                 
+
                               len = this.x - startPos;
                               display.FontExtent(font, text + startPos, len, &x, null);
                            }
-                           
+
                            if(!shift) _Deselect();
                            ComputeColumn();
 
@@ -4214,7 +4214,7 @@ private:
 
                         SetViewToCursor(false);
                         return false;
-                     } 
+                     }
                      else if(textPos >= line.count && line.next)
                      {
                         startPos = 0;
@@ -4298,7 +4298,7 @@ private:
                         break;
                   if(shift && (c != 0 || this.x))
                      DirtyLine(this.y);
-                  if(this.x != c) 
+                  if(this.x != c)
                      this.x = c;
                   else
                      this.x = 0;
@@ -4398,7 +4398,7 @@ private:
                               Record(action);
                            }
                            memmove(line.buffer,line.buffer+lastC,line.size-lastC);
-                           if(!line.AdjustBuffer(line.count-lastC)) 
+                           if(!line.AdjustBuffer(line.count-lastC))
                               break;
                            line.count-=lastC;
                            DirtyLine(y);
@@ -4421,7 +4421,7 @@ private:
                                  {
                                     BufferLocation before = { line, y, 0 }, after = { line, y, 1 };
 
-                                    if(!line.AdjustBuffer(line.count+1)) 
+                                    if(!line.AdjustBuffer(line.count+1))
                                        break;
 
                                     NotifyCharsAdded(master, this, &before, &after, this.pasteOperation);
@@ -4443,7 +4443,7 @@ private:
                                     BufferLocation before = { line, y, 0 }, after = { line, y, this.tabSize };
                                     NotifyCharsAdded(master, this, &before, &after, this.pasteOperation);
 
-                                    if(!line.AdjustBuffer(line.count+this.tabSize)) 
+                                    if(!line.AdjustBuffer(line.count+this.tabSize))
                                        break;
 
                                     {
@@ -4573,10 +4573,10 @@ private:
                NotifyOvrToggle(master, this, this.overwrite);
             }
             break;
-         case hotKey: 
+         case hotKey:
             break;
          default:
-            
+
             switch(key)
             {
                case ctrlA:
@@ -4587,7 +4587,7 @@ private:
                      //Save current view position
                      int tempX = this.viewX;
                      int tempY = this.viewY;
-                     
+
                      this.selX = 0;
                      this.selY = 0;
                      this.selLine = this.lines.first;
@@ -4597,10 +4597,10 @@ private:
                      ComputeColumn();
                      DirtyAll();
                      SetViewToCursor(true);
-                     
+
                      //Restore previous view position
                      SetScrollPosition(tempX, tempY * this.space.h);
-                     
+
                      UpdateDirty();
                      SetSelectCursor();
                      SelectionEnables();
@@ -4647,10 +4647,10 @@ private:
                         int i;
                         char * newline;
                         int putsize;
-                        
+
                         int indentwidth;
                         EditLine line = this.line;
-                        
+
                         //Only remove one tab if there is nothing else on the line.
                         for(i = 0; i < this.line.count; i++)
                         {
@@ -4660,13 +4660,13 @@ private:
                               return false;
                            }
                         }
-                        
+
                         //Find opening {
                         i = 1;
                         while(i && line)
                         {
                            int pos;
-                           
+
                            indentwidth = 0;
                            for(pos = line.count - 1; pos >= 0; pos--)
                            {
@@ -4685,31 +4685,31 @@ private:
                            }
                            line = line.prev;
                         }
-                        
+
                         //Place the } to get an undo:
                         PutCh(ch);
-                        
+
                         this.x = this.line.count;
                         this.selX = 0;
-                        
+
                         if(!style.useTab)
                            putsize = indentwidth;
                         else
                            putsize = indentwidth / this.tabSize + indentwidth % this.tabSize;
-                        
+
                         newline = new char[putsize+2];
                         newline[putsize] = '}';
                         newline[putsize+1] = '\0';
-                        
+
                         i = 0;
                         if(style.useTab)
                            for(; i < indentwidth / this.tabSize; i++)
                               newline[i] = '\t';
                         for(;i < putsize; i++)
                            newline[i] = ' ';
-                        
+
                         AddS(newline);
-                        
+
                         delete newline;
                      }
                      return false;
@@ -4761,7 +4761,7 @@ private:
          for(; position > this.viewY && this.viewLine.next; this.viewLine = this.viewLine.next, this.viewY++);
          FigureStartSyntaxStates(oldViewLine, false);
       }
-      
+
       if(action != setRange)
       {
          if(!this.mouseMove && style.cursorFollowsView && !SelSize()) SetCursorToViewY();
@@ -4777,8 +4777,8 @@ private:
          int numLines = clientSize.h / this.space.h;
          int y;
          if(Abs(this.viewY - oldViewY) < numLines)
-            
-         
+
+
          if(this.viewY > oldViewY)
          {
             for(y = oldViewY; y <this.viewY; y++)
@@ -4798,7 +4798,7 @@ private:
          Box box { 0,0, clientSize.w-1, YOFFSET-1 };
          Update(box);
       }
-      
+
       UpdateDirty();
    }
 
@@ -4812,11 +4812,11 @@ private:
       int addedSpaces = 0, addedTabs = 0;
 
       if(ch == '\r') return true;
-      if(style.stuckCaret /*|EES_READONLY)*/ ) 
+      if(style.stuckCaret /*|EES_READONLY)*/ )
          GoToEnd(true);
-   
+
       if(ch == '\n' && !(style.multiLine) && this.line) return false;
-      
+
       if(!undoBuffer.dontRecord)
       {
          if(selX != x || selY != y)
@@ -4896,7 +4896,7 @@ private:
                length = this.line.count - endX;
             }
          }
-         if(!line.AdjustBuffer(length)) 
+         if(!line.AdjustBuffer(length))
             return false;
          if(this.line)
          {
@@ -5079,7 +5079,7 @@ public:
 
          this.pasteOperation = true;
 
-         if(style.stuckCaret /*|EES_READONLY)*/ ) 
+         if(style.stuckCaret /*|EES_READONLY)*/ )
             GoToEnd(true);
 
          if(!undoBuffer.dontRecord)
@@ -5088,7 +5088,7 @@ public:
             if(!style.multiLine)
             {
                int i;
-               char ch; 
+               char ch;
                for(i = 0; (ch = placeString[i]); i++)
                   if(ch == '\n')
                   {
@@ -5097,7 +5097,7 @@ public:
                      break;
                   }
             }
-            
+
             if(selX != x || selY != y)
             {
                char * newString;
@@ -5130,7 +5130,7 @@ public:
                   action = AddTextAction { y1 = y, x1 = Min(this.line.count, x), string = placeString };
                else
                   action = AddTextAction { y1 = y, x1 = x, string = placeString };
-               
+
                Record(action);
             }
             else
@@ -5164,7 +5164,7 @@ public:
                count = 0;
                line = string+c+1;
                /*
-               if(string[c] == '\r' && *line == '\n') 
+               if(string[c] == '\r' && *line == '\n')
                {
                   line++;
                   c++;
@@ -5228,7 +5228,7 @@ public:
    void PutCh(unichar ch)
    {
       bool result;
-      
+
       if((ch >= 32 /*&& ch <=126*/) || ch == '\n')
       //if((ch >= 32) || ch == '\n')
       {
@@ -5303,7 +5303,7 @@ public:
             replaceAction.y3 = y;
             replaceAction.addedSpaces = addedSpaces;
             replaceAction.addedTabs = addedTabs;
-         }  
+         }
          if(addCharAction)
          {
             addCharAction.x -= addedTabs * (tabSize-1);
@@ -5500,7 +5500,7 @@ public:
          FixScrollArea();
 
          selected = selX != this.x || selY != y;
-         
+
          viewX = this.viewX;
          viewY = this.viewY;
 
@@ -5548,7 +5548,7 @@ public:
             }
          }
 
-         if(!dontScroll) 
+         if(!dontScroll)
          {
             if(style.vScroll)
             {
@@ -5571,13 +5571,13 @@ public:
                   for(;dropLine && dropLine.prev && dropY >= numLines;)
                   {
                      dropLine = dropLine.prev;
-                     dropY--;                  
+                     dropY--;
                   }
                else
                   for(;this.line && this.line.prev && this.y >= numLines;)
                   {
                      this.line = this.line.prev;
-                     y--;                  
+                     y--;
                   }
             }
 
@@ -5687,7 +5687,7 @@ public:
    {
       int c, numLines;
       EditLine line;
-      
+
       if(this.y == 0) return;
 
       numLines = clientSize.h / this.space.h;
@@ -5742,7 +5742,7 @@ public:
          //DirtyAll();
          // this.viewLine = this.viewLine.next;
          // this.viewY++;
-         
+
          SetScrollPosition(this.viewX, (this.viewY + 1) * this.space.h);
       }
    }
@@ -5786,11 +5786,11 @@ public:
       }
       nx1 = Min(x1,l1.count);
       nx2 = Min(x2,l2.count);
-      
+
       // Find Number of Bytes Needed
       size = 0;
       for(line = l1; line; line = line.next)
-      {  
+      {
          if(line == l1) start = nx1; else start = 0;
          if(line == l2) end = nx2; else end = line.count;
          size += end-start;
@@ -5908,16 +5908,16 @@ public:
 
       // Copy text
       for(line = l1; line; line = line.next)
-      {  
+      {
          if(line == l1) start = nx1; else start = 0;
          if(line == l2) end = nx2; else end = line.count;
          if(text)
          {
             CopyBytes(text, line.buffer + start, end - start);
             text += end-start;
-         } 
+         }
          numChars += end-start;
-         
+
          if(style.freeCaret && line == l2 && addSpaces)
          {
             if(l1 == l2)
@@ -5939,10 +5939,10 @@ public:
             if(text)
                *(text++) = '\r';
             numChars++;
-         } 
+         }
          if(text)
             *(text++) = '\n';
-         numChars++; 
+         numChars++;
       }
       // '\0' terminate Terminate
       if(text)
@@ -5981,7 +5981,7 @@ public:
             ClipBoard clipBoard { };
             if(clipBoard.Allocate(size+1))
             {
-               GetSel(clipBoard.memory, true);   
+               GetSel(clipBoard.memory, true);
                // Save clipboard
                clipBoard.Save();
             }
@@ -6031,7 +6031,7 @@ public:
       savedAction = undoBuffer.curAction;
 
       for(line = this.lines.first; line; line = line.next)
-      {  
+      {
          f.Write(line.buffer, line.count,1);
          if(line.next)
          {
@@ -6048,7 +6048,7 @@ public:
       if(f)
       {
          char buffer[BUFFER_SIZE];
-     
+
          for(;;)
          {
             int count = f.Read(buffer, 1, BUFFER_SIZE-1);
@@ -6079,7 +6079,7 @@ public:
       {
          char * string;
 
-         if(!line) 
+         if(!line)
          {
             if(isSearchDown)
             {
@@ -6094,7 +6094,7 @@ public:
                result = wrapped;
             }
          }
-         
+
          if(isSearchDown)
             string = SearchString(line.buffer, firstPass ? Min(this.x,line.count) : 0,text,matchCase,matchWord);
          else
@@ -6104,7 +6104,7 @@ public:
          {
             Select((void *)line,num,string - line.buffer,(void *)line,num,string - line.buffer + strlen(text));
             return result;
-         } 
+         }
          if(line == this.line && !firstPass) break;
 
          if(isSearchDown)
@@ -6135,7 +6135,7 @@ public:
          {
             Select((void *)line,y,string - line.buffer,(void *)line,y,string - line.buffer + strlen(text));
             return found;
-         } 
+         }
       }
       return notFound;
    }
@@ -6147,7 +6147,7 @@ public:
 #endif
       if(!NotifyKeyDown(master, this, key, ch))
          return false;
-      else 
+      else
       {
          switch(key)
          {
@@ -6253,7 +6253,7 @@ public:
             y++;
          }
          else
-            break;         
+            break;
       }
 
       editBox.line = editBox.selLine = line;
@@ -6357,13 +6357,13 @@ public:
       }
       return result;
    }
-   
+
    bool Puts(char * string)
    {
       EditBox editBox = this.editBox;
       BufferLocation start { editBox.line, editBox.y, editBox.x };
       BufferLocation pos;
-      
+
       numBytes = 0;
       editBox.AddS(string);
 
@@ -6400,7 +6400,7 @@ public:
          }
          return true;
       }
-      return false; 
+      return false;
    }
 
    bool Getc(char * ch)
index cf1ac39..a2c744f 100644 (file)
@@ -14,7 +14,7 @@ public class Label : CommonControl
 public:
    property Window labeledWindow
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          Size size;
@@ -42,13 +42,13 @@ public:
    };
 
    property bool isGroupBox
-   { 
-      property_category $"Appearance" 
+   {
+      property_category $"Appearance"
       set
       {
          isGroupBox = value;
          inactive = !value;
-      } 
+      }
       get { return isGroupBox; }
    };
 
index 1845d21..dab9bdd 100644 (file)
@@ -52,7 +52,7 @@ extern int __ecereVMethodID_class_OnSaveEdit;
 
 private:
 
-public class DataField 
+public class DataField
 {
 public:
    property Class dataType
@@ -133,7 +133,7 @@ public:
       set
       {
          userData = value;
-      } 
+      }
       get
       {
          return this ? userData : null;
@@ -141,7 +141,7 @@ public:
    };
    property bool freeData
    {
-      set { freeData = value; } get { return freeData; }      
+      set { freeData = value; } get { return freeData; }
    };
    property DataField prev { get { return prev; } };
    property DataField next { get { return next; } };
@@ -223,11 +223,11 @@ private:
          listBox.fields.Remove(this);
          for(field = listBox.fields.first; field; field = field.next)
          {
-            if(field.index >= index) 
+            if(field.index >= index)
                field.index--;
          }
          if(listBox.currentField == this)
-            listBox.currentField = null;            
+            listBox.currentField = null;
          listBox.numFields--;
          listBox.OnResize(listBox.clientSize.w, listBox.clientSize.h);
          listBox = null;
@@ -292,11 +292,11 @@ public:
                      if(!listBox.clickedRow)
                         listBox.clickedRow = this;
                   }
-                  if(listBox.currentRow && !listBox.currentRow.parent.IsExpanded()) 
+                  if(listBox.currentRow && !listBox.currentRow.parent.IsExpanded())
                   {
                      listBox.SetCurrentRow(this, true);
                   }
-                  if(listBox.firstRowShown && !listBox.firstRowShown.parent.IsExpanded()) 
+                  if(listBox.firstRowShown && !listBox.firstRowShown.parent.IsExpanded())
                   {
                      listBox.firstRowShown = GetPrevRow();
                      if(!listBox.firstRowShown)
@@ -313,7 +313,7 @@ public:
 
                listBox.SetScrollArea(
                   listBox.width,
-                  (listBox.rowCount * listBox.rowHeight) + 
+                  (listBox.rowCount * listBox.rowHeight) +
                   ((listBox.style.header) ? listBox.rowHeight : 0) -
                   ((!((listBox.clientSize.h+1) % listBox.rowHeight)) ? listBox.rowHeight : 0), true);
                listBox.Update(null);
@@ -358,14 +358,14 @@ public:
             listBox.HideEditBox(false, false, true);
 
             /*
-            if(this == listBox.clickedRow) 
+            if(this == listBox.clickedRow)
             {
                listBox.clickedRow = GetNextRow();
                if(!listBox.clickedRow)
                   listBox.clickedRow = GetPrevRow();
             }
 
-            if(this == listBox.currentRow) 
+            if(this == listBox.currentRow)
             {
                DataRow newCurrentRow = GetNextRow();
                if(!listBox.newCurrentRow)
@@ -373,7 +373,7 @@ public:
                listBox.SetCurrentRow(newCurrentRow, true);
             }
 
-            if(this == listBox.firstRowShown) 
+            if(this == listBox.firstRowShown)
             {
                listBox.firstRowShown = GetPrevRow();
                if(!listBox.firstRowShown)
@@ -423,7 +423,7 @@ public:
 
                listBox.SetScrollArea(
                   listBox.width,
-                  (listBox.rowCount * listBox.rowHeight) + 
+                  (listBox.rowCount * listBox.rowHeight) +
                   ((listBox.style.header) ? listBox.rowHeight : 0) -
                   ((!((listBox.clientSize.h+1) % listBox.rowHeight)) ? listBox.rowHeight : 0), true);
                if(listBox.style.autoScroll)
@@ -493,7 +493,7 @@ public:
 
             if(!after || after.index < index)
             {
-               if(after == listBox.firstRowShown.prev) 
+               if(after == listBox.firstRowShown.prev)
                   listBox.firstRowShown = this;
 
                // All rows between AFTER (exclusive) and ROW (exclusive) are incremented by one
@@ -698,7 +698,7 @@ public:
                      break;
                if(field)
                {
-                  int size = (field.dataType && field.dataType.typeSize) ? 
+                  int size = (field.dataType && field.dataType.typeSize) ?
                      (sizeof(class ListBoxCell) + field.dataType.typeSize - sizeof(void *)) : sizeof(class ListBoxCell);
                   ListBoxCell cell = (ListBoxCell)new0 byte[size];
                   row.cells.Add(cell);
@@ -723,11 +723,11 @@ public:
                listBox.rowCount++;
 
                for(search = row.GetNextRow(); search; search = search.GetNextRow())
-                  search.index++;            
+                  search.index++;
 
                listBox.SetScrollArea(
                   listBox.width,
-                  (listBox.rowCount * listBox.rowHeight) + 
+                  (listBox.rowCount * listBox.rowHeight) +
                   ((listBox.style.header) ? listBox.rowHeight : 0) -
                   ((!((listBox.clientSize.h+1) % listBox.rowHeight)) ? listBox.rowHeight : 0), true);
                if(listBox.style.autoScroll)
@@ -835,8 +835,8 @@ private:
       int result = 0;
       ListBoxCell cell1, cell2;
       uint index;
-      for(index = 0, cell1 = cells.first, cell2 = b.cells.first; 
-          index != sortField.index; 
+      for(index = 0, cell1 = cells.first, cell2 = b.cells.first;
+          index != sortField.index;
           index++, cell1 = cell1.next, cell2 = cell2.next);
    /*
       if(!cell1.isSet && !cell2.isSet)
@@ -854,14 +854,14 @@ private:
       {
          if(sortField.dataType.type == normalClass || sortField.dataType.type == noHeadClass)
          {
-            result = ((int (*)(void *, void *, void *))(void *)sortField.dataType._vTbl[__ecereVMethodID_class_OnCompare])(sortField.dataType, 
-               (cell1.isSet && cell1.data) ? cell1.data[0] : null, 
+            result = ((int (*)(void *, void *, void *))(void *)sortField.dataType._vTbl[__ecereVMethodID_class_OnCompare])(sortField.dataType,
+               (cell1.isSet && cell1.data) ? cell1.data[0] : null,
                (cell2.isSet && cell2.data) ? cell2.data[0] : null);
          }
          else
          {
-            result = ((int (*)(void *, void *, void *))(void *)sortField.dataType._vTbl[__ecereVMethodID_class_OnCompare])(sortField.dataType, 
-               cell1.isSet ? cell1.data : null, 
+            result = ((int (*)(void *, void *, void *))(void *)sortField.dataType._vTbl[__ecereVMethodID_class_OnCompare])(sortField.dataType,
+               cell1.isSet ? cell1.data : null,
                cell2.isSet ? cell2.data : null);
          }
       }
@@ -918,9 +918,9 @@ private:
    {
       DataRow row;
       // Find Next row
-      if(subRows.first && !collapsed) 
+      if(subRows.first && !collapsed)
          row = subRows.first;
-      else 
+      else
       {
          for(row = this; row; row = row.parent)
          {
@@ -980,7 +980,7 @@ public:
 
    property int rowHeight
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       isset { return style.heightSet; }
       set
       {
@@ -1001,7 +1001,7 @@ public:
    };
    property Seconds typingTimeout
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          typedString[0] = '\0';
@@ -1018,7 +1018,7 @@ public:
    property bool hasClearHeader { property_category $"Appearance" set { style.clearHeader = value; if(value) property::hasHeader = true; } get { return style.clearHeader; } };
    property bool hasHeader
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       set
       {
          if(value && !style.header)
@@ -1044,7 +1044,7 @@ public:
          style.header = value;
       }
       get { return style.header; }
-   };   
+   };
    property bool multiSelect { property_category $"Behavior" set { style.multiSelect = value; } get { return style.multiSelect; } };
    property bool alwaysEdit { property_category $"Behavior" set { style.alwaysEdit = value; } get { return style.alwaysEdit; } };
    property bool fullRowSelect { property_category $"Appearance" set { style.fullRowSelect = value; } get { return style.fullRowSelect; } };
@@ -1055,7 +1055,7 @@ public:
    property bool noDragging { property_category $"Behavior" set { style.noDragging = value; } get { return style.noDragging; } };
    property bool fillLastField
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          style.fillLastField = value;
@@ -1106,7 +1106,7 @@ public:
    virtual bool Window::NotifyResized(ListBox listBox, DataField field, Modifiers mods);
    virtual bool Window::NotifyCollapse(ListBox listBox, DataRow row, bool collapsed);
    virtual bool Window::NotifyKeyHit(ListBox listBox, DataRow row, Key key, unichar ch);
-   virtual bool Window::NotifyModified(ListBox listBox, DataRow row);   
+   virtual bool Window::NotifyModified(ListBox listBox, DataRow row);
    virtual bool Window::NotifyEditing(ListBox listBox, DataRow row);
 
 #ifdef _DEBUG
@@ -1144,7 +1144,7 @@ public:
          incref addedField;
          addedField.listBox = this;
          fields.Add(addedField);
-      
+
          addedField.sortOrder = 1;
          addedField.index = numFields;
          numFields++;
@@ -1181,16 +1181,16 @@ public:
             field = addedField;
             for(row = rows.first; row; )
             {
-               int size = (field.dataType && field.dataType.typeSize) ? 
+               int size = (field.dataType && field.dataType.typeSize) ?
                   (sizeof(class ListBoxCell) + field.dataType.typeSize - sizeof(void *)) : sizeof(class ListBoxCell);
                ListBoxCell cell = (ListBoxCell)new0 byte[size];
                row.cells.Add(cell);
                FillBytes(cell.data, 0, size - (uint)&((ListBoxCell)0).data);
                cell.isSet = false;
 
-               if(row.subRows.first) 
+               if(row.subRows.first)
                   row = row.subRows.first;
-               else 
+               else
                {
                   for(; row; row = row.parent)
                   {
@@ -1255,9 +1255,9 @@ public:
                   delete cell;
                }
 
-               if(row.subRows.first) 
+               if(row.subRows.first)
                   row = row.subRows.first;
-               else 
+               else
                {
                   for(; row; row = row.parent)
                   {
@@ -1289,16 +1289,16 @@ public:
          row.listBox = this;
 
          for(search = row.GetNextRow(); search; search = search.GetNextRow())
-            search.index++;         
+            search.index++;
 
          this.rowCount++;
          row.cells.Clear();
-         
+
          firstRowShown = row;
 
          SetScrollArea(
             width,
-            (rowCount * rowHeight) + 
+            (rowCount * rowHeight) +
             ((style.header) ? rowHeight : 0) -
             ((!((clientSize.h+1) % rowHeight)) ? rowHeight : 0), true);
          if(style.autoScroll)
@@ -1342,7 +1342,7 @@ public:
                         break;
                   if(field)
                   {
-                     int size = (field.dataType && field.dataType.typeSize) ? 
+                     int size = (field.dataType && field.dataType.typeSize) ?
                         (sizeof(class ListBoxCell) + field.dataType.typeSize - sizeof(void *)) : sizeof(class ListBoxCell);
                      ListBoxCell cell = (ListBoxCell) new0 byte[size];
                      row.cells.Add(cell);
@@ -1359,7 +1359,7 @@ public:
                if(rowHeight)
                   SetScrollArea(
                      width,
-                     (rowCount * rowHeight) + 
+                     (rowCount * rowHeight) +
                      ((style.header) ? rowHeight : 0) -
                      ((!((clientSize.h+1) % rowHeight)) ? rowHeight : 0), true);
                if(style.autoScroll)
@@ -1399,7 +1399,7 @@ public:
             row.listBox = this;
 
             for(search = row.GetNextRow(); search; search = search.GetNextRow())
-               search.index++;         
+               search.index++;
 
             this.rowCount++;
             row.cells.Clear();
@@ -1410,7 +1410,7 @@ public:
                      break;
                if(field)
                {
-                  int size = (field.dataType && field.dataType.typeSize) ? 
+                  int size = (field.dataType && field.dataType.typeSize) ?
                      (sizeof(class ListBoxCell) + field.dataType.typeSize - sizeof(void *)) : sizeof(class ListBoxCell);
                   ListBoxCell cell = (ListBoxCell) new0 byte[size];
                   row.cells.Add(cell);
@@ -1425,7 +1425,7 @@ public:
 
             SetScrollArea(
                width,
-               (rowCount * rowHeight) + 
+               (rowCount * rowHeight) +
                ((style.header) ? rowHeight : 0) -
                ((!((clientSize.h+1) % rowHeight)) ? rowHeight : 0), true);
             if(style.autoScroll)
@@ -1497,20 +1497,20 @@ public:
          if(row.parent.IsExpanded())
          {
             for(search = row.GetNextRow(); search; search = search.GetNextRow())
-               search.index--;         
+               search.index--;
             this.rowCount--;
          }
 
          HideEditBox(false, false, true);
 
-         if(row == clickedRow) 
+         if(row == clickedRow)
          {
             clickedRow = row.GetNextRow();
             if(!clickedRow)
                clickedRow = row.GetPrevRow();
          }
 
-         if(row == currentRow) 
+         if(row == currentRow)
          {
             DataRow newCurrentRow = row.GetNextRow();
             if(!newCurrentRow)
@@ -1518,7 +1518,7 @@ public:
             SetCurrentRow(newCurrentRow, true);
          }
 
-         if(row == firstRowShown) 
+         if(row == firstRowShown)
          {
             firstRowShown = row.GetPrevRow();
             if(!firstRowShown)
@@ -1532,7 +1532,7 @@ public:
 
          SetScrollArea(
             this.width,
-            (this.rowCount * rowHeight) + 
+            (this.rowCount * rowHeight) +
             ((style.header) ? rowHeight : 0) -
             ((!((clientSize.h+1) % rowHeight)) ? rowHeight : 0), true);
 
@@ -1719,7 +1719,7 @@ public:
       if(this)
       {
          DataRow row = null;
-      
+
          for(row = rows.first; row; row = row.next)
          {
             if(!row.noneRow && row.tag == tag)
@@ -1744,10 +1744,10 @@ public:
 
          HideEditBox(false, true, false);
          editData.Destroy(0);
-               
+
          firstRowShown = currentRow = null;
          ClearEx();
-     
+
          if(master)
          {
             if(style.freeSelect)
@@ -1759,12 +1759,12 @@ public:
          if(style.alwaysEdit && currentRow)
             currentRow.Edit(currentField);
 
-      
+
          this.rowCount = 0;
-      
+
          SetScrollArea(
                this.width,
-               (this.rowCount * rowHeight) + 
+               (this.rowCount * rowHeight) +
                ((style.header) ? rowHeight : 0) -
                ((rowHeight && !((clientSize.h+1) % rowHeight)) ? rowHeight : 0), true);
          Update(null);
@@ -1902,7 +1902,7 @@ private:
       if(*row)
       {
          if(!*field) *field = this ? currentField : null;
-         if(!*field && this) 
+         if(!*field && this)
          {
             for(*field = fields.first; (*field).index != 0; *field = (*field).next);
          }
@@ -1923,9 +1923,9 @@ private:
       if(editData && editData.visible)
       {
          Class dataType = currentField.dataType;
-         if(save) 
+         if(save)
             editData.SaveData();
-         
+
          editData.visible = false;
          NotifyEditDone(master, this, currentRow);
 
@@ -1938,7 +1938,7 @@ private:
             int height = rowHeight - (style.alwaysEdit ? 1 : 0);
             int y = currentRow.index * rowHeight + (style.header ? rowHeight : 0);
             int x = currentField.x;
-            int width = (!currentField.next && style.fillLastField && (!hasHorzScroll || clientSize.w - currentField.x > currentField.width + EXTRA_SPACE)) ? 
+            int width = (!currentField.next && style.fillLastField && (!hasHorzScroll || clientSize.w - currentField.x > currentField.width + EXTRA_SPACE)) ?
                   clientSize.w - currentField.x : (currentField.width + EXTRA_SPACE);
 
             if(!style.alwaysEdit)
@@ -1959,7 +1959,7 @@ private:
          }
          else
             printf("");
-            
+
          /*else
             currentField = null;*/
       }
@@ -2036,7 +2036,7 @@ private:
             x += 15;
          for(field = fields.first; field; field = field.next)
          {
-            width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+            width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
                clientSize.w - field.x : (field.width + EXTRA_SPACE);
             if(field == currentField) break;
             x += width;
@@ -2076,7 +2076,7 @@ private:
 
             for(field = fields.first; field; field = field.next)
             {
-               width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+               width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
                   clientSize.w - field.x : (field.width + EXTRA_SPACE);
                if(field == whichField) break;
                x += width;
@@ -2125,7 +2125,7 @@ private:
                      bool result = DataBox::OnKeyDown(key, ch);
                      if(visible && active)   // Added this check here, because we will not use enter/escape otherwise, and lose DataBox's result
                      {
-                        if((SmartKey)key == enter || (SmartKey)key == escape) 
+                        if((SmartKey)key == enter || (SmartKey)key == escape)
                            return true;
                      }
                      return result;
@@ -2210,7 +2210,7 @@ private:
          // Vertical lines
          for(field = fields.first; field; field = field.next)
          {
-            int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+            int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
                clientSize.w - field.x : (field.width + EXTRA_SPACE);
             if(field.prev && y > 0)
                surface.VLine(0, y-1, x);
@@ -2250,7 +2250,7 @@ private:
                int y1 = y + PLUSY + 4;
                int y2;
                DataRow child;
-            
+
                for(child = row.collapsed ? null : row.subRows.first; child && child != row; )
                {
                   numRows++;
@@ -2585,7 +2585,7 @@ private:
       if(sortField && !style.clearHeader && style.header)
       {
          DataField field = sortField;
-         int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+         int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
             clientSize.w - field.x : (field.width + EXTRA_SPACE);
          int tw = 0, th = 0;
          if(field.header)
@@ -2594,9 +2594,9 @@ private:
          {
             bool up = field.sortOrder == 1;
             int x = 4, y = 4;
-            Box clip = 
-            { 
-               field.x + 2 - scroll.x, 0, 
+            Box clip =
+            {
+               field.x + 2 - scroll.x, 0,
                field.x + width + EXTRA_SPACE - 1 - scroll.x, rowHeight
             };
             surface.Clip(&clip);
@@ -2606,7 +2606,7 @@ private:
                   x = field.x + (width + EXTRA_SPACE - tw) / 2 + tw + EXTRA_SPACE + 4;
                else
                   x = field.x + tw + EXTRA_SPACE + 4;
-             
+
                x = Min(x, field.x + width - 4);
             }
             else if(field.alignment == right)
@@ -2630,7 +2630,7 @@ private:
                   surface.PutPixel(x + 1, y + 5);
                   surface.PutPixel(x + 1, y + 3);
                   surface.PutPixel(x + 2, y + 1);
-            
+
                   surface.SetForeground(white);
                   surface.DrawLine(x + 4, y, x + 7, y + 5);
                   surface.PutPixel(x + 6, y + 5);
@@ -2646,7 +2646,7 @@ private:
                   surface.PutPixel(x + 1, y+1);
                   surface.PutPixel(x + 1, y+3);
                   surface.PutPixel(x + 2, y+5);
-            
+
                   surface.SetForeground(white);
                   surface.DrawLine(x + 4, y+6, x + 7, y+1);
                   surface.PutPixel(x + 6, y+1);
@@ -2679,13 +2679,13 @@ private:
 
       SetScrollArea(
          width,
-         (rowCount * rowHeight) + 
+         (rowCount * rowHeight) +
          ((style.header) ? rowHeight : 0) -
          ((!((clientSize.h+1) % rowHeight)) ? rowHeight : 0), true);
 
       for(field = fields.first; field; field = field.next)
       {
-         int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+         int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
             clientSize.w - field.x : (field.width + EXTRA_SPACE);
          if(style.header && field.headButton)
          {
@@ -2743,7 +2743,7 @@ private:
       // false: dont destroy edit box
       HideEditBox(true, false, true);
       if(style.resizable && ((!field && x < RESIZE_BORDER && fields.last) ||
-         (field && x < RESIZE_BORDER && field.prev) || 
+         (field && x < RESIZE_BORDER && field.prev) ||
          (field && x >= control.clientSize.w - RESIZE_BORDER)))
       {
          if(!field)
@@ -2782,7 +2782,7 @@ private:
          x += control.position.x;
 
          // Tweak to prevent shrinking field if we're actually moving right
-         if(x - scroll.x > this.oldX && 
+         if(x - scroll.x > this.oldX &&
             this.startWidth + x - this.resizeX < field.width)
          {
             this.oldX = x - scroll.x;
@@ -2804,9 +2804,9 @@ private:
             int fieldX = 0;
             for(field = fields.first; field; field = field.next)
             {
-               fieldX += ((field.width || style.resizable) ? 
+               fieldX += ((field.width || style.resizable) ?
                   field.width : clientSize.w) + EXTRA_SPACE;
-               if(fieldX > x) 
+               if(fieldX > x)
                   break;
             }
             if(draggingField == field)
@@ -2816,7 +2816,7 @@ private:
                        field.x >= field.x + field.width + EXTRA_SPACE - clientSize.w)
                {
                   SetScrollPosition(
-                     field.x + field.width + EXTRA_SPACE - clientSize.w, 
+                     field.x + field.width + EXTRA_SPACE - clientSize.w,
                      scroll.y);
                }
                else if(field.x + field.width + EXTRA_SPACE - clientSize.w > scroll.x ||
@@ -2887,7 +2887,7 @@ private:
       if(draggingField)
       {
          bool result = true;
-         
+
          if(style.moveFields)
          {
             if(dropField)
@@ -2900,9 +2900,9 @@ private:
                x += draggingField.x;
                for(field = fields.first; field; field = field.next)
                {
-                  fieldX += ((field.width || style.resizable) ? 
+                  fieldX += ((field.width || style.resizable) ?
                      field.width : clientSize.w) + EXTRA_SPACE;
-                  if(fieldX > x) 
+                  if(fieldX > x)
                   {
                      switchField = field;
                      break;
@@ -2998,7 +2998,7 @@ private:
 
    bool OnLoadGraphics()
    {
-      display.FontExtent(fontObject, "W", 1, null, &fontH); 
+      display.FontExtent(fontObject, "W", 1, null, &fontH);
       if(!style.heightSet)
       {
          rowHeight = Max(fontH + 2, 16) + (style.alwaysEdit ? 1 : 0);
@@ -3038,7 +3038,7 @@ private:
             Font font = fontObject;
             Font boldFont = this.boldFont.font;
             Display display = this.display;
-            
+
             for(row = rows.first; row; row = row.GetNextRow())
             {
                Bitmap icon = row.icon ? row.icon.bitmap : null;
@@ -3159,7 +3159,7 @@ private:
 
          for(field = fields.first; field; field = field.next)
          {
-            int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+            int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
                clientSize.w - field.x : (field.width + EXTRA_SPACE);
 
             if(field.prev)
@@ -3176,7 +3176,7 @@ private:
 
       if((editData && editData.visible) || (style.alwaysEdit))
          return true;
-      
+
       if(x == MAXINT && y == MAXINT)
       {
          x = this.mouseX;
@@ -3195,18 +3195,18 @@ private:
          mouseY = y;
 
          if(this.dragging &&
-            ((vertScroll && vertScroll.visible && 
+            ((vertScroll && vertScroll.visible &&
              (y < 0 || y >= clientSize.h)) ||
-             (horzScroll && horzScroll.visible && 
+             (horzScroll && horzScroll.visible &&
              (x < 0 || x >= clientSize.w))))
          {
             timer.Start();
             if(isTimer)
             {
-               if(vertScroll && vertScroll.visible && 
+               if(vertScroll && vertScroll.visible &&
                   (y < 0 || y >= clientSize.h))
                   vertScroll.Action((y<0)?up:down, 0, 0);
-               if(horzScroll && horzScroll.visible && 
+               if(horzScroll && horzScroll.visible &&
                   (x < 0 || x >= clientSize.w))
                   horzScroll.Action((x<0)?up:down, 0, 0);
             }
@@ -3237,7 +3237,7 @@ private:
                {
                   DataRow thisRow;
                   for(thisRow = rows.first; thisRow; thisRow = thisRow.GetNextRow())
-                     if((thisRow.selectedFlag == selected || thisRow.selectedFlag == tempSelected) || 
+                     if((thisRow.selectedFlag == selected || thisRow.selectedFlag == tempSelected) ||
                         thisRow == row)
                         break;
                   if(thisRow != row)
@@ -3351,7 +3351,7 @@ private:
 
          for(field = fields.first; field; field = field.next)
          {
-            int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+            int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
                clientSize.w - field.x : (field.width + EXTRA_SPACE);
 
             if(field.prev)
@@ -3405,7 +3405,7 @@ private:
          for(row = firstRowShown; row; row = row.GetNextRow(), rowIndex ++)
          {
             rowY += rowHeight;
-            if(rowY > y || (style.multiSelect && !row.GetNextRow())) 
+            if(rowY > y || (style.multiSelect && !row.GetNextRow()))
             {
                int plusIndent = 0;
                if(style.treeBranch)
@@ -3421,7 +3421,7 @@ private:
                if(style.collapse && row.subRows.first && (row.parent || !(style.treeBranch) || (style.rootCollapse)) &&
                   (x >= rowStart + 3 + plusIndent && y >= rowY - rowHeight + PLUSY && x <= rowStart + 11 + plusIndent && y <= rowY - rowHeight + PLUSY + 8))
                */
-               if(style.collapse && 
+               if(style.collapse &&
                   (x >= rowStart && y >= rowY - rowHeight && x <= rowStart + 18 + plusIndent && y <= rowY + rowHeight-1))
                {
                   if(row.subRows.first && (row.parent || !(style.treeBranch) || (style.rootCollapse)) && x >= plusIndent)
@@ -3445,7 +3445,7 @@ private:
                         clickedRow = row;
                         //this.clickedRowIndex = rowIndex;
                      }
-                     else if(style.moveRows && !(mods.shift) && 
+                     else if(style.moveRows && !(mods.shift) &&
                         (row.selectedFlag == selected || row.selectedFlag == tempSelected) &&
                         !right && !(mods.isActivate))
                         moveMultiple = true;
@@ -3492,7 +3492,7 @@ private:
                                     {
                                        if(selRow != clickedRow)
                                        {
-                                          if(selRow.selectedFlag) 
+                                          if(selRow.selectedFlag)
                                              selRow.selectedFlag = tempUnselected;
                                           else
                                              selRow.selectedFlag = tempSelected;
@@ -3617,7 +3617,7 @@ private:
 
          if(style.freeSelect)
             NotifyHighlight(master, this, currentRow, mods);
-         else if((moveMultiple || (!(style.multiSelect) && previousRow == currentRow)) && 
+         else if((moveMultiple || (!(style.multiSelect) && previousRow == currentRow)) &&
             newCurrentRow && !(mods.shift))
          {
             if(!right)
@@ -3647,19 +3647,19 @@ private:
 
                      for(field = fields.first; field; field = field.next)
                      {
-                        int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+                        int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
                            clientSize.w - field.x : (field.width + EXTRA_SPACE);
 
                         if(!field.prev) width -= indent;
                         if(x >= sx && x < sx + width)
-                           break;                     
+                           break;
                         sx += width;
                      }
                      if(field == currentField)
                         editData.Deactivate();
                      else
                      {
-                        currentRow.Edit(field);                     
+                        currentRow.Edit(field);
                         editData.Activate();
                      }
                   }
@@ -3681,7 +3681,7 @@ private:
 
                      if(style.collapse && !(style.treeBranch))
                         sx += 15;
-                  
+
                      whichField = currentField;
 
                      {
@@ -3694,7 +3694,7 @@ private:
 
                      for(field = fields.first; field; field = field.next)
                      {
-                        int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+                        int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
                            clientSize.w - field.x : (field.width + EXTRA_SPACE);
                         if(!field.prev) width -= indent;
                         if(x >= sx && x < sx + width && newCurrentRow)
@@ -3739,7 +3739,7 @@ private:
 
                   for(field = fields.first; field; field = field.next)
                   {
-                     int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+                     int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
                         clientSize.w - field.x : (field.width + EXTRA_SPACE);
 
                      if(!field.prev) width -= indent;
@@ -3829,7 +3829,7 @@ private:
          for(row = firstRowShown; row; row = row.GetNextRow())
          {
             rowY += rowHeight;
-            if(rowY > y) 
+            if(rowY > y)
             {
                switchRow = row;
                break;
@@ -3842,14 +3842,14 @@ private:
             int fieldX = 0;
             for(field = fields.first; field; field = field.next)
             {
-               int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? 
+               int width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ?
                   clientSize.w - field.x : (field.width + EXTRA_SPACE);
                fieldX += width;
 
-               if(fieldX > x + scroll.x) 
+               if(fieldX > x + scroll.x)
                   break;
             }
-            
+
             if(field && field.editable)
             {
                // true: destroy edit box
@@ -3892,7 +3892,7 @@ private:
                clickedRow = row;
             }
             else
-            { 
+            {
                if(style.multiSelect)
                {
                   if(!switchRow.selectedFlag)
@@ -3997,7 +3997,7 @@ private:
       for(row = firstRowShown; row; row = row.GetNextRow())
       {
          rowY += rowHeight;
-         if(rowY > y || (style.multiSelect && !row.GetNextRow())) 
+         if(rowY > y || (style.multiSelect && !row.GetNextRow()))
          {
             if(style.treeBranch)
             {
@@ -4060,7 +4060,7 @@ private:
             bool looped = false;
             if(len == 1 && currentRow)
                startRow = (next = startRow.GetNextRow(), (next ? next : rows.first));
-        
+
             for(row = startRow; row != startRow || !looped; next = row.GetNextRow(), row = next ? next : rows.first)
             {
                void * data = row.GetData(field);
@@ -4142,10 +4142,10 @@ private:
             draggingField = null;
             Update(null);
             return false;
-         }      
+         }
       }
 
-      if(!currentField || !currentField.editable)            
+      if(!currentField || !currentField.editable)
          for(field = fields.first; field; field = field.next)
          {
             if(field.editable)
@@ -4175,7 +4175,7 @@ private:
             return false;
          }
       }
+
       if(!NotifyKeyDown(master, this, currentRow, key, ch))
          return false;
 
@@ -4186,7 +4186,7 @@ private:
             return editData.OnKeyDown(key, ch);
          return true;   // We want to pick up the OnKeyHit to replace contents, but skip GoToLetter
       }
-      
+
       if(ch >=32 && ch != 128 && !key.alt && !key.ctrl && GoToLetter(ch, false))
       {
          /*if(inactive && window.state != Hidden)
@@ -4554,7 +4554,7 @@ private:
    {
       delay = 0.5; // typingTimeOut
       userData = this;
-      
+
       bool DelayExpired()
       {
          typedString[0] = '\0';
index d8304c2..f8421ee 100644 (file)
@@ -55,7 +55,7 @@ public:
             if(menu)
                menu.RemoveItem(this);
             if(value)
-               value.AddItem(this);   
+               value.AddItem(this);
          }
       }
    };
@@ -83,7 +83,7 @@ public:
       set
       {
          accelerator = value;
-        
+
          if(!manualAccelText && text)
          {
             char accelString[50] = "\t";
@@ -162,7 +162,7 @@ public:
          }
          // Should callback be called here? guess not ;)
       }
-      get { return checked; } 
+      get { return checked; }
    };
    property bool disabled { set { if(this) disabled = value; } };
    property bool checkable { set { checkable = value; } };
@@ -253,7 +253,7 @@ public class MenuPlacement : MenuItem
 {
    MenuPlacement()
    {
-      placement = true; 
+      placement = true;
    }
 
 public:
@@ -310,7 +310,7 @@ public:
          item.menu = this;
       }
    }
-      
+
    void RemoveItem(MenuItem item)
    {
       if(item.menu == this)
@@ -344,7 +344,7 @@ public:
          MenuItem menuItem { };
          ItemPtr ptr { item = menuItem };
          items.Add(ptr);
-         
+
          incref menuItem;
 
          itemCount++;
@@ -358,13 +358,13 @@ public:
          }
       }
    }
-   
+
    void AddDynamic(MenuItem addedItem, Window master, bool persistent)
    {
       if(addedItem)
       {
          ItemPtr ptr = null, oldItemPtr;
-         
+
          for(oldItemPtr = items.first; oldItemPtr; oldItemPtr = oldItemPtr.next)
          {
             if((oldItemPtr.item.subMenu || oldItemPtr.item.placement) && !strcmpTillTab(ITEM_TEXT(oldItemPtr.item), ITEM_TEXT(addedItem)))
@@ -404,11 +404,11 @@ public:
          addedItem.menu = this;
       }
    }
-   
+
    MenuItem FindItem(bool (* Window::notifySelect)(MenuItem selection, Modifiers mods), uint64 id)
    {
       ItemPtr ptr;
-      
+
       for(ptr = items.first; ptr; ptr = ptr.next)
       {
          MenuItem item = ptr.item;
@@ -437,7 +437,7 @@ public:
             ptr.item = ptr.oldItem;
             ptr.oldItem = null;
             delete ptr.item;
-         }      
+         }
          items.Delete(ptr);
       }
    }
@@ -541,7 +541,7 @@ public:
                      itemCount++;
                   }
                }
-            
+
                if(!beingMergedItem.isDivider || (previous.item && !previous.item.isDivider))
                {
                   mergeIntoItemPtr = ItemPtr { };
@@ -571,7 +571,7 @@ public:
          }
          else if(item.subMenu)
             item.subMenu.Clean(window);
-          
+
          if(ptr.inserted.deleteItem)
             delete item;
 
@@ -592,7 +592,7 @@ public:
    Menu FindMenu(char * name)
    {
       ItemPtr ptr;
-      
+
       for(ptr = items.first; ptr; ptr = ptr.next)
       {
          MenuItem item = ptr.item;
@@ -638,13 +638,13 @@ public class PopupMenu : Window
    int rw, rh;
    int totalHeight;
    Menu menu;
-   ItemPtr selected;   
+   ItemPtr selected;
    bool pressed;
    bool altDown;
    bool keyboardFocus;
    bool mouseInput;
    Time unpressedTime;
-   
+
    void (* FontExtent)(Display display, Font font, char * text, int len, int * width, int * height);
 
    FontResource boldFont { faceName = font.faceName, font.size, bold = true, window = this };
@@ -693,8 +693,8 @@ public class PopupMenu : Window
    {
       ItemPtr selected, current = this.selected;
       for(selected = (current && current.prev) ? current.prev : menu.items.last;
-            selected && 
-            (selected.item.isDivider || selected.item.placement || ITEM_DISABLED(selected.item)) && 
+            selected &&
+            (selected.item.isDivider || selected.item.placement || ITEM_DISABLED(selected.item)) &&
             selected != current;
             selected = selected.prev ? selected.prev : menu.items.last)
       {
@@ -708,8 +708,8 @@ public class PopupMenu : Window
    {
       ItemPtr selected, current = this.selected;
       for(selected = (current && current.next) ? current.next : menu.items.first;
-            selected && 
-            (selected.item.isDivider || selected.item.placement || ITEM_DISABLED(selected.item)) && 
+            selected &&
+            (selected.item.isDivider || selected.item.placement || ITEM_DISABLED(selected.item)) &&
             selected != current;
             selected = selected.next ? selected.next : menu.items.first)
       {
@@ -768,7 +768,7 @@ public class PopupMenu : Window
             Window parent = this.parent;
             Window activeClient = parent.activeClient;
             bool systemButtons = activeClient && activeClient.state == maximized;
-            
+
             keyboardFocus = true;
             pressed = true;
 
@@ -835,7 +835,7 @@ public class PopupMenu : Window
             int y = 0;
             int selectedY = 0;
             ItemPtr ptr;
-            
+
             for(ptr = menu.items.first; ptr; ptr = ptr.next)
             {
                MenuItem item = ptr.item;
@@ -843,7 +843,7 @@ public class PopupMenu : Window
                if(item.placement) continue; //&& !ptr.inserted) continue;
                if(selected == ptr)
                {
-                  
+
                   selectedY = y;
                   break;
                }
@@ -870,7 +870,7 @@ public class PopupMenu : Window
       MenuItem selection = selectionPtr.item;
       if(!ITEM_DISABLED(selection))
       {
-         Window master = this;      
+         Window master = this;
 
          if(!isMenuBar)
             master = master.master;
@@ -879,7 +879,7 @@ public class PopupMenu : Window
             master = selectionPtr.master;
          while(eClass_IsDerived(master._class, _class) && master.master)
             master = master.master;
-            
+
          if(selection.checkable)
             selection.checked = !selection.checked;
          else if(selection.radio)
@@ -906,7 +906,7 @@ public class PopupMenu : Window
          MenuItem item = ptr.item;
          if(item.subMenu)
          {
-            if(!CheckAccelerators(item.subMenu, key)) 
+            if(!CheckAccelerators(item.subMenu, key))
                return false;
          }
          else if(!item.isDivider)
@@ -926,7 +926,7 @@ public class PopupMenu : Window
       Menu menu = this.menu;
       // Mouse moved inside menu
       ItemPtr selected = null;
-      
+
       *selectedX = 0;
       *selectedY = 0;
 
@@ -949,7 +949,7 @@ public class PopupMenu : Window
                if(!helpBreak)
                {
                   ItemPtr nextPtr;
-                  
+
                   int breakX = clientSize.w - (systemButtons ? 48 : 0);
                   for(nextPtr = ptr.next; nextPtr; nextPtr = nextPtr.next)
                   {
@@ -1052,7 +1052,7 @@ public class PopupMenu : Window
       else
       {
          // Shiny gradient for menu bar
-         ColorKey keys[2] = 
+         ColorKey keys[2] =
          {
             { white, 0 },
             { popupMenuColor, 1 }
@@ -1270,7 +1270,7 @@ public class PopupMenu : Window
                if(key && menu)
                {
                   ItemPtr ptr;
-                  
+
                   for(ptr = menu.items.first; ptr; ptr = ptr.next)
                   {
                      MenuItem item = ptr.item;
@@ -1382,7 +1382,7 @@ public class PopupMenu : Window
                      if(MenuGoToNextItem())
                         Update(null);
                      result = false;
-                  }         
+                  }
                   break;
                case end:
                   if(!isMenuBar)
@@ -1391,7 +1391,7 @@ public class PopupMenu : Window
                      if(MenuGoToPrevItem())
                         Update(null);
                      result = false;
-                  }         
+                  }
                   break;
                case left:
                   if(isMenuBar)
@@ -1517,7 +1517,7 @@ public class PopupMenu : Window
                   if(key && menu)
                   {
                      //ItemPtr ptr;
-                     
+
                      if(ch >= 32 && !isMenuBar)
                         return false;
                      /*
@@ -1647,9 +1647,9 @@ public class PopupMenu : Window
 
       if(this != masterMenuBar)
       {
-         if(!*w) 
+         if(!*w)
             *w = 80;
-         if(!*h) 
+         if(!*h)
             *h = 20;
       }
       return true;
@@ -1685,7 +1685,7 @@ public class PopupMenu : Window
          else
          {
             *x = Min(*x, parent.clientSize.w - w);
-            *y = Min(*y, parent.clientSize.h - h);   
+            *y = Min(*y, parent.clientSize.h - h);
          }
          if(parent == guiApp.desktop)
          {
@@ -1723,7 +1723,7 @@ public class PopupMenu : Window
             if(this.selected)
             {
                Menu childMenu = selected.item.subMenu;
-               
+
                this.pressed = pressed;
 
                if(this.selected.item.subMenu)
@@ -1949,7 +1949,7 @@ public class PopupMenu : Window
                         break;
                      }
                }
-               if(destroy) 
+               if(destroy)
                {
                   if(MenuDestroyMasters(false))
                      return false;
index afeb5d1..cdbbf7c 100644 (file)
@@ -33,7 +33,7 @@ public class PaneSplitter : Window
             property::split = split;
        }
    }
-         
+
    bool OnLeftButtonDown(int x, int y, Modifiers mods)
    {
       sliding = true;
@@ -48,7 +48,7 @@ public class PaneSplitter : Window
          startX = position.y;
       }
       Capture();
-      
+
       return true;
    }
 
@@ -123,7 +123,7 @@ public:
    {
       set { rightPane = value; property::split = split; } get { return rightPane; }
    }
-   property Window topPane 
+   property Window topPane
    {
       set { leftPane = value; property::split = split; } get { return leftPane; }
    }
@@ -165,7 +165,7 @@ public:
    property int split
    {
       set
-      {  
+      {
          split = value;
          if(orientation == vertical)
          {
@@ -191,7 +191,7 @@ public:
 
             scale = false;
          }
-      }      
+      }
       get { return split; }
    }
 
index 1c476bf..73a0883 100644 (file)
@@ -252,7 +252,7 @@ public class PathBox : CommonControl
          GetSystemPathBuffer(path, editBox.contents);
          if(!(path[0] == DIR_SEP && path[1] == DIR_SEP && (!path[2] || !strchr(&path[2], DIR_SEP))))
             exists = FileExists(path);
-         
+
          switch(typeExpected)
          {
             case any:
@@ -306,7 +306,7 @@ public:
             typeExpected = value;
             if(browseDialog && browseDialog.type == open && typeExpected == directory)
                browseDialog.type = selectDir;
-         }         
+         }
       }
    }
 
index a86ad0d..d5440df 100644 (file)
@@ -12,10 +12,10 @@ public class Picture : CommonControl
    inactive = true;
 
 public:
-   property Color tint { set { tint = value; } };   
+   property Color tint { set { tint = value; } };
    property BitmapResource image
    {
-      property_category $"Appearance" 
+      property_category $"Appearance"
       set
       {
          if(this)
@@ -43,7 +43,7 @@ public:
       {
          OnUnloadGraphics();
 
-         bitmapImage = value;         
+         bitmapImage = value;
 
          OnLoadGraphics();
       }
@@ -89,7 +89,7 @@ private:
          if(!bitmap)
          {
             bitmap = { };
-            
+
             if(hasHorzScroll || hasVertScroll)
                bitmap.Copy(bitmapImage);
             else if(bitmap.Allocate(null, clientSize.w, clientSize.h, 0, bitmapImage.pixelFormat, false))
@@ -146,10 +146,10 @@ private:
          else
             *w = 80;
       }
-         
+
       if(!size.h && (!anchor.top.type || !anchor.bottom.type))
       {
-         
+
          if(bitmap)
             *h = bitmap.height;
          else
@@ -178,14 +178,14 @@ private:
                if(zoomFactor < 25)
                {
                   float x = 0.5f, y = 0.5f;
-                  if(bitmap.width * zoomFactor > clientSize.w) 
+                  if(bitmap.width * zoomFactor > clientSize.w)
                      x = scroll.x / (bitmap.width * zoomFactor - clientSize.w);
-                  if(bitmap.height * zoomFactor > clientSize.h) 
+                  if(bitmap.height * zoomFactor > clientSize.h)
                      y = scroll.y / (bitmap.height * zoomFactor - clientSize.h);
 
                   zoomFactor *= 1.5;
                   SetScrollArea(
-                     (int)(bitmap.width * zoomFactor), 
+                     (int)(bitmap.width * zoomFactor),
                      (int)(bitmap.height * zoomFactor), false);
 
                   SetScrollPosition(
@@ -200,14 +200,14 @@ private:
                if(zoomFactor > 0.05)
                {
                   float x = 0.5f, y = 0.5f;
-                  if(bitmap.width * zoomFactor > clientSize.w) 
+                  if(bitmap.width * zoomFactor > clientSize.w)
                      x = scroll.x / (bitmap.width * zoomFactor - clientSize.w);
-                  if(bitmap.height * zoomFactor > clientSize.h) 
+                  if(bitmap.height * zoomFactor > clientSize.h)
                      y = scroll.y / (bitmap.height * zoomFactor - clientSize.h);
 
                   zoomFactor /= 1.5;
                   SetScrollArea(
-                     (int)(bitmap.width * zoomFactor), 
+                     (int)(bitmap.width * zoomFactor),
                      (int)(bitmap.height * zoomFactor), false);
 
                   SetScrollPosition(
@@ -234,21 +234,21 @@ private:
             int h = (int)(bitmap.height * zoomFactor);
             if(w == bitmap.width && h == bitmap.height)
             {
-               surface.Blit(bitmap, 
-                  Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2), 
+               surface.Blit(bitmap,
+                  Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2),
                   scroll.x,scroll.y, w, h);
             }
             else
             {
                if(filter)
-                  surface.Filter(bitmap, 
-                     Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2), 
-                     (int)(scroll.x / zoomFactor), (int)(scroll.y / zoomFactor), w, h, 
+                  surface.Filter(bitmap,
+                     Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2),
+                     (int)(scroll.x / zoomFactor), (int)(scroll.y / zoomFactor), w, h,
                      bitmap.width, bitmap.height);
                else
-                  surface.Stretch(bitmap, 
-                     Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2), 
-                     (int)(scroll.x / zoomFactor), (int)(scroll.y / zoomFactor), w, h, 
+                  surface.Stretch(bitmap,
+                     Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2),
+                     (int)(scroll.x / zoomFactor), (int)(scroll.y / zoomFactor), w, h,
                      bitmap.width, bitmap.height);
             }
          }
@@ -257,9 +257,9 @@ private:
             int w = bitmap.width;
             int h = bitmap.height;
             if(clientSize.w == bitmap.width && clientSize.h == bitmap.height)
-               surface.Blit(bitmap, 
+               surface.Blit(bitmap,
                   Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2),
-                  scroll.x,scroll.y, 
+                  scroll.x,scroll.y,
                   hasHorzScroll ? clientSize.w : bitmap.width, hasVertScroll ? clientSize.h : bitmap.height);
             else
             {
index a6cb29d..0af7218 100644 (file)
@@ -8,7 +8,7 @@ public class ProgressBar : CommonControl
 
    background = formColor;
    borderStyle = deep;
+
 public:
    property uint progress { property_category $"Data" set { position = value; Update(null); } get { return position; } };
    property uint range { property_category $"Data" set { range = value; Update(null); } get { return range; } };
index 8170a95..4c897b0 100644 (file)
@@ -63,7 +63,7 @@ public:
             // SNAPDOWN(position, lineStep);
 
          if(position < 0) position = 0;
-         if(position >= range) 
+         if(position >= range)
             position = range - 1;
 
          if(thumb)
@@ -84,7 +84,7 @@ public:
    property bool snap { property_category $"Behavior" set { sbStyle.snap = value; } get { return sbStyle.snap; } };
    property int range
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          total = value + seen - 1;
@@ -95,7 +95,7 @@ public:
    // Improve this, needs to be done in 2 so updates commented out for seen
    property int seen
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          if(this)
@@ -111,7 +111,7 @@ public:
    };
    property int total
    {
-      property_category $"Behavior" 
+      property_category $"Behavior"
       set
       {
          if(this)
@@ -186,7 +186,7 @@ private:
 
       bool NotifyPushed(Button button, int x, int y, Modifiers mods)
       {
-         action = up; 
+         action = up;
          Action(action, 0, Key { modifiers = mods });
          timer.Start();
          return true;
@@ -303,7 +303,7 @@ private:
    bool draggingThumb;
    Point pos, thumbClick;
    bool inside;
-   
+
    void OnRedraw(Surface surface)
    {
       int sbWidth = SB_WIDTH;
@@ -480,7 +480,7 @@ private:
             thumbSize = seen * size / total;
          }
          else
-            thumbSize = 0;      
+            thumbSize = 0;
 
          if(sbStyle.vertical)
          {
@@ -577,9 +577,9 @@ private:
       {
          case left:
          case up:     Action(up, 0, key); break;
-         case right: 
-         case down:   
-            Action(down, 0, key); 
+         case right:
+         case down:
+            Action(down, 0, key);
             break;
          case pageUp:   Action(pageUp, 0, key); break;
          case pageDown:  Action(pageDown, 0, key); break;
index 8d4a875..f742cd1 100644 (file)
@@ -22,7 +22,7 @@ static void DrawStipple(Surface surface, Size clientSize)
 
    surface.LineStipple(0x5555);
    surface.Rectangle(x1, y1, x2, y2);
-   surface.LineStipple(0);            
+   surface.LineStipple(0);
 }
 
 public class SelectorBar : Stacker
@@ -180,7 +180,7 @@ public:
             if(eClass_IsDerived(b._class, class(SelectorButton)) && b != this)
                b.checked = false;
          }
-         font = { font.faceName, font.size, bold = true }; 
+         font = { font.faceName, font.size, bold = true };
          // this should not be required: the font change should resize the control and Stacker should adapt automatically
          // why does it not?
          selector.OnResize(selector.clientSize.w, selector.clientSize.h);
@@ -239,15 +239,15 @@ public class EditableSelectorButton : SelectorButton
                   if(master && ((EditableSelectorButton)master).focusHolder)
                      ((EditableSelectorButton)master).focusHolder.Activate();
                   delete this;
-               }               
+               }
                return true;
             }
-            
+
             bool NotifyModified(EditBox editBox)
             {
                char * oldName = CopyString(text);
                char * newName = CopyString(editBox.contents);
-               
+
                if(OnRename(master, this, &oldName, &newName))
                {
                   SelectorBar selector = (SelectorBar)parent;
@@ -255,10 +255,10 @@ public class EditableSelectorButton : SelectorButton
                   if(selector)
                      selector.MakeControlVisible(this);
                }
-               
+
                delete oldName;
                delete newName;
-               
+
                //OnLeavingEdit();? //master.someControl.Activate();
                if(focusHolder)
                   focusHolder.Activate();
@@ -284,7 +284,7 @@ public class EditableSelectorButton : SelectorButton
             }
          };
          incref editBox;
-         editBox.contents = text;         
+         editBox.contents = text;
          editBox.Create();
          editBox.SetModified(false);
          editBox.SelectAll();
index 64bc6c8..b3e355d 100644 (file)
@@ -32,7 +32,7 @@ public:
    {
       if(this && field)
       {
-         field._statusBar = null; 
+         field._statusBar = null;
          width -= field.width + (guiApp.textMode ? 0 : 6);
          fields.Remove(field);
          delete field;
@@ -86,7 +86,7 @@ private:
 
       if(!guiApp.textMode)
          surface.ThinBevel(false, -1,0, clientSize.w+2, clientSize.h+1);
-      
+
       for(field = fields.first; field; field = field.next)
       {
          int x = position - field.width;
@@ -111,7 +111,7 @@ private:
             surface.Clip(clip);
             surface.TextExtent(field.text, strlen(field.text), &tw, null);
             surface.WriteTextf(x + (field.width - tw) / 2, 2, field.text);
-            surface.Clip(null);         
+            surface.Clip(null);
          }
          position -= field.width + (guiApp.textMode ? 0 : 6);
       }
@@ -123,7 +123,7 @@ private:
          surface.SetForeground(white);
       else
          surface.SetForeground(foreground);
-         
+
       surface.WriteTextf(2, 2, text);
       surface.Clip(null);
    }
@@ -159,7 +159,7 @@ public:
    }
    property Color color
    {
-      set 
+      set
       {
          if(this)
          {
index 180954e..d52628b 100644 (file)
@@ -19,7 +19,7 @@ class TabButton : Button
    {
       return true;
    }
-   
+
    bool OnLeftButtonDown(int x, int y, Modifiers mods)
    {
       Button::OnLeftButtonDown(x, y, mods);
@@ -130,7 +130,7 @@ class TabButton : Button
             surface.DrawLine(x+2,h-1, w-4, h-1);
             surface.PutPixel(x,h-3);
             surface.PutPixel(x+1,h-2);
-            
+
             surface.PutPixel(w-2, h - 3);
             surface.PutPixel(w-3, h - 2);
             break;
@@ -138,7 +138,7 @@ class TabButton : Button
             surface.DrawLine(x+2,0, w-4,0);
             surface.PutPixel(x, 2);
             surface.PutPixel(x+1, 1);
-            
+
             surface.PutPixel(w-2, 2);
             surface.PutPixel(w-3, 1);
             break;
@@ -146,7 +146,7 @@ class TabButton : Button
             surface.DrawLine(w-1,y+2, w-1, h-4);
             surface.PutPixel(w-3, y);
             surface.PutPixel(w-2, y+1);
-            
+
             surface.PutPixel(w - 3, h-2);
             surface.PutPixel(w - 2, h-3);
             break;
@@ -154,7 +154,7 @@ class TabButton : Button
             surface.DrawLine(0,y+2, 0, h-4);
             surface.PutPixel(2, y);
             surface.PutPixel(1, y+1);
-            
+
             surface.PutPixel(2, h-2);
             surface.PutPixel(1, h-3);
             break;
@@ -164,7 +164,7 @@ class TabButton : Button
       if(text)
          surface.TextExtent(text, strlen(text),&tw, &th);
       y = (clientSize.h - th - 1)/2 + (checked ? 0 : -2);
-      
+
       if(ellipsis)
       {
          int width = clientSize.w - 2*6;
@@ -199,7 +199,7 @@ class TabButton : Button
 
          surface.LineStipple(0x5555);
          surface.Rectangle(x1, y1, x2, y2);
-         surface.LineStipple(0);            
+         surface.LineStipple(0);
       }
    }
 }
@@ -296,7 +296,7 @@ public class TabControl : Window
             }
          }
          else
-            return true; 
+            return true;
       }
       return false;
    }
@@ -326,13 +326,13 @@ public class TabControl : Window
          {
             surface.SetForeground(gray);
             surface.Rectangle(0,1, size.w-1, CAPTION+1);
-            
+
             surface.SetForeground(white);
             surface.Rectangle(1, 1, clientSize.w-2, CAPTION-1);
 
-            surface.SetBackground(skinBackground);         
+            surface.SetBackground(skinBackground);
             surface.Area(2, 2, size.w-3, CAPTION+1);
-            
+
             surface.SetForeground((active ? skinTextColor : skinInactiveTextColor));
             surface.TextOpacity(false);
             surface.TextFont(captionFont);
@@ -340,7 +340,7 @@ public class TabControl : Window
             {
                int buttonsSize = border +
                   ((hasMaximize || hasMinimize) ? 52 : 18);
-               surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET, 
+               surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET,
                   size.w - (buttonsSize + border + 4), name, strlen(name));
             }
          }
@@ -366,15 +366,15 @@ public class TabControl : Window
       {
          surface.SetForeground(white);
          surface.Rectangle(
-            clientStart.x + 1 + (placement == left) * 80, 
-            clientStart.y + 1 + (placement == top) * 30, 
-            clientStart.x + clientSize.w - (placement == right) * 80 - 2, 
+            clientStart.x + 1 + (placement == left) * 80,
+            clientStart.y + 1 + (placement == top) * 30,
+            clientStart.x + clientSize.w - (placement == right) * 80 - 2,
             clientStart.y + clientSize.h - (placement == bottom) * 30 - 2);
          surface.SetForeground(gray);
          surface.Rectangle(
-            clientStart.x + (placement == left) * 80, 
-            clientStart.y + (placement == top) * 30, 
-            clientStart.x + clientSize.w - (placement == right) * 80 - 1, 
+            clientStart.x + (placement == left) * 80,
+            clientStart.y + (placement == top) * 30,
+            clientStart.x + clientSize.w - (placement == right) * 80 - 1,
             clientStart.y + clientSize.h - (placement == bottom) * 30 - 1);
       }
 
@@ -385,7 +385,7 @@ public class TabControl : Window
          Button button = curButton;
          int x = button.position.x;
          int y = button.position.y;
-         
+
          switch(placement)
          {
             case TabsPlacement::bottom:
@@ -409,7 +409,7 @@ public class TabControl : Window
          surface.SetForeground(white);
          switch(placement)
          {
-            case TabsPlacement::bottom:   surface.VLine(clientSize.h-32 + clientStart.y + 1, clientSize.h-28 + clientStart.y + 1, x + 1 + clientStart.x); break; 
+            case TabsPlacement::bottom:   surface.VLine(clientSize.h-32 + clientStart.y + 1, clientSize.h-28 + clientStart.y + 1, x + 1 + clientStart.x); break;
             case TabsPlacement::top:      surface.VLine(clientStart.y + 30, clientStart.y + 31, x + 1 + clientStart.x); break;
             case TabsPlacement::left:     surface.HLine(78 + clientStart.x, 81 + clientStart.x, y + 1 + clientStart.y); break;
             case TabsPlacement::right:    surface.HLine(clientStart.y + 30, clientStart.y + 31, y + 1 + clientStart.y); break;
@@ -677,7 +677,7 @@ public class TabControl : Window
             int pleft = button.anchor.left.distance, nleft = newButton ? newButton.anchor.left.distance : 0;
             int ptop = button.anchor.top.distance, ntop = newButton ? newButton.anchor.top.distance : 0;
             if(button == curButton) continue;
-            if((smartKey == left && (pleft < cleft || ptop < ctop) && (!newButton || pleft > nleft || ptop > ntop)) || 
+            if((smartKey == left && (pleft < cleft || ptop < ctop) && (!newButton || pleft > nleft || ptop > ntop)) ||
                (smartKey == right && (pleft > cleft || ptop > ctop) && (!newButton || pleft < nleft || pleft < ptop)))
                newButton = button;
          }
index e25515e..47a6ba6 100644 (file)
@@ -100,9 +100,9 @@ public class ToolTip : Window
          timer.Stop();
          position =
          {
-            pos.x + offset.x + tippedWindow.clientStart.x + 
+            pos.x + offset.x + tippedWindow.clientStart.x +
                tippedWindow.absPosition.x - parent.position.x;
-            pos.y + offset.y + tippedWindow.clientStart.y + 
+            pos.y + offset.y + tippedWindow.clientStart.y +
                tippedWindow.absPosition.y - parent.position.y;
          };
          Create();
@@ -325,5 +325,5 @@ public class ToolSeparator : Window
       surface.VLine(0, 23, 1);
       surface.foreground = white;
       surface.VLine(0, 23, 2);
-   } 
+   }
 }
index a013e9c..8c7fcd2 100644 (file)
@@ -23,13 +23,13 @@ static ColorAlpha Color_SVHA(float s, float v, float h, float a) { return Color_
 
 static ColorAlpha Color_aLbA(float A, float L, float B, float a)
 {
-   return ColorAlpha 
+   return ColorAlpha
    {
       (byte)Max(Min(a*255, 255), 0),
       ColorLab
-      { 
-         L * 100, 
-         (A * LAB_AB_RANGE) - (LAB_AB_RANGE+1)/2, 
+      {
+         L * 100,
+         (A * LAB_AB_RANGE) - (LAB_AB_RANGE+1)/2,
          (B * LAB_AB_RANGE) - (LAB_AB_RANGE+1)/2
       };
    };
@@ -64,15 +64,15 @@ class ColorPlane : Window
          fy = Min(Max(fy,0),1);
          switch((ColorPlaneType) id)
          {
-            case xyPlane: 
-               picker.x = fx; picker.y = fy; 
+            case xyPlane:
+               picker.x = fx; picker.y = fy;
                break;
             case zRamp:
-               picker.z = fy; 
+               picker.z = fy;
                picker.xyPlaneUpdate = true;
                break;
             case aRamp:
-               picker.w = fx; 
+               picker.w = fx;
                picker.xyPlaneUpdate = true;
                break;
          }
@@ -148,8 +148,8 @@ class ColorXYPlane : ColorPlane
                for(y = 0; y<256; y++)
                {
                   ColorAlpha color = ColorFunctions[picker.colorMode](
-                     (float)x / (256-1), 
-                     (float)(256-1-y) / (256-1), 
+                     (float)x / (256-1),
+                     (float)(256-1-y) / (256-1),
                      picker.z, picker.w);
 
                   surface.SetForeground(color);
@@ -161,7 +161,7 @@ class ColorXYPlane : ColorPlane
       }
 
       surface.Blit(bitmap, 0,0,0,0, clientSize.w, clientSize.h);
-      
+
       x = (int)(picker.x * (clientSize.w-1));
       y = (int)(clientSize.h-1-(picker.y * (clientSize.h-1)));
 
@@ -201,7 +201,7 @@ class ColorZRamp : ColorPlane
       for(z = 0; z<ch; z++)
       {
          ColorAlpha color = ColorFunctions[picker.colorMode](
-            picker.x, picker.y, 
+            picker.x, picker.y,
             (float)(ch-1-z) / (ch-1), picker.w);
 
          surface.SetForeground(color);
@@ -223,7 +223,7 @@ class ColorZRamp : ColorPlane
       for(a = 0; a<clientSize.w; a++)
       {
          ColorAlpha color = ColorFunctions[picker.colorMode](
-            picker.x, picker.y, 
+            picker.x, picker.y,
             picker.z, (float)a / (clientSize.w-1));
 
          surface.SetForeground(color);
@@ -250,7 +250,7 @@ public:
          Lab = rgb;
          cmyk = rgb;
          hsv = rgb;
-         
+
          UpdatePosition();
       }
       get { return argb; }
@@ -473,7 +473,7 @@ private:
          colorMode = (ColorSelectionMode)control.id;
          xyPlaneUpdate = true;
       }
-      
+
       UpdatePosition();
 
       return true;
@@ -551,7 +551,7 @@ private:
    EditBox a
    {
       this, position = { 442, 30 }, size = { 32, 20 };
-      
+
       bool NotifyModified(EditBox control)
       {
          ColorRGB rgb;
@@ -589,7 +589,7 @@ private:
    EditBox C
    {
       this, position = { 350, 150 }, size = { 32, 20 }, text = "C:", hotKey = altC;
-      
+
       bool NotifyModified(EditBox control)
       {
          ColorRGB rgb;
@@ -681,7 +681,7 @@ private:
 
       // position = { 330, 270 },
       // anchor = { right = 10, bottom = 32 };
-              
+
       bool NotifyModified(EditBox control)
       {
          ColorRGB rgb;
@@ -739,7 +739,7 @@ private:
    {
       this, isRadio = true, position = { 312, 10 }, id = ColorSelectionMode::selectH, text = "H:", hotKey = altH, checked = true;
       NotifyClicked = RadioClicked;
-   };   
+   };
 
    Button rS
    {
@@ -776,7 +776,7 @@ private:
       this, isRadio = true, position = { 312, 80 }, id = ColorSelectionMode::selectR, text = "R:", hotKey = altR;
       NotifyClicked = RadioClicked;
    };
-  
+
    Button rG
    {
       this, isRadio = true, position = { 312, 100 }, id = ColorSelectionMode::selectG, text = "G:", hotKey = altG;
@@ -871,7 +871,7 @@ private:
             surface.Area(0,0, 49, 49);
          }
       }
-   };   
+   };
 
    EditBox R
    {
@@ -900,9 +900,9 @@ private:
          aRamp.autoCreate = value;
          A.autoCreate = value;
          labelA.autoCreate = value;
-         if(value) clientSize.h = 275 + 50; else clientSize.h = 275; 
+         if(value) clientSize.h = 275 + 50; else clientSize.h = 275;
       }
-      get 
+      get
       {
          return hasAlpha;
       }
index 9f0e1bd..8729d1b 100644 (file)
@@ -13,7 +13,7 @@ default:
 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit;
 private:
 
-static char * iconNames[] = 
+static char * iconNames[] =
 {
    "<:ecere>places/folder.png",
    "<:ecere>status/folderOpen.png",
@@ -54,7 +54,7 @@ public enum FileNameType     // Had to be private, since icons member of FileDia
    textFile, webFile, pictureFile, soundFile,
    archiveFile, packageFile, opticalMediaImageFile; /* these (all previous) are sort equal */
 
-   /*property char * 
+   /*property char *
    {
       set
       {
@@ -162,7 +162,7 @@ public struct FileFilter
 public enum FileForceExtension { never, always, whenNoneGiven };
 public struct FileType
 {
-   char * name, * typeExtension; 
+   char * name, * typeExtension;
    FileForceExtension forceExtension;
 };
 
@@ -189,7 +189,7 @@ public struct FileName
          indentSize = 8;
       }
       textOffset = indent * indentSize + (icon ? (icon.width + 4) : 0);
-      
+
       surface.WriteTextDots
          (alignment, x + textOffset, y + 2, width - textOffset, name, strlen(name));
       if(icon)
@@ -314,7 +314,7 @@ public:
    // Stuff currently in config moving to FileDialog:
    property char * filePath { set { strcpy(filePath, value); } get { return (char *)filePath; } };
    property char * currentDirectory
-   { 
+   {
       set
       {
          GetWorkingDir(currentDirectory, MAX_DIRECTORY);
@@ -502,7 +502,7 @@ private:
             listing.name[1] == currentDirectory[1])
          {
    #endif
-            for(c = start; currentDirectory[c]; ) 
+            for(c = start; currentDirectory[c]; )
             {
                int len = 0;
                char ch;
@@ -510,7 +510,7 @@ private:
                for(;(ch = currentDirectory[c]) && (ch != '/' && ch != '\\'); c++)
                {
                   if(len < MAX_FILENAME)
-                     tmpDir[len++] = ch;  
+                     tmpDir[len++] = ch;
                }
                for(;(ch = currentDirectory[c]) && (ch == '/' || ch == '\\'); c++);
                tmpDir[len] = '\0';
@@ -544,7 +544,7 @@ private:
       {
          if(currentDirectory[0] == '\\' && currentDirectory[1] == '\\')
          {
-            for(c = 2; currentDirectory[c]; ) 
+            for(c = 2; currentDirectory[c]; )
             {
                int len = 0;
                char ch;
@@ -552,7 +552,7 @@ private:
                for(;(ch = currentDirectory[c]) && (ch != '/' && ch != '\\'); c++)
                {
                   if(len < MAX_FILENAME)
-                     tmpDir[len++] = ch;  
+                     tmpDir[len++] = ch;
                }
                for(;(ch = currentDirectory[c]) && (ch == '/' || ch == '\\'); c++);
                tmpDir[len] = '\0';
@@ -610,10 +610,10 @@ private:
       if(sizeFilters < sizeof(FileFilter) && !fileFilter)
          listing.extensions = null;
       else if(filters && fileFilter < sizeFilters / (int)sizeof(FileFilter))
-         listing.extensions = filters[fileFilter].extensions;    
+         listing.extensions = filters[fileFilter].extensions;
       else
          listing.extensions = customFilter.extensions;
-     
+
       listBox.Clear();
 
       fileName.indent = 0;
@@ -631,7 +631,7 @@ private:
                if(listing.stats.attribs.isShare) fileName.type = share;
                if(listing.stats.attribs.isCDROM) fileName.type = cdrom;
                if(listing.stats.attribs.isRemote) fileName.type = netDrive;
-               if(listing.stats.attribs.isRemovable) 
+               if(listing.stats.attribs.isRemovable)
                {
                   if(listing.name[0] == 'A' || listing.name[0] == 'B')
                      fileName.type = floppy;
@@ -675,7 +675,7 @@ private:
    #endif
          goUp.disabled = true;
       }
-      else 
+      else
          goUp.disabled = false;
 
       ListDrives();
@@ -742,7 +742,7 @@ private:
                   strcat(*selectedFileName, name);
                }
                else
-   #endif            
+   #endif
                strcat(*selectedFileName, fileName->name);
                if(selection.count > 1) strcat(*selectedFileName, "\"");
             }
@@ -785,7 +785,7 @@ private:
       bool result = true;
       FileAttribs exists = 0;
       char * wildcardPointer = strstr(fileName, "*");
-      
+
       if(wildcardPointer)
       {
          if(style != selectDir)
@@ -800,8 +800,8 @@ private:
             while(pointer)
             {
                if(pointer[1] == '.' && pointer[2])
-                  pointer +=3; 
-               else 
+                  pointer +=3;
+               else
                   pointer ++;
                pointer = strstr(pointer, "*");
                numExtensions++;
@@ -839,7 +839,7 @@ private:
                                  extension[len++] = ch;
                            }
                            extension[len] = '\0';
-                     
+
                            if(!strcmpi(extension, compared))
                            {
                               matched = true;
@@ -880,7 +880,7 @@ private:
                char * name = new char[numExtensions * (4 + MAX_EXTENSION)];
 
                delete customFilter.extensions;
-            
+
                if(!strcmp(wildcardPointer, "*") || strstr(wildcardPointer, "*.*"))
                {
                   strcpy(name, $"All Files");
@@ -891,7 +891,7 @@ private:
                   customFilter.extensions = new char[numExtensions * (2 + MAX_EXTENSION)];
                   customFilter.extensions[0] = '\0';
                   name[0] = '\0';
-            
+
                   numExtensions = 0;
                   for(c = 0; wildcardPointer[c]; )
                   {
@@ -901,7 +901,7 @@ private:
                      for(;(ch = wildcardPointer[c]) && IS_ALUNDER(ch); c++)
                      {
                         if(len < MAX_EXTENSION)
-                           extension[len++] = ch;  
+                           extension[len++] = ch;
                      }
                      extension[len] = '\0';
 
@@ -912,7 +912,7 @@ private:
                      }
                      strcat(name, "*.");
                      strcat(name, extension);
-                     if(!extension[0]) 
+                     if(!extension[0])
                         strcat(customFilter.extensions, ".");
                      else
                         strcat(customFilter.extensions, extension);
@@ -933,7 +933,7 @@ private:
 
                delete name;
             }
-         
+
             filter.currentRow = filter.FindRow(fileFilter);
             ListFiles();
             result = true;
@@ -986,7 +986,7 @@ private:
          for(selection = selections.first; selection; selection = selection.next)
          {
             char * fileName = selection.data;
-            
+
             // For every file
             strcpy(currentFileName, currentDirectory);
             if(PathCat(currentFileName, fileName))
@@ -1043,7 +1043,7 @@ private:
 
                ListFiles();
             }
-            else 
+            else
             {
                // *** SAVING ONLY ****
                if(style == save)
@@ -1168,7 +1168,7 @@ private:
    DropBox filter
    {
       this, text = $"Filter:", anchor = { left = 96, right = 104, bottom = 16 }, hotKey = altR;
-      
+
       bool NotifySelect(DropBox control, DataRow row, Modifiers mods)
       {
          fileFilter = (int)(row ? row.tag : 0);
@@ -1214,7 +1214,7 @@ private:
          return true;
       }
    };
-      
+
    Label typeLabel
    {
       this, inactive = true, visible = false, anchor = { left = 8, bottom = 19 }, labeledWindow = type;
@@ -1323,7 +1323,7 @@ private:
          #endif
             if(indent < fileName->indent)
             {
-               for(; currentDirectory[c]; ) 
+               for(; currentDirectory[c]; )
                {
                   int len = 0;
                   char ch;
@@ -1332,7 +1332,7 @@ private:
                   for(;(ch = currentDirectory[c]) && (ch != '/' && ch != '\\'); c++)
                   {
                      if(len < MAX_FILENAME)
-                        directory[len++] = ch;  
+                        directory[len++] = ch;
                   }
                   for(;(ch = currentDirectory[c]) && (ch == '/' || ch == '\\'); c++);
                   directory[len] = '\0';
@@ -1350,7 +1350,7 @@ private:
    };
 
    DataField lookInField { dataType = "FileName", userData = this };
-   
+
    Label lookInLabel
    {
       this, position = { 10, 11 }, labeledWindow = lookIn;
@@ -1553,7 +1553,7 @@ private:
          return true;
       }
    };
-   
+
    Button cancel
    {
       parent = this, position = { 140, 60 }, size = { 60 }, hotKey = escape, text = $"Cancel";
index d323e6c..5f74772 100644 (file)
@@ -30,7 +30,7 @@ private:
    {
       this, isCheckbox = true, text = $"Match case", position = { 10, 60 }, hotKey = altC
    };
-      
+
    Button searchUp
    {
       this, isRadio = true, text = $"Up", position = { 220, 50 }, hotKey = altU
@@ -71,7 +71,7 @@ private:
    Button cancel
    {
       this, text = $"Cancel", anchor = Anchor { right = 10, top = 45 }, size = { 80 }, hotKey = escape;
-      
+
       bool NotifyClicked(Button control, int x, int y, Modifiers mods)
       {
          findWhat.Activate();
index 74a28a1..f5d6c9c 100644 (file)
@@ -44,11 +44,11 @@ private:
       this, text = $"Close", hotKey = escape, anchor = { right = 10, top = 45 }, size = { 80 };
       NotifyClicked = ButtonCloseDialog;
    };
-   
+
    EditBox lineBox
    {
       this, text = $"Line number:", anchor = { left = 120, right = 100, top = 10 }, size.h = 20, hotKey = altL;
-      
+
       void NotifyUpdate(EditBox editBox)
       {
          goTo.disabled = atoi(lineBox.contents) ? false : true;
index dcfea1b..2193736 100644 (file)
@@ -47,7 +47,7 @@ public:
             }
          }
       }
-   }; 
+   };
 
 private:
    MessageBoxType style;
index 88cef7b..1c27681 100644 (file)
@@ -12,7 +12,7 @@ public class ReplaceDialog : Window
    background = formColor;
    minClientSize = { 432, 144 };
    text = $"Replace";
-  
+
 public:
    property EditBox editBox
    {
@@ -91,7 +91,7 @@ private:
          // If in whole file mode, the starting position is the end of the replace
          else
             editBox.GetSelPos(
-               null, &this.y, &this.x, 
+               null, &this.y, &this.x,
                null, null, null, true);
       }
 
@@ -292,8 +292,8 @@ private:
                   &line, &this.y, &this.x, true);
             // If in whole file mode, the starting position is the end of the replace
             else
-               editBox.GetSelPos( 
-                  null, &this.y, &this.x, 
+               editBox.GetSelPos(
+                  null, &this.y, &this.x,
                   null, null, null, true);
          }
 
@@ -315,7 +315,7 @@ private:
             EditBoxFindResult findResult;
 
             if(selectionOnly)
-               findResult = editBox.FindInSelection(searchString, 
+               findResult = editBox.FindInSelection(searchString,
                                wholeWord, matchCase,
                                line, this.y, this.x);
             else
index 4265f2e..3f38904 100644 (file)
@@ -44,7 +44,7 @@ private:
       {
          return ok.NotifyClicked(this, ok, x, y, mods);
       }
-   };    
+   };
 
    Label label
    {
index 9b8c943..5b467f1 100644 (file)
@@ -794,7 +794,7 @@ class AndroidInterface : Interface
       if(window && window.windowData)
       {
       }
-   }  
+   }
 
    void ClearClipboard()
    {
@@ -808,7 +808,7 @@ class AndroidInterface : Interface
    {
       bool result = false;
       if((clipBoard.text = new0 byte[size]))
-         result = true;   
+         result = true;
       return result;
    }
 
@@ -880,7 +880,7 @@ class AndroidInterface : Interface
    void SetTimerResolution(uint hertz)
    {
       // timerDelay = hertz ? (1000000 / hertz) : MAXINT;
-   }  
+   }
 
    bool SetIcon(Window window, BitmapResource resource)
    {
@@ -1099,7 +1099,7 @@ class AndroidActivity : AndroidAppGlue
          //PrintLn("Got a motion input event: ", action);
          /*
          if(action == 8) //AMOTION_EVENT_ACTION_SCROLL)
-            axis = AMotionEvent_getAxisValue(event, 9, index); //AMOTION_EVENT_AXIS_VSCROLL); 
+            axis = AMotionEvent_getAxisValue(event, 9, index); //AMOTION_EVENT_AXIS_VSCROLL);
          */
 
          AInputQueue_finishEvent(inputQueue, event, 1);
@@ -1245,7 +1245,7 @@ class AndroidActivity : AndroidAppGlue
 
       {
          Module app;
-          
+
          // Evolve the Application class into a GuiApplication
          eInstance_Evolve((Instance *)&__androidCurrentModule, class(GuiApplication));
 
index 939d695..e4afbf9 100644 (file)
@@ -106,9 +106,9 @@ static void AddMessagesToQueue(int ch)
       if(ch == 0x1B) //Escaped = true;
       {
          ch = getch();
-#ifdef NCDEBUG            
+#ifdef NCDEBUG
          fprintf(f, "  \\e: %d\n",ch);
-#endif            
+#endif
          if((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9'))
          {
             key = characters2Key[ch];
@@ -119,11 +119,11 @@ static void AddMessagesToQueue(int ch)
             ch = getch();
 #ifdef NCDEBUG
             fprintf(f, "   [: %d\n",ch);
-#endif               
+#endif
             ch1 = getch();
 #ifdef NCDEBUG
             fprintf(f, "   MOD: %c\n",ch1);
-#endif      
+#endif
             if(ch == '[')
             {
                if(ch1 == 'A') key = f1;
@@ -143,7 +143,7 @@ static void AddMessagesToQueue(int ch)
                switch(ch)
                {
                   case '1': case '7': key = home; break;
-                  case '2': key = insert; break; 
+                  case '2': key = insert; break;
                   case '3': key = del; break;
                   case '4': case '8': key = end; break;
                   case '5': key = pageUp; break;
@@ -162,7 +162,7 @@ static void AddMessagesToQueue(int ch)
             ch = getch();
 #ifdef NCDEBUG
             fprintf(f, "   O: %d\n",ch);
-#endif               
+#endif
             keyFlags.ctrl = true;
             switch(ch)
             {
@@ -180,7 +180,7 @@ static void AddMessagesToQueue(int ch)
                key = escape;
                ch = 27;
             }
-            else 
+            else
                ch = 0;
             /*else
             {
@@ -188,7 +188,7 @@ static void AddMessagesToQueue(int ch)
             }*/
          }
       }
-      else if(ch<256) 
+      else if(ch<256)
       {
          key = characters2Key[ch];
          if(!key && ch <= 26)
@@ -252,7 +252,7 @@ static void AddMessagesToQueue(int ch)
                if(event.bstate & BUTTON1_PRESSED)
                {
                   Time time = GetTime();
-                  if(time - lastTime[0] < DBLCLICK_DELAY && 
+                  if(time - lastTime[0] < DBLCLICK_DELAY &&
                      Abs(mousePosition.x - lastPos[0].x) < DBLCLICK_DELTA &&
                      Abs(mousePosition.y - lastPos[0].y) < DBLCLICK_DELTA)
                      AddMsg(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftDoubleClick, x, y, keyFlags);
@@ -266,7 +266,7 @@ static void AddMessagesToQueue(int ch)
                if(event.bstate & BUTTON3_PRESSED)
                {
                   Time time = GetTime();
-                  if(time - lastTime[2] < DBLCLICK_DELAY && 
+                  if(time - lastTime[2] < DBLCLICK_DELAY &&
                      Abs(mousePosition.x - lastPos[2].x) < DBLCLICK_DELTA &&
                      Abs(mousePosition.y - lastPos[2].y) < DBLCLICK_DELTA)
                      AddMsg(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightDoubleClick, x, y, keyFlags);
@@ -280,7 +280,7 @@ static void AddMessagesToQueue(int ch)
                if(event.bstate & BUTTON2_PRESSED)
                {
                   Time time = GetTime();
-                  if(time - lastTime[1] < DBLCLICK_DELAY && 
+                  if(time - lastTime[1] < DBLCLICK_DELAY &&
                      Abs(mousePosition.x - lastPos[1].x) < DBLCLICK_DELTA &&
                      Abs(mousePosition.y - lastPos[1].y) < DBLCLICK_DELTA)
                      AddMsg(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleDoubleClick, x, y, keyFlags);
@@ -346,7 +346,7 @@ class NCursesInterface : Interface
 
       byte c = 0,f,b;
       initscr();
-      
+
       SetLoggingMode(buffer, null);
       if((bool)has_colors())
       {
@@ -355,7 +355,7 @@ class NCursesInterface : Interface
             for(f=0; f<8; f++)
                init_pair(c++,colorMap[f],colorMap[b]);
       }
-     
+
       printf( "\033(U\017");
       fflush(stdout);
       intrflush(stdscr, (_Bool)false);
@@ -383,7 +383,7 @@ class NCursesInterface : Interface
        ncursesMutex = Mutex { };
 
       ncursesTerminate = false;
-      
+
       ncursesThread = Thread { };
       incref ncursesThread;
       ncursesThread.Main = NCursesThread;
@@ -605,7 +605,7 @@ class NCursesInterface : Interface
       }
       else
          caretVisible = false;
-   }  
+   }
 
    // --- Clipboard manipulation ---
 
@@ -618,7 +618,7 @@ class NCursesInterface : Interface
    {
       bool result = false;
       if((clipBoard.text = new char[size]))
-         result = true;   
+         result = true;
       return result;
    }
 
index c66c21b..c2caa74 100644 (file)
@@ -16,7 +16,7 @@ import "instance"
 import "Display"
 
 default:
-WINBASEAPI HWND WINAPI GetConsoleWindow (); 
+WINBASEAPI HWND WINAPI GetConsoleWindow ();
 
 private:
 
@@ -154,7 +154,7 @@ class Win32ConsoleInterface : Interface
                   }
                   else
                   {
-                     keys[key] = (byte)bool::false;   
+                     keys[key] = (byte)bool::false;
                      guiApp.desktop.KeyMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyUp,keyFlags,ch);
                   }
                   break;
@@ -214,7 +214,7 @@ class Win32ConsoleInterface : Interface
                      default:
                         if(buttonState.left && !(lastButtonState.left))
                            guiApp.desktop.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonDown,
-                              mousePosition.x, mousePosition.y, &keyFlags, false, 
+                              mousePosition.x, mousePosition.y, &keyFlags, false,
                               (event.Event.MouseEvent.dwEventFlags == DOUBLE_CLICK) ? false : true) ;
                         else if(buttonState.middle && !(lastButtonState.middle))
                            guiApp.desktop.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonDown,
@@ -239,8 +239,8 @@ class Win32ConsoleInterface : Interface
                }
                case WINDOW_BUFFER_SIZE_EVENT:
                {
-                  COORD coord = 
-                  { 
+                  COORD coord =
+                  {
                      event.Event.WindowBufferSizeEvent.dwSize.X,
                      event.Event.WindowBufferSizeEvent.dwSize.Y
                   };
@@ -420,14 +420,14 @@ class Win32ConsoleInterface : Interface
    void SetCaret(int x, int y, int size)
    {
       COORD coords = { (short)(x / textCellW), (short)(y / textCellH) };
-      CONSOLE_CURSOR_INFO cursor = 
-      { 
-         size ? size : 99, 
+      CONSOLE_CURSOR_INFO cursor =
+      {
+         size ? size : 99,
          (size && x >= 0 && y >= 0 && x < guiApp.desktop.clientSize.w && y < guiApp.desktop.clientSize.h) ? TRUE : FALSE
       };
       SetConsoleCursorInfo(hStdout, &cursor);
       SetConsoleCursorPosition(hStdout, coords);
-   }  
+   }
 
    // --- Clipboard manipulation ---
 
index a729512..1514b0c 100644 (file)
@@ -229,7 +229,7 @@ void AeroSnapPosition(Window window, int x, int y, int w, int h)
 class Win32Interface : Interface
 {
    class_property(name) = "Win32";
-   
+
    void ::RepositionDesktop(bool updateChildren)
    {
       int c;
@@ -243,7 +243,7 @@ class Win32Interface : Interface
       static double lastAutoHideCheck = 0;
       int newTaskBarState = taskBarState;
       HMONITOR primaryMonitor;
-            
+
       time = GetTime();
       if(time - lastTime < 0.1) return;
       lastTime = time;
@@ -272,7 +272,7 @@ class Win32Interface : Interface
       memcpy(lastMonitorAreas, monitorAreas, sizeof(monitorAreas));
 
       guiApp.virtualScreen =
-      { 
+      {
          GetSystemMetrics(SM_CXVIRTUALSCREEN),
          GetSystemMetrics(SM_CYVIRTUALSCREEN)
       };
@@ -332,7 +332,7 @@ class Win32Interface : Interface
                }
             }
          }
-   
+
         if(c < monitor ||
          placement.rcNormalPosition.left != taskBarPlacement.rcNormalPosition.left ||
          placement.rcNormalPosition.top != taskBarPlacement.rcNormalPosition.top ||
@@ -366,7 +366,7 @@ class Win32Interface : Interface
       Key key;
       // UNICODE FIX
       bool frenchShift = (ch < 0x10000) ? (((VkKeyScan((uint16)ch) >> 8) & 6) == 6) : false;
-      
+
       if(msg == WM_CHAR || msg == WM_DEADCHAR)
       {
          wParam = 0;
@@ -395,7 +395,7 @@ class Win32Interface : Interface
          code.ctrl = true;
       if(key != leftAlt && key != rightAlt && ::GetKeyState(VK_MENU) & 0x80000 && !frenchShift)
          code.alt = true;
-      
+
       if(msg == WM_MOUSEWHEEL)
       {
          result = window.KeyMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit, code, 0);
@@ -407,10 +407,10 @@ class Win32Interface : Interface
          if(::GetKeyState(VK_CAPITAL))
             ch = toupper(ch);
          */
-         
+
          if(msg == WM_KEYUP || msg == WM_SYSKEYUP)
          {
-            result = window.KeyMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyUp, code, ch); 
+            result = window.KeyMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyUp, code, ch);
          }
          else
          {
@@ -431,7 +431,7 @@ class Win32Interface : Interface
                result = window.KeyMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit, code,ch);
          }
       }
-               
+
       return result;
    }
 
@@ -463,7 +463,7 @@ class Win32Interface : Interface
                   if(wParam)
                   {
                      Window modalRoot = window.FindModal();
-                     
+
                      HWND modalWindow = modalRoot ? modalRoot.windowHandle : null;
 
                      FLASHWINFO flashInfo = { 0 };
@@ -510,7 +510,7 @@ class Win32Interface : Interface
                {
                   for(window = guiApp.desktop.firstChild; window; window = window.next)
                      SetWindowPos(window.windowHandle, window.style.stayOnTop ? HWND_TOPMOST : HWND_TOP, 0,0,0,0,
-                        SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOSIZE); //|SWP_NOREDRAW); 
+                        SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOSIZE); //|SWP_NOREDRAW);
                   activateApp = false;
                }
 
@@ -546,20 +546,20 @@ class Win32Interface : Interface
                   else
                   {
                      Window window;
-                     
+
                      if(wParam && !guiApp.desktop.active /*&& lParam != GetCurrentThreadID()*/)
                      {
                         activateApp = true;
                         /*
                         for(window = guiApp.desktop.firstChild; window; window = window.next)
                            SetWindowPos(window.windowHandle, window.style.stayOnTop ? HWND_TOPMOST : HWND_TOP, 0,0,0,0,
-                              SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOSIZE); //|SWP_NOREDRAW); 
-                        */ 
+                              SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOMOVE|SWP_NOSIZE); //|SWP_NOREDRAW);
+                        */
                      }
                      guiApp.SetAppFocus((bool)wParam);
                   }
                }
-               else 
+               else
                   guiApp.SetAppFocus((bool)wParam);
                break;
             case WM_PAINT:
@@ -579,20 +579,20 @@ class Win32Interface : Interface
                   BoxItem item = window.dirtyArea.count ? (BoxItem)ACCESS_ITEM(window.dirtyArea, window.dirtyArea.first) : null;
 
                   BeginPaint(windowHandle, &ps);
-                  
+
                   // Prevent flickering if we're going to update anyways
                   /*
-                  printf("   Paint message (%d, %d)-(%d, %d)\n", 
+                  printf("   Paint message (%d, %d)-(%d, %d)\n",
                      item ? item.box.left : 0,
                      item ? item.box.top : 0,
                      item ? item.box.right : 0,
                      item ? item.box.bottom : 0);
                   */
-                  // Causes redraw bug...      
+                  // Causes redraw bug...
                   if(!window.manageDisplay || !item ||
-                     item.box.left > 0 || 
+                     item.box.left > 0 ||
                      item.box.top > 0 ||
-                     item.box.right < window.size.w - 1 || 
+                     item.box.right < window.size.w - 1 ||
                      item.box.bottom < window.size.h - 1)
                   {
                      Box box { ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right-1, ps.rcPaint.bottom-1 };
@@ -612,7 +612,7 @@ class Win32Interface : Interface
                {
                   lastBits = (int)wParam;
                   lastRes = (int)lParam;
-               
+
                   externalDisplayChange = true;
                   if(guiApp.desktop.DisplayModeChanged())
                   {
@@ -629,14 +629,14 @@ class Win32Interface : Interface
             // Keyboard Messages
             case WM_SYSKEYDOWN:
             case WM_KEYDOWN:
-            case WM_SYSKEYUP: 
+            case WM_SYSKEYUP:
             case WM_KEYUP:
-            case WM_CHAR: 
-            //case WM_DEADCHAR: 
+            case WM_CHAR:
+            //case WM_DEADCHAR:
             {
                MSG charMsg;
                DWORD min, max;
-               
+
                if(msg != WM_CHAR && window.composing)
                   break;
 
@@ -772,7 +772,7 @@ class Win32Interface : Interface
                   return HTCLIENT;
 
             // Mouse Messages
-            case WM_LBUTTONUP:  
+            case WM_LBUTTONUP:
             case WM_RBUTTONUP:
             case WM_MBUTTONUP:
             case WM_LBUTTONDOWN:
@@ -784,7 +784,7 @@ class Win32Interface : Interface
             case WM_MOUSEMOVE:
                x = window.absPosition.x;
                y = window.absPosition.y;
-            /*case WM_NCLBUTTONUP:  
+            /*case WM_NCLBUTTONUP:
             case WM_NCRBUTTONUP:
             case WM_NCMBUTTONUP:
             case WM_NCLBUTTONDOWN:
@@ -797,7 +797,7 @@ class Win32Interface : Interface
             {
                Modifiers code = 0;
                bool consequential = false;
+
                x += (short)LOWORD(lParam);
                y += (short)HIWORD(lParam);
 
@@ -813,7 +813,7 @@ class Win32Interface : Interface
                if(wParam & MK_LBUTTON) code.left = true;
                if(wParam & MK_MBUTTON) code.middle = true;
                if(wParam & MK_RBUTTON) code.right = true;
-               
+
                if(msg == WM_MOUSEMOVE)
                {
                   if(lastPos.x == x && lastPos.y == y)
@@ -835,7 +835,7 @@ class Win32Interface : Interface
                         break;
                   //case WM_NCLBUTTONDOWN:
                   case WM_LBUTTONDOWN:
-                     window.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonDown,x,y,&code, false, 
+                     window.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonDown,x,y,&code, false,
                                              /*(msg == WM_LBUTTONDBLCLK) ? false: */true);
                      break;
                   //case WM_NCLBUTTONUP:
@@ -846,7 +846,7 @@ class Win32Interface : Interface
                         break;
                   //case WM_NCMBUTTONDOWN:
                   case WM_MBUTTONDOWN:
-                     window.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonDown, x,y,&code, false, 
+                     window.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonDown, x,y,&code, false,
                                              (msg == WM_LBUTTONDBLCLK) ? false: true);
                      break;
                   //case WM_NCMBUTTONUP:
@@ -859,7 +859,7 @@ class Win32Interface : Interface
                         break;
                   //case WM_NCRBUTTONDOWN:
                   case WM_RBUTTONDOWN:
-                     window.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonDown, x,y,&code, false, 
+                     window.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonDown, x,y,&code, false,
                                              (msg == WM_LBUTTONDBLCLK) ? false: true);
                      break;
                   //case WM_NCRBUTTONUP:
@@ -1014,15 +1014,15 @@ class Win32Interface : Interface
 
    bool CALLBACK ::JoystickAxesCallback( const DIDEVICEOBJECTINSTANCE* pdidoi, void * context )
    {
-      DIPROPRANGE diprg; 
+      DIPROPRANGE diprg;
       IDirectInputDevice2 * curJoy = (IDirectInputDevice2 *)context;
 
-      diprg.diph.dwSize       = sizeof(DIPROPRANGE); 
-      diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER); 
-      diprg.diph.dwHow        = DIPH_BYOFFSET; 
+      diprg.diph.dwSize       = sizeof(DIPROPRANGE);
+      diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER);
+      diprg.diph.dwHow        = DIPH_BYOFFSET;
       diprg.diph.dwObj        = pdidoi->dwOfs;
-      diprg.lMin              = -128; 
-      diprg.lMax              = 127; 
+      diprg.lMin              = -128;
+      diprg.lMax              = 127;
       if(curJoy->lpVtbl->SetProperty(curJoy, DIPROP_RANGE, &diprg.diph))
          return DIENUM_STOP;
       return DIENUM_CONTINUE;
@@ -1032,7 +1032,7 @@ class Win32Interface : Interface
    void ::TerminateDirectInput()
    {
       int j;
-      if (directMouse) 
+      if (directMouse)
       {
          directMouse->lpVtbl->Unacquire(directMouse);
          directMouse->lpVtbl->Release(directMouse);
@@ -1041,7 +1041,7 @@ class Win32Interface : Interface
    #ifndef ECERE_NOJOYSTICK
       for(j=0; j<numJoysticks; j++)
       {
-         if (directJoysticks[j]) 
+         if (directJoysticks[j])
          {
             directJoysticks[j]->lpVtbl->Unacquire(directJoysticks[j]);
             directJoysticks[j]->lpVtbl->Release(directJoysticks[j]);
@@ -1050,7 +1050,7 @@ class Win32Interface : Interface
       }
       numJoysticks = 0;
    #endif
-      if(dInput) 
+      if(dInput)
       {
          dInput->lpVtbl->Release(dInput);
          dInput = null;
@@ -1087,7 +1087,7 @@ class Win32Interface : Interface
                dInput->lpVtbl->EnumDevices(dInput, DIDEVTYPE_JOYSTICK, JoystickCallback, null, DIEDFL_ATTACHEDONLY );
                for(j=0; j<NUMJOY; j++)
                   if(directJoysticks[j])
-                     if(!directJoysticks[j]->lpVtbl->SetDataFormat(directJoysticks[j], &c_dfDIJoystick )) 
+                     if(!directJoysticks[j]->lpVtbl->SetDataFormat(directJoysticks[j], &c_dfDIJoystick ))
                         directJoysticks[j]->lpVtbl->EnumObjects(directJoysticks[j], JoystickAxesCallback, directJoysticks[j], DIDFT_AXIS );
    #endif
                result = true;
@@ -1111,7 +1111,7 @@ class Win32Interface : Interface
                directMouse->lpVtbl->SetCooperativeLevel(directMouse, /*fullScreenMode ? */windowHandle /*: HWND_DESKTOP*/, DISCL_EXCLUSIVE|DISCL_FOREGROUND);
                directMouse->lpVtbl->Acquire(directMouse);
             }
-            else 
+            else
                directMouse->lpVtbl->Unacquire(directMouse);
          }
    #ifndef ECERE_NOJOYSTICK
@@ -1161,10 +1161,10 @@ class Win32Interface : Interface
    // --- User Interface System ---
    bool Initialize()
    {
-      WNDCLASS wcl = 
-      { 
-         CS_DBLCLKS, ApplicationWindow, 0L, 0L, 0, 
-         LoadIcon(null, IDI_APPLICATION), 
+      WNDCLASS wcl =
+      {
+         CS_DBLCLKS, ApplicationWindow, 0L, 0L, 0,
+         LoadIcon(null, IDI_APPLICATION),
          null,
          null,
          null,
@@ -1203,7 +1203,7 @@ class Win32Interface : Interface
          1000.0 / 500.0,
          TimerProc,0,TIME_PERIODIC);
          */
-      
+
    /*
       topWindow = CreateWindowEx(0, className, "",WS_POPUP,0,0,1,1,HWND_DESKTOP,
          null, hInstance, null);
@@ -1224,7 +1224,7 @@ class Win32Interface : Interface
       if(hiResTimer) timeKillEvent(hiResTimer);
       if(hertz)
          hiResTimer = timeSetEvent(1000 / hertz, 1000 / hertz, TimerProc, 0, TIME_PERIODIC);
-   }  
+   }
 
    bool ProcessInput(bool processAll)
    {
@@ -1345,13 +1345,13 @@ class Win32Interface : Interface
       {
          windowHandle = CreateWindowEx(0, className, text,
                         WS_POPUP,
-                        0,0,GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN), 
-                        HWND_DESKTOP, 
+                        0,0,GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN),
+                        HWND_DESKTOP,
                         null, hInstance, null);
          ShowWindow(windowHandle, SW_SHOWNORMAL);
       }
       else if(window.systemParent)
-         windowHandle = CreateWindowEx(0, className, text, 
+         windowHandle = CreateWindowEx(0, className, text,
          WS_CHILD,0,0,1,1, window.systemParent, null, hInstance, null);
       else
       {
@@ -1364,7 +1364,7 @@ class Win32Interface : Interface
 
          if(rootWindow && (window._isModal || window.style.interim))
             parentWindow = rootWindow.is3D ? rootWindow.parent.windowHandle : rootWindow.windowHandle;
-            
+
          if(window.alphaBlend)
          // if(window.background.a < 255) //&& window.style & ES_REDRAW) Not needed anymore?
             exStyle |= WS_EX_LAYERED; // | WS_EX_TRANSPARENT;
@@ -1401,7 +1401,7 @@ class Win32Interface : Interface
             windowHandle = CreateWindowEx(
                exStyle,
                className, text,
-               style | (window.systemParent ? WS_CHILD : 
+               style | (window.systemParent ? WS_CHILD :
                (WS_POPUP | (window.style.hasMinimize ? WS_MINIMIZEBOX : 0))),
                   0,0,1,1, parentWindow, null, hInstance, null);
    #if 0
@@ -1509,7 +1509,7 @@ class Win32Interface : Interface
 #endif
             // SetLayeredWindowAttributes(window.windowHandle, 0, 255 /*Max(A(window.background),1)*/, LWA_ALPHA);
          }
-      }  
+      }
    }
 
    void OffsetWindow(Window window, int * x, int * y)
@@ -1536,7 +1536,7 @@ class Win32Interface : Interface
          {
             case maximized:
             case normal:
-               ShowWindow(window.windowHandle, ((window.active || window.creationActivation == activate) && !externalDisplayChange) ? 
+               ShowWindow(window.windowHandle, ((window.active || window.creationActivation == activate) && !externalDisplayChange) ?
                   ((window.nativeDecorations && state == maximized) ? SW_MAXIMIZE : SW_SHOWNORMAL) : SW_SHOWNOACTIVATE);
                break;
             case minimized:
@@ -1633,7 +1633,7 @@ class Win32Interface : Interface
    void SetCaret(int x, int y, int size)
    {
 
-   }  
+   }
 
    // --- Clipboard manipulation ---
 
@@ -1764,7 +1764,7 @@ class Win32Interface : Interface
              middle = (dims.rgbButtons[2] & 0x80) ? true : false };
       }
    #endif
-      
+
       return result;
    }
 
@@ -1776,9 +1776,9 @@ class Win32Interface : Interface
       {
          DIJOYSTATE dijs = {0};
    #ifndef ECERE_NOJOYSTICK
-         if(acquiredWindow && device < numJoysticks) 
+         if(acquiredWindow && device < numJoysticks)
          {
-            if(directJoysticks[device]) 
+            if(directJoysticks[device])
             {
                directJoysticks[device]->lpVtbl->Poll(directJoysticks[device]);
                if(directJoysticks[device]->lpVtbl->GetDeviceState(directJoysticks[device], sizeof(DIJOYSTATE), &dijs ))
@@ -1793,7 +1793,7 @@ class Win32Interface : Interface
          joystick.rx = dijs.lRx;
          joystick.ry = dijs.lRy;
          joystick.rz = dijs.lRz;
-         joystick.buttons = 
+         joystick.buttons =
               ((dijs.rgbButtons[0] & 0x80) ? JOY_BUTTON1 : 0)
             | ((dijs.rgbButtons[1] & 0x80) ? JOY_BUTTON2 : 0)
             | ((dijs.rgbButtons[2] & 0x80) ? JOY_BUTTON3 : 0)
@@ -1871,7 +1871,7 @@ class Win32Interface : Interface
             PixelFormat format = window.display.pixelFormat;
             int bits = GetDepthBits(format);
             bool blend;
-            
+
             bitmap.Convert(null, pixelFormat888, null);
             and.Allocate(null, (bitmap.width+7/8), bitmap.height, 0, pixelFormat8, false);
 
@@ -1909,7 +1909,7 @@ class Win32Interface : Interface
             }
             if(bits == 15) { bits = 16; format = pixelFormat565; };
             bitmap.Convert(null, format, null);
-            
+
             icon = CreateIcon(hInstance, bitmap.width, bitmap.height, 1, (byte)bits, and.picture, bitmap.picture);
             delete and;
          }
@@ -1931,7 +1931,7 @@ class Win32Interface : Interface
          GetMonitorInfo(monitor, &info);
          // box = { info.rcWork.left, info.rcWork.top, info.rcWork.right, info.rcWork.bottom };
          box = { info.rcMonitor.left, info.rcMonitor.top, info.rcMonitor.right-1, info.rcMonitor.bottom-1 };
-         
+
          if(taskBarMonitor == monitor)
          {
             if(taskBarPlacement.rcNormalPosition.top <= box.top && taskBarPlacement.rcNormalPosition.bottom >= box.bottom)
@@ -1968,7 +1968,7 @@ class Win32Interface : Interface
          box.top -= desktopY;
          box.right -= desktopX;
          box.bottom -= desktopY;
-      }      
+      }
    }
 }
 
index 04c2975..1fbd0e2 100644 (file)
@@ -202,7 +202,7 @@ static Visual * FindFullColorVisual(X11Display *dpy, int * depth)
    XVisualInfo vinfo;
    XVisualInfo *vinfo_ret;
    int numitems;
-  
+
    vinfo._class = TrueColor;
    vinfo_ret = XGetVisualInfo(dpy, VisualClassMask, &vinfo, &numitems);
    if(numitems)
@@ -223,7 +223,7 @@ static Visual * FindFullColorVisual(X11Display *dpy, int * depth)
             return vinfo.visual;
          }
       }
-   } 
+   }
    return null;
 }
 
@@ -233,7 +233,7 @@ static void RepositionDesktop(bool updateChildren)
    int w, h;
    Screen * x_screen = XDefaultScreenOfDisplay(xGlobalDisplay);
    X11Window x_root;
-   int current = 0;   
+   int current = 0;
    char *data = null;
    int format;
    unsigned long len, fill;
@@ -247,7 +247,7 @@ static void RepositionDesktop(bool updateChildren)
    w = XDisplayWidth(xGlobalDisplay, DefaultScreen(xGlobalDisplay));
    h = XDisplayHeight(xGlobalDisplay, DefaultScreen(xGlobalDisplay));
    x_root = XRootWindowOfScreen(x_screen);
-   
+
    if(atoms[_net_number_of_desktops] != None)
    {
       if(XGetWindowProperty(xGlobalDisplay, x_root, atoms[_net_number_of_desktops], 0, 1, False,
@@ -256,7 +256,7 @@ static void RepositionDesktop(bool updateChildren)
       {
          printf("cant get xa desktops property\n");
       }
-      
+
       if(data)
       {
          int desktops = 0;
@@ -268,16 +268,16 @@ static void RepositionDesktop(bool updateChildren)
          data = null;
       }
    }
-   
+
    if(atoms[_net_current_desktop] != None)
-   {   
+   {
       if(XGetWindowProperty(xGlobalDisplay, x_root, atoms[_net_current_desktop], 0, 1, False,
                             XA_CARDINAL, &type, &format, &len, &fill,
                             &data) != Success)
       {
          printf("cant get xa current property\n");
       }
-      
+
       if(data)
       {
          current = (int)*(long *)data;
@@ -286,7 +286,7 @@ static void RepositionDesktop(bool updateChildren)
 
          //printf("_NET_CURRENT_DESKTOP is %d\n", current);
       }
-   }   
+   }
    if(atoms[_net_workarea] != None)
    {
       long *workareas;
@@ -297,22 +297,22 @@ static void RepositionDesktop(bool updateChildren)
       {
          //printf("warning\n");
       }
-      
+
       /*
       if(type == None || format == 0)
          printf("warning\n");
 
       if(fill)
          printf("warning\n");
-      
+
       if(len % 4)
          printf("warning\n");
       */
-  
+
       if(data)
       {
          workareas = (long *)data;
-     
+
          x = (int)workareas[current * 4];
          y = (int)workareas[current * 4 + 1];
          w = (int)workareas[current * 4 + 2];
@@ -389,7 +389,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
    /*
    key = key - 8;
    //Logf("Got 0x%x (%d)\n", key, key);
-   
+
    switch(key)
    {
       case KEYCODE_HOME: key = home; break;
@@ -404,7 +404,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
       case KEYCODE_DEL: key = del; break;
       case KEYCODE_SLASH: key = keyPadSlash; break;
    }
-  
+
    ch = (byte)Interface::TranslateKey(key, event->state & ShiftMask);
    */
 /*
@@ -417,7 +417,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
    if(!buf)
       buf = malloc((uint)bufsize);
    if(windowData && windowData.ic)
-   { 
+   {
       buflength = XmbLookupString(windowData.ic, event, buf, (int)bufsize, &keysym, &status);
       if (status == XBufferOverflow)
       {
@@ -462,7 +462,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
          // case XK_Begin:
 
          // case XK_Select:
-         // case XK_Print: 
+         // case XK_Print:
          // case XK_Execute:
          case XK_Insert:      key = insert; break;
          // case XK_Undo:
@@ -480,7 +480,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
          // case XK_script_switch:
          case XK_Num_Lock:    key = numLock; break;
 
-         // case XK_KP_Space: 
+         // case XK_KP_Space:
          // case XK_KP_Tab:
          case XK_KP_Enter:    key = keyPadEnter; break;
          // case XK_KP_F1:
@@ -505,7 +505,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
          case XK_KP_Add:      key = keyPadPlus; break;
          case XK_KP_Separator:key = keyPadDelete; break;
          case XK_KP_Subtract: key = keyPadMinus; break;
-         // case XK_KP_Decimal: 
+         // case XK_KP_Decimal:
          case XK_KP_Divide:   key = keyPadSlash; break;
 
          case XK_KP_0:  key = keyPad0; break;
@@ -586,7 +586,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
          case XK_Control_L: key = leftControl; break;
          case XK_Control_R: key = rightControl; break;
          case XK_Caps_Lock: key = capsLock; break;
-         // case XK_Shift_Lock: 
+         // case XK_Shift_Lock:
          // case XK_Meta_L:
          // case XK_Meta_R:
          case XK_Alt_L: key = leftAlt; break;
@@ -717,7 +717,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
       code.alt = true;
       /*buflength = 0;
       ch = 0;*/
-   } 
+   }
 #endif
 
    // Logf("Key Message: %s, keysym: 0x%x, key: %d state: %d, ch: %c\n", release ? ((release == 2) ? "REPEAT" : "KeyRelease") : "KeyPress", keysym, key, event->state, (byte)ch);
@@ -743,7 +743,7 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
                int numBytes;
                ch = UTF8GetChar(buf + c, &numBytes);
                if(ch == 127) ch = 0;
-               result = window.KeyMessage((c == 0) ? 
+               result = window.KeyMessage((c == 0) ?
                   __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown : __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit,
                   (c == 0) ? code : 0, ch);
                c += numBytes;
@@ -767,10 +767,10 @@ static bool ProcessKeyMessage(Window window, uint keyCode, int release, XKeyEven
             }
          else
             result = window.KeyMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit, code, ch);
-      } 
+      }
    }
    delete window;
-            
+
    return result;
 }
 /*
@@ -823,7 +823,7 @@ static uint XTimerThread(Thread thread)
       //bool waitSemaphore = false;
       fd_set readSet, writeSet, exceptSet;
       struct timeval tv = { (timerDelay == MAXINT) ? 0 : (timerDelay / 1000000), (timerDelay == MAXINT) ? (int)(1000000 / 18.2) : (timerDelay % 1000000) };
-      
+
       if(xTerminate) break;
       FD_ZERO(&readSet);
       FD_ZERO(&writeSet);
@@ -853,7 +853,7 @@ static uint XTimerThread(Thread thread)
             PropertyChangeMask, (union _XEvent *)&event);
       }
       xMutex.Release();
-      guiApp.SignalEvent();  
+      guiApp.SignalEvent();
       xSemaphore.Wait();
 
 #if 0
@@ -936,7 +936,7 @@ static void WaitForViewableWindow(Window window)
    //int attempts = 0;
    //Logf("Wait for viewable %s\n", window.name);
    XFlush(xGlobalDisplay);
-   //while(attempts++ < 40) 
+   //while(attempts++ < 40)
    while(true)
    {
       XWindowAttributes attributes = { 0 };
@@ -958,7 +958,7 @@ static void WaitForViewableWindow(Window window)
 {
    bool terminate;
    uint delay;
-   
+
    void Stop()
    {
       if(started)
@@ -967,7 +967,7 @@ static void WaitForViewableWindow(Window window)
          Wait();
       }
    }
-   
+
    uint Main()
    {
       while(!terminate)
@@ -1068,7 +1068,7 @@ class XInterface : Interface
       joystickFD[1] = open("/dev/js1", O_RDONLY);
       joystickFD[2] = open("/dev/js2", O_RDONLY);
       joystickFD[3] = open("/dev/js3", O_RDONLY);
-    
+
       if(xGlobalDisplay)
       {
          XWindowAttributes attributes = { 0 };
@@ -1084,7 +1084,7 @@ class XInterface : Interface
                XVisualInfo vinfo;
                XVisualInfo *vinfo_ret;
                int numitems = 0;
-              
+
                vinfo.visualid = XVisualIDFromVisual(xSystemVisual);
                vinfo_ret = XGetVisualInfo(xGlobalDisplay, VisualIDMask, &vinfo, &numitems);
                if(numitems)
@@ -1122,16 +1122,16 @@ class XInterface : Interface
                   else
                      printf("Could not get a 555 visual\n");
                   */
-               } 
+               }
                break;
             }
          }
          // printf("Got a depth of %d\n", xSystemDepth);
 
-         {  
+         {
             int major, minor, pixmaps;
             xSharedMemory = XShmQueryExtension(xGlobalDisplay) && XShmQueryVersion(xGlobalDisplay, &major, &minor, &pixmaps) && pixmaps;
-         }  
+         }
 
          // printf("Opening IM\n");
          im = XOpenIM(xGlobalDisplay, null, null, null);
@@ -1145,7 +1145,7 @@ class XInterface : Interface
             XkbSetDetectableAutoRepeat(xGlobalDisplay, True, &autoRepeatDetectable);
 
             XInternAtoms(xGlobalDisplay, (char**)atomNames, AtomIdents::enumSize, False, atoms);
-            
+
             {
                Atom protocols[2] = { atoms[wm_delete_window], atoms[wm_take_focus] };
 
@@ -1178,7 +1178,7 @@ class XInterface : Interface
 
                /*
                XIMStyles *IMcando;
-               XIMStyle  clientCanDo; 
+               XIMStyle  clientCanDo;
                XIMStyle  styleWeWillUse = null;
                int i;
                XVaNestedList arglist;
@@ -1191,7 +1191,7 @@ class XInterface : Interface
                   XIMPreeditPosition | XIMStatusArea |
                   XIMPreeditArea | XIMStatusArea |
                   XIMPreeditNothing | XIMStatusNothing;
-               
+
                for(i=0; i<IMcando->count_styles; i++)
                {
                    XIMStyle tmpStyle;
@@ -1224,7 +1224,7 @@ class XInterface : Interface
                XSetICFocus(ic);
                */
             }
-            
+
             xMutex.Wait();
             timerThread = Thread { };
             incref timerThread;
@@ -1232,7 +1232,7 @@ class XInterface : Interface
             timerThread.Create();
 
             return true;
-         }   
+         }
       }
       return false;
    }
@@ -1472,7 +1472,7 @@ class XInterface : Interface
                   break;
                }
                case MotionNotify:
-               { 
+               {
                   static uint lastTime = 0;
                   XMotionEvent * event = (XMotionEvent *) thisEvent;
                   while(XCheckIfEvent(xGlobalDisplay, (XEvent *)thisEvent, EventChecker, (void *)MotionNotify));
@@ -1538,7 +1538,7 @@ class XInterface : Interface
                         }
                   else
                                 respond.xselection._property = None;
-                        
+
                   respond.xselection.type = SelectionNotify;
                         respond.xselection.display = req->display;
                         respond.xselection.requestor = req->requestor;
@@ -1603,7 +1603,7 @@ class XInterface : Interface
                      if(XCheckTypedWindowEvent(xGlobalDisplay, thisEvent->window, FocusOut, (XEvent *)thisEvent))
                      {
                         XFocusChangeEvent *event = (XFocusChangeEvent *) thisEvent;
-                        
+
                         XFindContext(xGlobalDisplay, thisEvent->window, windowContext, (XPointer *) &window);
                         if(window)
                         {
@@ -1636,7 +1636,7 @@ class XInterface : Interface
                      {
                         XWindowData windowData;
                         XFindContext(xGlobalDisplay, thisEvent->window, windowContext, (XPointer *) &window);
-                        
+
                         if(window)
                         {
                            XFocusChangeEvent *event = (XFocusChangeEvent *) thisEvent;
@@ -1677,7 +1677,7 @@ class XInterface : Interface
                      {
                         XCheckTypedEvent(xGlobalDisplay, /*thisEvent->window, */ButtonPress, (XEvent *)thisEvent);
                      }
-                     
+
                      //delete lastActive;
                      /*
                      lastActive = window;
@@ -1741,7 +1741,7 @@ class XInterface : Interface
                         X11Window rootChild;
                         int rootX, rootY;
                         XTranslateCoordinates(xGlobalDisplay, event->window,
-                           RootWindow(xGlobalDisplay, DefaultScreen(xGlobalDisplay)), 0, 0, 
+                           RootWindow(xGlobalDisplay, DefaultScreen(xGlobalDisplay)), 0, 0,
                            &rootX, &rootY, &rootChild);
                         x = rootX;
                         y = rootY;
@@ -1784,7 +1784,7 @@ class XInterface : Interface
                      activeWindow = (X11Window)window.windowHandle;
 
                      timeStamp = (int)event->data.l[1];
-                     
+
                      windowData = window.windowData;
                      laterFocus = windowData.laterFocus;
                      windowData.laterFocus = true;
@@ -1795,7 +1795,7 @@ class XInterface : Interface
                      if(guiApp.interimWindow && guiApp.interimWindow.created && window != guiApp.interimWindow) break; //window == window.parent.activeChild) break;
                      // if(window == window.parent.activeChild) break;
                      incref window;
-   
+
                      {
                         XEvent checkEvent;
                         //XFlush(xGlobalDisplay);
@@ -1860,7 +1860,7 @@ class XInterface : Interface
                            else
                            {
                               XSetInputFocus(xGlobalDisplay, (X11Window)window.windowHandle, RevertToPointerRoot, (uint)timeStamp);
-                              window.ExternalActivate(true, true, window, null); // lastActive); 
+                              window.ExternalActivate(true, true, window, null); // lastActive);
                               if(windowData && windowData.ic)
                               {
                                  // XSetICValues(ic, XNClientWindow, window.windowHandle, XNFocusWindow, window.windowHandle, 0);
@@ -2049,7 +2049,7 @@ class XInterface : Interface
                GLX_BLUE_SIZE, 1
             };
             int numAttribs = 14;
-            
+
             GLXFBConfig *fbconfigs = null, fbconfig;
             int numfbconfigs;
             int i;
@@ -2119,12 +2119,12 @@ class XInterface : Interface
       }
       if(!visualInfo)
       {
-         int attrList[] = 
+         int attrList[] =
          {
             GLX_USE_GL, GLX_DEPTH_SIZE, 1,
-            GLX_RGBA, 
+            GLX_RGBA,
             GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1,
-            GLX_DOUBLEBUFFER, 
+            GLX_DOUBLEBUFFER,
             None
          };
          visualInfo = glXChooseVisual(xGlobalDisplay, DefaultScreen(xGlobalDisplay), attrList);
@@ -2145,7 +2145,7 @@ class XInterface : Interface
       if(fullScreenMode)
       {
          windowHandle = XCreateWindow(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay),
-            0,0,guiApp.desktop.size.w,guiApp.desktop.size.h,0, depth, InputOutput, visual ? visual : CopyFromParent, 
+            0,0,guiApp.desktop.size.w,guiApp.desktop.size.h,0, depth, InputOutput, visual ? visual : CopyFromParent,
             CWEventMask | (visual ? (CWColormap | CWBorderPixel) : 0)/*| CWOverrideRedirect*/, &attributes);
       }
       /*
@@ -2175,8 +2175,8 @@ class XInterface : Interface
             if(window.style.showInTaskBar)
                parentWindow = (X11Window)null;
 
-            windowHandle = XCreateWindow(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay), 
-               0,0,1,1,0, depth, InputOutput, visual ? visual : CopyFromParent, 
+            windowHandle = XCreateWindow(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay),
+               0,0,1,1,0, depth, InputOutput, visual ? visual : CopyFromParent,
                CWEventMask | CWOverrideRedirect | (visual ? (CWColormap | CWBorderPixel) : 0), &attributes);
 
             if(parentWindow && (window.interim || window.isModal))
@@ -2228,13 +2228,13 @@ class XInterface : Interface
          int num_missing_charsets = 0;
          char *default_string;
          XFontSet fontset;
-         XRectangle area = { 0, 0,  400, 400 };         
+         XRectangle area = { 0, 0,  400, 400 };
          XVaNestedList argList;
 
          // sprintf(fontString, "-*-%s-*-r-*-*-*-%d-*-*-*-*-*-*", "Helvetica" /*window.font.faceName*/, (int)(window.font.size * 20));
          fontset = XCreateFontSet(xGlobalDisplay, fontString, &missing_charsets, &num_missing_charsets, &default_string);
          argList = XVaCreateNestedList(0,
-                                       XNSpotLocation, &cursor_location, 
+                                       XNSpotLocation, &cursor_location,
                                        //XNArea, &area,
                                        XNFontSet, fontset,/*
                                        XNForeground,
@@ -2271,7 +2271,7 @@ class XInterface : Interface
       */
 
       {
-         if ( atoms[_motif_wm_hints] != None ) 
+         if ( atoms[_motif_wm_hints] != None )
          {
             MWM_Hints hints
             {
@@ -2289,16 +2289,16 @@ class XInterface : Interface
          if(atoms[_net_wm_pid] != None)
          {
             int pid = getpid();
-            // printf("Setting _NET_WM_PID to %d\n", pid); 
+            // printf("Setting _NET_WM_PID to %d\n", pid);
             XChangeProperty(xGlobalDisplay, windowHandle, atoms[_net_wm_pid], XA_CARDINAL, 32,
-               PropModeReplace, (unsigned char*)&pid, 1);            
+               PropModeReplace, (unsigned char*)&pid, 1);
          }
       }
-      
+
       /*
       {
          Atom protocolsAtom = XInternAtom(xGlobalDisplay, "WM_PROTOCOLS", False);
-         if ( protocolsAtom != None ) 
+         if ( protocolsAtom != None )
          {
             MWM_Hints hints = { MWM_HINTS_DECORATIONS|MWM_HINTS_FUNCTIONS, 0, 0, 0, 0 };
             XChangeProperty(xGlobalDisplay, windowHandle, atoms[_motif_wm_hints], atoms[_motif_wm_hints], 32,
@@ -2307,7 +2307,7 @@ class XInterface : Interface
       }*/
       // XFlush(xGlobalDisplay);
       window.windowData = XWindowData { visualInfo, ic };
-      
+
       XSaveContext(xGlobalDisplay, windowHandle, windowContext, (XPointer)window);
 
       XSelectInput(xGlobalDisplay, windowHandle, mask);
@@ -2350,7 +2350,7 @@ class XInterface : Interface
    {
       XEvent event;
 
-      XDeleteContext(xGlobalDisplay, (XID)window, windowContext); 
+      XDeleteContext(xGlobalDisplay, (XID)window, windowContext);
       XSaveContext(xGlobalDisplay, (X11Window)window.windowHandle, windowContext, null);
       XDestroyWindow(xGlobalDisplay, (X11Window)window.windowHandle);
       XSync(xGlobalDisplay, 0);
@@ -2380,7 +2380,7 @@ class XInterface : Interface
             atoms[utf8_string], 8, PropModeReplace, (byte *)name, name ? strlen(name) : 0);
          XChangeProperty(xGlobalDisplay, (X11Window)window.windowHandle, atoms[wm_name],
             atoms[utf8_string], 8, PropModeReplace, (byte *)name, name ? strlen(name) : 0);
-      }   
+      }
    }
 
    void PositionRootWindow(Window window, int x, int y, int w, int h, bool move, bool resize)
@@ -2481,7 +2481,7 @@ class XInterface : Interface
             WaitForViewableWindow(window);
             if(window.creationActivation == activate && state != minimized)
                ActivateRootWindow(window);
-            
+
             if(state == minimized)
             {
                uint iconic = IconicState;
@@ -2493,7 +2493,7 @@ class XInterface : Interface
                XChangeProperty(xGlobalDisplay, window.windowHandle, atoms[wm_state], XA_CARDINAL, 32,
                   PropModeReplace, &iconic, 1);
                */
-               
+
                /*
                XClientMessageEvent event = { 0 };
                event.type = ClientMessage;
@@ -2545,7 +2545,7 @@ class XInterface : Interface
 
                   // With native decorations, we do it the first time
                   // or the WM (Gnome) is sticking it to the top/right!
-                  XMoveResizeWindow(xGlobalDisplay, 
+                  XMoveResizeWindow(xGlobalDisplay,
                      (X11Window)window.windowHandle,
                      x, y, w, h);
                   UpdateRootWindow(window);
@@ -2612,18 +2612,18 @@ class XInterface : Interface
                event.send_event = 1;
                event.format = 32;
                event.data.l[0] = 0;
-               
+
                //event.data.l[0] = 2;
                //event.data.l[1] = timeStamp;
-               
+
 
                //event.data.l[1] = atoms[_net_wm_user_time];
                //event.data.l[2] = activeWindow; //guiApp.desktop.activeChild.windowHandle;
-               
+
 #ifdef _DEBUG
                //printf("(ActivateRootWindow) Setting _NET_ACTIVE_WINDOW for %s (%x)\n", window._class.name, window);
 #endif
-               
+
                XSendEvent(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay), bool::false, SubstructureRedirectMask | SubstructureNotifyMask, (union _XEvent *)&event);
 //#if defined(__APPLE__)
                XSetInputFocus(xGlobalDisplay, (X11Window)window.windowHandle, RevertToPointerRoot, CurrentTime);
@@ -2656,7 +2656,7 @@ class XInterface : Interface
       unsigned int state;
       ((GuiApplication)__thisModule.application).Lock();
       //XLockDisplay(xGlobalDisplay);
-      XQueryPointer(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay), &childWindow, 
+      XQueryPointer(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay), &childWindow,
          &rootWindow, x, y, &mx, &my, &state);
       //XUnlockDisplay(xGlobalDisplay);
       ((GuiApplication)__thisModule.application).Unlock();
@@ -2671,14 +2671,14 @@ class XInterface : Interface
    {
       ((GuiApplication)__thisModule.application).Lock();
       //XLockDisplay(xGlobalDisplay);
-      if(box && box.left > 0 && box.top > 0 && 
+      if(box && box.left > 0 && box.top > 0 &&
          box.right < guiApp.desktop.clientSize.w - 1 && box.bottom < guiApp.desktop.clientSize.h - 1)
       {
          if(!window.parent || !window.parent.display)
          {
-            XMoveResizeWindow(xGlobalDisplay, confineWindow, box.left + desktopX, box.top + desktopY, 
+            XMoveResizeWindow(xGlobalDisplay, confineWindow, box.left + desktopX, box.top + desktopY,
                box.right - box.left + 1, box.bottom - box.top + 1);
-      
+
             if(!restrictedWindow)
                XMapWindow(xGlobalDisplay, confineWindow);
 
@@ -2699,7 +2699,7 @@ class XInterface : Interface
          }
          else
             XUngrabPointer(xGlobalDisplay, CurrentTime);
-         
+
          if(restrictedWindow)
             XUnmapWindow(xGlobalDisplay, confineWindow);
 
@@ -2726,7 +2726,7 @@ class XInterface : Interface
       else if(capturedWindow != None)
       {
          if(restrictedWindow)
-            XGrabPointer(xGlobalDisplay, (X11Window) restrictedWindow.rootWindow.windowHandle, False, 
+            XGrabPointer(xGlobalDisplay, (X11Window) restrictedWindow.rootWindow.windowHandle, False,
                ButtonPressMask | ButtonReleaseMask | PointerMotionMask, GrabModeAsync,
                GrabModeAsync, confineWindow, fullScreenMode ? nullCursor : None, CurrentTime);
          else
@@ -2768,7 +2768,7 @@ class XInterface : Interface
             XSetICValues(windowData.ic, XNPreeditAttributes, argList, 0);
          }
       }
-   }  
+   }
 
    void ClearClipboard()
    {
@@ -2785,7 +2785,7 @@ class XInterface : Interface
    {
       bool result = false;
       if((clipBoard.text = new0 byte[size]))
-         result = true;   
+         result = true;
       return result;
    }
 
@@ -2796,16 +2796,16 @@ class XInterface : Interface
       if(clipBoard.text)
       {
          Window rootWindow = guiApp.desktop;
-         if(!fullScreenMode) 
+         if(!fullScreenMode)
          {
-            for(rootWindow = rootWindow.children.first; 
-               rootWindow && !rootWindow.windowHandle; 
+            for(rootWindow = rootWindow.children.first;
+               rootWindow && !rootWindow.windowHandle;
                rootWindow = rootWindow.next);
          }
          if(clipBoardData)
             delete clipBoardData;
          else if(rootWindow)
-          XSetSelectionOwner(xGlobalDisplay, atoms[clipboard], 
+            XSetSelectionOwner(xGlobalDisplay, atoms[clipboard],
                (X11Window) rootWindow.windowHandle, CurrentTime);
          clipBoardData = clipBoard.text;
          clipBoard.text = null;
@@ -2833,8 +2833,8 @@ class XInterface : Interface
          Window rootWindow = guiApp.desktop;
          if(!fullScreenMode)
          {
-            for(rootWindow = rootWindow.children.first; 
-               rootWindow && !rootWindow.windowHandle; 
+            for(rootWindow = rootWindow.children.first;
+               rootWindow && !rootWindow.windowHandle;
                rootWindow = rootWindow.next);
          }
          if(rootWindow)
@@ -2908,7 +2908,7 @@ class XInterface : Interface
    bool GetJoystickState(int device, Joystick joystick)
    {
       bool result = false;
-   #if defined(__linux__)   
+   #if defined(__linux__)
       if(joystick && device < 4)
       {
          struct JS_DATA_TYPE js = { 0 };
@@ -2921,7 +2921,7 @@ class XInterface : Interface
             result = true;
          }
       }
-   #endif   
+   #endif
       return result;
    }
 
@@ -2942,7 +2942,7 @@ class XInterface : Interface
          hiResTimer.Create();
       }
       */
-   }  
+   }
 
    bool SetIcon(Window window, BitmapResource resource)
    {
index 37fcb72..413a613 100644 (file)
@@ -1,5 +1,5 @@
 #import <Cocoa/Cocoa.h>
+
 #import "CocoaEcereBridge.h"
 #import "EcereView.h"
 
@@ -7,7 +7,7 @@ bool CocoaInitialize()
 {
     [[NSAutoreleasePool alloc] init];
     [NSApplication sharedApplication];
-    
+
     [NSOpenGLContext clearCurrentContext];
 
     return true;
@@ -33,9 +33,9 @@ bool CocoaProcessInput(bool processAll)
             untilDate:nil
             inMode:NSDefaultRunLoopMode
             dequeue:YES];
-        
+
         [NSApp sendEvent:event];
-        if ([event type]) 
+        if ([event type])
             printf("e%i\n", [event type]);
     } while (event && processAll);
 
@@ -45,9 +45,9 @@ bool CocoaProcessInput(bool processAll)
 bool CocoaLock(WindowHandle handle)
 {
     EcereView *view = (EcereView*)handle;
-    
+
     [view lockFocus];
-    
+
     return true;
 }
 
@@ -55,7 +55,7 @@ void CocoaUnlock(WindowHandle handle)
 {
     EcereView *view = (EcereView*)handle;
 
-    [view unlockFocus];    
+    [view unlockFocus];
 }
 
 void CocoaGetCurrentMode(bool * fullScreen, int * resolution, int * colorDepth, int * refreshRate)
@@ -69,26 +69,26 @@ void CocoaGetCurrentMode(bool * fullScreen, int * resolution, int * colorDepth,
 WindowHandle CocoaCreateRootWindow(EcereWindowRef ecereWindow)
 {
     NSWindow *window = [[NSWindow alloc]
-        initWithContentRect:NSZeroRect 
-        styleMask:( NSResizableWindowMask | NSClosableWindowMask | NSTitledWindowMask) 
-        backing:NSBackingStoreBuffered 
+        initWithContentRect:NSZeroRect
+        styleMask:( NSResizableWindowMask | NSClosableWindowMask | NSTitledWindowMask)
+        backing:NSBackingStoreBuffered
         defer:NO
         screen:nil];
-        
+
     EcereView *view = [[EcereView alloc] initWithEcereWindow:ecereWindow];
        [window setContentView:view];
-        
+
     if (window) {
         [window makeKeyAndOrderFront:window];
     }
-    
+
     return view;
 }
 
 void CocoaDestroyRootWindow(WindowHandle handle)
 {
     EcereView *view = (EcereView*)handle;
-    
+
     [[view window] release];
     [view release];
 }
@@ -96,30 +96,30 @@ void CocoaDestroyRootWindow(WindowHandle handle)
 void CocoaSetRootWindowCaption(WindowHandle handle, char *name)
 {
     EcereView *view = (EcereView*)handle;
-    
+
     NSString *title = [NSString stringWithCString:name];
-    
+
     [[view window] setTitle:title];
-    
+
     [title release];
 }
 
 void CocoaPositionRootWindow(WindowHandle handle, int x, int y, int w, int h, bool move, bool resize)
 {
     EcereView *view = (EcereView*)handle;
-    
+
     NSRect frame = [[view window] frame];
-    
+
     if (move) {
         frame.origin.x = x;
         frame.origin.y = y;
     }
-    
+
     if (resize) {
         frame.size.width = w;
         frame.size.height = h;
     }
-    
+
     [[view window] setFrame:frame display:YES];
 }
 
@@ -129,7 +129,7 @@ void CocoaOffsetWindow(WindowHandle handle, int *x, int *y)
 
 void CocoaGetMousePosition(int *x, int *y)
 {
-    NSPoint location; 
+    NSPoint location;
     location = [NSEvent mouseLocation];
 
     *x = location.x;
@@ -139,14 +139,14 @@ void CocoaGetMousePosition(int *x, int *y)
 void CocoaOpenGLMakeCurrentContext(WindowHandle handle)
 {
     EcereView *view = (EcereView*)handle;
-    
+
     [view makeCurrentContext];
 }
 
 void CocoaOpenGLUpdate(WindowHandle handle)
 {
-    EcereView *view = (EcereView*)handle;    
-    
+    EcereView *view = (EcereView*)handle;
+
     [view flushOpenGLBuffer];
 }
 
index 5c0bc70..59eeeaf 100644 (file)
@@ -18,10 +18,10 @@ class CocoaInterface : Interface
     bool Initialize()
     {
         bool result;
-    
+
         printf("Initialize %s:%i\n", __FILE__, __LINE__);
         result = CocoaInitialize();
-     
+
         return result;
     }
 
@@ -34,10 +34,10 @@ class CocoaInterface : Interface
     bool ProcessInput(bool processAll)
     {
         bool result;
-    
+
         //printf("ProcessInput %s:%i\n", __FILE__, __LINE__);
         result = CocoaProcessInput(processAll);
-        
+
         return result;
     }
 
@@ -63,12 +63,12 @@ class CocoaInterface : Interface
     {
         static char *graphicsDrivers[] = { "CocoaOpenGL" };
         *numDrivers = sizeof(graphicsDrivers) / sizeof(char *);
-        
+
         return (char **)graphicsDrivers;
     }
 
     void GetCurrentMode(bool * fullScreen, int * resolution, int * colorDepth, int * refreshRate)
-    {        
+    {
         printf("GetCurrentMode %s:%i\n", __FILE__, __LINE__);
         CocoaGetCurrentMode(fullScreen, resolution, colorDepth, refreshRate);
     }
@@ -82,7 +82,7 @@ class CocoaInterface : Interface
     bool ScreenMode(bool fullScreen, int resolution, int colorDepth, int refreshRate, bool * textMode)
     {
         printf("STUB! %s:%i\n", __FILE__, __LINE__);
-        
+
         *textMode = false;
         return true;
     }
@@ -93,7 +93,7 @@ class CocoaInterface : Interface
         // TODO:
         printf("CreateRootWindow %s:%i\n", __FILE__, __LINE__);
         window.windowHandle = CocoaCreateRootWindow(window);
-        
+
         return window.windowHandle;
     }
 
@@ -153,7 +153,7 @@ class CocoaInterface : Interface
         // TODO:
         printf("STUB! %s:%i\n", __FILE__, __LINE__);
     }
-    
+
     void ActivateRootWindow(Window window)
     {
         // TODO:
@@ -214,7 +214,7 @@ class CocoaInterface : Interface
     {
         // TODO:
         printf("STUB! %s:%i\n", __FILE__, __LINE__);
-    }  
+    }
 
     void ClearClipboard()
     {
@@ -277,13 +277,13 @@ class CocoaInterface : Interface
     {
         // TODO:
         printf("STUB! %s:%i\n", __FILE__, __LINE__);
-    }  
+    }
 
     bool SetIcon(Window window, BitmapResource resource)
     {
         // TODO:
         printf("STUB! %s:%i\n", __FILE__, __LINE__);
-        
+
         return true;
     }
 }
index 4362b8d..2fe3a64 100644 (file)
@@ -7,13 +7,13 @@ typedef uint32_t CocoaColor;
 @private
     // Reference to the Ecere Window class via pointer. Used for callbacks.
     EcereWindowRef _ecereWindow;
-    
+
     // Foreground and background draw color.
     CocoaColor _foreground;
     CocoaColor _background;
-    
+
     int lockCount;
-    
+
     NSOpenGLContext *_context;
     NSOpenGLPixelFormat *_pixelformat;
 }
index 6c84dc0..31b3a9e 100644 (file)
@@ -4,15 +4,15 @@
 
 @implementation EcereView
 - (EcereView*)initWithEcereWindow:(EcereWindowRef)ecereWindow;
-{ 
+{
     self = [super initWithFrame:NSZeroRect];
-    
+
     lockCount = 0;
-    
+
     if (self != nil)
-    { 
+    {
         NSOpenGLPixelFormatAttribute attributes[] =
-        { 
+        {
             NSOpenGLPFAWindow,
             //NSOpenGLPFAAccelerated,
             NSOpenGLPFADoubleBuffer,
             // exceeds these requirements
             0
         };
-        
+
         _pixelformat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] ;
-    
+
         if (_pixelformat == nil)
-        { 
+        {
             NSLog( @"No valid OpenGL pixel format" );
             NSLog( @"matching attributes specified" );
             exit(1);
         }
-        
+
         [self setEcereWindow:ecereWindow];
-        
+
         _context = [[NSOpenGLContext alloc]
             initWithFormat:_pixelformat shareContext:nil] ;
-    
+
         if (_context == nil)
         {
             // Failed initialization
             NSLog( @"No valid OpenGL" ) ;
             exit(1);
         }
-        else 
+        else
         {
             // ensure we are pointing to ourself as the Drawable
             [_context setView:self];
         }
     }
-    
+
     if (_context == nil) {
         self = nil;
     }
-    
+
     return self;
 }
 
 }
 
 - (NSOpenGLContext*)openGLContext
-{ 
+{
     return _context;
 }
 
 - (void)lockFocus
-{ 
+{
     // ensure we are ready to draw
     lockCount++;
-    
+
     [_context setView:self];
     [super lockFocus];
-    
+
     [self makeCurrentContext];
-    
+
     printf("- (void)lockFocus(%i)\n", lockCount);
 }
 
 - (void)unlockFocus
-{ 
+{
     lockCount--;
 
     [self flushOpenGLBuffer];
-    
+
     [super unlockFocus];
 
     printf("- (void)unlockFocus(%i)\n", lockCount);
@@ -97,7 +97,7 @@
 - (void)makeCurrentContext
 {
     printf("- (void)makeCurrentContext\n");
-    
+
     [_context makeCurrentContext];
 }
 
 }
 
 - drawRect:(NSRect)rect
-{ 
+{
     // make us the current OpenGL context
     //[_context makeCurrentContext];
     printf("- drawRect:(NSRect)rect\n");
     // Register with window for resize and move notification.
     [[NSNotificationCenter defaultCenter]
         addObserver:self
-        selector:@selector(windowResized:) 
+        selector:@selector(windowResized:)
         name:NSWindowDidResizeNotification
         object:[self window]];
 
     [[NSNotificationCenter defaultCenter]
         addObserver:self
-        selector:@selector(windowMoved:) 
+        selector:@selector(windowMoved:)
         name:NSWindowDidMoveNotification
         object:[self window]];
 }
     NSRect rect = [[self window] frame];
 
     CocoaDispatch_ExternalPosition([self ecereWindow], rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
-        
+
     printf("- (void)windowResized:(NSNotification *)notification\n");
 }
 
     NSRect rect = [[self window] frame];
 
     CocoaDispatch_ExternalPosition([self ecereWindow], rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
-            
+
     printf("- (void)windowMoved:(NSNotification *)notification\n");
 }
 
 
 - setEcereWindow:(EcereWindowRef)ecereWindow
 {
-    _ecereWindow = ecereWindow;    
+    _ecereWindow = ecereWindow;
 }
 
 - (void)mouseDown:(NSEvent *)event
 {
     NSPoint location = [NSEvent mouseLocation];
-    
+
     CocoaKeyMod mod;
-    
+
     CocoaDispatch_OnLeftButtonDown([self ecereWindow], location.x, location.y, mod);
 }
 
index a1b916e..4d8164a 100644 (file)
@@ -4,7 +4,7 @@ import "Window"
 #define BORDER       5 //4
 #define TOP          3
 #define BOTTOM       (4 + 2)
-#define CORNER       (BORDER * 2 + 6) 
+#define CORNER       (BORDER * 2 + 6)
 #define CAPTION      22 // 20
 #define DEAD_BORDER  0 //3
 #define MIN_WIDTH    68
@@ -120,18 +120,18 @@ static void Button::ThumbOnRedraw(Surface surface)
    int w = 14;// * sizeW / 14;
    int sideH = 10; // * sizeW / 14;
    int middleH = size.h - 2 * (sideH + y);
-   
+
    surface.Stretch(left.bitmap, x, y, 0,0, w, sideH, left.bitmap.width, left.bitmap.height);
    surface.HTile(middle.bitmap, x, y + sideH, w, middleH);
    surface.Stretch(right.bitmap, x, y + sideH + middleH, 0,0, w, sideH, right.bitmap.width, right.bitmap.height);
-   
+
    /*
    surface.Filter(left.bitmap, x, y, 0,0, w, sideH, left.bitmap.width, left.bitmap.height);
    surface.FilterVTile(middle.bitmap, x, y + sideH, w, middleH);
    surface.Filter(right.bitmap, x, y + sideH + middleH, 0,0, w, sideH, right.bitmap.width, right.bitmap.height);
    */
 }
-   
+
 static bool Button::ThumbIsInside(int x, int y)
 {
    return (x >= 0 && y >= 0 && x < size.w && y < size.h);
@@ -199,7 +199,7 @@ public class AquaSkin_ScrollBar : ScrollBar
       }
       return true;
    }
-   
+
    void OnRedraw(Surface surface)
    {
       surface.VTile(bmpScrollVert.bitmap, 0, 0, clientSize.w, clientSize.h);
@@ -283,7 +283,7 @@ public class AquaSkin_Button : Button
    }
 
    void OnRedraw(Surface surface)
-   {  
+   {
       if(bitmap)
       {
          return PUREVTBL(Button)[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRedraw](this, surface);
@@ -310,7 +310,7 @@ public class AquaSkin_Button : Button
          surface.Filter(left.bitmap, x, y, 0,0, sideW, h, left.bitmap.width, left.bitmap.height);
          surface.FilterHTile(middle.bitmap, x + sideW, y, middleW, h);
          surface.Filter(right.bitmap, x + sideW + middleW, y, 0,0, sideW, h, left.bitmap.width, left.bitmap.height);
-         
+
 
          surface.CenterTextf(clientSize.w/2 + offset, (clientSize.h - textH * 1.1) / 2 + offset, text);
       }
@@ -318,7 +318,7 @@ public class AquaSkin_Button : Button
 }
 
 
-char * cursorsBitmaps[] = 
+char * cursorsBitmaps[] =
 {
    "<:ecere>cursors/arrow.png",
    "<:ecere>cursors/iBeam.png",
@@ -572,7 +572,7 @@ public class AquaSkin_Window : Window
             deepBottom = (((BorderBits)borderStyle).fixed /*sizable*/ && isNormal) ? bottom : border;
          }
 
-         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop, 
+         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop,
             size.w - deepBorder - deepBorder, size.h - deepBottom - deepTop);
       }
 
@@ -584,7 +584,7 @@ public class AquaSkin_Window : Window
          surface.SetForeground(activeBorder);
          surface.Rectangle(2, 2, size.w-3, size.h-3);
 
-         // Resizeable frame is 1 pixel thicker 
+         // Resizeable frame is 1 pixel thicker
          if(((BorderBits)borderStyle).sizable && isNormal)
             surface.Rectangle(3, 3, size.w - 4, size.h - 4);
 
@@ -594,7 +594,7 @@ public class AquaSkin_Window : Window
             surface.Gradient(gradient, sizeof(gradient) / sizeof(ColorKey), GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
          else
-            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey), 
+            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey),
             GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
          */
@@ -608,7 +608,7 @@ public class AquaSkin_Window : Window
          // surface.blend = rootWindow != this;
 
          surface.Blit(bmpTopLeftBorder.bitmap, 0, 0, 0, 0, bmpTopLeftBorder.bitmap.width, bmpTopLeftBorder.bitmap.height);
-         surface.Stretch(bmpTopBorder.bitmap, bmpTopLeftBorder.bitmap.width, 0, 0, 0, size.w - 2 * bmpTopLeftBorder.bitmap.width, bmpTopBorder.bitmap.height, 
+         surface.Stretch(bmpTopBorder.bitmap, bmpTopLeftBorder.bitmap.width, 0, 0, 0, size.w - 2 * bmpTopLeftBorder.bitmap.width, bmpTopBorder.bitmap.height,
             bmpTopBorder.bitmap.width, bmpTopBorder.bitmap.height);
          surface.Blit(bmpTopRightBorder.bitmap, size.w - bmpTopRightBorder.bitmap.width, 0, 0, 0, bmpTopRightBorder.bitmap.width, bmpTopRightBorder.bitmap.height);
 
@@ -616,7 +616,7 @@ public class AquaSkin_Window : Window
          surface.Stretch(bmpRightBorder.bitmap, size.w-9, 27, 0, 0, bmpRightBorder.bitmap.width, size.h - 27 - 9, bmpLeftBorder.bitmap.width, bmpLeftBorder.bitmap.height);
 
          surface.Blit(bmpBottomLeftBorder.bitmap, 0, size.h - 9, 0, 0, bmpBottomLeftBorder.bitmap.width, bmpBottomLeftBorder.bitmap.height);
-         surface.Stretch(bmpBottomBorder.bitmap, bmpBottomLeftBorder.bitmap.width, size.h - 9, 0, 0, size.w - 2 * bmpBottomLeftBorder.bitmap.width, bmpBottomBorder.bitmap.height, 
+         surface.Stretch(bmpBottomBorder.bitmap, bmpBottomLeftBorder.bitmap.width, size.h - 9, 0, 0, size.w - 2 * bmpBottomLeftBorder.bitmap.width, bmpBottomBorder.bitmap.height,
             bmpBottomBorder.bitmap.width, bmpBottomBorder.bitmap.height);
          surface.Blit(bmpBottomRightBorder.bitmap, size.w - bmpBottomRightBorder.bitmap.width, size.h - 9, 0, 0, bmpBottomRightBorder.bitmap.width, bmpBottomRightBorder.bitmap.height);
          //surface.alphaWrite = DontWrite;
@@ -635,7 +635,7 @@ public class AquaSkin_Window : Window
          {
             int buttonsSize = border +
                ((hasMaximize || hasMinimize) ? 60 : 26);
-            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET, 
+            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET,
                size.w - (buttonsSize + border + NAME_OFFSETX /*4*/), name, strlen(name));
          }
       }
index f69b81b..cb8a491 100644 (file)
@@ -5,7 +5,7 @@ namespace gui::skins;
 
    Copyright (c) 2001-2007 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    tvision.ec - TurboVision'ish skin implementation
 ****************************************************************************/
 import "Skin"
@@ -294,7 +294,7 @@ public class TVisionSkin_Window : Window
          int corner = (style.sizable && state == normal) ? CORNER : 0;
          int border = (style.sizable && state == normal) ? BORDER : 0;
          int top    = (style.sizable && state == normal) ? TOP    : 0;
-         
+
          // Special case for having caption on resize bar
          if(!CAPTION)
             result = Box { corner, 0, w-corner-1, TOP-1 }.IsPointInside({x, y});
index 5d240ac..80f0272 100644 (file)
@@ -93,7 +93,7 @@ static ColorKey gradientInactive[] =
    { ColorAlpha { 255, Color { 192, 192, 192 } }, 1.00f }
 };
 */
-char * cursorsBitmaps[] = 
+char * cursorsBitmaps[] =
 {
    "<:ecere>cursors/arrow.png",
    "<:ecere>cursors/iBeam.png",
@@ -371,7 +371,7 @@ public class WindowsSkin_Window : Window
             deepBottom = (((BorderBits)borderStyle).sizable && isNormal) ? bottom : border;
          }
 
-         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop, 
+         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop,
             size.w - deepBorder - deepBorder, size.h - deepBottom - deepTop);
       }
 
@@ -384,7 +384,7 @@ public class WindowsSkin_Window : Window
             surface.SetForeground(formColor);
             surface.Rectangle(2, 2, size.w-3, size.h-3);
 
-            // Resizeable frame is 1 pixel thicker 
+            // Resizeable frame is 1 pixel thicker
             if(((BorderBits)borderStyle).sizable && isNormal)
                surface.Rectangle(3, 3, size.w - 4, size.h - 4);
          }
@@ -394,7 +394,7 @@ public class WindowsSkin_Window : Window
             surface.Gradient(gradient, sizeof(gradient) / sizeof(ColorKey), GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
          else
-            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey), 
+            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey),
             GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
 
@@ -409,7 +409,7 @@ public class WindowsSkin_Window : Window
          {
             int buttonsSize = border +
                ((hasMaximize || hasMinimize) ? (BUTTON_SIZE*3)+7 : (BUTTON_SIZE+3));
-            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET, 
+            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET,
                size.w - (buttonsSize + border + 4), name, strlen(name));
          }
       }
@@ -724,13 +724,13 @@ public class WindowsSkin_Button : Button
                   x, y,
                   0,0,buttonBitmap.width,buttonBitmap.height);
             }
-            else 
+            else
             {
                // Push Buttons
                if(scaleBitmap)
                {
                   if(bevel || offset)
-                     surface.Stretch(buttonBitmap, 
+                     surface.Stretch(buttonBitmap,
                         1 + offset, 1 + offset,0,0,
                         clientSize.w-3,clientSize.h-3,buttonBitmap.width,buttonBitmap.height);
                   else
@@ -815,10 +815,10 @@ public class WindowsSkin_Button : Button
             if((isRadio || isCheckbox) && !bevelOver)
                WriteCaption(surface, CAPTION_DISTANCE + 3, // + clientSize.h,
                   (clientSize.h - th - 4)/2);
-            else 
+            else
             {
                int x, y = (clientSize.h - th - 1)/2 + offset;
-               
+
                if(buttonStyle.bevelOver && buttonBitmap && !buttonStyle.checkBox && !buttonStyle.radio)
                {
                   if(bitmapAlignment == top)
index f56bd7f..e91a0c8 100644 (file)
@@ -54,7 +54,7 @@ private:
 
       bool DataBox::NotifyClose(DropBox dropBox)
       {
-         //dropBox.Deactivate();   
+         //dropBox.Deactivate();
          return true;
       }
    };
@@ -176,7 +176,7 @@ static Window OnEdit(Class _class, void * data, Window window, Window master,
       char * string = "";
       EditBox editBox
       {
-         window, master = master, visible = false, //position = { x, y }, 
+         window, master = master, visible = false, //position = { x, y },
          borderStyle = 0,
          modifyVirtualArea = false, //sizeAnchor = { { w, h }, isClientH = true };
          autoSize = (eClass_IsDerived(window._class, class(DataBox)) ? ((DataBox)window).autoSize : false);
@@ -221,7 +221,7 @@ static Window OnEdit(Class _class, void * data, Window window, Window master,
       }
       return editBox;
    }
-   
+
 }
 
 __on_register_module()
index cc00284..d0f3879 100644 (file)
@@ -237,12 +237,12 @@ private class HTTPConnection : SSLSocket
             pos += c;
             count -= c;
             buffer += c;
-            
+
          }
          else
             break;
       }
-      
+
       return pos;
    }
 
@@ -365,7 +365,7 @@ private:
          HTTPConnection connection = null;
          close = false;
 
-         if(fileName) 
+         if(fileName)
          {
             fileName++;
             memcpy(server, serverStart, fileName - serverStart - 1);
@@ -455,7 +455,7 @@ private:
 #endif
             };
             incref connection;      // HTTPFile reference on success
-            
+
             connection.file = this;
 
             connectionsMutex.Release();
@@ -510,7 +510,7 @@ private:
             this.connection = connection;
             this.relocation = relocation;
             //openStarted = false;
-                  
+
             totalSizeSet = false;   // HEAD will sometimes give you 0!
             strcpy(msg, askBody ? "GET /" : "HEAD /");
 
@@ -551,7 +551,7 @@ private:
             }
             strcat(msg, "\r\n");
             len = strlen(msg);
-            
+
             //::PrintLn("Releasing connectionsMutex before GET for ", name, " ", (uint64)this, " in thread ", GetCurrentThreadID());
             connectionsMutex.Release();
 
@@ -613,20 +613,20 @@ private:
                         }
                      }
                   }
-                  
+
                   connectionsMutex.Wait();
                   if(this.connection)
                   {
                      this.connection.OnReceive = null;
                      this.connection.file = null;
-                     
+
                      if(close)
                      {
                         this.connection.Disconnect(0);
                         connection = null;
                      }
                   }
-                  
+
                   status = 0;
                   delete this.connection; // This decrements the file's reference
                   this.relocation = null;
@@ -728,7 +728,7 @@ private:
          numbytes = Min(numbytes, readSize - read);
          if(totalSizeSet)
             numbytes = Min(numbytes, totalSize - position);
-         
+
          if(numbytes)
          {
             lastTime = GetTime();
index aaa9486..e766af2 100644 (file)
@@ -99,7 +99,7 @@ static class Request : struct
             }
             memcpy(file.buffer + file.bufferCount, buffer + overlap, bytesToRead);
             file.bufferCount += bytesToRead;
-         }      
+         }
 
          // Request some more data!
          if(file.bufferCount < BUFFER_SIZE)
@@ -219,7 +219,7 @@ public class NetworkClientFile : File
       switch(mode)
       {
          case start:
-            newPosition = pos;         
+            newPosition = pos;
             break;
          case current:
             newPosition += pos;
@@ -260,7 +260,7 @@ public class NetworkClientFile : File
    {
       return position;
    }
-                                                                                             
+
    bool Eof()
    {
       return false;
@@ -292,7 +292,7 @@ public class NetworkClientFile : File
       OldList blocks { };
       Request request;
       NetDataBlock block { };
-      
+
       blocks.Add(block);
 
       // Initialize block to what we need
@@ -305,7 +305,7 @@ public class NetworkClientFile : File
             (request.CallBack == Request::ReadResultCallback || request.CallBack == Request::ReadCallback))
          {
             // If this request overlap with the entire block of data we need
-            if(*start + *size >= request.readStart && 
+            if(*start + *size >= request.readStart &&
                *start + *size < request.readStart + request.readSize)
             {
                NetDataBlock next;
@@ -313,11 +313,11 @@ public class NetworkClientFile : File
                {
                   next = block.next;
                   // If this block overlap with this request
-                  if(request.readStart                     < block.end && 
+                  if(request.readStart                     < block.end &&
                      request.readStart + request.readSize >= block.start)
                   {
                      // We have all this block, get rid of it
-                     if(request.readStart <= block.start && 
+                     if(request.readStart <= block.start &&
                         request.readStart + request.readSize > block.end)
                         blocks.Delete(block);
                      // We're missing data at the end of this block
@@ -421,7 +421,7 @@ public:
       request.semaphore.Wait();
       delete request.semaphore;
       delete request;
-      
+
       if(!f.handle)
          delete f;
       return f;
@@ -447,7 +447,7 @@ private:
 
       mutex.Wait();
       while((request = requests.first))
-      {      
+      {
          uint numBytes = request.numBytes;
          if(count - bytesProcessed < numBytes)
             break;
index 3efc867..dd94021 100644 (file)
@@ -56,7 +56,7 @@ public class SSLSocket : Socket
          sbio = null;
       }
       if(ssl)
-      { 
+      {
          //SSL_free(ssl);
          ssl = null;
       }
@@ -64,7 +64,7 @@ public class SSLSocket : Socket
       {
          SSL_CTX_free(ctx);
          ctx = null;
-      } 
+      }
    }
 
    int ReceiveData(unsigned char * buffer, int count, unsigned int flags)
@@ -94,7 +94,7 @@ public class SSLSocket : Socket
       ssl = SSL_new(ctx);
       sbio = BIO_new_socket(s, BIO_NOCLOSE);
       SSL_set_bio(ssl,sbio,sbio);
-      
+
       result = SSL_connect(ssl) > 0;
 
       /*
@@ -102,9 +102,9 @@ public class SSLSocket : Socket
       {
          if(!(SSL_CTX_use_certificate_chain_file(ctx, "client.pem")))
             printf("Can't read certificate file");
-         
+
          SSL_CTX_set_default_passwd_cb(ctx, password_cb);
-         
+
          if(!(SSL_CTX_use_PrivateKey_file(ctx, "client.pem", SSL_FILETYPE_PEM)))
             printf("Can't read key file");
 
index 5cd1d27..ed3e336 100644 (file)
@@ -93,7 +93,7 @@ public:
 
                FD_SET(s, &network.readSet);
                FD_SET(s, &network.exceptSet);
-               if(s >= network.ns) 
+               if(s >= network.ns)
                {
                   network.ns = (int)(s+1);
                   network.socketsSemaphore.Release();
index 9d202b3..d45dc69 100644 (file)
@@ -58,9 +58,9 @@ public:
 };
 
 static class SocketConnectThread : Thread
-{  
+{
    Socket socket;
-   
+
    uint Main()
    {
       bool result = false;
@@ -78,7 +78,7 @@ static class SocketConnectThread : Thread
             {
                network.mutex.Wait();
                strcpy(socket.inetAddress, inet_ntoa(socket.a.sin_addr));
-               socket.inetPort = ntohs(socket.a.sin_port); 
+               socket.inetPort = ntohs(socket.a.sin_port);
                network.mutex.Release();
 
                if(socket.OnEstablishConnection((int)socket.s))
@@ -134,7 +134,7 @@ public:
             SOCKET s;
             SOCKADDR_IN a;
             int addrLen = sizeof(a);
-            
+
             value.accepted = true;
             s = accept(value.s,(SOCKADDR *)&a, &addrLen);
             if(s != -1)
@@ -154,7 +154,7 @@ public:
                address = null;
                this.a = a;
                strcpy(inetAddress, inet_ntoa(this.a.sin_addr));
-               inetPort = ntohs(a.sin_port); 
+               inetPort = ntohs(a.sin_port);
                this.s = s;
                service = value;
                connectThread = null;
@@ -164,7 +164,7 @@ public:
                network.mutex.Wait();
                FD_SET(s, &network.exceptSet);
                FD_SET(s, &network.readSet);
-               if(s >= network.ns) 
+               if(s >= network.ns)
                {
                   network.ns = (int)(s+1);
                   network.socketsSemaphore.Release();
@@ -210,7 +210,7 @@ public:
             OnReceivePacket(packet);
             delete tempBuffer;
             return 0;
-         }                   
+         }
       }
       return 0;
    }
@@ -270,7 +270,7 @@ public:
 
          if(s == network.ns - 1)
             Network_DetermineMaxSocket();
-      
+
          if(s != -1)
          {
             FD_CLR(s, &network.readSet);
@@ -319,7 +319,7 @@ public:
    #endif
             {
                //Print("~");
-            }               
+            }
 
             // This is what was making eCom jam...
             // select(s+1, null, &ws, &es, null);
@@ -399,7 +399,7 @@ public:
             FD_CLR(s, &network.writeSet);
             FD_SET(s, &network.readSet);
             FD_SET(s, &network.exceptSet);
-            if(s >= network.ns) 
+            if(s >= network.ns)
             {
                network.ns = (int)(s+1);
                network.socketsSemaphore.Release();
@@ -465,16 +465,16 @@ private:
          service = null;
          _connected = 0;
       }
-      
+
       if(s != -1) { closesocket(s); this.s = -1; }
 
       delete address;
-      delete recvBuffer; 
+      delete recvBuffer;
 
       recvBufferSize = 0;
       recvBytes = 0;
 
-      if(s != -1) 
+      if(s != -1)
       {
          FD_CLR(s, &network.readSet);
          FD_CLR(s, &network.writeSet);
@@ -530,7 +530,7 @@ private:
          _connected = -2;
 
          FD_SET(s, &network.writeSet);
-         if(s >= network.ns && !processAlone) 
+         if(s >= network.ns && !processAlone)
          {
             network.ns = (int)(s+1);
             network.socketsSemaphore.Release();
@@ -548,7 +548,7 @@ private:
             if(_connected == -1 || destroyed)
             {
                _connected = 0;
-               
+
                if(s == network.ns - 1)
                   Network_DetermineMaxSocket();
 #if 0
@@ -571,7 +571,7 @@ private:
             }
             else
                this.s = -1;
-            
+
             delete connectThread;
          }
          else
@@ -610,7 +610,7 @@ private:
             recvBuffer = renew recvBuffer byte[recvBufferSize + MAX_RECEIVE];
             recvBufferSize += MAX_RECEIVE;
          }
-           
+
          if(FD_ISSET(s, rs) && disconnectCode == (DisconnectCode)-1)
          {
             if(type == tcp /*|| _connected*/)
@@ -618,7 +618,7 @@ private:
             else
             {
                int len = sizeof(a);
-               count = (int)recvfrom(s, recvBuffer + recvBytes, 
+               count = (int)recvfrom(s, recvBuffer + recvBytes,
                   recvBufferSize - recvBytes, 0, (SOCKADDR *)&a, &len);
                strcpy(inetAddress, inet_ntoa(this.a.sin_addr));
                inetPort = ntohs((uint16)a.sin_port);
index 36fabbd..ac5a6df 100644 (file)
@@ -171,7 +171,7 @@ public:
                    processingSocket = (DCOMServerSocket)next)
                {
                   next = processingSocket.next;
-                  if(processingSocket.connected && 
+                  if(processingSocket.connected &&
                      (int64)processingSocket.thread.id == currentThreadID)
                      break;
                }
@@ -273,7 +273,7 @@ static uint32 htoled(uint32 value)
 
 static uint32 letohd(uint32 value)
 {
-   return GETLEDWORD((byte *)&value);   
+   return GETLEDWORD((byte *)&value);
 }
 
 class DCOMServerThread : Thread
@@ -413,16 +413,16 @@ class DCOMClientThread : Thread
             Class runClass = eSystem_FindClass(__thisModule.application, createInstance.className + 4);
             DCOMServerObject object;
             int vid;
-            
+
             if(!_class)
                _class = eSystem_FindClass(runClass.module, createInstance.className);
-            
+
             objects = renew objects DCOMServerObject[numObjects+1];
             object = objects[numObjects] = eInstance_New(_class);
             incref object;
             object.serverSocket = this;
             object.id = numObjects++;
-            object.instance = eInstance_New(runClass);   
+            object.instance = eInstance_New(runClass);
             incref object.instance;
             object.instance._vTbl = new void *[object.instance._class.vTblSize + 1];
             object.instance._vTbl++;
@@ -617,7 +617,7 @@ public:
          packet.type = (DCOMPacketType)htoled((DCOMPacketType)dcom_CreateInstance);
          packet.size = size;
          CopyBytes(packet.className, "DCOM", 4);
-         CopyBytes(packet.className + 4, _class.name + strlen("DCOMClient_"), len-4+1);     
+         CopyBytes(packet.className + 4, _class.name + strlen("DCOMClient_"), len-4+1);
          answered = false;
          SendPacket(packet);
          delete packet;
index d8afc90..f7e966f 100644 (file)
@@ -82,7 +82,7 @@ static class NetworkThread : Thread
       while(!network.networkTerminated)
       {
          int ns = network.ns;
-         
+
          if(ns)
          {
             struct timeval tv = { 0, 0 }; // TESTING 0 INSTEAD OF (int)(1000000 / 18.2) };
@@ -107,7 +107,7 @@ static class NetworkThread : Thread
                network.mutex.Release();
                network.selectSemaphore.Wait();
                network.mutex.Wait();
-            } 
+            }
             else
             {
                ecere::sys::Sleep(1 / 18.2f);
@@ -120,7 +120,7 @@ static class NetworkThread : Thread
             network.socketsSemaphore.Wait();
             network.mutex.Wait();
          }
-         
+
       }
       network.mutex.Release();
       return 0;
index 426f9a3..e6e2f2b 100644 (file)
@@ -41,7 +41,7 @@ public class BufferedFile : File
    {
       if(handle)
       {
-         uint totalBytesRead = 0;         
+         uint totalBytesRead = 0;
          uint bufferCount = this.bufferCount;
          uint bufferPos = this.bufferPos;
          byte * fileBuffer = this.buffer + bufferPos;
@@ -125,7 +125,7 @@ public class BufferedFile : File
 
       //bufferCount = 0;
       //bufferPos = 0;
-      
+
       if(bytesToBuffer < numBytes && bufferCount >= bufferPos && numBytes < bufferSize && missing < bufferPos)
       {
          memcpy(this.buffer, this.buffer + missing, bufferPos - missing);
@@ -146,7 +146,7 @@ public class BufferedFile : File
          bytesToBuffer = Min(numBytes, bufferSize);
          memcpy(this.buffer, buffer + numBytes - bytesToBuffer, bytesToBuffer);
          bufferPos = bytesToBuffer;
-         bufferCount = bytesToBuffer;         
+         bufferCount = bytesToBuffer;
       }
       return result;
    }
@@ -200,7 +200,7 @@ public class BufferedFile : File
       switch(mode)
       {
          case start:
-            newPosition = pos;         
+            newPosition = pos;
             break;
          case current:
             newPosition += pos;
@@ -259,7 +259,7 @@ public class BufferedFile : File
    {
       return pos;
    }
-                                                                                             
+
    bool Eof()
    {
       return eof;
@@ -358,6 +358,6 @@ public BufferedFile FileOpenBuffered(char * fileName, FileOpenMode mode)
          if(!result)
             delete f;
       }
-   }  
+   }
    return result;
 }
index b86078b..49b2f52 100644 (file)
@@ -91,13 +91,13 @@ public struct Date
    int year;
    Month month;
    int day;
-   
+
    char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
    {
       if(stringOutput)
       {
          if(day && year)
-            sprintf(stringOutput, "%s, %s %2d, %d", 
+            sprintf(stringOutput, "%s, %s %2d, %d",
                longDaysNames[dayOfTheWeek], longMonthsNames[month], day, year);
          else
             stringOutput[0] = 0;
@@ -118,7 +118,7 @@ public struct Date
       time.GetLocalTime();
 
       if(!strcmpi(string, "today") || !strcmpi(string, $"today") ||
-         !strcmpi(string, "now") || !strcmpi(string, $"now") || 
+         !strcmpi(string, "now") || !strcmpi(string, $"now") ||
          !strcmpi(string, "tomorrow") || !strcmpi(string, $"tomorrow") ||
          !strcmpi(string, "yesterday") || !strcmpi(string, $"yesterday"))
       {
@@ -138,7 +138,7 @@ public struct Date
          this.day = time.day;
          return true;
       }
-      
+
       if(string)
       {
          if(!string[0])
@@ -163,7 +163,7 @@ public struct Date
             }
 
             if(isAlpha)
-            {            
+            {
                Month m;
                for(m = 0; m<Month::enumSize; m++)
                   if(!strcmpi(shortMonthsNames[m], value)  || !strcmpi(longMonthsNames[m], value) ||
@@ -316,7 +316,7 @@ public struct Date
          if(dayOfTheWeek < 0)
             dayOfTheWeek += 7;
          return dayOfTheWeek;
-      }      
+      }
    }
 
    bool OnSaveEdit(DropBox dropBox, void * object)
@@ -335,7 +335,7 @@ public struct Date
          borderStyle = 0;
          hotKey = f2;
       };
-      
+
       if(day || year || month)
       {
          char tempString[MAX_F_STRING] = "";
@@ -357,7 +357,7 @@ public struct Date
          comboBox.calendar.shownMonth = (Month)now.month;
          comboBox.calendar.shownYear = now.year;
       }
-      
+
       comboBox.contents = string;
       comboBox.Create();
       if(!dataBox.active)
@@ -450,7 +450,7 @@ class DateDropBox : DropBox
       calendar.Create();
       return calendar;
    }
-      
+
    void OnCloseDropDown(Window dateEditor)
    {
       master.Update(null);
@@ -503,10 +503,10 @@ public:
    bool pressing;
    isRemote = true;
    inactive = true;
-   
+
    property Seconds delay { set { timer2.delay = value; } }
    property Seconds delay0 { set { timer.delay = value; } }
-   
+
    bool OnKeyHit(Key key, unichar ch)
    {
       if(key == hotKey)
index 4e475ac..d2dd890 100644 (file)
@@ -170,7 +170,7 @@ bool DualPipe_Seek(_DualPipe * dp, int pos, FileSeekMode mode)
          result = SetFilePointer(dp->inputHandle, pos, null, FILE_END) != -1;
          break;
    }
-   return result;   
+   return result;
 #endif
    return false;
 }
@@ -195,7 +195,7 @@ bool DualPipe_Eof(_DualPipe * dp)
 // Not yet supported... Will ever be?
 bool DualPipe_GetSize(_DualPipe * dp)
 {
-   return 0; 
+   return 0;
 }
 
 bool DualPipe_Peek(_DualPipe * dp)
@@ -208,7 +208,7 @@ bool DualPipe_Peek(_DualPipe * dp)
       unsigned int read;
       char buffer[1];
       dp->eof = !ReadFile(dp->inputHandle, buffer, 0, (DWORD *)&read, null);
-   }      
+   }
    return avail ? true : false;
 #else
    bool result = false; //true; // false
@@ -273,7 +273,7 @@ int DualPipe_GetProcessID(_DualPipe * dp)
 
 void DualPipe_Wait(_DualPipe * dp)
 {
-#if defined(__WIN32__)   
+#if defined(__WIN32__)
    WaitForSingleObject(dp->hProcess, INFINITE);
 #else
    if(dp->pid)
@@ -283,7 +283,7 @@ void DualPipe_Wait(_DualPipe * dp)
       dp->exitCode = WEXITSTATUS(status);
       dp->gotExitCode = true;
    }
-#endif   
+#endif
 }
 
 _DualPipe * _DualPipeOpen(PipeOpenMode mode, char * commandLine, char * env, void ** inputPtr, void ** outputPtr)
@@ -297,7 +297,7 @@ _DualPipe * _DualPipeOpen(PipeOpenMode mode, char * commandLine, char * env, voi
       FILE * input = null, * output = null;
       int hInput[2] = { 0 }, hOutput[2] = { 0 };
       pid_t pid;
-      
+
       if((mode & POM_error) || (mode & POM_output))
          pipe(hOutput);
 
@@ -330,21 +330,21 @@ _DualPipe * _DualPipeOpen(PipeOpenMode mode, char * commandLine, char * env, voi
             close(hInput[PIPE_WRITE]);
          if(hOutput[PIPE_READ])
             close(hOutput[PIPE_READ]);
-         
+
          if((mode & POM_error) && hOutput[PIPE_WRITE] != STDERR_FILENO)
             dup2(hOutput[PIPE_WRITE], STDERR_FILENO);
 
          if((mode & POM_output) && hOutput[PIPE_WRITE] != STDOUT_FILENO)
             dup2(hOutput[PIPE_WRITE], STDOUT_FILENO);
          if(hOutput[PIPE_WRITE] && hOutput[PIPE_WRITE] != STDOUT_FILENO)
-            close(hOutput[PIPE_WRITE]);            
-         
+            close(hOutput[PIPE_WRITE]);
+
          if((mode & POM_input) && hInput[PIPE_READ] != STDIN_FILENO)
          {
             dup2(hInput[PIPE_READ], STDIN_FILENO);
             close(hInput[PIPE_READ]);
          }
-         
+
 #if 0 //#ifdef _DEBUG
          fprintf(stderr, "\n_DualPipeOpen (in child): %s\n\n", commandLineCopy);
 #endif
@@ -415,10 +415,10 @@ _DualPipe * _DualPipeOpen(PipeOpenMode mode, char * commandLine, char * env, voi
       if((mode & POM_output) || !hStdOut)
          CreatePipe(&hOutput[PIPE_READ],&hOutput[PIPE_WRITE],&sa,0);
 
-      if(( (mode & POM_error) && !(mode & POM_output)) || 
+      if(( (mode & POM_error) && !(mode & POM_output)) ||
          (!(mode & POM_error) && !hStdErr))
          CreatePipe(&hError[PIPE_READ], &hError[PIPE_WRITE],&sa,0);
-         
+
       if((mode & POM_input) || !hStdIn)
          CreatePipe(&hInput[PIPE_READ], &hInput[PIPE_WRITE], &sa,0);
 
@@ -430,7 +430,7 @@ _DualPipe * _DualPipeOpen(PipeOpenMode mode, char * commandLine, char * env, voi
          DuplicateHandle(GetCurrentProcess(),hOutput[PIPE_READ],GetCurrentProcess(),&hOutputRead,0,FALSE,DUPLICATE_SAME_ACCESS);
          DuplicateHandle(GetCurrentProcess(),hOutput[PIPE_WRITE],GetCurrentProcess(),&hError[PIPE_WRITE],0,TRUE,DUPLICATE_SAME_ACCESS);
       }
-      else 
+      else
       {
          if(hOutput[PIPE_WRITE])
             DuplicateHandle(GetCurrentProcess(),hOutput[PIPE_READ],GetCurrentProcess(),&hOutputRead,0,FALSE,DUPLICATE_SAME_ACCESS);
index bd9aff8..c2551b9 100644 (file)
@@ -49,7 +49,7 @@ public class DualPipe : File
 public:
    bool Peek() { return DualPipe_Peek(dp); }
    void Terminate() { DualPipe_Terminate(dp); }
-   int GetExitCode() { return DualPipe_GetExitCode(dp); }   
+   int GetExitCode() { return DualPipe_GetExitCode(dp); }
    int GetProcessID() { return DualPipe_GetProcessID(dp); }
    void Wait() { DualPipe_Wait(dp); }
 };
index e3912ac..fee97e2 100644 (file)
@@ -21,7 +21,7 @@ static class FreeBlock : struct
 };
 
 static struct EARHeader
-{                                               
+{
    byte recognition[sizeof(earRecognition)] __attribute__((packed));
    uint version                            __attribute__((packed));
    FileSize totalSize                      __attribute__((packed));
@@ -98,7 +98,7 @@ static FileAttribs EARGetEntry(File f, EAREntry entry, char * name, char * path)
       for(;;)
       {
          char fileName[MAX_FILENAME];
-         
+
          f.Read(entry, sizeof(EAREntry), 1);
          f.Read(fileName, 1, entry.nameLen);
          fileName[entry.nameLen] = '\0';
@@ -181,7 +181,7 @@ class EARArchive : Archive
          // Fix the size of the archive
          FileTruncate(path, archiveStart);
       }*/
-      
+
       freeBlocks.Free(null);
    }
 
@@ -229,7 +229,7 @@ class EARArchive : Archive
             rootDir = Position(2*sizeof(uint));
             dir.position = rootDir;
          }
-         
+
          result = dir;
 
          // Open rest of directory...
@@ -303,7 +303,7 @@ class EARArchive : Archive
          if(f.Seek(dirPosition + sizeof(uint), start))
             f.Write(&last, sizeof(uint), 1);
       }
-      
+
       for(; position; position = next)
       {
          EAREntry entry { };
@@ -376,7 +376,7 @@ class EARArchive : Archive
       for(position = directory.first; position; position = entry.next)
       {
          char fileName[MAX_FILENAME];
-      
+
          if(f.Seek(position, start) && f.Read(entry, sizeof(EAREntry), 1))
          {
             if(entry.nameLen > MAX_FILENAME)
@@ -399,12 +399,12 @@ class EARArchive : Archive
    void AddFreeBlock(uint position, uint size)
    {
       FreeBlock block, prevBlock, nextBlock = null;
-      
+
       // Find the previous and next free block
       prevBlock = null;
       for(block = freeBlocks.first; block; block = block.next)
          if(block.end < position)
-            prevBlock = block; 
+            prevBlock = block;
          else
          {
             nextBlock = block;
@@ -493,12 +493,12 @@ class EARArchive : Archive
          size = sizeof(EAREntry) + entry.nameLen + (entry.cSize ? entry.cSize : entry.size);
 
       // Unlink this file
-      if(entry.prev) 
+      if(entry.prev)
       {
          f.Seek(entry.prev + OFFSET(EAREntry, next), start);
          f.Write(&entry.next, sizeof(uint), 1);
       }
-      if(entry.next) 
+      if(entry.next)
       {
          f.Seek(entry.next + OFFSET(EAREntry, prev), start);
          f.Write(&entry.prev, sizeof(uint), 1);
@@ -779,7 +779,7 @@ class EARArchiveDir : ArchiveDir
             strcpy(namePart, DIR_SEPS);
 
          // Search for directory
-         
+
          position = archive.Find(this, namePart, entry);
          if(position)
          {
@@ -794,9 +794,9 @@ class EARArchiveDir : ArchiveDir
 
                archive.f.Read(&dir.first, sizeof(uint), 1);
                archive.f.Read(&dir.last, sizeof(uint), 1);
-               
+
                result = dir;
-            }               
+            }
          }
 
          // If directory doesn't exist already
@@ -863,7 +863,7 @@ class EARArchiveDir : ArchiveDir
       strcpy(namePart, name);
       if(!strcmp(namePart, "/") || !strcmp(namePart, "\\"))
          strcpy(namePart, DIR_SEPS);
-  
+
       position = archive.Find(this, namePart, entry);
       if(position)
       {
@@ -895,7 +895,7 @@ class EARArchiveDir : ArchiveDir
                archive.f.Seek(entry.prev + OFFSET(EAREntry, next), start);
                archive.f.Write(&entry.next, sizeof(uint), 1);
             }
-            if(entry.next) 
+            if(entry.next)
             {
                archive.f.Seek(entry.next + OFFSET(EAREntry, prev), start);
                archive.f.Write(&entry.prev, sizeof(uint), 1);
@@ -948,7 +948,7 @@ class EARArchiveDir : ArchiveDir
             dataSize = 2 * sizeof(uint);
          else
             dataSize = entry.cSize ? entry.cSize : entry.size;
-      
+
          newEntry.nameLen = strlen(newName);
          if(newEntry.nameLen > entry.nameLen)
          {
@@ -960,12 +960,12 @@ class EARArchiveDir : ArchiveDir
             archive.f.Write(newName, sizeof(char), newEntry.nameLen);
 
             // Fix the links
-            if(entry.prev) 
+            if(entry.prev)
             {
                archive.f.Seek(entry.prev + OFFSET(EAREntry, next), start);
                archive.f.Write(&newPosition, sizeof(uint), 1);
             }
-            if(entry.next) 
+            if(entry.next)
             {
                archive.f.Seek(entry.next + OFFSET(EAREntry, prev), start);
                archive.f.Write(&newPosition, sizeof(uint), 1);
@@ -983,7 +983,7 @@ class EARArchiveDir : ArchiveDir
 
             // There will be free space at the end of an entry with a shorter new name
             if(newEntry.nameLen < entry.nameLen)
-               archive.AddFreeBlock(position + sizeof(EAREntry) + newEntry.nameLen + dataSize, entry.nameLen - newEntry.nameLen);            
+               archive.AddFreeBlock(position + sizeof(EAREntry) + newEntry.nameLen + dataSize, entry.nameLen - newEntry.nameLen);
          }
          if(entry.nameLen != newEntry.nameLen)
          {
@@ -1076,9 +1076,9 @@ class EARArchiveDir : ArchiveDir
             break;
          // Only updates changed files
          case refresh:
-            if(oldPosition && 
-                 (oldEntry.size != stats.size || 
-                  oldEntry.modified != (TimeStamp32)stats.modified || 
+            if(oldPosition &&
+                 (oldEntry.size != stats.size ||
+                  oldEntry.modified != (TimeStamp32)stats.modified ||
                   oldEntry.created != (TimeStamp32)stats.created))
                   archive.Delete(this, oldPosition, oldEntry);
             else
@@ -1088,8 +1088,8 @@ class EARArchiveDir : ArchiveDir
          case update:
             if(oldPosition)
             {
-               if(oldEntry.size != stats.size || 
-                  oldEntry.modified != (TimeStamp32)stats.modified || 
+               if(oldEntry.size != stats.size ||
+                  oldEntry.modified != (TimeStamp32)stats.modified ||
                   oldEntry.created != (TimeStamp32)stats.created)
                   archive.Delete(this, oldPosition, oldEntry);
                else
@@ -1109,11 +1109,11 @@ class EARArchiveDir : ArchiveDir
          entry.prev = last;
          entry.next = 0;
          entry.type = ENTRY_FILE;
-         
+
          entry.size = stats.size;
          entry.created = (TimeStamp32)stats.created;
          entry.modified = (TimeStamp32)stats.modified;
-      
+
          if(compression)
          {
             byte * uncompressed = new byte[entry.size];
@@ -1197,7 +1197,7 @@ class EARArchiveDir : ArchiveDir
       {
          if(newPosition) *newPosition = 0;
       }
-               
+
       // archive.f.handle = archive.f;
       return true;
    }
@@ -1296,7 +1296,7 @@ class EARFile : File
       bool result = false;
       switch(mode)
       {
-         case start:   
+         case start:
             if(pos <= (int)size)
             {
                position = pos;
@@ -1327,7 +1327,7 @@ class EARFile : File
             }
             break;
       }
-      return result;   
+      return result;
    }
 
    uint Tell()
@@ -1518,7 +1518,7 @@ class EARFileSystem : FileSystem
                   file.stats.accessed = file.stats.modified = (TimeStamp)entry.modified;
                   file.stats.created = (TimeStamp)entry.created;
                   file.stats.size = entry.size;
-                  
+
                   strcpy(file.path, d.path);
                   PathCat(file.path, file.name);
                   d.next = entry.next;
@@ -1660,9 +1660,9 @@ class EARFileSystem : FileSystem
                   EAR_RECOGNITION,
                   MDWORD(0, 1)
                };
-                    
+
                archive.f.Seek(0, end);
-         
+
                archive.archiveStart = archive.f.Tell();
                archive.freeBlocks.Add(FreeBlock { start = archive.archiveStart + sizeof(EARHeader), end = MAXDWORD });
 
index a317fa5..0d06f0f 100644 (file)
@@ -111,11 +111,11 @@ static BOOL CALLBACK EnumThreadWindowsProc(HWND hwnd, LPARAM lParam)
 {
    DWORD pid;
    if(IsWindowVisible(hwnd) && GetWindowThreadProcessId(hwnd, &pid) && pid == GetCurrentProcessId())
-   {      
+   {
       *(void **)lParam = hwnd;
       return FALSE;
    }
-   return TRUE;   
+   return TRUE;
 }
 bool WinReviveNetworkResource(uint16 * _wfileName)
 {
@@ -147,7 +147,7 @@ bool WinReviveNetworkResource(uint16 * _wfileName)
    if(!windowHandle)
    {
       EnumWindows(EnumThreadWindowsProc, (LPARAM)&windowHandle);
-      
+
    }
    if(WNetAddConnection3(windowHandle, &nr, null, null, CONNECT_INTERACTIVE|CONNECT_PROMPT) == NO_ERROR)
       result = true;
@@ -189,7 +189,7 @@ bool FILE_Lock(FILE * input, FILE * output, FileLock type, uint64 start, uint64
             (uint)(length ? ((length & 0xFFFFFFFF00000000LL) >> 32) : 0xFFFFFFFF),
             &overlapped) != 0;
       else
-         return LockFileEx(hFile, ((type == exclusive) ? LOCKFILE_EXCLUSIVE_LOCK : 0) | (wait ? 0 : LOCKFILE_FAIL_IMMEDIATELY), 0, 
+         return LockFileEx(hFile, ((type == exclusive) ? LOCKFILE_EXCLUSIVE_LOCK : 0) | (wait ? 0 : LOCKFILE_FAIL_IMMEDIATELY), 0,
             (uint)(length ? (length & 0xFFFFFFFF) : 0xFFFFFFFF),
             (uint)(length ? ((length & 0xFFFFFFFF00000000LL) >> 32) : 0xFFFFFFFF),
             &overlapped) != 0;
@@ -205,7 +205,7 @@ bool FILE_Lock(FILE * input, FILE * output, FileLock type, uint64 start, uint64
 
       fd = fileno(output ? output : input);
       return fcntl(fd, wait ? F_SETLKW : F_SETLK, &fl) != -1;
-#endif      
+#endif
    }
 }
 
@@ -348,7 +348,7 @@ bool FILE_FileGetStats(char * fileName, FileStats * stats)
             stats->accessed = Win32FileTimeToTimeStamp(&a);
             stats->modified = Win32FileTimeToTimeStamp(&m);
 #endif
-            
+
             CloseHandle(hFile);
          }
       }
@@ -419,7 +419,7 @@ void FILE_FileFixCase(char * file)
       }
       // Copy Entire Computer to new path
       else if(file[0] == '/'  && !file[1])
-   
+
       {
          parent[0] = '/';
          parent[1] = '\0';
@@ -436,7 +436,7 @@ void FILE_FileFixCase(char * file)
          for(;(ch = file[c]) && (ch != '/' && ch != '\\'); c++)
          {
             if(len < MAX_FILENAME)
-               directory[len++] = ch;  
+               directory[len++] = ch;
          }
          directory[len] = '\0';
 
index 87c50e2..e652211 100644 (file)
@@ -50,7 +50,7 @@ BOOL WINAPI GetVolumePathName(LPCTSTR lpszFileName,LPTSTR lpszVolumePathName,DWO
 
 // Missing function...
 /*
-#ifndef WNetGetResourceInformation 
+#ifndef WNetGetResourceInformation
 DWORD APIENTRY WNetGetResourceInformationA(LPNETRESOURCE lpNetResource, LPVOID lpBuffer, LPDWORD lpcbBuffer, LPTSTR* lplpSystem);
 #ifdef UNICODE
 #define WNetGetResourceInformation  WNetGetResourceInformationW
@@ -290,7 +290,7 @@ public class File : IOChannel
    {
       Window editData = class::OnEdit(dataBox, obsolete, x + 24, y, w - 48, h, userData);
       Button load
-      { 
+      {
          dataBox, inactive = true, text = $"Import"."Imp", hotKey = f2,
          position = { Max(x + 24, x + w - 24), y }, size = { 24, h };
 
@@ -314,7 +314,7 @@ public class File : IOChannel
          }
       };
       Button save
-      { 
+      {
          dataBox, inactive = true, text = $"Export"."Exp", hotKey = f2,
          position = { Max(x + 24, x + w - 48), y }, size = { 24, h };
 
@@ -335,10 +335,10 @@ public class File : IOChannel
                   {
                      byte buffer[4096];
                      uint read = input.Read(buffer, 1, sizeof(buffer));
-                     f.Write(buffer, 1, read);                     
+                     f.Write(buffer, 1, read);
                   }
                   delete f;
-               }               
+               }
             }
             return true;
          }
@@ -518,7 +518,7 @@ public:
    {
       return input ? feof(input) : true;
    }
-   
+
    virtual bool Truncate(FileSize size)
    {
    #ifdef ECERE_BOOTSTRAP
@@ -529,7 +529,7 @@ public:
       return output ? (_chsize(fileno(output), size) == 0) : false;
    #else
       return output ? (ftruncate(fileno(output), size) == 0) : false;
-   #endif   
+   #endif
    #endif
    }
 
@@ -537,7 +537,7 @@ public:
    {
       return FILE_GetSize(input);
    }
-   
+
    virtual void CloseInput(void)
    {
       if(input)
@@ -630,13 +630,13 @@ public:
          while(c<max-1)
          {
             char ch = 0;
-         
+
             if(/*!Peek() || */ !Getc(&ch))
             {
                result = false;
                break;
             }
-            if(ch =='\n') 
+            if(ch =='\n')
                break;
             if(ch !='\r')
                s[c++]=ch;
@@ -680,11 +680,11 @@ public:
             else
                string[c]=ch;
 
-            if(!Getc(&ch)) 
+            if(!Getc(&ch))
             {
                c++;
                result = false;
-               break;            
+               break;
             }
          }
          string[c]=0;
@@ -727,7 +727,7 @@ public:
       set
       {
          FILE_set_buffered(input, output, value);
-      }      
+      }
    }
    property bool eof { get { return Eof(); } }
 
@@ -805,7 +805,7 @@ public:
          //if(!result)
          {
             /* TOFIX:
-            LogErrorCode((mode == Read || mode == ReadWrite) ? 
+            LogErrorCode((mode == Read || mode == ReadWrite) ?
                ERR_FILE_NOT_FOUND : ERR_FILE_WRITE_FAILED, fileName);
             */
          }
@@ -900,7 +900,7 @@ default void TimeStampToWin32FileTime(TimeStamp t, FILETIME * fileTime)
    // TIME_ZONE_INFORMATION tz = { 0 };
    SYSTEMTIME st, lt;
    DateTime tm;
-   
+
    tm = t;
 
    st.wYear = (short)tm.year;
@@ -1007,7 +1007,7 @@ public File FileOpen(char * fileName, FileOpenMode mode)
             {
                delete file;
                /* TOFIX:
-               LogErrorCode((mode == Read || mode == ReadWrite) ? 
+               LogErrorCode((mode == Read || mode == ReadWrite) ?
                   ERR_FILE_NOT_FOUND : ERR_FILE_WRITE_FAILED, fileName);
                */
             }
@@ -1113,7 +1113,7 @@ public bool FileSetTime(char * fileName, TimeStamp created, TimeStamp accessed,
       if(hFile != INVALID_HANDLE_VALUE)
       {
          FILETIME c, a, m;
-      
+
          TimeStampToWin32FileTime(created, &c);
          TimeStampToWin32FileTime(accessed, &a);
          TimeStampToWin32FileTime(modified, &m);
@@ -1127,7 +1127,7 @@ public bool FileSetTime(char * fileName, TimeStamp created, TimeStamp accessed,
             mm = Win32FileTimeToTimeStamp(&m);
          }
          */
-                  
+
          if(SetFileTime(hFile, &c, &a, &m))
             result = true;
 
@@ -1183,7 +1183,7 @@ static FileDesc FileFind(char * path, char * extensions)
       else
       {
          Dir d;
-      
+
          if((d = file.dir = Dir {}))
          {
 #if defined(__WIN32__)
@@ -1217,8 +1217,8 @@ static FileDesc FileFind(char * path, char * extensions)
                      }
                      drives ^= (1<<c);
                      if(driveType == DRIVE_NO_ROOT_DIR) continue;
-                  
-                     if(driveType != DRIVE_REMOVABLE && driveType != DRIVE_REMOTE && 
+
+                     if(driveType != DRIVE_REMOVABLE && driveType != DRIVE_REMOTE &&
                         GetVolumeInformation(_wfilePath, _wvolume, MAX_FILENAME - 1, null, null, null, null, 0))
                      {
                         file.path[2] = '\0';
@@ -1356,7 +1356,7 @@ static FileDesc FileFind(char * path, char * extensions)
 
                      size = 512 * sizeof(NETRESOURCE);
                      resources = (NETRESOURCE *)new0 byte[size];
-                  
+
                      // Entire Network
                      WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK, 0, &buffer[c], &handle);
                      while(true)
@@ -1545,7 +1545,7 @@ private class FileDesc : struct
                         _wpath[3] = 0;
                      }
 
-                     if(driveType != DRIVE_REMOVABLE && driveType != DRIVE_REMOTE && 
+                     if(driveType != DRIVE_REMOVABLE && driveType != DRIVE_REMOTE &&
                         GetVolumeInformation(_wpath, _wvolume, MAX_FILENAME - 1, null, null, null, null, 0))
                      {
                         UTF16toUTF8Buffer(_wvolume, volume, MAX_FILENAME);
@@ -1639,7 +1639,7 @@ private class FileDesc : struct
                               break;
                            countInGroup = 0xFFFFFFFF;
                            resources = (NETRESOURCE *)renew0 resources byte[size];
-                           
+
                         }
                         WNetCloseEnum(handle);
                         d.numResources = countInGroup;
@@ -1665,7 +1665,7 @@ private class FileDesc : struct
                      }
                      else
                      {
-                        if(d.resources) 
+                        if(d.resources)
                            delete d.resources;
                      }
                   }
@@ -1778,7 +1778,7 @@ public File CreateTemporaryFile(char * tempFileName, char * template)
    //strcpy(buffer, template);
    strcat(buffer, "XXXXXX");
    // mktemp(buffer);
-   fd = mkstemp(buffer);   
+   fd = mkstemp(buffer);
    strcpy(tempFileName, buffer);
    f = { };
    f.output = f.input = fdopen(fd, "r+");
@@ -1787,7 +1787,7 @@ public File CreateTemporaryFile(char * tempFileName, char * template)
    GetTempPathA(MAX_LOCATION, tempPath);     // TODO: Patch this whole thing to support Unicode temp path
    GetTempFileNameA(tempPath, template, 0, tempFileName);
    f = FileOpen(tempFileName, readWrite);
-#endif   
+#endif
    return f;
 #endif
 }
index b6f1fb0..7b1801d 100644 (file)
@@ -237,7 +237,7 @@ private:
    {
       if(watchFor & action)
       {
-         fileNotifies.Add(FileNotify { 
+         fileNotifies.Add(FileNotify {
                monitor = this, action = action, fileName = CopyString(fileName), param = CopyString(param)
             });
          return true;
@@ -269,7 +269,7 @@ static int CompareFiles(FileEntry e1, FileEntry e2, void * data)
       return 1;
    else if(e1.attribs.isDirectory && !e2.attribs.isDirectory)
       return -1;
-   else 
+   else
       return strcmp(e1.name, e2.name);
 }
 
@@ -365,7 +365,7 @@ static class MonitorThread : Thread
                      }
                      monitor.files.Free(FileEntry::Free);
                      monitor.files = newEntries;
-                  }            
+                  }
                }
                else if(monitor.fileName)
                {
@@ -381,7 +381,7 @@ static class MonitorThread : Thread
                   {
                      fileActivity |= monitor.AddFileNotify(FileChange { deleted = true }, monitor.fileName, null);
                      monitor.exists = false;
-                  }            
+                  }
                   else if(monitor.exists)
                   {
                      FileStats stats { };
@@ -424,7 +424,7 @@ static class MonitorThread : Thread
             // printf("[%d] Releasing Mutex...\n", (int)GetCurrentThreadID());
             globalSystem.fileMonitorMutex.Release();
          }
-         
+
          // printf("[%d] Sleeping...\n", (int)GetCurrentThreadID());
          Sleep(1.0 / 18.2);
       }
index 5360e0a..af16e4c 100644 (file)
@@ -47,7 +47,7 @@ static subclass(GlobalSettingsDriver) GetGlobalSettingsDriver(char * driverName)
       if(driver.name && !strcmp(driver.name, driverName))
          return driver;
    }
-   
+
    /*{
       Module module;
       char moduleName[MAX_LOCATION];
@@ -56,7 +56,7 @@ static subclass(GlobalSettingsDriver) GetGlobalSettingsDriver(char * driverName)
       {
          //Class dsdClass = class(GlobalSettingsDriver);
          Class dsdClass = eSystem_FindClass(module /-__thisModule.application-/, "GlobalSettingsDriver");
-         
+
          for(link = dsdClass.derivatives.first; link; link = link.next)
          {
             subclass(GlobalSettingsDriver) driver = link.data;
@@ -79,7 +79,7 @@ public:
    {
       set { delete settingsName; if(value && value[0]) settingsName = CopyString(value); }
       get { return settingsName; }
-   }; 
+   };
    property char * settingsExtension
    {
       set { delete settingsExtension; if(value && value[0]) settingsExtension = CopyString(value); }
@@ -93,7 +93,7 @@ public:
    property char * settingsFilePath
    {
       get { return settingsFilePath; }
-   }; 
+   };
    property bool allowDefaultLocations
    {
       set { allowDefaultLocations = value; }
@@ -164,7 +164,7 @@ private:
 
    char * PreparePortablePath()
    {
-      // 
+      //
       char * path = null;
       char location[MAX_LOCATION];
       LocateModule(null, location);
@@ -255,7 +255,7 @@ private:
       }
       return path;
    }
-   
+
    char * PrepareSystemPath()
    {
       char * path = new char[MAX_LOCATION];
@@ -384,7 +384,7 @@ public:
                   result = success;
             }
          }
-         
+
       }
       return result;
    }
@@ -519,7 +519,7 @@ public:
                      }
                   }
                   result = true;
-                  break;               
+                  break;
                }
             }
          }
@@ -561,7 +561,7 @@ public:
                   item.Next();
                   if(item.pointer)
                      strcat(outputLine, ",");
-               }            
+               }
                break;
             }
             case singleString:
@@ -599,8 +599,8 @@ public:
                if(!f.GetLine(line, sizeof(line)))
                   break;
                if(posBeforeSection == -1 || !line[0])
-                  posBeforeSection = pos;                
-               
+                  posBeforeSection = pos;
+
                if(line[0] == '[')
                {
                   // We've already reached next section
index 01c2c42..0b86099 100644 (file)
@@ -94,7 +94,7 @@ public:
       {
          Container array;
          result = GetArray(type, &array);
-         
+
          if(type && eClass_IsDerived(type, class(Container)))
          {
             value.p = array;
@@ -139,9 +139,9 @@ public:
          }
          buffer[c] = 0;
          result = success;
-         
+
          if(type)
-         { 
+         {
             if(!strcmp(type.name, "bool"))
             {
                if(!strcmpi(buffer, "false")) value.i = 0;
@@ -156,7 +156,7 @@ public:
                else
                   result = typeMismatch;
             }
-            else if(!strcmpi(buffer, "null")) 
+            else if(!strcmpi(buffer, "null"))
             {
                value.p = 0;
             }
@@ -214,18 +214,18 @@ public:
                {
                   t = value.ui64;
                }
-               else if(arrayType.typeSize == sizeof(int) || !strcmp(arrayType.dataTypeString, "int") || 
+               else if(arrayType.typeSize == sizeof(int) || !strcmp(arrayType.dataTypeString, "int") ||
                   !strcmp(arrayType.dataTypeString, "unsigned int") || !strcmp(arrayType.dataTypeString, "uint"))
                {
                   t = value.i;
                }
-               else if(arrayType.typeSize == sizeof(short int) || !strcmp(arrayType.dataTypeString, "short") || 
-                  !strcmp(arrayType.dataTypeString, "unsigned short") || !strcmp(arrayType.dataTypeString, "uint16") || 
+               else if(arrayType.typeSize == sizeof(short int) || !strcmp(arrayType.dataTypeString, "short") ||
+                  !strcmp(arrayType.dataTypeString, "unsigned short") || !strcmp(arrayType.dataTypeString, "uint16") ||
                   !strcmp(arrayType.dataTypeString, "int16"))
                {
                   t = value.s;
                }
-               else if(arrayType.typeSize == sizeof(byte) || !strcmp(arrayType.dataTypeString, "char") || 
+               else if(arrayType.typeSize == sizeof(byte) || !strcmp(arrayType.dataTypeString, "char") ||
                   !strcmp(arrayType.dataTypeString, "unsigned char") || !strcmp(arrayType.dataTypeString, "byte"))
                {
                   t = value.c;
@@ -265,7 +265,7 @@ public:
             }
          }
       }
-      ch = 0;  
+      ch = 0;
       return result;
    }
 
@@ -299,7 +299,7 @@ public:
                      f.Getc(&unicode[0]);
                      f.Getc(&unicode[1]);
                      f.Getc(&unicode[2]);
-                     f.Getc(&unicode[3]);                  
+                     f.Getc(&unicode[3]);
                   }
                   escaped = false;
                }
@@ -370,7 +370,7 @@ public:
                      }
                      else
                         PrintLn("Warning: member ", string, " not found in class ", (String)objectType.name);
-                  }                    
+                  }
                }
                // Find Member in Object Class
                {
@@ -425,18 +425,18 @@ public:
                                  {
                                     *(uint64 *)((byte *)*object + member._class.offset + member.offset) = value.ui64;
                                  }
-                                 else if(type.typeSize == sizeof(int) || !strcmp(type.dataTypeString, "int") || 
+                                 else if(type.typeSize == sizeof(int) || !strcmp(type.dataTypeString, "int") ||
                                     !strcmp(type.dataTypeString, "unsigned int") || !strcmp(type.dataTypeString, "uint"))
                                  {
                                     *(int *)((byte *)*object + member._class.offset + member.offset) = value.i;
                                  }
-                                 else if(type.typeSize == sizeof(short int) || !strcmp(type.dataTypeString, "short") || 
-                                    !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") || 
+                                 else if(type.typeSize == sizeof(short int) || !strcmp(type.dataTypeString, "short") ||
+                                    !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") ||
                                     !strcmp(type.dataTypeString, "int16"))
                                  {
                                     *(short *)((byte *)*object + member._class.offset + member.offset) = value.s;
                                  }
-                                 else if(type.typeSize == sizeof(byte) || !strcmp(type.dataTypeString, "char") || 
+                                 else if(type.typeSize == sizeof(byte) || !strcmp(type.dataTypeString, "char") ||
                                     !strcmp(type.dataTypeString, "unsigned char") || !strcmp(type.dataTypeString, "byte"))
                                  {
                                     *(char *)((byte *)*object + member._class.offset + member.offset) = value.c;
@@ -467,18 +467,18 @@ public:
                                  {
                                     ((void (*)(void *, uint64))(void *)prop.Set)(*object, value.ui64);
                                  }
-                                 else if(type.typeSize == sizeof(int) || !strcmp(type.dataTypeString, "int") || 
+                                 else if(type.typeSize == sizeof(int) || !strcmp(type.dataTypeString, "int") ||
                                     !strcmp(type.dataTypeString, "unsigned int") || !strcmp(type.dataTypeString, "uint"))
                                  {
                                     ((void (*)(void *, int))(void *)prop.Set)(*object, value.i);
                                  }
-                                 else if(type.typeSize == sizeof(short int) || !strcmp(type.dataTypeString, "short") || 
-                                    !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") || 
+                                 else if(type.typeSize == sizeof(short int) || !strcmp(type.dataTypeString, "short") ||
+                                    !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") ||
                                     !strcmp(type.dataTypeString, "int16"))
                                  {
                                     ((void (*)(void *, short))(void *)prop.Set)(*object, value.s);
                                  }
-                                 else if(type.typeSize == sizeof(byte) || !strcmp(type.dataTypeString, "char") || 
+                                 else if(type.typeSize == sizeof(byte) || !strcmp(type.dataTypeString, "char") ||
                                     !strcmp(type.dataTypeString, "unsigned char") || !strcmp(type.dataTypeString, "byte"))
                                  {
                                     ((void (*)(void *, char))(void *)prop.Set)(*object, value.c);
@@ -577,7 +577,7 @@ bool WriteArray(File f, Class type, Container array, int indent)
       Class arrayType = type.templateArgs[0].dataTypeClass;
       f.Puts("[\n");
       indent++;
-      
+
       while(it.Next())
       {
          byte * pointer;
@@ -586,8 +586,8 @@ bool WriteArray(File f, Class type, Container array, int indent)
          if(!isFirst)
             f.Puts(",\n");
          else
-            isFirst = false;         
-         
+            isFirst = false;
+
          // Add value
          // TODO: Verify the matching between template type and uint64
          if(arrayType.type == structClass)
@@ -607,18 +607,18 @@ bool WriteArray(File f, Class type, Container array, int indent)
          {
             value.ui64 = t;
          }
-         else if(arrayType.typeSize == sizeof(int) || !strcmp(arrayType.dataTypeString, "int") || 
+         else if(arrayType.typeSize == sizeof(int) || !strcmp(arrayType.dataTypeString, "int") ||
             !strcmp(arrayType.dataTypeString, "unsigned int") || !strcmp(arrayType.dataTypeString, "uint"))
          {
             value.i = (int)t;
          }
-         else if(arrayType.typeSize == sizeof(short int) || !strcmp(arrayType.dataTypeString, "short") || 
-            !strcmp(arrayType.dataTypeString, "unsigned short") || !strcmp(arrayType.dataTypeString, "uint16") || 
+         else if(arrayType.typeSize == sizeof(short int) || !strcmp(arrayType.dataTypeString, "short") ||
+            !strcmp(arrayType.dataTypeString, "unsigned short") || !strcmp(arrayType.dataTypeString, "uint16") ||
             !strcmp(arrayType.dataTypeString, "int16"))
          {
             value.s = (short)t;
          }
-         else if(arrayType.typeSize == sizeof(byte) || !strcmp(arrayType.dataTypeString, "char") || 
+         else if(arrayType.typeSize == sizeof(byte) || !strcmp(arrayType.dataTypeString, "char") ||
             !strcmp(arrayType.dataTypeString, "unsigned char") || !strcmp(arrayType.dataTypeString, "byte"))
          {
             value.c = (char)t;
@@ -629,11 +629,11 @@ bool WriteArray(File f, Class type, Container array, int indent)
          }
          for(i = 0; i<indent; i++) f.Puts("   ");
          WriteValue(f, arrayType, value, indent);
-      }      
+      }
       f.Puts("\n");
       indent--;
       for(i = 0; i<indent; i++) f.Puts("   ");
-      f.Puts("]");      
+      f.Puts("]");
    }
    else
       f.Puts("null");
@@ -733,7 +733,7 @@ bool WriteValue(File f, Class type, DataValue value, int indent)
    else if(type.type == enumClass)
    {
       f.Puts("\"");
-      WriteNumber(f, type, value, indent);      
+      WriteNumber(f, type, value, indent);
       f.Puts("\"");
    }
    else if(eClass_IsDerived(type, class(Container)))
@@ -791,7 +791,7 @@ static bool _WriteJSONObject(File f, Class objectType, void * object, int indent
          Property prop;
          int c;
          bool isFirst = true;
-         
+
          f.Puts("{\n");
          indent++;
 
@@ -821,18 +821,18 @@ static bool _WriteJSONObject(File f, Class objectType, void * object, int indent
                   {
                      value.ui64 = ((uint64 (*)(void *))(void *)prop.Get)(object);
                   }
-                  else if(type.typeSize == sizeof(int) || !strcmp(type.dataTypeString, "int") || 
+                  else if(type.typeSize == sizeof(int) || !strcmp(type.dataTypeString, "int") ||
                      !strcmp(type.dataTypeString, "unsigned int") || !strcmp(type.dataTypeString, "uint"))
                   {
                      value.i = ((int (*)(void *))(void *)prop.Get)(object);
                   }
-                  else if(type.typeSize == sizeof(short int) || !strcmp(type.dataTypeString, "short") || 
-                     !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") || 
+                  else if(type.typeSize == sizeof(short int) || !strcmp(type.dataTypeString, "short") ||
+                     !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") ||
                      !strcmp(type.dataTypeString, "int16"))
                   {
                      value.s = ((short (*)(void *))(void *)prop.Get)(object);
                   }
-                  else if(type.typeSize == sizeof(byte) || !strcmp(type.dataTypeString, "char") || 
+                  else if(type.typeSize == sizeof(byte) || !strcmp(type.dataTypeString, "char") ||
                      !strcmp(type.dataTypeString, "unsigned char") || !strcmp(type.dataTypeString, "byte"))
                   {
                      value.c = ((char (*)(void *))(void *)prop.Get)(object);
@@ -885,7 +885,7 @@ static bool _WriteJSONObject(File f, Class objectType, void * object, int indent
                   {
                      value.ui64 = *(uint64 *)((byte *)object + member._class.offset + member.offset);
                   }
-                  else if(type.typeSize == sizeof(int) || !strcmp(type.dataTypeString, "int") || 
+                  else if(type.typeSize == sizeof(int) || !strcmp(type.dataTypeString, "int") ||
                      !strcmp(type.dataTypeString, "unsigned int") || !strcmp(type.dataTypeString, "uint"))
                   {
                      value.i = *(int *)((byte *)object + member._class.offset + member.offset);
@@ -893,20 +893,20 @@ static bool _WriteJSONObject(File f, Class objectType, void * object, int indent
                         if(!value.i)
                            continue;
                   }
-                  else if(type.typeSize == sizeof(short int) || !strcmp(type.dataTypeString, "short") || 
-                     !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") || 
+                  else if(type.typeSize == sizeof(short int) || !strcmp(type.dataTypeString, "short") ||
+                     !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") ||
                      !strcmp(type.dataTypeString, "int16"))
                   {
                      value.s = *(short *)((byte *)object + member._class.offset + member.offset);
                   }
-                  else if(type.typeSize == sizeof(byte) || !strcmp(type.dataTypeString, "char") || 
+                  else if(type.typeSize == sizeof(byte) || !strcmp(type.dataTypeString, "char") ||
                      !strcmp(type.dataTypeString, "unsigned char") || !strcmp(type.dataTypeString, "byte"))
                   {
                      value.c = *(char *)((byte *)object + member._class.offset + member.offset);
                   }
                   else
                   {
-                     value.i = *(int *)((byte *)object + member._class.offset + member.offset);  
+                     value.i = *(int *)((byte *)object + member._class.offset + member.offset);
                   }
 
                   if(!isFirst) f.Puts(",\n");
@@ -920,7 +920,7 @@ static bool _WriteJSONObject(File f, Class objectType, void * object, int indent
                   isFirst = false;
                }
             }
-         }   
+         }
 
          indent--;
          f.Puts("\n");
index f7b22a6..a200fcb 100644 (file)
@@ -32,7 +32,7 @@ public class Semaphore : struct
    semaphore_t semaphore;
    int count;
    Mutex mutex { };
-#else   
+#else
    sem_t semaphore;
 #endif
 
index 496b844..5e7b2be 100644 (file)
@@ -144,7 +144,7 @@ bool System_MakeDir(char * path)
       for(;(ch = path[c]) && (ch != '/' && ch != '\\'); c++)
       {
          if(len < MAX_FILENAME)
-            directory[len++] = ch;  
+            directory[len++] = ch;
       }
       directory[len] = '\0';
       if(locationLen > 0 &&
@@ -196,7 +196,7 @@ bool System_RemoveDir(char * path)
       for(;(ch = path[c]) && (ch != '/' && ch != '\\'); c++)
       {
          if(len < MAX_FILENAME)
-            directory[len++] = ch;  
+            directory[len++] = ch;
       }
       directory[len] = '\0';
       if(locationLen > 0 &&
@@ -261,7 +261,7 @@ char * System_GetEnvironment(char * envName, char * envValue, int max)
       __ecereNameSpace__ecere__sys__UTF16toUTF8Buffer(result, (byte *)envValue, max);
    else
       envValue[0] = 0;
-      
+
    __ecereNameSpace__ecere__com__eSystem_Delete(_wenvName);
    return envValue; //result ? envValue : null;
 #else
@@ -284,7 +284,7 @@ void System_SetEnvironment(char * envName, char * envValue)
    __ecereNameSpace__ecere__com__eSystem_Delete(_wenvValue);
 #else
    setenv(envName, envValue, 1);
-#endif   
+#endif
 }
 
 void System_UnsetEnvironment(char * envName)
@@ -295,7 +295,7 @@ void System_UnsetEnvironment(char * envName)
    __ecereNameSpace__ecere__com__eSystem_Delete(_wenvName);
 #else
    unsetenv(envName);
-#endif   
+#endif
 }
 
 bool System_Execute(char * env, char * command, va_list args)
index 4133f3d..4fea82c 100644 (file)
@@ -82,7 +82,7 @@ public enum ErrorLevel
 {
    veryFatal = 0,
    fatal = 1,
-   major = 2,   
+   major = 2,
    minor = 3
 };
 
@@ -231,7 +231,7 @@ public void Log(char * text)
          break;
       }
 #endif
-      case stdOut: 
+      case stdOut:
          fputs(text, eC_stdout());
          fflush(eC_stdout());
          break;
@@ -251,7 +251,7 @@ public void Log(char * text)
       }
       case buffer:
       case msgBox:
-         strcat(globalSystem.errorBuffer, text); 
+         strcat(globalSystem.errorBuffer, text);
          break;
    }
 }
@@ -284,12 +284,12 @@ public void LogErrorCode(ErrorCode errorCode, char * details)
    if(errorCode.level <= globalSystem.errorLevel)
    {
       if(details)
-         Logf("System Error [%d]: %s (%s).\n", 
+         Logf("System Error [%d]: %s (%s).\n",
             errorCode.level,
-            errorMessages[errorCode.code], 
+            errorMessages[errorCode.code],
             details);
       else
-         Logf("System Error [%d]: %s.\n", 
+         Logf("System Error [%d]: %s.\n",
             errorCode.level,
             errorMessages[errorCode.code]);
    }
@@ -429,7 +429,7 @@ static DWORD REAL_ExceptionHandler(EXCEPTION_POINTERS *exception)
          break;
          */
    }
-   
+
    sprintf(title, "%s - Fatal Error", guiApp.appName);
 
    if(globalSystem.errorBuffer && globalSystem.errorBuffer[0])
@@ -440,7 +440,7 @@ static DWORD REAL_ExceptionHandler(EXCEPTION_POINTERS *exception)
    }
    else
       MessageBox(HWND_DESKTOP, exceptionString, title, MB_OK|MB_ICONERROR);
-   
+
    return EXCEPTION_EXECUTE_HANDLER;
 }
 #endif
index a009e2e..0feb666 100644 (file)
@@ -160,7 +160,7 @@ public class TempFile : File
          this.size += increase;
          this.buffer = renew this.buffer byte[this.size];
       }
-      return result;   
+      return result;
    }
 
    uint Tell()
index fac2a25..e81cdb6 100644 (file)
@@ -41,7 +41,7 @@ public class Thread
    ~Thread()
    {
 #if defined(__WIN32__)
-      if(handle) 
+      if(handle)
          CloseHandle(handle);
 #endif
    }
@@ -114,7 +114,7 @@ public:
          handle = null;
       }
 #else
-      if(started) 
+      if(started)
          pthread_kill(id, SIGQUIT);
 #endif
       if(started)
@@ -130,7 +130,7 @@ public:
       if(WaitForSingleObject(handle, INFINITE /*2000*/) == WAIT_TIMEOUT)
          PrintLn("Thread not returning?\n");
 #else
-      
+
       /*dontDetach = true;
       if(started)
          pthread_join(id, NULL);*/
@@ -151,7 +151,7 @@ public:
       param.sched_priority = (priority > 0) ? (priority * 99 / 15) : 0;
       pthread_setschedparam(id, policy, &param);
       */
-#endif      
+#endif
    }
 
    property bool created { get { return started; } };
index e5c3ef1..18e4ae7 100644 (file)
@@ -157,7 +157,7 @@ static uint TIME_CompTimeZoneID(const TIME_ZONE_INFORMATION *pTZinfo, FILETIME *
       else if( beforeStandardDate || afterDaylightDate )
          retval = TIME_ZONE_ID_DAYLIGHT;
    }
-   else 
+   else
       retval = TIME_ZONE_ID_UNKNOWN;
    return retval;
 }
@@ -177,7 +177,7 @@ static bool TIME_GetTimezoneBias(const TIME_ZONE_INFORMATION *pTZinfo, FILETIME
    return true;
 }
 
-static bool _TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTimeZoneInformation, LPSYSTEMTIME lpLocalTime, LPSYSTEMTIME lpUniversalTime)       
+static bool _TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTimeZoneInformation, LPSYSTEMTIME lpLocalTime, LPSYSTEMTIME lpUniversalTime)
 {
    FILETIME ft;
    LONG lBias;
@@ -219,7 +219,7 @@ public class Time : double
       value = (int)(time / (60 * 60 * 24));
       if(value)
       {
-         
+
          sprintf(temp, "%d:", value);
          strcat(tempString, temp);
          time -= value * 60 * 60 * 24;
@@ -532,7 +532,7 @@ public struct DateTime
       #else
          struct tm tm;
          //time_t t = (time_t)(SecSince1970)this;
-         time_t t = MakeTimeTfromDT(this);         
+         time_t t = MakeTimeTfromDT(this);
          gmtime_r(&t, &tm);
          value.year = tm.tm_year + 1900;
          value.month = (Month)tm.tm_mon;
@@ -594,7 +594,7 @@ public struct DateTime
       {
          int64 days, y;
          int rem;
-            
+
          days = value / SECS_PER_DAY;
          rem = (int)(value % SECS_PER_DAY);
 
@@ -666,7 +666,7 @@ public struct DateTime
       if(!year && !day && !month && !this.hour && !minute && !second)
          stringOutput[0] = 0;
       else
-         sprintf(stringOutput, "%s %s %2d %2d:%02d:%02d %s %04d", 
+         sprintf(stringOutput, "%s %s %2d %2d:%02d:%02d %s %04d",
             shortDaysNames[dayOfTheWeek], shortMonthsNames[month], day, hour, minute, second, ampm[pm], year);
 
       return stringOutput;
@@ -690,16 +690,16 @@ public struct DateTime
       for(c = 0; c < count; c++)
       {
          int i;
-         for(i = 0; i<7; i++) 
+         for(i = 0; i<7; i++)
             if(!strcmpi(tokens[c], shortDaysNames[i]) || !strcmpi(tokens[c], longDaysNames[i]) ||
                !strcmpi(tokens[c], enShortDaysNames[i]) || !strcmpi(tokens[c], enLongDaysNames[i]))
-               break;               
+               break;
          if(i < 7) { dayOfTheWeek = (DayOfTheWeek)i; foundDayOfTheWeek = true; continue; }
 
-         for(i = 0; i<12; i++) 
+         for(i = 0; i<12; i++)
             if(!strcmpi(tokens[c], shortMonthsNames[i]) || !strcmpi(tokens[c], longMonthsNames[i]) ||
                !strcmpi(tokens[c], enShortMonthsNames[i]) || !strcmpi(tokens[c], enLongMonthsNames[i]))
-               break;               
+               break;
          if(i < 12) { month = (Month)i; continue; }
 
          if(strchr(tokens[c], ':'))
@@ -714,9 +714,9 @@ public struct DateTime
                else if(!strcmpi(subTokens[t], "pm")) pm = true;
                else if(t-am-pm == 0) hour = atoi(subTokens[t]);
                else if(t-am-pm == 1) minute = atoi(subTokens[t]);
-               else if(t-am-pm == 2) second = atoi(subTokens[t]);               
+               else if(t-am-pm == 2) second = atoi(subTokens[t]);
             }
-            
+
             if(c < count - 1)
             {
                if(!strcmpi(tokens[c+1], "am")) am = true;
@@ -728,7 +728,7 @@ public struct DateTime
 
             continue;
          }
-         
+
          if(!foundDate)
          {
             if(strchr(tokens[c], '/') || strchr(tokens[c], '-'))
index 491ab0d..8ce51dd 100644 (file)
@@ -86,7 +86,7 @@ public dllexport void LoadTranslatedStrings(Module module, char * name)
          f.Read(&transStrings, sizeof(uint), 1);   if(swap) SWAP_DWORD(transStrings);
          f.Read(&hashingSize, sizeof(uint), 1);    if(swap) SWAP_DWORD(hashingSize);
          f.Read(&hashingOffset, sizeof(uint), 1);  if(swap) SWAP_DWORD(hashingOffset);
-         
+
          if(!moduleMaps)
             moduleMaps = { };
          {
index 2fb88a9..7fd8e24 100644 (file)
@@ -12,7 +12,7 @@ public void CopyBytes(void * dest, const void * source, uint count)
 #if !defined(ECERE_BOOTSTRAP) && (defined(__WATCOMC__) || defined(__MSC__) || defined(__BORLANDC__))
    _asm
    {
-      push esi      
+      push esi
       push edi
       push ecx
 
@@ -20,7 +20,7 @@ public void CopyBytes(void * dest, const void * source, uint count)
       mov edi,dest
       mov ecx,count
       rep movsb
-      
+
       pop ecx
       pop edi
       pop esi
@@ -88,7 +88,7 @@ public void CopyBytesBy4(void * dest, const void * source, uint count)
       mov edi,dest
       mov ecx,count
       rep movsd
-      
+
       pop ecx
       pop edi
       pop esi
@@ -154,7 +154,7 @@ public void FillBytesBy2(void * area, uint16 value, uint count)
       mov ecx,count
       mov ax,value
       rep stosw
-      
+
       pop eax
       pop ecx
       pop edi
index ce0ef92..00beb69 100644 (file)
@@ -77,9 +77,9 @@ public uint16 * UTF8toUTF16Len(char * source, int byteCount, int * wordCount)
          }
          if(i < numBytes)
             error = true;
-         if(codePoint > 0x10FFFF || (codePoint >= 0xD800 && codePoint <= 0xDFFF) || 
-           (codePoint < 0x80 && numBytes > 1) || 
-           (codePoint < 0x800 && numBytes > 2) || 
+         if(codePoint > 0x10FFFF || (codePoint >= 0xD800 && codePoint <= 0xDFFF) ||
+           (codePoint < 0x80 && numBytes > 1) ||
+           (codePoint < 0x800 && numBytes > 2) ||
            (codePoint < 0x10000 && numBytes > 3))
             error = true;
          if(error)
@@ -162,7 +162,7 @@ public int UTF8toUTF16BufferLen(char * source, uint16 * dest, int max, int len)
       dest[d] = 0;
       return d;
    }
-   return 0;   
+   return 0;
 }
 
 public int UTF16BEtoUTF8Buffer(uint16 * source, byte * dest, int max)
@@ -176,7 +176,7 @@ public int UTF16BEtoUTF8Buffer(uint16 * source, byte * dest, int max)
       if(u16 < 0xD800 || u16 > 0xDBFF)
       {
          // TOFIX: PRECOMP ERROR IF NO BRACKETS
-         ch = (unichar)u16;         
+         ch = (unichar)u16;
       }
       else
       {
@@ -286,7 +286,7 @@ public enum PredefinedCharCategories : CharCategories
    separators = CharCategories { separatorSpace = true, separatorLine = true, separatorParagraph = true },
    others = CharCategories { otherControl = true, otherFormat = true, otherSurrogate = true, otherPrivateUse = true, otherNotAssigned = true },
    letters = CharCategories { letterUpperCase = true, letterLowerCase = true, letterTitleCase = true, letterModifier = true, letterOther = true },
-   punctuation = CharCategories { punctiationConnector = true, punctuationDash = true, punctuationOpen = true, punctuationClose = true, punctuationInitial = true, 
+   punctuation = CharCategories { punctiationConnector = true, punctuationDash = true, punctuationOpen = true, punctuationClose = true, punctuationInitial = true,
                      punctuationFinal = true, punctuationOther = true },
    symbols = CharCategories { symbolMath = true, symbolCurrency = true, symbolModifier = true, symbolOther = true },
    connector = CharCategories { punctuationConnector = true },
@@ -372,21 +372,21 @@ static void FreeRange(Range range)
 
 static CharCategory asciiCategories[] =
 {
-   Cc, Cc, Cc, Cc, Cc, Cc, Cc, Cc, 
-   Cc, Cc, Cc, Cc, Cc, Cc, Cc, Cc, 
-   Cc, Cc, Cc, Cc, Cc, Cc, Cc, Cc, 
-   Cc, Cc, Cc, Cc, Cc, Cc, Cc, Cc, 
+   Cc, Cc, Cc, Cc, Cc, Cc, Cc, Cc,
+   Cc, Cc, Cc, Cc, Cc, Cc, Cc, Cc,
+   Cc, Cc, Cc, Cc, Cc, Cc, Cc, Cc,
+   Cc, Cc, Cc, Cc, Cc, Cc, Cc, Cc,
    Zs, Po, Po, Po, Sc, Po, Po, Po,
    Ps, Pe, Po, Sm, Cs, Pd, Po, Po,
    Nd, Nd, Nd, Nd, Nd, Nd, Nd, Nd,
    Nd, Nd, Po, Po, Sm, Sm, Sm, Po,
-   Po, Lu, Lu, Lu, Lu, Lu, Lu, Lu, 
-   Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu, 
-   Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu, 
+   Po, Lu, Lu, Lu, Lu, Lu, Lu, Lu,
+   Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu,
+   Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu,
    Lu, Lu, Lu, Ps, Po, Pe, Sk, Pc,
-   Sk, Ll, Ll, Ll, Ll, Ll, Ll, Ll, 
-   Ll, Ll, Ll, Ll, Ll, Ll, Ll, Ll, 
-   Ll, Ll, Ll, Ll, Ll, Ll, Ll, Ll, 
+   Sk, Ll, Ll, Ll, Ll, Ll, Ll, Ll,
+   Ll, Ll, Ll, Ll, Ll, Ll, Ll, Ll,
+   Ll, Ll, Ll, Ll, Ll, Ll, Ll, Ll,
    Ll, Ll, Ll, Ps, Sm, Pe, Sm, Cc
 };
 
@@ -496,7 +496,7 @@ static class UnicodeDatabase
                            {
                               node.key = (uintptr)new Range[1];
                               *(Range *)node.key = range;
-                           } 
+                           }
                            else
                               delete node;
                         }
@@ -527,7 +527,7 @@ static class UnicodeDatabase
                string[len++] = ';';
                string[len++] = ' ';
                range->category.OnGetString(string + len, null, null);
-               len += 2;                              
+               len += 2;
                string[len++] = '\n';
                string[len] = '\0';
                f.Puts(string);
@@ -535,7 +535,7 @@ static class UnicodeDatabase
             delete f;
          }
          */
-      }      
+      }
    }
    ~UnicodeDatabase()
    {
index 86777d2..abac3fc 100644 (file)
@@ -41,7 +41,7 @@ public struct Box
    void ClipOffset(Box against, int x, int y)
    {
       // Clip Top Left
-      //if(against) 
+      //if(against)
       {
          if(left   + x < against.left)   left   = against.left   - x;
          if(top    + y < against.top)    top    = against.top    - y;
@@ -64,7 +64,7 @@ public struct Box
    void Clip(Box against)
    {
       // Clip Top Left
-      if(against != null) 
+      if(against != null)
       {
          if(left   < against.left)   left   = against.left;
          if(top    < against.top)    top    = against.top;
@@ -95,7 +95,7 @@ public struct Box
    }
 
    property int width
-   { 
+   {
       set { right = left + value - 1; }
       get { return right - left + 1; }
    }
@@ -114,7 +114,7 @@ public class Radians : Angle
    public property Angle { };
 }
 
-public class Degrees : Angle 
+public class Degrees : Angle
 {
    public property Radians
    {
index bb6fc86..858b3a1 100644 (file)
@@ -20,12 +20,12 @@ static void LogMySqlError(MYSQL * mySql, String msg)
 static void LogMySqlErrorf(MYSQL * mySql, String format, ...)
 {
    char msg[MAX_F_STRING];
-   
+
    va_list args;
    va_start(args, format);
    vsprintf(msg, format, args);
    va_end(args);
-   
+
    Logf("%s\n   MySql Error: #%d %s\n", msg, mysql_errno(mySql), mysql_error(mySql));
 }
 
@@ -86,7 +86,7 @@ static class MySqlRow : struct
 public:
    MYSQL_ROW myRow;
    unsigned long *myLengths;
-   
+
    MySqlTable dTbl;
    MySqlField dFld;
 
@@ -135,7 +135,7 @@ public:
          pszT = mysql_get_host_info(src.mySql); Logf("   Host info: %s\n", pszT);
          pszT = mysql_get_server_info(src.mySql); Logf("   Server info: %s\n", pszT);
       Log("     _____________________________________\n\n");
-      
+
       Log(" ********************************************* \n");
       Log(" *      Stats                                * \n");
       Log(" ********************************************* \n");
@@ -207,7 +207,7 @@ public:
       Log("TODO: MySql - DatabaseNameGet");
       return null;
    }
-   
+
    bool ::DatabaseNameSet(Database db, const String value)
    {
       MySqlDatabase dDb = (MySqlDatabase)db.driverData;
@@ -222,7 +222,7 @@ public:
       Table databases;
       db.driver = ds.driver;
       db.driverData = (void *)dDb;
-      
+
       databases = ds.OpenTable(null, { databasesList });
       if(databases)
       {
@@ -250,7 +250,7 @@ public:
       }
       else
          Log("Unable to detect if database exists!\n");
-      
+
       if(mysql_select_db(dDb.mySql, name) < 0)
       {
          LogMySqlErrorf(src.mySql, "Can't open the %s database!\n", db);
@@ -272,7 +272,7 @@ public:
       Log("TODO: MySql - DatabaseDelete");
       return false;
    }
-   
+
    /* -------------------------------------------------------------------------------------------------- */
    /* --- Table ---------------------------------------------------------------------------------------- */
 
@@ -281,19 +281,19 @@ public:
       MySqlTable dTbl = (MySqlTable)tbl.driverData;
       if(dTbl.myRes) mysql_free_result(dTbl.myRes);
    }
-   
+
    uint ::TableFieldsCount(Table tbl)
    {
       MySqlTable dTbl = (MySqlTable)tbl.driverData;
       return mysql_num_fields(dTbl.myRes);
    }
-   
+
    uint ::TableRowsCount(Table tbl)
    {
       MySqlTable dTbl = (MySqlTable)tbl.driverData;
       return (uint)mysql_num_rows(dTbl.myRes);
    }
-   
+
    Field ::TableField(Table tbl)
    {
       MySqlTable dTbl = (MySqlTable)tbl.driverData;
@@ -315,7 +315,7 @@ public:
       }
       return dTbl.row;
    }
-   
+
    String ::TableNameGet(Table tbl)
    {
       MySqlTable dTbl = (MySqlTable)tbl.driverData;
@@ -359,7 +359,7 @@ public:
          else if(options.type == viewRows)
             ;
       }
-      
+
       if(options.type == tableRows)
       {
          if(tables)
@@ -550,7 +550,7 @@ public:
       name[dFld.myFlds[dFld.fldsPos].org_name_length] = '\0';
       return name;
    }
-   
+
    bool ::FieldNameSet(Field fld, const String value)
    {
       MySqlField dFld = (MySqlField)fld.driverData;
@@ -572,7 +572,7 @@ public:
       }
       return dRow.fld;
    }
-   
+
    bool ::RowEnd(Row row)
    {
       MySqlRow dRow = (MySqlRow)row.driverData;
@@ -605,7 +605,7 @@ public:
          return false;
       }
       dRow.rowsPos--;
-      dRow.myRow = mysql_fetch_row(dTbl.myRes);  // this won't work at all... 
+      dRow.myRow = mysql_fetch_row(dTbl.myRes);  // this won't work at all...
       Log("TODO: MySql - FieldNameSet");
       return false;
       return true;
@@ -657,7 +657,7 @@ public:
       MySqlRow dRow = (MySqlRow)row.driverData;
       MySqlTable dTbl = dRow.dTbl;
       MySqlField dFld = dRow.dFld;
-      
+
       switch(dFld.myFlds[dFld.fldsPos].type)
       {
          case FIELD_TYPE_TINY:
index a4cc972..532d8b0 100644 (file)
@@ -13,7 +13,7 @@ static class PgSQLDataSource : DataSourceDriver
    {
       char r[MAX_F_STRING];
       char t[MAX_LOCATION];
-      
+
       /*
       host
       hostaddr
@@ -29,7 +29,7 @@ static class PgSQLDataSource : DataSourceDriver
       krbsrvname
       service
       */
-      
+
       r[0] = '\0';
       if(ds.host)
          sprintf(t, "host=%s ", ds.host), strcat(r, t);
@@ -86,7 +86,7 @@ static class PgSQLDataSource : DataSourceDriver
       char dbLocator[MAX_F_STRING];
       PGconn * conn;
       PgSQLDatabase db;
-      
+
       //PGconn *PQconnectStart(const char *conninfo);
       //PostgresPollingStatusType PQconnectPoll(PGconn *conn);
       //void PQreset(PGconn *conn);
@@ -197,7 +197,7 @@ class PgSQLDatabase : Database
          ExecStatusType status;
          PgSQLTable tbl { };
          tbl.res = PQexec(conn, sql);
-         //PGresult *PQexecParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, 
+         //PGresult *PQexecParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes,
          //             const char * const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat);
          //PGresult *PQprepare(PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes);
          //PGresult *PQexecPrepared(PGconn *conn, const char *stmtName, int nParams, const char * const *paramValues,
@@ -291,22 +291,22 @@ class PgSQLTable : Table
    {
       return res ? PQnfields(res) : 0;
    }
-   
+
    uint GetRowsCount()
    {
       return res ? PQntuples(res) : 0;
    }
-   
+
    DriverRow CreateRow()
    {
       return null;
    }
-   
+
    Field AddField(const String name, Class type, int length)
    {
       return null;
    }
-   
+
    //char *PQfname(const PGresult *res, int column_number);
    //Oid PQftable(const PGresult *res, int column_number);
    //int PQftablecol(const PGresult *res, int column_number);
@@ -321,7 +321,7 @@ class PgSQLTable : Table
    //int PQnparams(const PGresult *res);
    //Oid PQparamtype(const PGresult *res, int param_number);
    //void PQprint(FILE *fout,      /* output stream */ const PGresult *res, const PQprintOpt *po);
-   
+
    //char *PQcmdStatus(PGresult *res);
    //char *PQcmdTuples(PGresult *res);
    //Oid PQoidValue(const PGresult *res);
@@ -348,7 +348,7 @@ class PgSQLTable : Table
       }
       return null;
    }
-   
+
    bool Index(int count, FieldIndex * fieldIndexes)
    {
       return false;
@@ -359,7 +359,7 @@ static class PgSQLField : Field
 {
 public:
    PgSQLTable tbl;
-   
+
    Class type;
    int length;
 
@@ -435,7 +435,7 @@ static class PgSQLRow : DriverRow
    {
       return _num == -1;
    }
-   
+
    bool Select(MoveOptions move)
    {
       int rowsCount = tbl.GetRowsCount();
index 8f6ac4e..3d70d96 100644 (file)
@@ -58,13 +58,13 @@ void ToUpperAndUnderscore(String stringValue)
 
 int OracleExecuteNonQuery(OCIEnv* env, OCISvcCtx* svc, String command)
 {
-   OCIStmt* stmt; 
+   OCIStmt* stmt;
    OCIError* err;
    text errbuf[512];
    ub4 buflen;
    ub4 errcode;
    int r;
-   
+
    OCIHandleAlloc(env, (dvoid**)&err, OCI_HTYPE_ERROR,   0, 0);
    OCIHandleAlloc(env, (dvoid**)&stmt, OCI_HTYPE_STMT, 0, 0);
 
@@ -74,7 +74,7 @@ int OracleExecuteNonQuery(OCIEnv* env, OCISvcCtx* svc, String command)
 
    r = OCIStmtExecute(svc, stmt, err, 1, 0,
       (OCISnapshot *) 0, (OCISnapshot *) 0, OCI_COMMIT_ON_SUCCESS);
-   
+
    OCIStmtRelease(stmt, err, (OraText *)NULL, 0, OCI_DEFAULT);
 
    if (err) OCIHandleFree(err, OCI_HTYPE_ERROR);
@@ -141,7 +141,7 @@ class OracleDataSource : DataSourceDriver
 
       char s[MAX_F_STRING];
       char t[MAX_LOCATION];
-      
+
       s[0] = '\0';
       strcat(s, "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(");
       if(ds.host)
@@ -153,14 +153,14 @@ class OracleDataSource : DataSourceDriver
       if(name)
          sprintf(t, "SID=%s", name), strcat(s, t);
       strcat(s, ")))");
-      
+
       if (ses) OCIHandleFree(ses, OCI_HTYPE_SESSION);
       if (svc) OCIHandleFree(svc, OCI_HTYPE_SVCCTX);
       if (srv) OCIHandleFree(srv, OCI_HTYPE_SERVER);
       if (err) OCIHandleFree(err, OCI_HTYPE_ERROR);
       if (env) OCIHandleFree(env, OCI_HTYPE_ENV);
 
-      r = OCIEnvCreate(&env, OCI_DEFAULT, 0, 0, 0, 0, 0, 0);                  
+      r = OCIEnvCreate(&env, OCI_DEFAULT, 0, 0, 0, 0, 0, 0);
 
       OCIHandleAlloc(env, (dvoid**)&err, OCI_HTYPE_ERROR,   0, 0);
       OCIHandleAlloc(env, (dvoid**)&srv, OCI_HTYPE_SERVER,  0, 0);
@@ -171,7 +171,7 @@ class OracleDataSource : DataSourceDriver
 
       OCIAttrSet(svc, OCI_HTYPE_SVCCTX, srv, 0, OCI_ATTR_SERVER,  err);
 
-      OCIAttrSet(ses, OCI_HTYPE_SESSION, ds.user, strlen(ds.user), OCI_ATTR_USERNAME, err); 
+      OCIAttrSet(ses, OCI_HTYPE_SESSION, ds.user, strlen(ds.user), OCI_ATTR_USERNAME, err);
       OCIAttrSet(ses, OCI_HTYPE_SESSION, ds.pass, strlen(ds.pass), OCI_ATTR_PASSWORD, err);
 
       r = OCISessionBegin(svc, err, ses, OCI_CRED_RDBMS, OCI_DEFAULT);
@@ -236,7 +236,7 @@ class OracleDatabase : Database
    OCIServer* srv;
    OCISvcCtx* svc;
    OCISession* ses;
-   
+
    ~OracleDatabase()
    {
       //
@@ -278,7 +278,7 @@ class OracleDatabase : Database
       OCIDefine* p_dfn3;
       char p_sli1[1024];
       char p_sli2[1024];
-      int p_sli3; 
+      int p_sli3;
 
       int oracleType;
 
@@ -313,7 +313,7 @@ class OracleDatabase : Database
          OracleField field;
          int num;
 
-         OCIStmt* stmtRows; 
+         OCIStmt* stmtRows;
 
          OCIHandleAlloc(env, (dvoid**)&stmtRows, OCI_HTYPE_STMT, 0, 0);
 
@@ -352,10 +352,10 @@ class OracleDatabase : Database
 
             if (type)
             {
-               if(!strcmp(type.dataTypeString, "int") || !strcmp(type.dataTypeString, "unsigned int") || 
-                  !strcmp(type.dataTypeString, "long") || !strcmp(type.dataTypeString, "long int") || 
-                  !strcmp(type.dataTypeString, "uint") || !strcmp(type.dataTypeString, "uint32") || 
-                  !strcmp(type.dataTypeString, "int64") || !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64") || 
+               if(!strcmp(type.dataTypeString, "int") || !strcmp(type.dataTypeString, "unsigned int") ||
+                  !strcmp(type.dataTypeString, "long") || !strcmp(type.dataTypeString, "long int") ||
+                  !strcmp(type.dataTypeString, "uint") || !strcmp(type.dataTypeString, "uint32") ||
+                  !strcmp(type.dataTypeString, "int64") || !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64") ||
                   !strcmp(type.dataTypeString, "short") || !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") ||
                   !strcmp(type.dataTypeString, "char") || !strcmp(type.dataTypeString, "unsigned char") || !strcmp(type.dataTypeString, "byte"))
                   oracleType = SQLT_INT;
@@ -383,7 +383,7 @@ class OracleDatabase : Database
             {
                oracleType = SQLT_TIMESTAMP_TZ;
             }
-            
+
             field = { name = CopyString(p_sli1), type = type, length = p_sli3, num = table.fields.count, oracleType = oracleType };
             incref field;
             table.fields.Add(field);
@@ -391,7 +391,7 @@ class OracleDatabase : Database
 
          OCIStmtRelease(stmtRows, err, (OraText *)NULL, 0, OCI_DEFAULT);
 
-         if (stmtRows) OCIHandleFree(stmtRows, OCI_HTYPE_STMT);   
+         if (stmtRows) OCIHandleFree(stmtRows, OCI_HTYPE_STMT);
       }
 
       return (Table)table;
@@ -433,7 +433,7 @@ class OracleTable : Table
    OCIStmt* stmt;
    OCIDefine* def;
    OCIDefine* p_dfn;
-   char p_sli[1024];  
+   char p_sli[1024];
 
    Field AddField(const String fieldName, Class type, int length)
    {
@@ -448,17 +448,17 @@ class OracleTable : Table
       command[0] = 0;
 
       if(FindField(fieldName)) return null;
-      
+
       oracleType = SQLT_BLOB;
 
       ((Class)(&type)).OnGetDataFromString(type);    // TODO: THIS REQUIRES A FIX SOMEWHERE ELSE
 
       if (type)
       {
-         if(!strcmp(type.dataTypeString, "int") || !strcmp(type.dataTypeString, "unsigned int") || 
-            !strcmp(type.dataTypeString, "long") || !strcmp(type.dataTypeString, "long int") || 
-            !strcmp(type.dataTypeString, "uint") || !strcmp(type.dataTypeString, "uint32") || 
-            !strcmp(type.dataTypeString, "int64") || !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64") || 
+         if(!strcmp(type.dataTypeString, "int") || !strcmp(type.dataTypeString, "unsigned int") ||
+            !strcmp(type.dataTypeString, "long") || !strcmp(type.dataTypeString, "long int") ||
+            !strcmp(type.dataTypeString, "uint") || !strcmp(type.dataTypeString, "uint32") ||
+            !strcmp(type.dataTypeString, "int64") || !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64") ||
             !strcmp(type.dataTypeString, "short") || !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") ||
             !strcmp(type.dataTypeString, "char") || !strcmp(type.dataTypeString, "unsigned char") || !strcmp(type.dataTypeString, "byte"))
             oracleType = SQLT_INT;
@@ -496,7 +496,7 @@ class OracleTable : Table
 
    Field FindField(const String name)
    {
-      String upperName = CopyString(name);     
+      String upperName = CopyString(name);
       ToUpperAndUnderscore(upperName);
 
       for(f : fields)
@@ -517,8 +517,8 @@ class OracleTable : Table
                }
             }
 
-            delete upperFieldName;            
-            return (Field)f;  
+            delete upperFieldName;
+            return (Field)f;
          }
 
          delete upperFieldName;
@@ -555,8 +555,8 @@ class OracleTable : Table
       int nCols, nRows;
       int result;
       uint rowCount = 0;
-      
-      OCIStmt* stmtCount; 
+
+      OCIStmt* stmtCount;
       OCIError* err;
       text errbuf[512];
       ub4 buflen;
@@ -638,7 +638,7 @@ class OracleTable : Table
       }
 
       if (stmt) OCIHandleFree(stmt, OCI_HTYPE_STMT);
-      OCIHandleAlloc(db.env, (dvoid**)&stmt, OCI_HTYPE_STMT, 0, 0); 
+      OCIHandleAlloc(db.env, (dvoid**)&stmt, OCI_HTYPE_STMT, 0, 0);
 
       for (i = 0; i < fields.count; i++)
       {
@@ -650,7 +650,7 @@ class OracleTable : Table
       r = OCIStmtPrepare(stmt, db.err, (OraText *)command,
          (ub4)strlen((char *)command),
          (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT);
-      
+
       for (i = 0; i < fields.count; i++)
       {
          OracleField field = fields[i];
@@ -696,7 +696,7 @@ class OracleTable : Table
 
    ~OracleTable()
    {
-      if (stmt) OCIHandleFree(stmt, OCI_HTYPE_STMT); 
+      if (stmt) OCIHandleFree(stmt, OCI_HTYPE_STMT);
 
       delete name;
       delete specialStatement;
@@ -713,7 +713,7 @@ class OracleRow : DriverRow
    done = true;
    int64 rowID;
    int numVal;
-   
+
    bool Nil()
    {
       return done;
@@ -728,7 +728,7 @@ class OracleRow : DriverRow
       int r;
 
       text errbuf[512];
-      ub4 errcode;  
+      ub4 errcode;
       int i;
 
       switch(move)
@@ -764,7 +764,7 @@ class OracleRow : DriverRow
             break;
          }
          case previous:
-         {           
+         {
             break;
          }
          case nil:
@@ -804,7 +804,7 @@ class OracleRow : DriverRow
       {
          OracleField oracleField = (OracleField)fld;
          Class dataType = oracleField.type;
-         int r;  
+         int r;
 
          switch (oracleField.oracleType)
          {
@@ -819,7 +819,7 @@ class OracleRow : DriverRow
 
                      rowID = 1;
                      r = OCIStmtFetch2(tbl.stmt, tbl.db.err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT);
-                     
+
                      if (oracleField.p_sliInt == dataValue)
                      {
                         return true;
@@ -841,7 +841,7 @@ class OracleRow : DriverRow
 
                      rowID = 1;
                      r = OCIStmtFetch2(tbl.stmt, tbl.db.err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT);
-                     
+
                      if (oracleField.p_sliInt == dataValue)
                      {
                         return true;
@@ -863,7 +863,7 @@ class OracleRow : DriverRow
 
                      rowID = 1;
                      r = OCIStmtFetch2(tbl.stmt, tbl.db.err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT);
-                     
+
                      if (oracleField.p_sliInt == dataValue)
                      {
                         return true;
@@ -887,7 +887,7 @@ class OracleRow : DriverRow
 
                         rowID = 1;
                         r = OCIStmtFetch2(tbl.stmt, tbl.db.err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT);
-                        
+
                         if (oracleField.p_sliInt == dataValue)
                         {
                            return true;
@@ -908,7 +908,7 @@ class OracleRow : DriverRow
 
                         rowID = 1;
                         r = OCIStmtFetch2(tbl.stmt, tbl.db.err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT);
-                        
+
                         if (oracleField.p_sliInt == dataValue)
                         {
                            return true;
@@ -922,7 +922,7 @@ class OracleRow : DriverRow
                               return true;
                            }
                         }
-                     }                     
+                     }
                      break;
                   }
                }
@@ -934,7 +934,7 @@ class OracleRow : DriverRow
 
                rowID = 1;
                r = OCIStmtFetch2(tbl.stmt, tbl.db.err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT);
-               
+
                if (oracleField.p_sliInt == dataValue)
                {
                   return true;
@@ -956,7 +956,7 @@ class OracleRow : DriverRow
 
                rowID = 1;
                r = OCIStmtFetch2(tbl.stmt, tbl.db.err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT);
-               
+
                if (!strcmp(oracleField.p_sli, dataValue))
                {
                   return true;
@@ -981,9 +981,9 @@ class OracleRow : DriverRow
 
                rowID = 1;
                r = OCIStmtFetch2(tbl.stmt, tbl.db.err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT);
-               
+
                OCIDateTimeGetDate(tbl.db.env, tbl.db.err, oracleField.p_sliDateTime,
-                  &year, &month, &day);  
+                  &year, &month, &day);
 
                if ((year == date.year) && ((Month)(month-1) == date.month) && (day == date.day))
                {
@@ -1009,7 +1009,7 @@ class OracleRow : DriverRow
             }
          }
       }
-      
+
       return false;
    }
 
@@ -1059,17 +1059,17 @@ class OracleRow : DriverRow
       {
          /* New row with id as max(id)+i*/
          sprintf(command, "INSERT INTO %s (%s) SELECT MAX(CAST(%s AS INTEGER)) + 1 FROM %s",
-            tableName, primaryKeyName, primaryKeyName, tbl.name); 
+            tableName, primaryKeyName, primaryKeyName, tbl.name);
       }
 
       OracleExecuteNonQuery(tbl.db.env, tbl.db.svc, command);
-      
+
       OCIStmtRelease(tbl.stmt, tbl.db.err, (OraText *)NULL, 0, OCI_DEFAULT);
 
       r = OCIStmtExecute(tbl.db.svc, tbl.stmt, tbl.db.err, 0, 0,
-         (OCISnapshot *) 0, (OCISnapshot *) 0, OCI_STMT_SCROLLABLE_READONLY); 
+         (OCISnapshot *) 0, (OCISnapshot *) 0, OCI_STMT_SCROLLABLE_READONLY);
       r = OCIStmtFetch2(tbl.stmt, tbl.db.err, 1, OCI_FETCH_LAST, 0, OCI_DEFAULT);
-      
+
       delete primaryKeyName;
       delete tableName;
 
@@ -1098,7 +1098,7 @@ class OracleRow : DriverRow
       {
          primaryKeyName = CopyString(tbl.GetFirstField().name);
       }
-      
+
       primaryKeyField = (OracleField)tbl.FindField(primaryKeyName);
 
       tableName = CopyString(tbl.name);
@@ -1208,7 +1208,7 @@ class OracleRow : DriverRow
             buffer.count = buffer._size;
 
             dataType._vTbl[__ecereVMethodID_class_OnUnserialize](dataType, data, buffer);
-           
+
             buffer._buffer = null;
             delete buffer;
             break;
@@ -1242,7 +1242,7 @@ class OracleRow : DriverRow
       {
          primaryKeyName = CopyString(tbl.GetFirstField().name);
       }
-      
+
       primaryKeyField = (OracleField)tbl.FindField(primaryKeyName);
       if (primaryKeyField.oracleType == SQLT_STR)
       {
@@ -1294,7 +1294,7 @@ class OracleRow : DriverRow
                }
             }
             break;
-         case SQLT_FLT:            
+         case SQLT_FLT:
             sprintf(command, "UPDATE %s SET %s = '%i' WHERE %s = %s", tableName, fieldName, (uint16)data, primaryKeyName, primaryKeyValue);
             r = OracleExecuteNonQuery(tbl.db.env, tbl.db.svc, command);
             break;
@@ -1327,7 +1327,7 @@ class OracleRow : DriverRow
             break;
          }
          case SQLT_BLOB: // No basic datatype
-         {           
+         {
             break;
          }
       }
@@ -1341,16 +1341,16 @@ class OracleRow : DriverRow
 
       actualRowID = rowID;
       OracleExecuteNonQuery(tbl.db.env, tbl.db.svc, command);
-      
+
       OCIStmtRelease(tbl.stmt, tbl.db.err, (OraText *)NULL, 0, OCI_DEFAULT);
 
       r = OCIStmtExecute(tbl.db.svc, tbl.stmt, tbl.db.err, 0, 0,
-         (OCISnapshot *) 0, (OCISnapshot *) 0, OCI_STMT_SCROLLABLE_READONLY); 
+         (OCISnapshot *) 0, (OCISnapshot *) 0, OCI_STMT_SCROLLABLE_READONLY);
       r = OCIStmtFetch2(tbl.stmt, tbl.db.err, (uint)actualRowID, OCI_FETCH_ABSOLUTE, 0, OCI_DEFAULT);
-      
+
       if ((r == OCI_SUCCESS) || (r == OCI_SUCCESS_WITH_INFO))
          return true;
-      
+
       return false;
    }
 
@@ -1361,7 +1361,7 @@ class OracleRow : DriverRow
 
    bool GoToSysID(uint id)
    {
-      /* We need to find in primaryKey field the row matching primaryKey field value and id */    
+      /* We need to find in primaryKey field the row matching primaryKey field value and id */
       char idValue[64];
       int r;
       int i;
index ceeadc9..3c3313f 100644 (file)
@@ -53,7 +53,7 @@ int CollationCompare(Class type, int count1, void * data1, int count2, void * da
       ((void (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnUnserialize])(type, &inst2, buffer2);
 
       result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, inst1, inst2);
-     
+
       buffer1.buffer = null;
       buffer2.buffer = null;
       delete buffer1;
@@ -75,7 +75,7 @@ int CollationCompare(Class type, int count1, void * data1, int count2, void * da
       ((void (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnUnserialize])(type, inst2, buffer2);
 
       result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, inst1, inst2);
-     
+
       buffer1.buffer = null;
       buffer2.buffer = null;
       delete buffer1;
@@ -188,7 +188,7 @@ class SQLiteDataSource : DataSourceDriver
 
          // sqlite3_open(path, &db);
          // sqlite3_open_v2(path, &db, SQLITE_OPEN_READONLY /*SQLITE_OPEN_READWRITE*/ /*SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE*/, null );
-         
+
          if(sqlite3_open_v2(path, &db, (createOptions == readOnly) ? SQLITE_OPEN_READONLY :
             (SQLITE_OPEN_READWRITE | ((createOptions == create) ? SQLITE_OPEN_CREATE : 0)), null))
          {
@@ -210,7 +210,7 @@ class SQLiteDataSource : DataSourceDriver
                   if(sqlite3_exec(db, "INSERT INTO eda_table_fields (Table_Name, Name, Type, Length) VALUES ('lockDummy', 'lockDummy', 'lockDummy', 'lockDummy')", null, null, null))
                      success = false;
                   else
-                     sqlite3_exec(db, "DELETE FROM eda_table_fields WHERE Name = 'lockDummy'", null, null, null); 
+                     sqlite3_exec(db, "DELETE FROM eda_table_fields WHERE Name = 'lockDummy'", null, null, null);
                }
             }
             if(success)
@@ -264,7 +264,7 @@ class SQLiteDatabase : Database
 {
    sqlite3 * db;
    AVLTree<String> collations { };
-   
+
    ~SQLiteDatabase()
    {
       sqlite3_exec(db, "PRAGMA locking_mode=normal", null, null, null);
@@ -337,7 +337,7 @@ class SQLiteDatabase : Database
          sprintf(command, "SELECT sql FROM sqlite_master WHERE type='table' AND name='%s';", name);
          nCols = 0, nRows = 0;
          result = sqlite3_get_table(db, command, &t, &nRows, &nCols, null);
-         
+
          if((nCols || nRows) || options.create)
          {
             table = SQLiteTable { db = this, name = CopyString(name) };
@@ -353,7 +353,7 @@ class SQLiteDatabase : Database
                   {
                      char * sql = t[nCols * r];
                      char * bracket = strchr(sql, '(');
-                     if(bracket) 
+                     if(bracket)
                      {
                         int c = 0;
                         bracket++;
@@ -383,7 +383,7 @@ class SQLiteDatabase : Database
                            dataType[c - d - 2] = 0;
 
                            while(ch && bracket[c] == ' ') c++;
-                           
+
                            if(!strcmp(dataType, "REAL")) { sqliteType = SQLITE_FLOAT; type = class(double); }
                            else if(!strcmp(dataType, "TEXT")) { sqliteType = SQLITE_TEXT; type = class(String); }
                            else if(!strcmp(dataType, "INTEGER")) { sqliteType = SQLITE_INTEGER; type = class(int); }
@@ -408,7 +408,7 @@ class SQLiteDatabase : Database
                {
                   Table refTable = null;
                   sqlite3_stmt * statement;
-                  
+
                   sprintf(command, "SELECT Name, Type, Length FROM eda_table_fields WHERE Table_Name='%s';", name);
                   result = sqlite3_prepare_v2(db, command, -1, &statement, null);
 
@@ -424,10 +424,10 @@ class SQLiteDatabase : Database
 
                      if(type)
                      {
-                        if(!strcmp(type.dataTypeString, "int") || !strcmp(type.dataTypeString, "unsigned int") || 
-                           !strcmp(type.dataTypeString, "long") || !strcmp(type.dataTypeString, "long int") || 
-                           !strcmp(type.dataTypeString, "uint") || !strcmp(type.dataTypeString, "uint32") || 
-                           !strcmp(type.dataTypeString, "int64") || !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64") || 
+                        if(!strcmp(type.dataTypeString, "int") || !strcmp(type.dataTypeString, "unsigned int") ||
+                           !strcmp(type.dataTypeString, "long") || !strcmp(type.dataTypeString, "long int") ||
+                           !strcmp(type.dataTypeString, "uint") || !strcmp(type.dataTypeString, "uint32") ||
+                           !strcmp(type.dataTypeString, "int64") || !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64") ||
                            !strcmp(type.dataTypeString, "short") || !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") ||
                            !strcmp(type.dataTypeString, "char") || !strcmp(type.dataTypeString, "unsigned char") || !strcmp(type.dataTypeString, "byte"))
                            sqliteType = SQLITE_INTEGER;
@@ -876,13 +876,13 @@ class SQLiteTable : Table
       Table refTable = null;
       Field idField = null;
       command[0] = 0;
-      
+
       if(FindField(fieldName)) return null;
 
-      if(!strcmp(type.dataTypeString, "int") || !strcmp(type.dataTypeString, "unsigned int") || 
-         !strcmp(type.dataTypeString, "long") || !strcmp(type.dataTypeString, "long int") || 
-         !strcmp(type.dataTypeString, "uint") || !strcmp(type.dataTypeString, "uint32") || 
-         !strcmp(type.dataTypeString, "int64") || !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64") || 
+      if(!strcmp(type.dataTypeString, "int") || !strcmp(type.dataTypeString, "unsigned int") ||
+         !strcmp(type.dataTypeString, "long") || !strcmp(type.dataTypeString, "long int") ||
+         !strcmp(type.dataTypeString, "uint") || !strcmp(type.dataTypeString, "uint32") ||
+         !strcmp(type.dataTypeString, "int64") || !strcmp(type.dataTypeString, "unsigned int64") || !strcmp(type.dataTypeString, "uint64") ||
          !strcmp(type.dataTypeString, "short") || !strcmp(type.dataTypeString, "unsigned short") || !strcmp(type.dataTypeString, "uint16") ||
          !strcmp(type.dataTypeString, "char") || !strcmp(type.dataTypeString, "unsigned char") || !strcmp(type.dataTypeString, "byte"))
       {
@@ -938,7 +938,7 @@ class SQLiteTable : Table
             PrintLn($"WARNING: Table not yet created for class ", (String)type.name);
          }
       }
-      
+
       if(mustCreate)
       {
          if(sqliteType == SQLITE_BLOB)
@@ -1181,7 +1181,7 @@ class SQLiteTable : Table
       sqlite3_prepare_v2(db.db, command, -1, &setRowIDStmt, null);
 
       return SQLiteRow
-         { tbl = this, defaultStatement = statement, curStatement = statement, sysIDStatement = sysIDStmt, 
+         { tbl = this, defaultStatement = statement, curStatement = statement, sysIDStatement = sysIDStmt,
            insertStatement = insertStmt, deleteStatement = deleteStmt, selectRowIDsStmt = selectRowIDsStmt, setRowIDStmt = setRowIDStmt,
            previousStatement = prevStmt, nextStatement = nextStmt, lastStatement = lastStmt, insertIDStatement = insertIDStmt };
    }
@@ -1223,7 +1223,7 @@ class SQLiteRow : DriverRow
    // this flag is used to distinguish between a Find() and a GoToSysID() for Select(next) purposes:
    bool findSysID;
    int findBindId;
-   
+
    bool Nil()
    {
       return done;
@@ -1282,7 +1282,7 @@ class SQLiteRow : DriverRow
          case previous:
          {
             // For sysID statement, for a Find() we want to go through next/previous in order, otherwise we just go to nil
-            if((move == next && curStatement != prevFindStatement && curStatement != lastFindStatement && !stepping && (curStatement != sysIDStatement || findSysID)) || 
+            if((move == next && curStatement != prevFindStatement && curStatement != lastFindStatement && !stepping && (curStatement != sysIDStatement || findSysID)) ||
                (move == previous && (curStatement == prevFindStatement || curStatement == lastFindStatement)))
             {
                result = sqlite3_step(curStatement);
@@ -1384,7 +1384,7 @@ class SQLiteRow : DriverRow
       SerialBuffer buffer = null;
       switch(fld.sqliteType)
       {
-         case SQLITE_INTEGER: 
+         case SQLITE_INTEGER:
          {
             switch(dataType.typeSize)
             {
@@ -1813,7 +1813,7 @@ class SQLiteRow : DriverRow
 
       switch(sqlFld.sqliteType)
       {
-         case SQLITE_INTEGER: 
+         case SQLITE_INTEGER:
          {
             switch(dataType.typeSize)
             {
@@ -1885,7 +1885,7 @@ class SQLiteRow : DriverRow
             buffer.count = buffer._size;
 
             ((void (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnUnserialize])(dataType, data, buffer);
-           
+
             buffer._buffer = null;
             delete buffer;
             break;
index 32a990c..7285217 100644 (file)
@@ -37,7 +37,7 @@ static class SQLiteCipherDataSource : SQLiteDataSource
 
          // sqlite3_open(path, &db);
          // sqlite3_open_v2(path, &db, SQLITE_OPEN_READONLY /*SQLITE_OPEN_READWRITE*/ /*SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE*/, null );
-         
+
          if(sqlite3_open_v2(path, &db, (createOptions == readOnly) ? SQLITE_OPEN_READONLY :
             (SQLITE_OPEN_READWRITE | ((createOptions == create) ? SQLITE_OPEN_CREATE : 0)), null))
             // fprintf(stderr, "%s\n", s); // interesting
@@ -67,7 +67,7 @@ static class SQLiteCipherDataSource : SQLiteDataSource
                else
                   printf($"Can't open database (%s): %s -- password may be incorrect\n", path, sqlite3_errstr(rc));
             }
-         }            
+         }
          if(!result)
             sqlite3_close(db);
          delete path;
index 453a842..1ecb009 100644 (file)
@@ -108,7 +108,7 @@ public class DataSource
    String user;
    String pass;
    String locator;
-   
+
    ~DataSource()
    {
       delete locator;
@@ -289,7 +289,7 @@ public:
    property Field primaryKey { get { return GetPrimaryKey(); } }
    property uint fieldsCount { get { return GetFieldsCount(); } }
    property uint rowsCount { get { return GetRowsCount(); } }
-   
+
    virtual Field AddField(const String name, Class type, int length);
    virtual Field FindField(const String name);
    virtual bool GenerateIndex(int count, FieldIndex * fieldIndexes, bool init);
@@ -331,7 +331,7 @@ public:
             editable = true;
             header = fld.name;
             width = 100;
-         };         
+         };
          list.AddField(df);
       }
    }
@@ -468,7 +468,7 @@ public:
 #ifdef AUTO_DELETE
             tbl.listRows.Add(this);
 #endif
-         }         
+         }
       }
       get { return tbl; }
    }
@@ -538,7 +538,7 @@ public:
    bool SetData(Field field, typed_object data) { return (row && field) ? row.SetData(field, data) : false; }
    bool Delete() { return row ? row.Delete() : false; }
    bool SetQueryParam(int paramID, int value) { return row ? row.SetQueryParam(paramID, value) : false; }
-   bool SetQueryParam64(int paramID, int64 value) { return row ? row.SetQueryParam64(paramID, value) : false; }   
+   bool SetQueryParam64(int paramID, int64 value) { return row ? row.SetQueryParam64(paramID, value) : false; }
    bool SetQueryParamText(int paramID, char * value) { return row ? row.SetQueryParamText(paramID, value) : false; }
    bool SetQueryParamObject(int paramID, void * value, Class type) { return row ? row.SetQueryParamObject(paramID, value, type) : false; }
    // TOCHECK: Field is passed here to have sqlite type handy. The API might be nicer without
index c4e73d4..b9bdbd5 100644 (file)
@@ -83,7 +83,7 @@ void RowsCountFileEdit(Archive archive, const String apath, const RowsCountFileA
       *allocatedRowsCount = 0;
       *deletedRowsCount = 0;
    }
-   
+
    switch(action)
    {
       case init: break;
@@ -156,12 +156,12 @@ static class EDBDataSource : DataSourceDriver
    /*
    Table OpenDatabasesListTable(subclass(DataDriver) driver)
    {
-      // get the table for databasesList using a temporary archive of a db with a table databases filled 
+      // get the table for databasesList using a temporary archive of a db with a table databases filled
       // with the list of edb files in data source's dirPath
-      
+
       TempFile f { };
       //ArchiveFile af = ArchiveOpen
-      
+
       return null;
    }
    */
@@ -275,7 +275,7 @@ static class EDBArchive : Archive
 {
    File f;
 };
+
 static class EDBArchiveDir : ArchiveDir
 {
    EDBArchive archive;
@@ -331,7 +331,7 @@ static class DBTable : struct
                   strcat(indexName, (index.fieldIndexes[c].order == ascending) ? "+" : "-");
                }
                tf.Seek(0, start);
-               
+
                dirTable = db.archive.OpenDirectory(apath, FileStats { }, replace);
                dirTable.AddFromFile(indexName, tf, { size = tf.GetSize() }, replace, 0, null, null);
                delete dirTable;
@@ -396,7 +396,7 @@ class EDBDatabase : Database
          dbTables.Add(dbTbl);
 
          dbTbl.dir = archive.OpenDirectory(apath, null, readOnlyDir);
-      
+
          RowsCountFileEdit(archive, apath, init, &dbTbl.allocatedRowsCount, &dbTbl.deletedRowsCount, &dbTbl.rowsCountPosition);
          dbTbl.rowsCount = dbTbl.allocatedRowsCount - dbTbl.deletedRowsCount;
 
@@ -411,7 +411,7 @@ class EDBDatabase : Database
             dbTbl.rowPositionsSize = dbTbl.allocatedRowsCount;
             dbTbl.rowPositions = new0 uint[Max(1,dbTbl.rowPositionsSize)];
             position = dir.first;
-            
+
             while(true)
             {
                char fileName[MAX_FILENAME] = "";
@@ -593,7 +593,7 @@ static int IndexCompareRows(IndexBinaryTree tree, uint r1, uint r2)
    int f;
    EDBRow row1 = index.row1;
    EDBRow row2 = index.row2;
-   
+
    if(index.cache && index.cache._num == r1)
       row1 = index.cache;
    else
@@ -627,7 +627,7 @@ static int IndexCompareRows(IndexBinaryTree tree, uint r1, uint r2)
          }
          ((bool (*)())(void *)row1.GetData)(row1, field, type, (type.type == structClass) ? (void *)data1 : &data1);
          ((bool (*)())(void *)row2.GetData)(row2, field, type, (type.type == structClass) ? (void *)data2 : &data2);
-         fieldResult = order * ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, 
+         fieldResult = order * ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type,
             (type.type == systemClass || type.type == bitClass || type.type == enumClass || type.type == unitClass) ? &data1 : (void *)data1,
             (type.type == systemClass || type.type == bitClass || type.type == enumClass || type.type == unitClass) ? &data2 : (void *)data2);
          ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type, (void *)data1);
@@ -653,7 +653,7 @@ static int IndexCompareRows(IndexBinaryTree tree, uint r1, uint r2)
                row2.tbl = ((EDBTable)index.fieldIndexes[f].memberTable).dbTable;
                row2.index = ((EDBTable)index.fieldIndexes[f].memberTable).index;
                row2.num = 0;
-               row2.Find(index.fieldIndexes[f].memberIdField, middle, nil, data2);               
+               row2.Find(index.fieldIndexes[f].memberIdField, middle, nil, data2);
 
                field = memberField;
                memberField = null;
@@ -706,7 +706,7 @@ static class EDBTable : Table
    {
       EDBDatabase edb = dbTable.db;
       EDBField field
-      {  
+      {
          tbl = dbTable,
          name = CopyString(name),
          type = type,
@@ -748,7 +748,7 @@ static class EDBTable : Table
    {
       return EDBRow { tbl = dbTable, index = index, num = 0 };
    }
-   
+
    bool GenerateIndex(int count, FieldIndex * fieldIndexes, bool init)
    {
       DBIndex index = null;
@@ -761,13 +761,13 @@ static class EDBTable : Table
             {
                int c;
                for(c = 0; c<count; c++)
-                  if(index.fieldIndexes[c].field != fieldIndexes[c].field || 
+                  if(index.fieldIndexes[c].field != fieldIndexes[c].field ||
                      index.fieldIndexes[c].order != fieldIndexes[c].order ||
                      index.fieldIndexes[c].memberField != fieldIndexes[c].memberField)
                      break;
                if(c == count)
                   break;
-            }         
+            }
          }
          if(!index)
          {
@@ -783,7 +783,7 @@ static class EDBTable : Table
                   for(field = dbTable.fields.first; field; field = field.next)
                      if(field == fieldIndexes[c].field)
                         break;
-                  if(!field) 
+                  if(!field)
                      return false;
                }
             }
@@ -971,7 +971,7 @@ static class EDBRow : DriverRow
    DBTable tbl;
    DBIndex index;
    BTNode node;
-   
+
    String aname;
    int _num;
 
@@ -1044,7 +1044,7 @@ static class EDBRow : DriverRow
             uint size;
             f.Read(offsets, sizeof(uint), oldNumFields);
             tf.Put(numFields);
-            
+
             tf.Write(offsets, sizeof(uint), numFields);
 
             size = f.GetSize();
@@ -1078,7 +1078,7 @@ static class EDBRow : DriverRow
             {
                buffer = renew buffer byte[size];
                f.Read(buffer, 1, size);
-               tf.Write(buffer, 1, size);               
+               tf.Write(buffer, 1, size);
             }
 
             // Update the offset of the field we're writing to
@@ -1098,7 +1098,7 @@ static class EDBRow : DriverRow
                      break;
                   }
                }
-                
+
                if(c < numFields)
                {
                   int fileSize = f.GetSize();
@@ -1151,7 +1151,7 @@ static class EDBRow : DriverRow
                BTNode n = (i == index) ? node : null;
                int c;
                for(c = 0; c<i.numFields; c++)
-                  if(i.fieldIndexes[c].field == field || 
+                  if(i.fieldIndexes[c].field == field ||
                      i.fieldIndexes[c].memberField == field ||
                      i.fieldIndexes[c].memberIdField == field)
                      break;
@@ -1174,7 +1174,7 @@ static class EDBRow : DriverRow
    {
       return !_num;
    }
-   
+
    bool Select(MoveOptions move)
    {
       EDBDatabase edb = tbl.db;
@@ -1280,7 +1280,7 @@ static class EDBRow : DriverRow
             }
             delete offsets;
          }
-         
+
          delete f;
       }
       return result;
@@ -1326,7 +1326,7 @@ static class EDBRow : DriverRow
                   {
                      this.node = node;
                      num = (uint)node.key;
-                     return true;                  
+                     return true;
                   }
                }
                else if(move == previous)
@@ -1345,7 +1345,7 @@ static class EDBRow : DriverRow
                   {
                      this.node = node;
                      num = (uint)node.key;
-                     return true;                  
+                     return true;
                   }
                }
 
@@ -1475,7 +1475,7 @@ static class EDBRow : DriverRow
                //if(data._class == type)
                {
                   result = order * ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type,
-                        (type.type == systemClass || type.type == bitClass || type.type == enumClass || type.type == unitClass) ? &read : (void *)read, 
+                        (type.type == systemClass || type.type == bitClass || type.type == enumClass || type.type == unitClass) ? &read : (void *)read,
                         (type.type == systemClass || type.type == bitClass || type.type == enumClass || type.type == unitClass) ? &findData[c].value.i64 : (void *)findData[c].value.i64);
                }
                ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type, (void *)read);
@@ -1527,7 +1527,7 @@ static class EDBRow : DriverRow
             {
                BTNode node = this.node, lastNode = null;
                int result;
-               
+
                if(move == next || move == nil)
                {
                   if(move == next)
@@ -1547,7 +1547,7 @@ static class EDBRow : DriverRow
                   {
                      this.node = node;
                      num = (uint)node.key;
-                     return true;                  
+                     return true;
                   }
                }
                else if(move == previous)
@@ -1566,7 +1566,7 @@ static class EDBRow : DriverRow
                   {
                      this.node = node;
                      num = (uint)node.key;
-                     return true;                  
+                     return true;
                   }
                }
 
@@ -1665,7 +1665,7 @@ static class EDBRow : DriverRow
       EDBDatabase edb = tbl.db;
       TempFile f;
       ArchiveDir dirTable;
-      
+
       RowsCountFileEdit(edb.archive, tbl.apath, reused ? reuse : add, &tbl.allocatedRowsCount, &tbl.deletedRowsCount, &tbl.rowsCountPosition);
       tbl.rowsCount = tbl.allocatedRowsCount - tbl.deletedRowsCount;
       if(reused)
@@ -1692,7 +1692,7 @@ static class EDBRow : DriverRow
       }
 
       dirTable = edb.archive.OpenDirectory(tbl.apath, FileStats { }, replace);
-      
+
       f = TempFile { };
       f.Seek(0, start);
 
@@ -1704,9 +1704,9 @@ static class EDBRow : DriverRow
       }
       dirTable.AddFromFileAtPosition(tbl.rowPositions[_num - 1], aname, f, { size = f.GetSize() }, replace, 0, null, &tbl.rowPositions[_num - 1]);
       delete f;
-      
+
       delete dirTable;
-      
+
       {
          DBIndex i;
          for(i = tbl.indexes.first; i; i = i.next)
@@ -1728,11 +1728,11 @@ static class EDBRow : DriverRow
          ArchiveDir dirTable;
          BTNode node = this.node;
          int oldNum = this._num;
-         
+
          RowsCountFileEdit(edb.archive, tbl.apath, del, &tbl.allocatedRowsCount, &tbl.deletedRowsCount, &tbl.rowsCountPosition);
          tbl.rowsCount = tbl.allocatedRowsCount - tbl.deletedRowsCount;
          tbl.rowPositions[_num - 1] = 0;
-         
+
          dirTable = edb.archive.OpenDirectory(tbl.apath, FileStats { }, replace);
          if(!aname)
          {
@@ -1742,11 +1742,11 @@ static class EDBRow : DriverRow
          }
          dirTable.Delete(aname);
          delete dirTable;
-         
+
          Select(next);
          if(!_num)
             Select(last);
-         
+
          {
             DBIndex i;
             for(i = tbl.indexes.first; i; i = i.next)
@@ -1776,7 +1776,7 @@ static class EDBRow : DriverRow
       if(tbl.allocatedRowsCount >= id && id > 0 && tbl.rowPositions[id - 1])
       {
          _num = id;
-         
+
          if(index)
             node = index.tree.FindAll(id);
          return true;
index 3ce1ea6..c51d010 100644 (file)
@@ -3,7 +3,7 @@ import "EDB"
 static class EDBMemoryDataSource : DataSourceDriver
 {
    class_property(name) = "MemoryEDB";
-   
+
    Database OpenDatabase(const String name, CreateOptions createOptions, DataSource ds)
    {
       return EDBDatabase { path = null, archive = ArchiveOpen(null, ArchiveOpenFlags { true }) };
index 6eb2077..7486fd2 100644 (file)
@@ -92,7 +92,7 @@ public:
    Window inside { this };
 
    int headerHeight;
-   
+
 private:
    Orientation orientation;
 }
@@ -174,10 +174,10 @@ public:
                reportHeader.anchor = Anchor { left = 0, top = 0, right = 0 };
                reportHeader.master = destination;
                reportHeader.parent = inside;
-               
+
                pageTop += reportHeader.size.h;
                reportHeader.Create();
-            
+
             }
             /*if(report.reportFooter)
             {
@@ -195,12 +195,12 @@ public:
             pageHeader.anchor = Anchor { left = 0, top = pageTop, right = 0 };
             pageHeader.master = destination;
             pageHeader.parent = inside;
-            
+
             pageTop += pageHeader.size.h;
 
             pageHeader.Create();
          }
-         
+
          if(report.pageFooter)
          {
             pageFooter = eInstance_New(report.pageFooter);
@@ -397,19 +397,19 @@ public:
                pageFooter.anchor = Anchor { left = 0, bottom = (int)reportFooter.size.h, right = 0 };
             else
                pageFooter.anchor = Anchor { left = 0, bottom = 0, right = 0 };
-            
+
             pageFooter.Create();
          }
          if(nil && report.reportFooter)
          {
             reportFooter.Create();
          }
-         
+
          destination.EndPage(page);
 
          if(nil)
             break;
-         
+
          // still have to bump report footer if it does not fit...
       }
       pleaseWait.Destroy(0);
@@ -445,7 +445,7 @@ private:
 
       detailSize = detail.size.h;
       overlap = (insideSize - pageTop - footerHeight) - detailSize;
-      
+
       if(overlap < 0 && detail.keepTogether)
       {
          delete detail;
@@ -537,7 +537,7 @@ public class ReportPreviewArea : ReportDestination
 
    void AddPage(Page page)
    {
-      PreviewPage previewPage { this, this, page = page, orientation = page.orientation, 
+      PreviewPage previewPage { this, this, page = page, orientation = page.orientation,
                                    anchor = { top = pageCount * ((int)page.size.h + shadowS + pgs) } };
       previewPage.Create();
       page.anchor = { left = pgs, top = pgs, right = shadowS + pgs, bottom = shadowS + pgs};
@@ -546,7 +546,7 @@ public class ReportPreviewArea : ReportDestination
       page.Create();
       pageCount++;
    }
-   
+
    Report GetReport()
    {
       return report;
@@ -560,7 +560,7 @@ public class ReportPreviewArea : ReportDestination
 
 Array<FileFilter> csvFilters
 { [
-   { 
+   {
       $"Comma Separated Values Spreadsheet (*.csv)",
       "csv"
    },
@@ -573,7 +573,7 @@ public class CSVReport : ReportDestination
    hasVertScroll = true;
    dontHideScroll = true;
    background = dimGray;
-   
+
    Page lastPage;
 
    void AddPage(Page page)
@@ -589,7 +589,7 @@ public class CSVReport : ReportDestination
       pageCount++;
       page.Create();
    }
-   
+
    void PutString(File f, char * text)
    {
       char output[4096];
@@ -631,14 +631,14 @@ public class CSVReport : ReportDestination
          File f = FileOpen(saveTo.filePath, write);
          if(f)
          {
-            Detail detail, first = null;         
+            Detail detail, first = null;
             for(detail = (Detail)page.inside.firstChild; detail && detail != first; detail = (Detail)detail.next)
             {
                if(!first) first = detail;
                if(eClass_IsDerived(detail._class, class(Detail)))
                {
                   Label label, first = null;
-      
+
                   if(detail._class == report.pageFooter) continue;
                   if(detail._class == report.groupings[0].header)
                      f.Puts("\n");
@@ -675,7 +675,7 @@ public class IdFilter : struct
 public:
    Id id;
    Field field;
-   
+
    bool RowMatch(Row row)
    {
       Id value;
@@ -716,7 +716,7 @@ public:
       filters.Free();
       delete row;
    }
-   
+
    virtual bool ShouldSkip()
    {
       return false;
@@ -738,7 +738,7 @@ public:
          result = row.Next();
       if(!result)
          return false;
-      
+
       if(reverseLink)
          reverseLink.row.GetData(reverseListFieldLink, reverseIdList);
 
@@ -856,7 +856,7 @@ public:
    {
       return grouping.Advance(linkId, dontAdvance);
    }
-   
+
    virtual bool ExecuteData(Database db)
    {
       return false;
index 7093621..fdbd846 100644 (file)
@@ -64,7 +64,7 @@ public class CheckBool : bool
          {
             dataBox, borderStyle = 0, text = dataBox.text, anchor = { 0, 0, 0, 0 },
             // size = { 100, 22 };
-            modifyVirtualArea = false, isCheckbox = true;            
+            modifyVirtualArea = false, isCheckbox = true;
 
             bool DataBox::NotifyClicked(Button control, int x, int y, Modifiers mods)
             {
@@ -156,7 +156,7 @@ public:
                      tbl.GenerateIndex(1, indexedFields, false);
 
                      r = Row { tbl };
-                     
+
                      for(r.Find(filterField, middle, nil, filter); !r.nil; r.Next()) //while(r.Next())
                      {
                         Id id;
@@ -234,7 +234,7 @@ public:
       }
       else if((SmartKey)key == enter)
          parent.CycleChildren(true, false, false, true);
-      
+
       return DropBox::OnKeyHit(key, ch);
    }
 
@@ -330,7 +330,7 @@ public:
          dropBox.filter = filter;
       else
          dropBox.filtered = false;
-      
+
       dropBox.exclusion = exclusion;
       dropBox.showNone = showNone;
    }
@@ -475,7 +475,7 @@ public:
          if(!DataBox::SaveData())
             Refresh();
 
-         ((bool (*)())(void *)Row::SetData)(row, field, type, 
+         ((bool (*)())(void *)Row::SetData)(row, field, type,
             (type.type == noHeadClass || type.type == normalClass) ? *(void **)data : data);
       }
    }
@@ -511,7 +511,7 @@ public:
    {
       if((SmartKey)key == enter)
          parent.CycleChildren(true, false, false, true);
-      
+
       return DataBox::OnKeyHit(key, ch);
    }
 
@@ -621,7 +621,7 @@ public:
    void Save()
    {
       TableDropBox dropBox = (TableDropBox) editor;
-      
+
       if(!dropBox.currentRow && dropBox.contents[0])
       {
          Row row { dropBox.table };
@@ -669,16 +669,16 @@ public:
             if(table)
             {
                FieldIndex indexedFields[1];
-               
+
                if(!fldId) fldId = table.FindField(defaultIdField);
                if(!fldName) fldName = table.FindField(defaultNameField);
                if(!fldActive) fldActive = table.FindField(defaultActiveField);
-               
+
                indexedFields[0] = { fldId };
                table.Index(1, indexedFields);
-               
+
                editor.editRow.tbl = table;
-               
+
                RefillList();
             }
          }
@@ -690,7 +690,7 @@ public:
    {
       return MessageBox { master = this, type = yesNoCancel, text = $"List Editor", contents = $"You have modified this entry. Would you like to save it before proceeding?" }.Modal();
    }
-   
+
    bool OnClose(bool parentClosing)
    {
       if(editor && editor.modifiedDocument)
@@ -753,9 +753,9 @@ public:
          list.NotifySelect(this, list, null, 0);
          if(!editor.modifiedDocument)
          {
-            uint id; // = table.rowsCount + 1; // this is bad with deleted rows, won't work, how to have unique id? 
+            uint id; // = table.rowsCount + 1; // this is bad with deleted rows, won't work, how to have unique id?
             Row r { table };
-         
+
             if(r.Last())   // this will reuse ids in cases where the item(s) with the last id have been deleted
             {
                r.GetData(fldId, id);
@@ -763,7 +763,7 @@ public:
             }
             else
                id = 1;
-         
+
             editor.EditClear();
             {
                bool active = true;
@@ -798,7 +798,7 @@ public:
 
    virtual bool Window::NotifyDeleteConfirmation(ListSection listSection)
    {
-      return MessageBox {  master = this, type = yesNo, text = $"List Editor", 
+      return MessageBox {  master = this, type = yesNo, text = $"List Editor",
                            contents =  $"You are about to delete an entry.\n"
                                         "Do you wish to continue?"
                   }.Modal() == yes;
@@ -847,7 +847,7 @@ public:
    {
       this, anchor = { left = sgs * 2, top = 22 + 22 + sgs * 4, right = shadowS + sgs * 2, bottom = shadowS + sgs * 2 };
       alwaysHighLight = true;
-      
+
       bool NotifySelect(ListBox listBox, DataRow row, Modifiers mods)
       {
          bool result = true;
@@ -878,7 +878,7 @@ public:
    };
 
    virtual void Window::NotifySelectListRow(ListSection listSection, uint64 id);
-   
+
    void SelectListRow(DataRow row)
    {
       // Time startTime = GetTime();
@@ -916,7 +916,7 @@ public:
          editor.disabled = !(bool)list.firstRow;
       }
    }
-   
+
    void OnResize(int width, int height)
    {
       int x = width - btnDelete.size.w - 20;
@@ -973,7 +973,7 @@ public:
    OldList editBoxes { };
 
    Window editArea { this, borderStyle = deep, tabCycle = true, anchor = { left = 8, top = 54, right = 10, bottom = 10 }, hasVertScroll = true, dontHideScroll = true };
-   
+
    ButtonStyle btnSave
    {
       this, anchor = { right = shadowS + sgs * 2, top = 24 }, hotKey = altV, text = $"Save";
@@ -1003,7 +1003,7 @@ public:
    }
 
    virtual void Window::NotifyInitFields(EditSection editSection);
-   
+
    void InitFields()
    {
       OldLink link;
@@ -1024,7 +1024,7 @@ public:
    {
       edit.listRow.string = name;
    }
-   
+
    void EditSave()
    {
       bool stringName = !strcmp(list.fldName.type.dataTypeString, "char *");
index 2240ed0..d3f0023 100644 (file)
@@ -345,7 +345,7 @@ public:
 
    //virtual bool Window::NotifyNew(AltListSection listSection, Row r);
    //virtual void Window::NotifyInitFields(AltEditSection editSection);
-   
+
    virtual DialogResult OnLeavingModifiedDocument()
    {
       DebugLn("TableEditor::OnLeavingModifiedDocument");
@@ -353,7 +353,7 @@ public:
                           contents = $"You have modified this entry. Would you like to save it before proceeding?"
                   }.Modal();
    }
-   
+
    virtual bool OnRemovalRequest()
    {
       DebugLn("TableEditor::OnRemovalRequest");
@@ -523,7 +523,7 @@ public:
       //list.NotifySelect(this, list, null, 0);
       if(table && editRow && editRow.tbl && !modifiedDocument)
       {
-         uint id; // = table.rowsCount + 1; // this is bad with deleted rows, won't work, how to have unique id? 
+         uint id; // = table.rowsCount + 1; // this is bad with deleted rows, won't work, how to have unique id?
                                // I think the 3 following comment lines apply to the old sqlite driver before many fix we done for wsms
          Row r = editRow;// { table }; // the multipurpose row is buggy with sqlite driver, you can't use the same row to do Row::Last(), Row::Next(), Row::Find(), etc...
          //Row r { editRow.tbl };                    // for example, Row::Last() here is not using the proper sqlite statement and fails to
@@ -794,7 +794,7 @@ public:
       }
       return result;
    }
-   
+
    bool SelectPrevious(bool loopAround)
    {
       bool result = NotifyClosing();
@@ -835,7 +835,7 @@ public:
       }
       return result;
    }
-   
+
    void SelectListRow(DataRow row)
    {
       // Time startTime = GetTime();
@@ -2093,7 +2093,7 @@ static WordEntry * btnodes;
 struct WordEntryBinaryTree : BinaryTree
 {
    WordEntry * entries;
-   
+
    void OnSerialize(IOChannel channel)
    {
       WordEntry node;
@@ -2111,7 +2111,7 @@ struct WordEntryBinaryTree : BinaryTree
          {
             bool isLeft = node == node.parent.left;
             node = node.parent;
-            
+
             while(node)
             {
                if(isLeft && node.right)
@@ -2139,11 +2139,11 @@ struct WordEntryBinaryTree : BinaryTree
       uint count;
       DebugLn("WordEntryBinaryTree::OnUnserialize");
       channel.Unserialize(count);
-      entries = new WordEntry[count];      
+      entries = new WordEntry[count];
       btnodes = entries;
       channel.Unserialize(root);
       this.root = (BTNode)root;
-      // count = root ? this.root.count : 0;      
+      // count = root ? this.root.count : 0;
       this.count = count;
       for(node = (WordEntry)root; node;)
       {
@@ -2161,7 +2161,7 @@ struct WordEntryBinaryTree : BinaryTree
          {
             bool isLeft = node == node.parent.left;
             node = node.parent;
-            
+
             while(node)
             {
                if(isLeft && node.right)
@@ -2188,7 +2188,7 @@ class WordEntry : struct
    WordEntry parent;
    WordEntry left, right;
    int depth;
-   
+
    IdList items;
    IdList words;
    uint id;
@@ -2248,7 +2248,7 @@ class WordEntry : struct
          // TODO: Fix typed_object issues
          entry = btnodes[id - 1] = eInstance_New(class(WordEntry));
          this = (void *)entry;
-         
+
          channel.Unserialize(string);
          channel.Unserialize(items);
          channel.Unserialize(words);
index f6d52ba..9d35666 100644 (file)
@@ -33,7 +33,7 @@ public class FieldBox : DataBox
          return result;
       }
    }
-   
+
    // DataBox has a member called editor as well?
    // would like to rename TableEditor to TableControl anyway
    public property TableEditor editor
@@ -163,9 +163,9 @@ public class FieldBox : DataBox
          if(!DataBox::SaveData())
             Refresh();
 
-         ((bool (*)())(void *)Row::SetData)(row, field, type, 
+         ((bool (*)())(void *)Row::SetData)(row, field, type,
             (type.type == noHeadClass || type.type == normalClass) ? *(void **)data : data);
-      
+
          modifiedDocument = false;
       }
    }
@@ -201,7 +201,7 @@ public class FieldBox : DataBox
    {
       if((SmartKey)key == enter)
          parent.CycleChildren(true, false, false, true);
-      
+
       return DataBox::OnKeyHit(key, ch);
    }
 
index c6f0f1f..8845b90 100644 (file)
@@ -59,7 +59,7 @@ public class Id : uint
 
          dropBox = TableDropBox
          {
-            dataBox, borderStyle = 0, anchor = { 0, 0, 0, 0 }, 
+            dataBox, borderStyle = 0, anchor = { 0, 0, 0, 0 },
             modifyVirtualArea = false, activeStipple = false;
             showNone = true;
             nameField = class_data(nameField) ? *class_data(nameField) : null;
@@ -262,14 +262,14 @@ public:
          count = 0;
       }
    }
-   
+
    bool Includes(Id id)
    {
       if(this)
       {
          int c;
          for(c = 0; c < count; c++)
-            if(ids[c] == id) 
+            if(ids[c] == id)
                return true;
       }
       return false;
@@ -349,7 +349,7 @@ public:
 
    }
    */
-   
+
    char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
    {
       stringOutput[0] = 0;
@@ -397,7 +397,7 @@ public:
             int idA = ids[c], idB = b.ids[c];
             if(idA > idB) return 1;
             else if(idA < idB) return -1;
-         }         
+         }
       }
       return 0;
    }
@@ -418,7 +418,7 @@ public:
             {
                if(row.next)
                   listBox.DeleteRow(row);
-            }            
+            }
             else
             {
                if(row == listBox.lastRow)
@@ -469,13 +469,13 @@ public:
          {
             Id id = r.GetData(null);
             if(id)
-               Add(id);         
+               Add(id);
          }
          return true;
       }
       return false;
    }
-   
+
    ~IdList()
    {
       delete ids;
@@ -490,7 +490,7 @@ static void FreeString(String string)
 public class StringList
 {
    StringBinaryTree strings
-   {  
+   {
       CompareKey = (void *)BinaryTree::CompareString;
       FreeKey = (void *)FreeString;
    };
@@ -499,7 +499,7 @@ public class StringList
    {
       strings.Free();
    }
-   
+
    bool Includes(String string)
    {
       return strings.FindString(string) != null;
@@ -533,7 +533,7 @@ public class StringList
    {
       channel.Get(strings);
    }
-   
+
    void OnUnserialize(IOChannel channel)
    {
       this = eInstance_New(class(StringList));
@@ -558,7 +558,7 @@ public class StringList
             result = strcmp((char *)nodeA.key, (char *)nodeB.key);
             if(result) return result;
          }
-      }         
+      }
       return 0;
    }
 
@@ -575,7 +575,7 @@ public class StringList
          {
             return (key == enter) ? false : ListBox::OnKeyHit(key, ch);
          }
-         
+
          bool DataBox::NotifyChanged(ListBox listBox, DataRow row)
          {
             String string = row.GetData(null);
@@ -586,7 +586,7 @@ public class StringList
                   listBox.DeleteRow(row);
                   listBox.firstChild.Activate();
                }
-            }            
+            }
             else
             {
                if(row == listBox.lastRow)
@@ -625,7 +625,7 @@ public class StringList
                   listBox.DeleteRow(row);
                   listBox.firstChild.Activate();
                }
-            }            
+            }
             else
             {
                if(row == listBox.lastRow)
@@ -644,7 +644,7 @@ public class StringList
 
       BTNode node;
       DataRow r;
-      
+
       /*
       {
          if(!this)
@@ -670,7 +670,7 @@ public class StringList
       ListBox list = (ListBox) window;
       if(list.modifiedDocument)
       {
-         
+
          DataRow r;
          if(list.activeChild)
             ((DataBox)list.activeChild).SaveData();
@@ -692,7 +692,7 @@ public class StringList
       }
       return false;
    }
-   
+
    ~StringList()
    {
       strings.Free();
@@ -716,7 +716,7 @@ public class FixedMultiLineString : String
 
          void DataBox::NotifyUpdate(EditBox editBox)
          {
-            Modified();          
+            Modified();
             modifiedDocument = true;
          }
       };
@@ -765,7 +765,7 @@ public class FixedMultiLineString : String
 
 public class CIString : String
 {
-   
+
 }
 
 public class MultiLineString : String
@@ -853,7 +853,7 @@ public struct DataList : OldList
       if(!class_data(type))
          class_data(type) = eSystem_FindClass(__thisModule.application, class_data(typeName));
       type = class_data(type);
-      
+
       this = { };
 
       while(true)
@@ -915,12 +915,12 @@ public struct DataList : OldList
          else
          {
             Class type = class_data(type);
-            result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, 
+            result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type,
                (type.type == systemClass || type.type == bitClass || type.type == enumClass || type.type == unitClass) ? &nodeA.data : (void *)nodeA.data,
                (type.type == systemClass || type.type == bitClass || type.type == enumClass || type.type == unitClass) ? &nodeB.data : (void *)nodeB.data);
             if(result) return result;
          }
-      }         
+      }
       return 0;
    }
 
@@ -937,7 +937,7 @@ public struct DataList : OldList
          {
             return (key == enter) ? false : ListBox::OnKeyHit(key, ch);
          }
-         
+
          bool DataBox::NotifyChanged(ListBox listBox, DataRow row)
          {
             Class type = ((subclass(DataList))this.type).dataType;
@@ -951,7 +951,7 @@ public struct DataList : OldList
                      listBox.DeleteRow(row);
                      listBox.firstChild.Activate();
                   }*/
-               }            
+               }
                else
                {
                   if(row == listBox.lastRow)
@@ -984,7 +984,7 @@ public struct DataList : OldList
                      listBox.DeleteRow(row);
                      listBox.firstChild.Activate();
                   }
-               }            
+               }
                else
                {
                   if(row == listBox.lastRow)
@@ -1026,7 +1026,7 @@ public struct DataList : OldList
                   listBox.scroll.y = listBox.scrollArea.h;
                   listBox.alwaysEdit = true;
                }
-            }            
+            }
             return true;
          }
 
@@ -1058,7 +1058,7 @@ public struct DataList : OldList
             Modified();
             return true;
          }
-   
+
          void OnDestroy()
          {
             Class type = firstField.dataType;
@@ -1081,7 +1081,7 @@ public struct DataList : OldList
       if(!class_data(type))
          class_data(type) = eSystem_FindClass(__thisModule.application, class_data(typeName));
       type = class_data(type);
-      
+
       list.AddField({ type, editable = true });
       for(node = first; node; node = node.next)
       {
@@ -1153,7 +1153,7 @@ public struct DataList : OldList
    }
 
    void OnFree()
-   {  
+   {
       Class type;
       OldLink node;
 
index 9e726b1..8a85b5b 100644 (file)
@@ -225,7 +225,7 @@ class epj2makeApp : GuiApplication
       }
       if(!epjPath)
          valid = false;
-      
+
       if(!valid)
       {
          printf($"Syntax:\n");
@@ -270,7 +270,7 @@ class epj2makeApp : GuiApplication
                   delete settingsContainer;
 
       // TODO: Command line option to choose between the two
-      // or a command line option to not use global settings 
+      // or a command line option to not use global settings
       //defaultCompiler = MakeDefaultCompiler();
                   defaultCompiler = ideSettings.GetCompilerConfig(compiler);
       // possible TODO: use the workspace to select the active compiler
index d6f0479..d4e3ef1 100644 (file)
@@ -42,7 +42,7 @@ public:
    {
       bool status = true;
       int c = 0;
-      
+
       for(s : strings)
       {
          Column column;
index c1eac97..a107709 100644 (file)
@@ -14,29 +14,29 @@ extern char **environ;
 #if 0
 #define BUFSIZE 4096
     TCHAR chNewEnv[BUFSIZE];
-    LPTSTR lpszCurrentVariable; 
+    LPTSTR lpszCurrentVariable;
     DWORD dwFlags=0;
     TCHAR szAppName[]=TEXT("ex3.exe");
     STARTUPINFO si;
     PROCESS_INFORMATION pi;
-    BOOL fSuccess; 
-    // Copy environment strings into an environment block. 
+    BOOL fSuccess;
+    // Copy environment strings into an environment block.
     lpszCurrentVariable = (LPTSTR) chNewEnv;
     if(FAILED(StringCchCopy(lpszCurrentVariable, BUFSIZE, TEXT("MySetting=A"))))
     {
-        printf("String copy failed\n"); 
+        printf("String copy failed\n");
         return FALSE;
     }
-    lpszCurrentVariable += lstrlen(lpszCurrentVariable) + 1; 
-    if(FAILED(StringCchCopy(lpszCurrentVariable, BUFSIZE, TEXT("MyVersion=2")))) 
+    lpszCurrentVariable += lstrlen(lpszCurrentVariable) + 1;
+    if(FAILED(StringCchCopy(lpszCurrentVariable, BUFSIZE, TEXT("MyVersion=2"))))
     {
-        printf("String copy failed\n"); 
+        printf("String copy failed\n");
         return FALSE;
     }
-    // Terminate the block with a NULL byte. 
-    lpszCurrentVariable += lstrlen(lpszCurrentVariable) + 1; 
-    *lpszCurrentVariable = (TCHAR)0; 
-    // Create the child process, specifying a new environment block. 
+    // Terminate the block with a NULL byte.
+    lpszCurrentVariable += lstrlen(lpszCurrentVariable) + 1;
+    *lpszCurrentVariable = (TCHAR)0;
+    // Create the child process, specifying a new environment block.
     SecureZeroMemory(&si, sizeof(STARTUPINFO));
     si.cb = sizeof(STARTUPINFO);
 #ifdef UNICODE
@@ -44,8 +44,8 @@ extern char **environ;
 #endif
     fSuccess = CreateProcess(szAppName, NULL, NULL, NULL, TRUE, dwFlags,
         (LPVOID) chNewEnv,   // new environment block
-        NULL, &si, &pi); 
-    if(!fSuccess) 
+        NULL, &si, &pi);
+    if(!fSuccess)
     {
         printf("CreateProcess failed (%d)\n", GetLastError());
         return FALSE;
@@ -81,7 +81,7 @@ void PrintCurrentEnvironment(char * headerLine)
    env.AddCurrentEnvVars();
    if(headerLine)
       PrintLn(headerLine);
-   env.Print(); 
+   env.Print();
    env.Free();
    delete env;
 }
@@ -176,7 +176,7 @@ public class EnvironmentVariables : Map<String, String>
       percentStyleRefId = new char[percentStyleRefIdLen+1];
       sprintf(percentStyleRefId, "%%%s%%", varName);
       percentStyleRef = strstr(varValue, percentStyleRefId);
-      
+
       // TODO: Make this a loop to replace multiple instances of both dollar and percent style references
       if(dollarStyleRef)
       {
@@ -212,7 +212,7 @@ public class EnvironmentVariables : Map<String, String>
       }
       else
          this[varName] = CopyString(varValue);
-      
+
       delete dollarStyleRefId;
       delete percentStyleRefId;
       delete oldValue;
index afa2fdc..16f7307 100644 (file)
@@ -35,7 +35,7 @@ public:
          frame = StackFrame { };
          stack.Add(frame);
          frame.path = CopyString(startPath);
-         frame.listing = FileListing { startPath, extensions = extensions };  // there should be a sorted = true/false 
+         frame.listing = FileListing { startPath, extensions = extensions };  // there should be a sorted = true/false
       }
 
       if(iterateStartPath)
@@ -94,7 +94,7 @@ public:
    {
       return false;
    }
-   
+
    virtual bool OnFile(char * filePath)
    {
       return true;
@@ -119,7 +119,7 @@ static class IteratorThread : Thread
 {
    void Temp()
    {
-      //listing = FileListing { dir, extensions = filter.extensions };  // there should be a sorted = true/false 
+      //listing = FileListing { dir, extensions = filter.extensions };  // there should be a sorted = true/false
    }
 }
 
index c266d74..957d6ae 100644 (file)
@@ -40,7 +40,7 @@ public:
             else
                Free();
          }
-         
+
       }
       get { return regex; }
    }
@@ -129,7 +129,7 @@ public:
       {
          int c;
          int result;
-         result = regexec(&compiledRegex, string, maxMatchCount, matches, executeFlags); 
+         result = regexec(&compiledRegex, string, maxMatchCount, matches, executeFlags);
          if(result == 0) // != REG_NOMATCH
          {
             for(c = 0; c < maxMatchCount; c++)
@@ -141,7 +141,7 @@ public:
                }
             }
             if(c == maxMatchCount)
-               matchCount = maxMatchCount;      
+               matchCount = maxMatchCount;
             return string + matches[0].rm_so;
          }
          else
@@ -154,7 +154,7 @@ public:
    {
       return matches[matchPos].rm_so;
    }
-   
+
    int GetMatchEndOffset(int matchPos)
    {
       return matches[matchPos].rm_eo;
@@ -191,22 +191,22 @@ private:
       valid = result == 0;
       if(valid && !maxMatchCount)
          property::maxMatchCount = 1;
-      
+
       // TODO: handle errors?
-      // size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size); 
-      // REG_BADBR      Invalid use of back reference operator. 
-      // REG_BADPAT     Invalid use of pattern operators such as group or list. 
-      // REG_BADRPT     Invalid use of repetition operators such as using '*' as the first character. 
-      // REG_EBRACE     Un-matched brace interval operators. 
-      // REG_EBRACK     Un-matched bracket list operators. 
-      // REG_ECOLLATE   Invalid collating element. 
-      // REG_ECTYPE     Unknown character class name. 
-      // REG_EEND       Non specific error. This is not defined by POSIX.2. 
-      // REG_EESCAPE    Trailing backslash. 
-      // REG_EPAREN     Un-matched parenthesis group operators. 
-      // REG_ERANGE     Invalid use of the range operator, eg. the ending point of the range occurs prior to the starting point. 
-      // REG_ESIZE      Compiled regular expression requires a pattern buffer larger than 64Kb. This is not defined by POSIX.2. 
-      // REG_ESPACE     The regex routines ran out of memory. 
+      // size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size);
+      // REG_BADBR      Invalid use of back reference operator.
+      // REG_BADPAT     Invalid use of pattern operators such as group or list.
+      // REG_BADRPT     Invalid use of repetition operators such as using '*' as the first character.
+      // REG_EBRACE     Un-matched brace interval operators.
+      // REG_EBRACK     Un-matched bracket list operators.
+      // REG_ECOLLATE   Invalid collating element.
+      // REG_ECTYPE     Unknown character class name.
+      // REG_EEND       Non specific error. This is not defined by POSIX.2.
+      // REG_EESCAPE    Trailing backslash.
+      // REG_EPAREN     Un-matched parenthesis group operators.
+      // REG_ERANGE     Invalid use of the range operator, eg. the ending point of the range occurs prior to the starting point.
+      // REG_ESIZE      Compiled regular expression requires a pattern buffer larger than 64Kb. This is not defined by POSIX.2.
+      // REG_ESPACE     The regex routines ran out of memory.
       // REG_ESUBREG    Invalid back reference to a subexpression.
    }
 
index 97f8c86..539bbc1 100644 (file)
@@ -21,7 +21,7 @@ class SMTPSocket : Socket
    }
    void OnDisconnect(int code)
    {
-      replied = true;      
+      replied = true;
    }
    void WaitReply()
    {
@@ -43,13 +43,13 @@ void SMTPSend(char * host, char * to, char * from, File file)
       socket.SendString("HELO localhost\r\n");
       socket.WaitReply();
       Logf("MAIL from: %s\n", from);
-      socket.Sendf("MAIL from: %s\r\n", from); 
+      socket.Sendf("MAIL from: %s\r\n", from);
       socket.WaitReply();
       Logf("RCPT To: %s\n", to);
-      socket.Sendf("RCPT To: %s\r\n", to); 
+      socket.Sendf("RCPT To: %s\r\n", to);
       socket.WaitReply();
       Log("DATA\n");
-      socket.SendString("DATA\r\n"); 
+      socket.SendString("DATA\r\n");
       socket.WaitReply();
       Log("Subject: Email test\n");
       Log("Mime-Version: 1.0;\n");
@@ -60,7 +60,7 @@ void SMTPSend(char * host, char * to, char * from, File file)
       socket.SendString("Content-Type: text/html; charset=\"ISO-8859-1\";\r\n");
       socket.SendString("Content-Transfer-Encoding: 7bit;\r\n");
       socket.SendString("\r\n");
-     
+
       file.Seek(0, start);
       while(!file.Eof())
       {
@@ -68,7 +68,7 @@ void SMTPSend(char * host, char * to, char * from, File file)
          uint read = file.Read(buffer, 1, sizeof(buffer));
          socket.Send(buffer, read);
       }
-      
+
       Log("\n.\n");
       socket.SendString("\r\n.\r\n");
       socket.WaitReply();
@@ -90,6 +90,6 @@ class MyApp : GuiApplication
          Send("mail.server.ca", "user@mail.com", "user@server.com", f);
       delete f;
       getch();
-   }   
+   }
 }
 */
index 801bfd5..f2cb196 100644 (file)
@@ -21,7 +21,7 @@ static WordStatus GetKeyWordEx(char ** input, char * keyWord, int maxSize, bool
       if(!quoted && wasQuoted)
          break;
 
-      if((ch == ' ' || ch == '\t') && !quoted) 
+      if((ch == ' ' || ch == '\t') && !quoted)
       {
          if(!start) break;
       }
@@ -37,7 +37,7 @@ static WordStatus GetKeyWordEx(char ** input, char * keyWord, int maxSize, bool
          }
          else if(ch != '\r' && ch != '\n')
          {
-            if(c < maxSize) 
+            if(c < maxSize)
                keyWord[c++] = ch;
             start = false;
          }
@@ -89,14 +89,14 @@ class XMLParser
       int charLen = 0;
       int oldDepth = xmlDepth;
       tag[0] = 0;
-      
+
       closingTag = false;
-      
+
       // Preparse to check for completeness
       for(stringPos = 0; stringPos < count; stringPos++)
       {
          byte ch = inputString[stringPos];
-      
+
          if(commented)
          {
             if((ch == '-' && tagLen < 2) || (ch == '>' && tagLen == 2))
@@ -188,7 +188,7 @@ class XMLParser
       for(stringPos = 0; stringPos < count; stringPos++)
       {
          byte ch = inputString[stringPos];
-      
+
          if(commented)
          {
             if((ch == '-' && tagLen < 2) || (ch == '>' && tagLen == 2))
@@ -264,7 +264,7 @@ class XMLParser
             if(ch == '<' || charLen == CHARBUFSIZE - 1)
             {
                ProcessCharacterData(characterData);
-               charLen = 0;               
+               charLen = 0;
             }
             if(ch == '<')
             {
index cadd3ae..e2fb0d6 100644 (file)
@@ -175,7 +175,7 @@ static class SoundThread : Thread
 
    uint Main()
    {
-      while(!done) 
+      while(!done)
       {
          if(paused)
          {
@@ -188,7 +188,7 @@ static class SoundThread : Thread
             double m = volume / (1 + Abs(balance * 2 - 1));
             double ll = (2 - (2 * Max(balance, 0.5)))* m;
             double lr = (-2 * Min(balance, 0.5) + 1) * m;
-            double rl = (2 * Max(balance, 0.5) - 1)  * m; 
+            double rl = (2 * Max(balance, 0.5) - 1)  * m;
             double rr = (2 * Min(balance, 0.5))      * m;
             // printf("Volume: %f, m : %f, Left: (%f, %f), Right: (%f, %f) \n", volume, m, ll, lr, rl, rr);
 
index 5712cd4..3830a51 100644 (file)
@@ -43,7 +43,7 @@ public void OpenMixer()
    waveFormat.wFormatTag = WAVE_FORMAT_PCM;
    waveFormat.nBlockAlign = (waveFormat.wBitsPerSample >> 3) * waveFormat.nChannels;
    waveFormat.nAvgBytesPerSec = waveFormat.nBlockAlign * waveFormat.nSamplesPerSec;
-   
+
    waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL);
    mixerOpen((HMIXER *)&hmx, (uint)hWaveOut, 0, 0, MIXER_OBJECTF_HWAVEOUT);
 }
@@ -63,12 +63,12 @@ public bool AudioSetVolume(VolumeControl type, double percent)
       {
          streamingSound.volume = percent;
          result = true;
-      }      
+      }
    }
    else
    {
       MIXERLINE uMixerLine;
-            
+
       // waveOutSetVolume((HWAVEOUT)0, (uint)(percent * 0xFFFF) | ((uint)(percent * 0xFFFF) << 16));
 
       uMixerLine.cbStruct = sizeof(MIXERLINE);
@@ -77,7 +77,7 @@ public bool AudioSetVolume(VolumeControl type, double percent)
       {
          MIXERLINECONTROLS uMixerLineControls;
          MIXERCONTROL mixerControl;
-         
+
          uMixerLineControls.cbStruct = sizeof(MIXERLINECONTROLS);
          uMixerLineControls.dwLineID = uMixerLine.dwLineID;
          uMixerLineControls.dwControlID = MIXERCONTROL_CONTROLTYPE_VOLUME;
@@ -113,19 +113,19 @@ public bool AudioGetVolume(VolumeControl type, double * percent)
       {
          *percent = streamingSound.volume;
          result = true;
-      }      
+      }
    }
    else
    {
       MIXERLINE uMixerLine;
-                  
+
       uMixerLine.cbStruct = sizeof(MIXERLINE);
       uMixerLine.dwComponentType = (type == pcm) ? MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT : MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
       if(mixerGetLineInfo(hmx, &uMixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE) == MMSYSERR_NOERROR)
       {
          MIXERLINECONTROLS uMixerLineControls;
          MIXERCONTROL mixerControl;
-         
+
          uMixerLineControls.cbStruct = sizeof(MIXERLINECONTROLS);
          uMixerLineControls.dwLineID = uMixerLine.dwLineID;
          uMixerLineControls.dwControlID = MIXERCONTROL_CONTROLTYPE_VOLUME;
@@ -178,7 +178,7 @@ public int OpenAudio(AudioSpec wanted, AudioSpec result)
    {
       streamingSound.volume = wanted.volume;
       dSoundThread.bDone = false;
-      
+
       //dSoundThread.Create();
       return 1;
    }
@@ -260,7 +260,7 @@ static class StreamingSound
          IDirectSoundBuffer_SetPan(apDSBuffer[0], pan);
       }
    }
-   
+
    property uint dwNumBuffers
    {
       set
@@ -282,7 +282,7 @@ static class StreamingSound
          }
       }
    }
-   
+
    ~StreamingSound()
    {
       uint i;
@@ -290,44 +290,44 @@ static class StreamingSound
       {
          if(apDSBuffer[i])
          {
-            IDirectSoundBuffer_Release( apDSBuffer[i] ); 
+            IDirectSoundBuffer_Release( apDSBuffer[i] );
             apDSBuffer[i] = 0;
          }
       }
-      
-      delete( apDSBuffer ); 
+
+      delete( apDSBuffer );
    }
-   
+
    int RestoreBuffer( IDirectSoundBuffer * pDSB, bool* pbWasRestored )
    {
       int hr;
       uint dwStatus;
-      
+
       if( pDSB == null )
          return CO_E_NOTINITIALIZED;
       if( pbWasRestored )
          *pbWasRestored = false;
-      
+
       if( FAILED( hr = IDirectSoundBuffer_GetStatus(pDSB, &dwStatus) ) )
          return 1; //DXUT_ERR( L"GetStatus", hr );
-      
+
       if( dwStatus & DSBSTATUS_BUFFERLOST )
       {
          // Since the app could have just been activated, then
-         // DirectSound may not be giving us control yet, so 
-         // the restoring the buffer may fail.  
+         // DirectSound may not be giving us control yet, so
+         // the restoring the buffer may fail.
          // If it does, sleep until DirectSound gives us control.
-         do 
+         do
          {
             hr = IDirectSoundBuffer_Restore(pDSB);
             if( hr == DSERR_BUFFERLOST )
                Sleep( 10 );
          }
          while( ( hr = IDirectSoundBuffer_Restore(pDSB) ) == DSERR_BUFFERLOST );
-         
+
          if( pbWasRestored != null )
             *pbWasRestored = true;
-         
+
          return S_OK;
       }
       else
@@ -340,75 +340,75 @@ static class StreamingSound
    {
       uint i;
       if(!apDSBuffer)
-         return null; 
-      
+         return null;
+
       for( i=0; i<dwNumBuffers; i++ )
       {
          if( apDSBuffer[i] )
-         {  
+         {
             uint dwStatus = 0;
             IDirectSoundBuffer_GetStatus(apDSBuffer[i], &dwStatus );
             if ( ( dwStatus & DSBSTATUS_PLAYING ) == 0 )
                break;
          }
       }
-      
+
       if( i != dwNumBuffers )
          return apDSBuffer[ i ];
       else
          return apDSBuffer[ rand() % dwNumBuffers ];
    }
-   
+
    IDirectSoundBuffer * GetBuffer( uint dwIndex )
    {
       if( apDSBuffer == null )
          return null;
       if( dwIndex >= dwNumBuffers )
          return null;
-      
+
       return apDSBuffer[dwIndex];
    }
-  
+
    int Play( uint dwPriority, uint dwFlags, uint lVolume, uint lFrequency, uint lPan )
    {
       int result;
       int hr;
       bool bRestored;
       //IDirectSoundBuffer * pDSB;
-      
+
       // For Streaming Sound
       dwFlags |= DSBPLAY_LOOPING;
 
       if( apDSBuffer == null )
          return CO_E_NOTINITIALIZED;
-      
+
       pDSB = GetFreeBuffer();
-      
+
       if( pDSB == null )
          return 1; //DXUT_ERR( L"GetFreeBuffer", E_FAIL );
-      
+
       // Restore the buffer if it was lost
       if( FAILED( hr = RestoreBuffer( pDSB, &bRestored ) ) )
          return 1; //DXUT_ERR( L"RestoreBuffer", hr );
-      
+
       if( bRestored )
       {
          // The buffer was restored, so we need to fill it with new data
          if( FAILED( hr = FillBufferWithSound( pDSB, false ) ) )
             return 1; //DXUT_ERR( L"FillBufferWithSound", hr );
       }
-      
+
       if( dwCreationFlags & DSBCAPS_CTRLVOLUME )
       {
          //IDirectSoundBuffer_SetVolume(pDSB, lVolume);
       }
-      
-      if( lFrequency != -1 && 
+
+      if( lFrequency != -1 &&
          (dwCreationFlags & DSBCAPS_CTRLFREQUENCY) )
       {
          IDirectSoundBuffer_SetFrequency(pDSB, lFrequency);
       }
-      
+
       if( dwCreationFlags & DSBCAPS_CTRLPAN )
       {
          //IDirectSoundBuffer_SetPan(pDSB, lPan);
@@ -423,10 +423,10 @@ static class StreamingSound
       uint i;
       if( apDSBuffer == null )
          return CO_E_NOTINITIALIZED;
-      
+
       for( i=0; i<dwNumBuffers; i++ )
          hr |= IDirectSoundBuffer_Stop(apDSBuffer[i]);
-      
+
       return hr;
    }
 
@@ -442,17 +442,17 @@ static class StreamingSound
       uint playCursor, writeCursor;
       bool bRestored;
       uint start, size;
-      
+
       static uint cursor;
       bool written = true;
       int c;
       while(written)
       {
          written = false;
-         
+
          // Figure out how much data has been played so far.  When we have played
          // past the end of the file, we will either need to start filling the
-         // buffer with silence or starting reading from the beginning of the file, 
+         // buffer with silence or starting reading from the beginning of the file,
          // depending if the user wants to loop the sound
          if(IDirectSoundBuffer_GetCurrentPosition(apDSBuffer[0], &dwCurrentPlayPos, null))
          {
@@ -478,7 +478,7 @@ static class StreamingSound
                IDirectSoundBuffer_Unlock(apDSBuffer[0], pDSLockedBuffer, dwDSLockedBufferSize, null, 0 );
                dwNextWriteOffset = 0;
             }
-            
+
             if(start > 0)
             {
                start = 0;
@@ -518,59 +518,59 @@ static class StreamingSound
          }
       return true;
    }
-   
+
    int Reset()
    {
       int hr;
       bool bRestored;
       int result;
-      
+
       if(!apDSBuffer[0])
          return 1;
-      
+
       dwLastPlayPos     = 0;
       dwPlayProgress    = 0;
       dwNextWriteOffset = 0;
       bFillNextNotificationWithSilence = false;
-      
+
       // Restore the buffer if it was lost
       if(RestoreBuffer( apDSBuffer[0], &bRestored ))
          return 1;
-      
+
       if( bRestored )
       {
          // The buffer was restored, so we need to fill it with new data
          if(FillBufferWithSound( apDSBuffer[0], false))
             return 1;
       }
-      
+
       result = IDirectSoundBuffer_SetCurrentPosition(apDSBuffer[0], 0L );
       return result;
    }
 
    int FillBufferWithSound( IDirectSoundBuffer * pDSB, bool bRepeatWavIfBufferLarger )
    {
-      int hr; 
+      int hr;
       void*   pDSLockedBuffer      = null; // Pointer to locked buffer memory
       uint   dwDSLockedBufferSize = 0;    // Size of the locked DirectSound buffer
-      uint   dwWavDataRead        = 0;    // Amount of data read from the wav file 
-      
+      uint   dwWavDataRead        = 0;    // Amount of data read from the wav file
+
       if( pDSB == null )
          return CO_E_NOTINITIALIZED;
-      
+
       // Make sure we have focus, and we didn't just switch in from
       // an app which had a DirectSound device
       if(RestoreBuffer( pDSB, null ))
          return 1;
-      
+
       // Lock the buffer down
       if(IDirectSoundBuffer_Lock(pDSB, 0, dwDSBufferSize, &pDSLockedBuffer, &dwDSLockedBufferSize, null, null, 0L ))
          return 1;
-      
+
       callback(data, pDSLockedBuffer, dwDSLockedBufferSize);
 
       dwWavDataRead = dwDSLockedBufferSize;
-      
+
       printf("Filling 16 spots\n");
       IDirectSoundBuffer_Unlock(pDSB, pDSLockedBuffer, dwDSLockedBufferSize, null, 0 );
 
@@ -582,74 +582,74 @@ static class StreamingSound
 static class CSoundManager
 {
    IDirectSound8* pDS;
-   
+
    ~CSoundManager()
    {
       if(pDS)
-         IDirectSound_Release( pDS ); 
+         IDirectSound_Release( pDS );
    }
-   
+
    int Initialize( void * hWnd )
    {
       int hr;
-      
+
       if(pDS)
       {
          IDirectSound_Release( pDS );
          pDS = null;
       }
-      
+
       // Create IDirectSound using the primary sound device
       if( FAILED( hr = DirectSoundCreate8( null, &pDS, null ) ) )
          return 1; //DXUT_ERR( L"DirectSoundCreate8", hr );
-      
-      // Set DirectSound coop level 
+
+      // Set DirectSound coop level
       if( FAILED( hr = IDirectSound_SetCooperativeLevel(pDS, hWnd, DSSCL_PRIORITY ) ) )
-         return 1; //DXUT_ERR( L"SetCooperativeLevel", hr );   
-      
+         return 1; //DXUT_ERR( L"SetCooperativeLevel", hr );
+
       return S_OK;
    }
-   
-   
+
+
    int SetPrimaryBufferFormat( uint dwPrimaryChannels, uint dwPrimaryFreq, uint dwPrimaryBitRate )
    {
       int hr;
       IDirectSoundBuffer * pDSBPrimary = null;
       DSBUFFERDESC dsbd;
       WAVEFORMATEX wfx;
-      
+
       if( pDS == null )
          return CO_E_NOTINITIALIZED;
-      
-      // Get the primary buffer 
+
+      // Get the primary buffer
       ZeroMemory( &dsbd, sizeof(DSBUFFERDESC) );
       dsbd.dwSize        = sizeof(DSBUFFERDESC);
       dsbd.dwFlags       = DSBCAPS_PRIMARYBUFFER | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME;
       dsbd.dwBufferBytes = 0;
       dsbd.lpwfxFormat   = null;
-      
+
       if( FAILED( hr = IDirectSound_CreateSoundBuffer(pDS, &dsbd, &pDSBPrimary, null ) ) )
          return 1; // DXUT_ERR( L"CreateSoundBuffer", hr );
-      
-      ZeroMemory( &wfx, sizeof(WAVEFORMATEX) ); 
-      wfx.wFormatTag      = (WORD) WAVE_FORMAT_PCM; 
-      wfx.nChannels       = (WORD) dwPrimaryChannels; 
-      wfx.nSamplesPerSec  = (uint) dwPrimaryFreq; 
-      wfx.wBitsPerSample  = (WORD) dwPrimaryBitRate; 
+
+      ZeroMemory( &wfx, sizeof(WAVEFORMATEX) );
+      wfx.wFormatTag      = (WORD) WAVE_FORMAT_PCM;
+      wfx.nChannels       = (WORD) dwPrimaryChannels;
+      wfx.nSamplesPerSec  = (uint) dwPrimaryFreq;
+      wfx.wBitsPerSample  = (WORD) dwPrimaryBitRate;
       wfx.nBlockAlign     = (WORD) (wfx.wBitsPerSample / 8 * wfx.nChannels);
       wfx.nAvgBytesPerSec = (uint) (wfx.nSamplesPerSec * wfx.nBlockAlign);
-      
+
       if( FAILED( hr = IDirectSoundBuffer_SetFormat(pDSBPrimary, &wfx) ) )
          return 1; //DXUT_ERR( L"SetFormat", hr );
-      
+
       if(pDSBPrimary)
       {
          IDirectSoundBuffer_Release( pDSBPrimary );
          pDSBPrimary = null;
-      }      
+      }
       return S_OK;
    }
-   
+
 
    bool InitStreaming(StreamingSound * ppStreamingSound, uint dwNotifyCount, uint dwNotifySize, void * hNotifyEvent,
                       void (*callback)(void * data, void * buffer, int len), void * data, int nChannels, int freq,int bits)
@@ -657,18 +657,18 @@ static class CSoundManager
       int hr;
       IDirectSoundBuffer * pDSBuffer = null;
       uint dwDSBufferSize = 0;
-      DSBPOSITIONNOTIFY * aPosNotify = null; 
+      DSBPOSITIONNOTIFY * aPosNotify = null;
       IDirectSoundNotify * pDSNotify = null;
       DSBUFFERDESC dsbd;
       uint i;
-      
+
       if(!pDS)
          return false;
       if(!ppStreamingSound || !hNotifyEvent)
          return false;
-      
+
       dwDSBufferSize = dwNotifySize * dwNotifyCount;
-      
+
       ZeroMemory( &dsbd, sizeof(DSBUFFERDESC) );
       dsbd.dwSize= sizeof(DSBUFFERDESC);
       dsbd.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLPOSITIONNOTIFY | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME;
@@ -681,30 +681,30 @@ static class CSoundManager
       dsbd.lpwfxFormat->wBitsPerSample = (uint16)bits;
       dsbd.lpwfxFormat->nBlockAlign = dsbd.lpwfxFormat->nChannels * dsbd.lpwfxFormat->wBitsPerSample / 8;
       dsbd.lpwfxFormat->nAvgBytesPerSec = dsbd.lpwfxFormat->nSamplesPerSec * dsbd.lpwfxFormat->nBlockAlign;
-      
+
       if(IDirectSound_CreateSoundBuffer(pDS, &dsbd, &pDSBuffer, null))
       {
          delete dsbd.lpwfxFormat;
          return false;
       }
       delete dsbd.lpwfxFormat;
-      
+
       if(IDirectSoundBuffer_QueryInterface(pDSBuffer, &IID_IDirectSoundNotify, (void**)&pDSNotify))
       {
          delete aPosNotify;
          return false;
       }
-      
+
       aPosNotify = new DSBPOSITIONNOTIFY[ dwNotifyCount ];
       if( aPosNotify == null )
          return false;
-      
+
       for( i = 0; i < dwNotifyCount; i++ )
       {
          aPosNotify[i].dwOffset     = (dwNotifySize * i) + dwNotifySize - 1;
-         aPosNotify[i].hEventNotify = hNotifyEvent;             
+         aPosNotify[i].hEventNotify = hNotifyEvent;
       }
-      
+
       if(IDirectSoundNotify_SetNotificationPositions(pDSNotify, dwNotifyCount, aPosNotify ))
       {
          if(pDSNotify)
@@ -712,15 +712,15 @@ static class CSoundManager
          delete( aPosNotify );
          return false;
       }
-      
+
       if(pDSNotify)
          IDirectSoundNotify_Release(pDSNotify);
       delete aPosNotify;
-      
+
       *ppStreamingSound = StreamingSound
       {
-         dwCreationFlags = DSBCAPS_CTRLPAN|DSBCAPS_CTRLVOLUME, dwNumBuffers = 1, dwNotifySize = dwNotifySize, dwDSBufferSize = dwDSBufferSize, apDSBuffer = &pDSBuffer, 
-         
+         dwCreationFlags = DSBCAPS_CTRLPAN|DSBCAPS_CTRLVOLUME, dwNumBuffers = 1, dwNotifySize = dwNotifySize, dwDSBufferSize = dwDSBufferSize, apDSBuffer = &pDSBuffer,
+
          callback = callback, data = data
       };
       // ppStreamingSound->FillBufferWithSound( pDSBuffer, false );
@@ -749,8 +749,8 @@ static class DSoundThread : Thread
    {
       bool filled = false;
       SetPriority(timeCritical);
-      while( !bDone ) 
-      { 
+      while( !bDone )
+      {
          WaitForSingleObject(g_hNotificationEvent, INFINITE);
          if(streamingSound)
          {
index d517e46..664ab24 100644 (file)
@@ -139,11 +139,11 @@ public class Mixer
                   } while(se >= frequency);
                   if(s < sound.length)
                   {
-                     sampleL = sBuffer[s];                  
+                     sampleL = sBuffer[s];
                      sampleR = (chn == 2) ? sBuffer[s+1] : sampleL;
                   }
                   else
-                     break;                   
+                     break;
                }
             }
             v.pos = s;
@@ -188,11 +188,11 @@ public class Mixer
                   } while(se >= frequency);
                   if(s < sound.length)
                   {
-                     sampleL = sBuffer[s];                  
+                     sampleL = sBuffer[s];
                      sampleR = (chn == 2) ? sBuffer[s+1] : sampleL;
                   }
                   else
-                     break;                   
+                     break;
                }
             }
             v.pos = s;
@@ -264,7 +264,7 @@ public:
          windowHandle = systemHandle;
          volume = 100;
       };
-      
+
       if(!OpenAudio(wantedSpec, spec))
       {
          MessageBox { contents = "OpenAudio failed" }.Modal();
index 8d225ff..349cd3a 100644 (file)
@@ -48,7 +48,7 @@ int Base64Decode(byte * input, int len, byte * decoded)
    while(c < len)
    {
       buffer = ((int)base64inv[input[c]] << 18) | ((int)base64inv[input[c+1]] << 12) | ((int)base64inv[input[c+2]] << 6) | ((int)base64inv[input[c+3]]);
-      
+
       decoded[decLen++] = (byte)((buffer & 0xFF0000) >> 16);
       if(len - c < 4)
       {
index 355eadb..e71b0b6 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-  
+
 ****************************************************************************/
 import "ecere"
 
@@ -74,7 +74,7 @@ class Fli
          f.Getc(&ch);
          put=ch;
 
-         if(!put) 
+         if(!put)
             put=256;
          f.Read(palette+skip*3,1,3*put);
 
index e9ccae5..dca721f 100644 (file)
@@ -13,8 +13,8 @@ class FliPlay : Window
       {
          Surface surface;
 
-         animation.PlayFrame(image);   
-         
+         animation.PlayFrame(image);
+
          surface = temp.GetSurface(0,0,null);
          /*
          if(surface)
@@ -64,7 +64,7 @@ class FliPlay : Window
       // temp.Allocate(null, w, h, 0, PixelFormatRGBA, false);
       temp.Allocate(null, w, h, 0, PixelFormat888, false);
       surface = temp.GetSurface(0,0,null);
-      surface.Stretch(image, 0,0,0,0, temp.width, temp.height, 
+      surface.Stretch(image, 0,0,0,0, temp.width, temp.height,
          image.width, image.height);
       delete surface;
    }
@@ -83,7 +83,7 @@ class FliPlay : Window
 
       //surface.Stretch(image, 0,0,0,0, clientSize.w, clientSize.h, image.width,image.height);
    }
-   
+
    void OnDestroy()
    {
       image.Free();
@@ -92,8 +92,8 @@ class FliPlay : Window
 
    bool OnKeyDown(Key key, unichar ch)
    {
-      if(key == escape) 
-         Destroy(0); 
+      if(key == escape)
+         Destroy(0);
       return true;
    }
 }
index 7c9f6d3..2b1d5d2 100644 (file)
@@ -41,7 +41,7 @@ public:
          icons.Add(br);
       }
    }
-   
+
    void Unload()
    {
       icons.RemoveAll();
index 3b983df..34c32ca 100644 (file)
@@ -34,7 +34,7 @@ static byte borderData[] =
    0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
-static byte insideData[] = 
+static byte insideData[] =
 {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -144,7 +144,7 @@ class RoundedBMPs
             {
                byte b = picture[y * s + x];
                byte ib = ipicture[y * s + x];
-               
+
                ((byte *)bl.picture)[(h-1-y) * s + x]        = b;
                ((byte *)br.picture)[(h-1-y) * s + (w-1-x)]  = b;
                ((byte *)tr.picture)[y * s + (w-1-x)]        = b;
@@ -152,7 +152,7 @@ class RoundedBMPs
                ((byte *)ibl.picture)[(h-1-y) * s + x]        = ib;
                ((byte *)ibr.picture)[(h-1-y) * s + (w-1-x)]  = ib;
                ((byte *)itr.picture)[y * s + (w-1-x)]        = ib;
-               
+
                /*if(x) Print(", ");
                printf("0x%02X", b);*/
             }
@@ -166,7 +166,7 @@ class RoundedBMPs
             for(x = 0; x < tl.width; x++)
             {
                byte ib = ipicture[y * s + x];
-               
+
                if(x) Print(", ");
                printf("0x%02X", ib);
             }
@@ -183,7 +183,7 @@ class RoundedBMPs
       ihorz.Grab(itl, tl.width - horz.width, 0);
       ieVert.Grab(ibr, tl.width - borderSize, 0);
       ieHorz.Grab(ibr, 0, tl.height - borderSize);
-      
+
       tl.MakeDD(displaySystem);
       bl.MakeDD(displaySystem);
       tr.MakeDD(displaySystem);
@@ -213,7 +213,7 @@ class RoundedBMPs
          surface.Tile(ivert, 0, tl.height, borderSize, size.h - 2*tl.height);
          surface.Tile(ieHorz, br.width, size.h - ieHorz.height, size.w - 2*br.width, ieHorz.height);
          surface.Tile(ieVert, size.w - ieVert.width, br.height, ieVert.width, size.h - 2*br.height);
-         
+
          surface.Blit(itl, 0,0,0,0, borderSize, tl.height);
          surface.Blit(itl, 0,0,0,0, tl.width, borderSize);
 
@@ -248,7 +248,7 @@ class RoundedBMPs
          surface.Tile(vert, 0, tl.height, borderSize, size.h - 2*tl.height);
          surface.Tile(eHorz, br.width, size.h - ieHorz.height, size.w - 2*br.width, ieHorz.height);
          surface.Tile(eVert, size.w - ieVert.width, br.height, ieVert.width, size.h - 2*br.height);
-         
+
          surface.Blit(tl, 0,0,0,0, borderSize, tl.height);
          surface.Blit(tl, 0,0,0,0, tl.width, borderSize);
 
index 670b449..152c958 100644 (file)
@@ -42,7 +42,7 @@ class CheckListBox : ListBox
 
    checkIndent = 20;
 
-   fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true, 
+   fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true,
    noDragging = true;
    // rowHeight = 18;
 
@@ -50,7 +50,7 @@ class CheckListBox : ListBox
    {
       buttonMaps.RemoveAll();
    }
-   
+
    bool NotifyCollapse(CheckListBox listBox, DataRow row, bool collapsed)
    {
       DataRow r;
@@ -73,9 +73,9 @@ class CheckListBox : ListBox
          {
             listBox.SetupButtons(r, false);
          }
-         if(r.firstRow && !r.collapsed) 
+         if(r.firstRow && !r.collapsed)
             r = r.firstRow;
-         else 
+         else
             for(; r != row; r = r.parent)
                if(r.next) { r = r.next; break; }
       }
@@ -98,7 +98,7 @@ class CheckListBox : ListBox
       }
       return false;
    }
-   
+
    void SetupButtons(DataRow row, bool recurse)
    {
       DataRow parent;
@@ -146,7 +146,7 @@ class CheckListBox : ListBox
       if(ListBox::OnCreate())
       {
          DataRow row;
-         
+
          buttonMaps.RemoveAll();
 
          for(row = firstRow; row; row = row.next)
@@ -165,10 +165,10 @@ class CheckListBox : ListBox
          DataRow r;
          for(r = row; r; r = r.parent)
             if(rowChecks.Find(r))
-            { 
+            {
                checked = true;
                break;
-            }         
+            }
          SetCheck(row, !checked);
       }
    }
@@ -193,7 +193,7 @@ class CheckListBox : ListBox
       }
       NotifyChecked(master, this, row);
    }
-   
+
    void UnsetChildren(DataRow row)
    {
       DataRow r;
@@ -212,9 +212,9 @@ class CheckListBox : ListBox
             it.Remove();
          UnsetChildren(r);
          NotifyChecked(master, this, r);
-      }      
+      }
    }
-   
+
    void SetCheck(DataRow row, bool checked)
    {
       DataRow parent;
@@ -312,7 +312,7 @@ class CheckListBox : ListBox
          }
       }
    }
-   
+
    bool NotifyKeyDown(CheckListBox listBox, DataRow row, Key key, unichar ch)
    {
       if(key == space)
index 657935c..270239d 100644 (file)
@@ -419,7 +419,7 @@ class NamedStringsBox : CommonControl
    };
    DataField nameField { dataType = class(char *), editable = true, width = 120 };
    DataField stringField { dataType = class(char *), editable = true };
-   
+
    NamedStringsBox()
    {
       //DataRow row;
index 3fb2421..5bcd293 100644 (file)
@@ -87,7 +87,7 @@ class SimSkin_Window : Window
             deepBottom = (((BorderBits)borderStyle).sizable && isNormal) ? bottom : border;
          }
 
-         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop, 
+         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop,
             size.w - deepBorder - deepBorder, size.h - deepBottom - deepTop);
       }
 
@@ -101,7 +101,7 @@ class SimSkin_Window : Window
             surface.SetForeground(activeBorder);
             surface.Rectangle(2, 2, size.w-3, size.h-3);
 
-            // Resizeable frame is 1 pixel thicker 
+            // Resizeable frame is 1 pixel thicker
             if(((BorderBits)borderStyle).sizable && isNormal)
                surface.Rectangle(3, 3, size.w - 4, size.h - 4);
          }
@@ -111,7 +111,7 @@ class SimSkin_Window : Window
             surface.Gradient(gradient, sizeof(gradient) / sizeof(ColorKey), GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
          else
-            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey), 
+            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey),
             GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
 
@@ -137,7 +137,7 @@ class SimSkin_Window : Window
          {
             int buttonsSize = border +
                ((hasMaximize || hasMinimize) ? 52 : 18);
-            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET, 
+            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET,
                size.w - (buttonsSize + border + 4), name, (int)strlen(name));
          }
       }
@@ -561,12 +561,12 @@ class SimSkin_Button : Button
             surface.SetForeground(Color { Min((int)c.r * 16/10, 255), Min((int)c.g * 16/10, 255), Min((int)c.b * 16/10,255) });
             surface.HLine(0 + isDefault, clientSize.w-2 - isDefault,  isDefault);
             surface.VLine(1 + isDefault, clientSize.h-2 - isDefault,  isDefault);
-            
-            
+
+
             surface.SetForeground(skinMainColor);
             surface.HLine(1 + isDefault, clientSize.w-2 - isDefault, clientSize.h-2 - isDefault);
             surface.VLine(1 + isDefault, clientSize.h-3 - isDefault, clientSize.w-2 - isDefault);
-            
+
             if(bevel)
             {
                //surface.SetForeground(skinForeground);
@@ -731,13 +731,13 @@ class SimSkin_Button : Button
                   x, y,
                   0,0,buttonBitmap.width,buttonBitmap.height);
             }
-            else 
+            else
             {
                // Push Buttons
                if(scaleBitmap)
                {
                   if(bevel || offset)
-                     surface.Stretch(buttonBitmap, 
+                     surface.Stretch(buttonBitmap,
                         1 + offset, 1 + offset,0,0,
                         clientSize.w-3,clientSize.h-3,buttonBitmap.width,buttonBitmap.height);
                   else
@@ -800,12 +800,12 @@ class SimSkin_Button : Button
             surface.TextExtent(text, (int)strlen(text),&tw, &th);
 
             if((isRadio || isCheckbox) && !bevelOver)
-               WriteCaption(surface, /*clientSize.h +*/ CAPTION_DISTANCE + 3, 
+               WriteCaption(surface, /*clientSize.h +*/ CAPTION_DISTANCE + 3,
                   (clientSize.h - th - 4)/2);
-            else 
+            else
             {
                int x, y = (clientSize.h - th - 1)/2 + offset;
-               
+
                if(ellipsis)
                {
                   int width = clientSize.w - 2*6;
@@ -898,7 +898,7 @@ class SimSkin_ScrollBar : ScrollBar
       downBtn.background = Color {  70 * 6/10, 130* 6/10, 180* 6/10 }; //skinBackground;
       downBtn.bitmap = { (direction == vertical) ? "<:ecere>elements/arrowDown.png" : "<:ecere>elements/arrowRight.png", monochrome = true };
       thumb.background = Color {  70 * 6/10, 130* 6/10, 180* 6/10 }; //skinBackground;*/
-   }   
+   }
 }
 
 /*class SimSkin_DropBox : DropBox
@@ -910,7 +910,7 @@ class SimSkin_ScrollBar : ScrollBar
       background = skinBackground;
       foreground = skinForeground;
       selectionColor = skinMainColor;
-   }   
+   }
 }*/
 
 /*class SimSkin_ListBox : ListBox
@@ -921,7 +921,7 @@ class SimSkin_ScrollBar : ScrollBar
       background = skinBackground;
       foreground = skinForeground;
       selectionColor = skinMainColor;
-   }   
+   }
 }*/
 
 public class SimSkin : Skin
index da136c6..2cd2797 100644 (file)
@@ -51,7 +51,7 @@ class ImageEntry : struct
       delete bitmap;
       delete referer;
       delete src;
-      bitmapPtrs.Free(null);     
+      bitmapPtrs.Free(null);
    }
 };
 
@@ -100,7 +100,7 @@ class ObjectThread : Thread
             RequestLink request;
 
             //((GuiApplication)__thisModule).Lock();
-            
+
             for(;!objectThreadTerminate;)
             {
                OldLink bitmapPtr;
@@ -117,11 +117,11 @@ class ObjectThread : Thread
                if(!request) break;
 
                entry = request.data;
-              
+
                strcpy(path, entry.src);
                //strcpy(referer, browserWindow.location ? browserWindow.location : "");
                strcpy(referer, entry.referer); //browserWindow.location ? browserWindow.location : "");
-            
+
                //((GuiApplication)__thisModule).Unlock();
 
                if(path && strstr(path, "http://") == path)
@@ -210,7 +210,7 @@ class ObjectThread : Thread
             objectThreadSemaphore.Wait();
          }
       }
-      objectThreadDead = true;   
+      objectThreadDead = true;
       return 0;
    }
 }
@@ -233,7 +233,7 @@ static void WriteBlock(File f, Block block)
 
    for(c = 0; c<indent; c++)
       f.Printf("   ");
-   
+
    switch(block.type)
    {
       case TEXT:
@@ -321,7 +321,7 @@ Window sharedWindow
       }
       return true;
    }
-   
+
    void OnUnloadGraphics()
    {
       ImageEntry entry;
@@ -360,7 +360,7 @@ class HTMLView : Window
             Block block = html.body;
             int textPos = 0;
             int centered = 0;
-            
+
             Surface surface = display.GetSurface(0,0,null);
             if(surface)
             {
@@ -402,11 +402,11 @@ class HTMLView : Window
          block.minW = 0;
          block.rowSpan = block.span = 1;
       }
-     
+
       for(b = block.subBlocks.first; b; b = b.next)
       {
          Clear(b);
-      }      
+      }
    }
    void ComputeSizes()
    {
@@ -419,9 +419,9 @@ class HTMLView : Window
       int centered = 0;
       Surface surface = display.GetSurface(0,0,null);
 
-      if(!initSize.w) 
+      if(!initSize.w)
          width = parent.clientSize.w;
-      if(!initSize.h) 
+      if(!initSize.h)
          height = parent.clientSize.h;
 
       if(surface)
@@ -458,7 +458,7 @@ class HTMLView : Window
          SetScrollArea(totalWidth, totalHeight, false);
          SetScrollArea(totalWidth, totalHeight, false);
       }
-      
+
       if(!initSize.w || !initSize.h)
          clientSize = Size {!initSize.w ? totalWidth : clientSize.w, !initSize.h ? totalHeight : clientSize.h };
    }
@@ -562,7 +562,7 @@ class HTMLView : Window
                objectsMutex.Wait();
                for(request = objectRequests.first; request; request = (RequestLink)request.next)
                {
-                  if(request.data == entry) 
+                  if(request.data == entry)
                      break;
                }
                if(!request)
@@ -743,7 +743,7 @@ class HTMLView : Window
             surface.font = font;
 
             PositionLine(this, surface, x - scroll.x, y - scroll.y,
-               maxW, newH, block, textPos, nextBlock, nextTextPos, 
+               maxW, newH, block, textPos, nextBlock, nextTextPos,
                left - scroll.x, right - scroll.x);
 
             if(changeLine)
@@ -800,7 +800,7 @@ class HTMLView : Window
       while(!opened)
       {
          char path[MAX_LOCATION];
-         
+
          if(this.location)
             delete this.location;
          this.location = CopyString(relocation);
@@ -1001,7 +1001,7 @@ class HTMLView : Window
             }
          }
          */
-         
+
       }
       ((GuiApplication)__thisModule.application).Unlock();
       // PrintLn("At position ", f.Tell(), " for ", fileName);
@@ -1054,7 +1054,7 @@ class HTMLView : Window
                delete f;
             }
          }
-         */         
+         */
       }
       NotifyPageOpened(master);
    }
@@ -1098,8 +1098,8 @@ class HTMLView : Window
       objectThread3.objectThreadSemaphore.Release();
       objectThread4.objectThreadSemaphore.Release();
 
-      
-      while(!objectThread1.objectThreadDead || 
+
+      while(!objectThread1.objectThreadDead ||
             !objectThread2.objectThreadDead ||
             !objectThread3.objectThreadDead ||
             !objectThread4.objectThreadDead)
@@ -1254,13 +1254,13 @@ class HTMLView : Window
          case tab:
             CycleChildren(false, false, false, true);
             return false;
-         case left: case right: 
+         case left: case right:
             horzScroll.OnKeyHit(key, character);
             break;
          case down: case up: case pageDown: case pageUp:
             vertScroll.OnKeyHit(key, character);
             break;
-      }   
+      }
       return true;
    }
 
@@ -1280,7 +1280,7 @@ class HTMLView : Window
             horzScroll.OnKeyDown(end, character);
             break;
          }
-      }   
+      }
       return true;
    }
 
@@ -1348,12 +1348,12 @@ class HTMLView : Window
 
             surface.font = font;
 
-            if(PickLine(this, surface, x - scroll.x, y - scroll.y, 
-               maxW, newH, block, textPos, nextBlock, nextTextPos, 
+            if(PickLine(this, surface, x - scroll.x, y - scroll.y,
+               maxW, newH, block, textPos, nextBlock, nextTextPos,
                left - scroll.x, right - scroll.x, pickX, pickY, pickBlock, pickTextPos))
             {
                result = true;
-               break;         
+               break;
             }
 
             if(changeLine)
@@ -1454,7 +1454,7 @@ class HTMLView : Window
       Open(newLocation, null);
       return true;
    }
-   
+
    bool OnLeftButtonUp(int x, int y, Modifiers mods)
    {
       if(clickedLink)
@@ -1484,7 +1484,7 @@ class HTMLView : Window
                int len;
                char * text;
 
-               if(location[strlen(location)-1] != '?') 
+               if(location[strlen(location)-1] != '?')
                {
                   strcat(location, "&");
                }
index d1b64f7..19b96bd 100644 (file)
@@ -141,7 +141,7 @@ String ParseURL(String input)
       if(!quoted && wasQuoted)
          break;
 
-      if((ch == ' ' || ch == '\t') && !quoted) 
+      if((ch == ' ' || ch == '\t') && !quoted)
       {
          if(!start) break;
       }
@@ -159,7 +159,7 @@ String ParseURL(String input)
          }
          else if(ch != '\r' && ch != '\n')
          {
-            if(c < maxSize) 
+            if(c < maxSize)
                keyWord[c++] = ch;
             start = false;
          }
@@ -185,7 +185,7 @@ static char * GetString(char * string, char * what, int count)
       if(string[sc] != ' ' && string[sc] != '\"')
          break;
    }
-   
+
    for(wc = 0; what[wc]; wc++, sc++)
    {
       if((count && sc >= count) || (string[sc] != what[wc] && tolower(string[sc]) != tolower(what[wc])))
@@ -263,7 +263,7 @@ class HTMLFile
       fontBlock.size = 12;
       fontBlock.textColor = LT_BLUE|0xFF000000;
       */
-      
+
       fontBlock.textColor = black;
       fontBlock.size = 10;
 
@@ -271,17 +271,17 @@ class HTMLFile
       fontCache.Add(fontBlock.font);*/
 
       background = white;
-      
+
       text = new char[32768*4];
 
       block.font = fontBlock.font;
       body = block;
-      
+
       // Parse entire file
       while(!f.Eof() && block)
       {
          byte ch = 0;
-         
+
          f.Getc(&ch);
 #ifdef _DEBUG
          //fwrite(&ch, 1, 1, stdout);
@@ -430,7 +430,7 @@ class HTMLFile
                            else if(!strcmpi(keyWord, "text"))
                            {
                               GetKeyWord(&string, keyWord, sizeof(keyWord));
-                              fontBlock.textColor = 
+                              fontBlock.textColor =
                                  block.textColor = 0xFF000000 | strtol((keyWord[0] == '#') ? (keyWord+1) : keyWord, null, 16);
                            }
                         }
@@ -473,8 +473,8 @@ class HTMLFile
                      else if(!strcmpi(keyWord, "p"))
                      {
                      }
-                     else if(!strcmpi(keyWord, "font") || !strcmpi(keyWord, "b") || !strcmpi(keyWord, "i") 
-                        || !strcmpi(keyWord, "strong") || !strcmpi(keyWord, "em") || 
+                     else if(!strcmpi(keyWord, "font") || !strcmpi(keyWord, "b") || !strcmpi(keyWord, "i")
+                        || !strcmpi(keyWord, "strong") || !strcmpi(keyWord, "em") ||
                         !strcmpi(keyWord, "h1") || !strcmpi(keyWord, "h2") || !strcmpi(keyWord, "h3"))
                      {
                         if((!strcmpi(keyWord, "h1") || !strcmpi(keyWord, "h2") || !strcmpi(keyWord, "h3")))
@@ -542,7 +542,7 @@ class HTMLFile
                               else if(!strcmpi(keyWord, "color"))
                               {
                                  GetKeyWord(&string, keyWord, sizeof(keyWord));
-                                 subBlock.textColor = 
+                                 subBlock.textColor =
                                     0xFF000000 | strtol((keyWord[0] == '#') ? (keyWord+1) : keyWord, null, 16);
                               }
                            }
@@ -1130,11 +1130,11 @@ class HTMLFile
                      char utf8[5];
                      if(symbol[0] == '#' && symbol[1] == 'x')
                         unicode = strtol(symbol+2, null, 16);
-                     else if(!strcmpi(symbol, "nbsp")) 
+                     else if(!strcmpi(symbol, "nbsp"))
                         unicode = ' ';
-                     else if(!strcmpi(symbol, "copy")) 
+                     else if(!strcmpi(symbol, "copy"))
                         unicode ='©';
-                     else if(!strcmpi(symbol, "raquo")) 
+                     else if(!strcmpi(symbol, "raquo"))
                         unicode = '»';
                      else if(!strcmpi(symbol, "eacute"))
                         unicode = 'é';
@@ -1209,7 +1209,7 @@ class HTMLFile
                subBlock.textLen = textLen;
                textLen = 0;
                text[0] = '\0';
-               subBlock = AddBlock(block, BR);               
+               subBlock = AddBlock(block, BR);
             }
          }
       }
@@ -1229,7 +1229,7 @@ class HTMLFile
          if(titleBlock && titleBlock.subBlocks.first && ((Block)titleBlock.subBlocks.first).type == TEXT)
          {
             Block t = titleBlock.subBlocks.first;
-            return t.text;            
+            return t.text;
          }
          return null;
       }
index b8a9917..6aa9be3 100644 (file)
@@ -81,7 +81,7 @@ Block GetNextBlock(Block block)
    return block;
 }
 
-int ComputeLine(Surface surface, Block startBlock, int startTextPos, Block * nextBlock, int * nextTextPos, int * centered, int * w, 
+int ComputeLine(Surface surface, Block startBlock, int startTextPos, Block * nextBlock, int * nextTextPos, int * centered, int * w,
    int maxW, int maxH, uint flags, int y, OldList leftObjects, OldList rightObjects, bool * changeLine, bool computeStartY, int sy, int sx)
 {
    int h = 0;
@@ -180,7 +180,7 @@ int ComputeLine(Surface surface, Block startBlock, int startTextPos, Block * nex
                   len = (nextSpace - (text + textPos)) + 1;
                else
                   len = block.textLen - textPos;
-               
+
                surface.TextExtent(text + textPos, len, &w, &th);
 
                if(x + width + w > maxW && x > 0)
@@ -243,7 +243,7 @@ int ComputeLine(Surface surface, Block startBlock, int startTextPos, Block * nex
                ComputeTable(surface, block, textPos, &width, &height, maxW, maxH, flags, y + sy, x + sx);
                surface.font = font;
                x += width;
-            
+
                *nextBlock = NextBlockUp(surface, block, centered, flags);
                *nextTextPos = 0;
                h = Max(h, height);
@@ -385,7 +385,7 @@ void RenderLine(HTMLView browser, Surface surface, int x, int y, int w, int h, B
             {
                surface.Bevel(false, dx, dy, bw, bh);
                if(browser.missing.bitmap)
-                  surface.Blit(browser.missing.bitmap, dx + 5, dy + 5, 0,0, 
+                  surface.Blit(browser.missing.bitmap, dx + 5, dy + 5, 0,0,
                      browser.missing.bitmap.width, browser.missing.bitmap.height);
             }
             surface.SetForeground(fg);
@@ -474,7 +474,7 @@ void RenderLine(HTMLView browser, Surface surface, int x, int y, int w, int h, B
    }
 }
 
-bool PickLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Block startBlock, int startTextPos, 
+bool PickLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Block startBlock, int startTextPos,
               Block endBlock, int endTextPos, int left, int right, int pickX, int pickY, Block* pickBlock, int * pickTextPos)
 {
    bool result = false;
@@ -583,8 +583,8 @@ bool PickLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Blo
    return result;
 }
 
-              
-void PositionLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Block startBlock, int startTextPos, 
+
+void PositionLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Block startBlock, int startTextPos,
                   Block endBlock, int endTextPos, int left, int right)
 {
    int textPos = startTextPos;
@@ -604,7 +604,7 @@ void PositionLine(HTMLView browser, Surface surface, int x, int y, int w, int h,
             {
                Window parent = block.window.parent;
                block.window.Move(
-                  x + parent.scroll.x, y + parent.scroll.y, 
+                  x + parent.scroll.x, y + parent.scroll.y,
                   block.window.size.w, block.window.size.h);
                //block.window.visible = false;
                x += block.window.size.w;
index a105afb..9570f1b 100644 (file)
@@ -143,7 +143,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                      if(flags.lineW)
                      {
                         column.lineW = Max(column.lineW, cell.lineW);
-                        column.minW = Max(column.minW, cell.minW);                        
+                        column.minW = Max(column.minW, cell.minW);
                      }
                   }
 
@@ -205,7 +205,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                         {
                            column.rowSpan = cell.rowSpan;
                            sumColW += column.w;
-                           column = column.next;  
+                           column = column.next;
                         }
                         rowLineW += Max(sumColW, cell.lineW);
                      }
@@ -243,7 +243,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
          if(w < table.w)
          {
             int needed = 0;
-            
+
             // Step 1: Weights how to distribute
             for(column = table.columns.first; column; column = column.next)
             {
@@ -264,13 +264,13 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
 
                      while(columnStart && columnStart.rowSpan)
                         columnStart = columnStart.next;
-                  
+
                      for(c = 0, column = columnStart; c<cell.span && column; c++)
                      {
                         column.rowSpan = cell.rowSpan;
                         if(cell.span == 1)
                            totalW += column.w;
-                        column = column.next;  
+                        column = column.next;
                      }
                      if(cell.span == 1 && totalW < cell.lineW)
                      {
@@ -282,7 +282,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                         needed += cell.lineW - totalW;
                      }
 
-                     columnStart = column;  
+                     columnStart = column;
                   }
                   for(column = table.columns.first; column; column = column.next)
                      if(column.rowSpan) column.rowSpan--;
@@ -317,7 +317,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                         column.rowSpan = cell.rowSpan;
                         totalW += column.w;
                         sumDesires += column.desire;
-                        column = column.next;  
+                        column = column.next;
                      }
                      if(cell.span > 1 && totalW < cell.minW)
                      {
@@ -336,7 +336,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                         for(c = 0, column = columnStart; c<cell.span && column; c++)
                         {
                            totalW += column.minW;
-                           column = column.next;  
+                           column = column.next;
                         }
 
                         if(totalW < cell.minW)
@@ -348,7 +348,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                            }
                         }
                      }
-                     columnStart = column;  
+                     columnStart = column;
                   }
                   for(column = table.columns.first; column; column = column.next)
                      if(column.rowSpan) column.rowSpan--;
@@ -366,8 +366,8 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                   column.w = column.minW;
                }
             }
-            
-            
+
+
             // Repeat Step 1: Weights how to distribute
             needed = 0;
             for(column = table.columns.first; column; column = column.next)
@@ -389,13 +389,13 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
 
                      while(columnStart && columnStart.rowSpan)
                         columnStart = columnStart.next;
-                  
+
                      for(c = 0, column = columnStart; c<cell.span && column; c++)
                      {
                         column.rowSpan = cell.rowSpan;
                         if(/*cell.span == 1 && */cell.width)
                            totalW += column.w;
-                        column = column.next;  
+                        column = column.next;
                      }
                      if(/*cell.span == 1 && */totalW < cell.lineW && cell.width)
                      {
@@ -407,7 +407,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                         needed += cell.lineW - totalW;
                      }
 
-                     columnStart = column;  
+                     columnStart = column;
                   }
                   for(column = table.columns.first; column; column = column.next)
                      if(column.rowSpan) column.rowSpan--;
@@ -416,7 +416,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                else
                   row = NextBlock(surface, row, null, 0);
             }
-                        
+
             // Step 2: Do the distribution
             if(needed)
             {
@@ -459,13 +459,13 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
 
                      while(columnStart && columnStart.rowSpan)
                         columnStart = columnStart.next;
-                  
+
                      for(c = 0, column = columnStart; c<cell.span && column; c++)
                      {
                         column.rowSpan = cell.rowSpan;
                         if(/*cell.span == 1 && */!cell.width)
                            totalW += column.w;
-                        column = column.next;  
+                        column = column.next;
                      }
                      if(/*cell.span == 1 && */totalW < cell.lineW && !cell.width)
                      {
@@ -477,7 +477,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                         needed += cell.lineW - totalW;
                      }
 
-                     columnStart = column;  
+                     columnStart = column;
                   }
                   for(column = table.columns.first; column; column = column.next)
                      if(column.rowSpan) column.rowSpan--;
@@ -486,7 +486,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                else
                   row = NextBlock(surface, row, null, 0);
             }
-            
+
             // Step 2: Do the distribution
             if(needed)
             {
@@ -504,7 +504,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
             for(column = table.columns.first; column; column = column.next)
                w += column.w;
          }
-         
+
          // Repartition the rest of the space in the columns
          if(w < table.w)
          {
@@ -646,7 +646,7 @@ void ComputeTable(Surface surface, Block table, int textPos, int * width, int *
                               rightObjects.Delete(object);
                         }
                         cellW = Max(cellW, 0);
+
                         // TRIED ADDING THIS CODE HERE...
                         {
                            int x;
@@ -818,7 +818,7 @@ static void RenderCell(HTMLView browser, Surface surface, Block cell, int cellX,
 
    cell.parent = null;
    cell.next = null;
-   
+
    /*
    if(cell.width)
       cellW = cell.width;
@@ -960,7 +960,7 @@ static void RenderRow(HTMLView browser, Surface surface, Block row, Block table,
          {
             column.rowSpan = cell.rowSpan;
             x += column.w;
-            column = column.next;  
+            column = column.next;
          }
       }
       c++;
@@ -1015,7 +1015,7 @@ void RenderTable(HTMLView browser, Surface surface, int x, int y, int w, int h,
          row = NextBlockUp(surface, row, null, 0);
       }
       else
-         row = NextBlock(surface, row, null, 0);   
+         row = NextBlock(surface, row, null, 0);
    }
 }
 
@@ -1093,7 +1093,7 @@ static bool PickCell(HTMLView browser, Surface surface, Block cell, int cellX, i
 
       font = surface.font;
       newLineH = ComputeLine(surface, block, textPos, &nextCellBlock, &nextCellPos, &centered, &lineW, maxW, maxH, RenderFlags {}, y, &leftObjects, &rightObjects, &changeLine, false, 0, 0);
-      surface.font = font; 
+      surface.font = font;
 
       //surface.TextFont(font);
 
@@ -1170,7 +1170,7 @@ static bool PickRow(HTMLView browser, Surface surface, Block row, Block table, i
          {
             column.rowSpan = cell.rowSpan;
             x += column.w;
-            column = column.next;  
+            column = column.next;
          }
       }
       c++;
@@ -1214,7 +1214,7 @@ bool PickTable(HTMLView browser, Surface surface, int x, int y, int w, int h, in
          row = NextBlockUp(surface, row, null, 0);
       }
       else
-         row = NextBlock(surface, row, null, 0);   
+         row = NextBlock(surface, row, null, 0);
    }
    return result;
 }
@@ -1362,7 +1362,7 @@ static void PositionRow(HTMLView browser, Surface surface, Block row, Block tabl
          {
             column.rowSpan = cell.rowSpan;
             x += column.w;
-            column = column.next;  
+            column = column.next;
          }
       }
       c++;
index ccd5868..497a09e 100644 (file)
@@ -281,6 +281,6 @@ void MD5Digest(char * string, int len, char * output)
    for(c = 0; c<16; c++)
    {
       sprintf(output + len, "%02x", bytes[c]);
-      len += 2;      
+      len += 2;
    }
 }
index 2bf342c..211456f 100644 (file)
@@ -2,7 +2,7 @@ import "ecere"
 /*
        Copyright (c) 2009  Gabriel A. Petursson
        All rights reserved.
-       
+
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions
        are met:
@@ -13,7 +13,7 @@ import "ecere"
           documentation and/or other materials provided with the distribution.
        3. The name of the author may not be used to endorse or promote products
           derived from this software without specific prior written permission.
-       
+
        THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
        IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
        OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -75,7 +75,7 @@ struct AmpheckSHA256
 {
        uint32 h[8];
        byte buffer[64];
-       
+
        uint64 length;
 
    void Init()
@@ -97,7 +97,7 @@ struct AmpheckSHA256
        {
                uint32 wv[8];
                uint32 w[16];
-               
+
                PACK_32(&data[(i << 6)     ], &w[ 0]);
                PACK_32(&data[(i << 6) +  4], &w[ 1]);
                PACK_32(&data[(i << 6) +  8], &w[ 2]);
@@ -114,7 +114,7 @@ struct AmpheckSHA256
                PACK_32(&data[(i << 6) + 52], &w[13]);
                PACK_32(&data[(i << 6) + 56], &w[14]);
                PACK_32(&data[(i << 6) + 60], &w[15]);
-               
+
                wv[0] = h[0];
                wv[1] = h[1];
                wv[2] = h[2];
@@ -123,7 +123,7 @@ struct AmpheckSHA256
                wv[5] = h[5];
                wv[6] = h[6];
                wv[7] = h[7];
-               
+
                SHA256_PRC(0, 1, 2, 3, 4, 5, 6, 7, w[ 0], 0x428a2f98);
                SHA256_PRC(7, 0, 1, 2, 3, 4, 5, 6, w[ 1], 0x71374491);
                SHA256_PRC(6, 7, 0, 1, 2, 3, 4, 5, w[ 2], 0xb5c0fbcf);
@@ -140,7 +140,7 @@ struct AmpheckSHA256
                SHA256_PRC(3, 4, 5, 6, 7, 0, 1, 2, w[13], 0x80deb1fe);
                SHA256_PRC(2, 3, 4, 5, 6, 7, 0, 1, w[14], 0x9bdc06a7);
                SHA256_PRC(1, 2, 3, 4, 5, 6, 7, 0, w[15], 0xc19bf174);
-               
+
                SHA256_PRC(0, 1, 2, 3, 4, 5, 6, 7, SHA256_EXT( 0), 0xe49b69c1);
                SHA256_PRC(7, 0, 1, 2, 3, 4, 5, 6, SHA256_EXT( 1), 0xefbe4786);
                SHA256_PRC(6, 7, 0, 1, 2, 3, 4, 5, SHA256_EXT( 2), 0x0fc19dc6);
@@ -189,7 +189,7 @@ struct AmpheckSHA256
                SHA256_PRC(3, 4, 5, 6, 7, 0, 1, 2, SHA256_EXT(13), 0xa4506ceb);
                SHA256_PRC(2, 3, 4, 5, 6, 7, 0, 1, SHA256_EXT(14), 0xbef9a3f7);
                SHA256_PRC(1, 2, 3, 4, 5, 6, 7, 0, SHA256_EXT(15), 0xc67178f2);
-               
+
                h[0] += wv[0];
                h[1] += wv[1];
                h[2] += wv[2];
@@ -206,7 +206,7 @@ struct AmpheckSHA256
        if (size >= 64 - length % 64)
        {
                memcpy(&buffer[length % 64], data, (uint32)(64 - length % 64));
-               
+
                TransformData(buffer, 1);
                //TransformData(&data[64 - length % 64], size / 64);
          TransformData(&data[64 - length % 64], (size - (64 - length % 64)) / 64);
@@ -215,14 +215,14 @@ struct AmpheckSHA256
        {
                memcpy(&buffer[length % 64], data, size);
        }
-       
+
        length += size;
    }
 
    void Finish(byte *digest)
    {
        AmpheckSHA256 tmp { };
-       
+
        tmp.h[0] = h[0];
        tmp.h[1] = h[1];
        tmp.h[2] = h[2];
@@ -231,10 +231,10 @@ struct AmpheckSHA256
        tmp.h[5] = h[5];
        tmp.h[6] = h[6];
        tmp.h[7] = h[7];
-       
+
        memcpy(tmp.buffer, buffer, (uint32)(length % 64));
        tmp.buffer[length % 64] = 0x80;
-       
+
        if (length % 64 < 56)
        {
                memset(&tmp.buffer[length % 64 + 1], 0x00, (uint32)(55 - length % 64));
@@ -243,13 +243,13 @@ struct AmpheckSHA256
        {
                memset(&tmp.buffer[length % 64 + 1], 0x00, (uint32)(63 - length % 64));
                tmp.TransformData(tmp.buffer, 1);
-               
+
                memset(tmp.buffer, 0x00, 56);
        }
-       
+
        UNPACK_64(length % 64 * 8, &tmp.buffer[56]);
        tmp.TransformData(tmp.buffer, 1);
-       
+
        UNPACK_32(tmp.h[0], &digest[ 0]);
        UNPACK_32(tmp.h[1], &digest[ 4]);
        UNPACK_32(tmp.h[2], &digest[ 8]);
index 84211b9..9b66d19 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 1997-2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    astar.ec - A* Path Finding Algorithm
 ****************************************************************************/
 import "ecere"
@@ -94,7 +94,7 @@ static void AStarPropagateDown(AStar * aStar, ASNode *old)
          if(aStar->stackIndex>=aStar->stackSize)
             break;
          aStar->stack[aStar->stackIndex++] = child;
-      } 
+      }
    }
 
    while(aStar->stackIndex > 0)
@@ -173,7 +173,7 @@ static void AStarGenerateSucc(AStar * aStar, ASNode *bestNode, int positionX, in
          old->parent=bestNode;
          old->g=g;
          old->f=g+old->h;
-         AStarPropagateDown(aStar, old); 
+         AStarPropagateDown(aStar, old);
       }
    }
    else
@@ -187,7 +187,7 @@ static void AStarGenerateSucc(AStar * aStar, ASNode *bestNode, int positionX, in
       successor->position.x=positionX;
       successor->position.y=positionY;
       successor->nodeNum=tileNumS;
-      AStarInsert(aStar, successor);     
+      AStarInsert(aStar, successor);
       for(c=0;c<8;c++)
          if(!bestNode->child[c]) break;
       bestNode->child[c]=successor;
index 3103f93..dab6df2 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 1997-2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    sequence.c - Sprite Sequence System
 ****************************************************************************/
 import "ecere"
@@ -64,9 +64,9 @@ Sequence * SequenceInit(uint16 numEvents)
 bool SequenceLoadTable(Sequence **sequences, int count, char *fileName)
 {
    bool result = false;
-   File f = FileOpen(fileName, read);   
+   File f = FileOpen(fileName, read);
    FillBytes(sequences, 0, sizeof(Sequence *) * count);
-   if(f) 
+   if(f)
    {
       int c;
       result = true;
index bd3f3e3..2842ebb 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 1997-2005 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    sprite.ec - Bitmap Sprite System
 ****************************************************************************/
 import "ecere"
@@ -126,7 +126,7 @@ class Sprite
          dx = x+frame->xDis;
          dy = y+frame->yDis;
       }
+
       if(inPal)
          frame->bitmap.paletteShades = inPal;
 
index ffbbfce..f5d804a 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 1997-2005 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    tiles.ec - Main Module
 ****************************************************************************/
 import "astar.ec"
@@ -29,7 +29,7 @@ struct TileMap
    uint16 * regions;
    uint16 * contents;
    uint16 * frames;
-   
+
    // Dimension Stuff
    int numLayers;
    Point maxDim;
@@ -42,7 +42,7 @@ struct TileMap
 
    // What's this for??
    Direction direction;
-   uint16 displaced; 
+   uint16 displaced;
    byte retries;
    Point path[256];
    bool chase;
@@ -82,7 +82,7 @@ struct TileUnit
    int pathPos;
 
    Direction direction;
-   uint16 displaced; 
+   uint16 displaced;
    byte retries;
    Point path[MAXPATH];
    bool chase;
@@ -315,7 +315,7 @@ void MapRedraw(TileMap * map, Surface surface, int vx, int vy, int vw, int vh)
 Point UnitExact(TileMap * map, TileUnit * unit)
 {
    Point exact;
-   
+
    exact.x = unit->pos.x*map->tileW*map->maxDim.x/map->dim[unit->space].x;
    exact.y = unit->pos.y*map->tileH*map->maxDim.y/map->dim[unit->space].y;
    MapForward(unit->direction,&exact,unit->displaced);
@@ -626,7 +626,7 @@ bool UnitSurround(TileMap * map,TileUnit *unit,TileUnit * target)
 
       if(!target||(target==unit))
          return false;
+
       unit->chase=1;
       unit->target=target;
       UnitRemove(map, unit);
@@ -720,7 +720,7 @@ void UnitDisplay(TileMap * map, Surface surface, TileUnit * unit, int viewX, int
       surface.SetForeground(white);
 
       exact = Point{exact.x-viewX*map->tileW, exact.y-viewY*map->tileH};
-   
+
       if(!unit->space)
       {
          unit->sprite.DisplayFrame(surface,unit->seqPos,exact.x,exact.y,true,unit->filter);
@@ -743,7 +743,7 @@ void UnitDisplay(TileMap * map, Surface surface, TileUnit * unit, int viewX, int
          {
             frame += unit->direction;
             unit->sprite.DisplayFrame(surface,frame,exact.x,exact.y,false,unit->filter);
-         }         
+         }
       }
    }
 }
@@ -843,7 +843,7 @@ void UnitEnter(TileMap * map, TileUnit *unit)
 
       unit->event = Moving;
 
-      if(unit->tick<seq->frames[unit->event][unit->seqPos].wait) 
+      if(unit->tick<seq->frames[unit->event][unit->seqPos].wait)
          return;
 
       unit->displaced+=seq->frames[unit->event][unit->seqPos].walk;
index 91cdd93..3a62a85 100644 (file)
@@ -32,4 +32,3 @@ public:
       }
    }
 }
-
index a06d410..a2c5dc2 100644 (file)
@@ -9,252 +9,252 @@ extern int __ecereVMethodID_class_OnGetString;
 static String countryNames[CountryCode] =
 {
    "(none)",
-   "Andorra", // 1974  
-   "United Arab Emirates", // 1974     
-   "Afghanistan", // 1974      
-   "Antigua and Barbuda", // 1974      
+   "Andorra", // 1974
+   "United Arab Emirates", // 1974
+   "Afghanistan", // 1974
+   "Antigua and Barbuda", // 1974
    "Anguilla", // 1983 AI previously represented French Afar and Issas
-   "Albania", // 1974  
-   "Armenia", // 1992  
-   "Netherlands Antilles", // 1974     
-   "Angola", // 1974   
+   "Albania", // 1974
+   "Armenia", // 1992
+   "Netherlands Antilles", // 1974
+   "Angola", // 1974
    "Antarctica", // 1974       Covers the territories south of 60° south latitude
-   "Argentina", // 1974        
-   "American Samoa", // 1974   
-   "Austria", // 1974  
+   "Argentina", // 1974
+   "American Samoa", // 1974
+   "Austria", // 1974
    "Australia", // 1974        Includes the Ashmore and Cartier Islands and the Coral Sea Islands
-   "Aruba", // 1986    
-   "Åland Islands", //        2004    
-   "Azerbaijan", // 1992       
-   "Bosnia and Herzegovina", // 1992   
-   "Barbados", // 1974 
-   "Bangladesh", // 1974       
-   "Belgium", // 1974  
+   "Aruba", // 1986
+   "Åland Islands", //        2004
+   "Azerbaijan", // 1992
+   "Bosnia and Herzegovina", // 1992
+   "Barbados", // 1974
+   "Bangladesh", // 1974
+   "Belgium", // 1974
    "Burkina Faso", // 1984     Name changed from Upper Volta (HV)
-   "Bulgaria", // 1974 
-   "Bahrain", // 1974  
-   "Burundi", // 1974  
+   "Bulgaria", // 1974
+   "Bahrain", // 1974
+   "Burundi", // 1974
    "Benin", // 1977    Name changed from Dahomey (DY)
-   "Saint Barthélemy", //     2007    
-   "Bermuda", // 1974  
-   "Brunei Darussalam", // 1974        
+   "Saint Barthélemy", //     2007
+   "Bermuda", // 1974
+   "Brunei Darussalam", // 1974
    "Bolivia, Plurinational State of", // 1974  Previous country name used by ISO: Bolivia
-   "Brazil", // 1974   
-   "Bahamas", // 1974  
-   "Bhutan", // 1974   
-   "Bouvet Island", // 1974    
-   "Botswana", // 1974 
+   "Brazil", // 1974
+   "Bahamas", // 1974
+   "Bhutan", // 1974
+   "Bouvet Island", // 1974
+   "Botswana", // 1974
    "Belarus", // 1974  Code taken from previous country name used by ISO: Byelorussian SSR
-   "Belize", // 1974   
-   "Canada", // 1974   
-   "Cocos (Keeling) Islands", // 1974  
+   "Belize", // 1974
+   "Canada", // 1974
+   "Cocos (Keeling) Islands", // 1974
    "Congo, the Democratic Republic of the", // 1997    Name changed from Zaire (ZR)
-   "Central African Republic", // 1974 
+   "Central African Republic", // 1974
    "Congo", // 1974    i.e., Congo, the Republic of the
    "Switzerland", // 1974      Code taken from name in Latin: Confoederatio Helvetica
    "Côte d'Ivoire", // 1974   i.e., Ivory Coast
-   "Cook Islands", // 1974     
-   "Chile", // 1974    
-   "Cameroon", // 1974 
-   "China", // 1974    
-   "Colombia", // 1974 
-   "Costa Rica", // 1974       
-   "Cuba", // 1974     
-   "Cape Verde", // 1974       
-   "Christmas Island", // 1974 
-   "Cyprus", // 1974   
-   "Czech Republic", // 1993   
+   "Cook Islands", // 1974
+   "Chile", // 1974
+   "Cameroon", // 1974
+   "China", // 1974
+   "Colombia", // 1974
+   "Costa Rica", // 1974
+   "Cuba", // 1974
+   "Cape Verde", // 1974
+   "Christmas Island", // 1974
+   "Cyprus", // 1974
+   "Czech Republic", // 1993
    "Germany", // 1974  Code taken from name in German: Deutschland, Code used for West Germany before , // 1990 (previous country name used by ISO: Germany, Federal Republic of)
    "Djibouti", // 1977 Name changed from French Afar and Issas (AI)
-   "Denmark", // 1974  
-   "Dominica", // 1974 
-   "Dominican Republic", // 1974       
+   "Denmark", // 1974
+   "Dominica", // 1974
+   "Dominican Republic", // 1974
    "Algeria", // 1974  Code taken from name in Kabyle: Dzayer
-   "Ecuador", // 1974  
+   "Ecuador", // 1974
    "Estonia", // 1992  Code taken from name in Estonian: Eesti
-   "Egypt", // 1974    
+   "Egypt", // 1974
    "Western Sahara", // 1974   Disputed territory Previous country name used by ISO: Spanish Sahara (code taken from name in Spanish: Sahara español)
-   "Eritrea", // 1993  
+   "Eritrea", // 1993
    "Spain", // 1974    Code taken from name in Spanish: España
-   "Ethiopia", // 1974 
-   "Finland", // 1974  
-   "Fiji", // 1974     
-   "Falkland Islands (Malvinas)", // 1974      
+   "Ethiopia", // 1974
+   "Finland", // 1974
+   "Fiji", // 1974
+   "Falkland Islands (Malvinas)", // 1974
    "Micronesia, Federated States of", // 1986  Previous country name used by ISO: Micronesia
-   "Faroe Islands", // 1974    
+   "Faroe Islands", // 1974
    "France", // 1974   Includes Clipperton Island
-   "Gabon", // 1974    
+   "Gabon", // 1974
    "United Kingdom", // 1974   Code taken from official name: United Kingdom of Great Britain and Northern Ireland
-   "Grenada", // 1974  
+   "Grenada", // 1974
    "Georgia", // 1992  GE previously represented Gilbert and Ellice Islands
    "French Guiana", // 1974    Code taken from name in French: Guyane française
-   "Guernsey", //      2006    
-   "Ghana", // 1974    
-   "Gibraltar", // 1974        
-   "Greenland", // 1974        
-   "Gambia", // 1974   
-   "Guinea", // 1974   
-   "Guadeloupe", // 1974       
+   "Guernsey", //      2006
+   "Ghana", // 1974
+   "Gibraltar", // 1974
+   "Greenland", // 1974
+   "Gambia", // 1974
+   "Guinea", // 1974
+   "Guadeloupe", // 1974
    "Equatorial Guinea", // 1974        Code taken from name in French: Guinée équatoriale
-   "Greece", // 1974   
-   "South Georgia and the South Sandwich Islands", // 1993     
-   "Guatemala", // 1974        
-   "Guam", // 1974     
-   "Guinea-Bissau", // 1974    
-   "Guyana", // 1974   
-   "Hong Kong", // 1974        
-   "Heard Island and McDonald Islands", // 1974        
-   "Honduras", // 1974 
+   "Greece", // 1974
+   "South Georgia and the South Sandwich Islands", // 1993
+   "Guatemala", // 1974
+   "Guam", // 1974
+   "Guinea-Bissau", // 1974
+   "Guyana", // 1974
+   "Hong Kong", // 1974
+   "Heard Island and McDonald Islands", // 1974
+   "Honduras", // 1974
    "Croatia", // 1992  Code taken from name in Croatian: Hrvatska
-   "Haiti", // 1974    
-   "Hungary", // 1974  
-   "Indonesia", // 1974        
-   "Ireland", // 1974  
-   "Israel", // 1974   
-   "Isle of Man", //   2006    
-   "India", // 1974    
-   "British Indian Ocean Territory", // 1974   
-   "Iraq", // 1974     
-   "Iran, Islamic Republic of", // 1974        
+   "Haiti", // 1974
+   "Hungary", // 1974
+   "Indonesia", // 1974
+   "Ireland", // 1974
+   "Israel", // 1974
+   "Isle of Man", //   2006
+   "India", // 1974
+   "British Indian Ocean Territory", // 1974
+   "Iraq", // 1974
+   "Iran, Islamic Republic of", // 1974
    "Iceland", // 1974  Code taken from name in Icelandic: Ísland
-   "Italy", // 1974    
-   "Jersey", //        2006    
-   "Jamaica", // 1974  
-   "Jordan", // 1974   
-   "Japan", // 1974    
-   "Kenya", // 1974    
-   "Kyrgyzstan", // 1992       
+   "Italy", // 1974
+   "Jersey", //        2006
+   "Jamaica", // 1974
+   "Jordan", // 1974
+   "Japan", // 1974
+   "Kenya", // 1974
+   "Kyrgyzstan", // 1992
    "Cambodia", // 1974 Code taken from former name: Khmer Republic, Previous country name used by ISO: Kampuchea
-   "Kiribati", // 1979 
+   "Kiribati", // 1979
    "Comoros", // 1974  Code taken from name in Comorian: Komori
    "Saint Kitts and Nevis", // 1974    Previous country name used by ISO: Saint Kitts-Nevis-Anguilla
    "Korea, Democratic People's Republic of", // 1974   i.e., North Korea
    "Korea, Republic of", // 1974       i.e., South Korea
-   "Kuwait", // 1974   
-   "Cayman Islands", // 1974   
+   "Kuwait", // 1974
+   "Cayman Islands", // 1974
    "Kazakhstan", // 1992       Previous country name used by ISO: Kazakstan
-   "Lao People's Democratic Republic", // 1974 
-   "Lebanon", // 1974  
-   "Saint Lucia", // 1974      
-   "Liechtenstein", // 1974    
-   "Sri Lanka", // 1974        
-   "Liberia", // 1974  
-   "Lesotho", // 1974  
-   "Lithuania", // 1992        
-   "Luxembourg", // 1974       
-   "Latvia", // 1992   
-   "Libyan Arab Jamahiriya", // 1974   
+   "Lao People's Democratic Republic", // 1974
+   "Lebanon", // 1974
+   "Saint Lucia", // 1974
+   "Liechtenstein", // 1974
+   "Sri Lanka", // 1974
+   "Liberia", // 1974
+   "Lesotho", // 1974
+   "Lithuania", // 1992
+   "Luxembourg", // 1974
+   "Latvia", // 1992
+   "Libyan Arab Jamahiriya", // 1974
    "Morocco", // 1974  Code taken from name in French: Maroc
-   "Monaco", // 1974   
+   "Monaco", // 1974
    "Moldova, Republic of", // 1992     Previous country name used by ISO: Moldova
-   "Montenegro",  // 2006      
-   "Saint Martin (French part)",       //2007  
-   "Madagascar", // 1974       
-   "Marshall Islands", // 1986 
+   "Montenegro",  // 2006
+   "Saint Martin (French part)",       //2007
+   "Madagascar", // 1974
+   "Marshall Islands", // 1986
    "Macedonia, the former Yugoslav Republic of", // 1993       Designated as such due to the Macedonia naming dispute, Code taken from name in Macedonian: Makedonija
-   "Mali", // 1974     
+   "Mali", // 1974
    "Myanmar", // 1989  Name changed from Burma (BU)
-   "Mongolia", // 1974 
+   "Mongolia", // 1974
    "Macao", // 1974    Previous country name used by ISO: Macau
-   "Northern Mariana Islands", // 1986 
-   "Martinique", // 1974       
-   "Mauritania", // 1974       
-   "Montserrat", // 1974       
-   "Malta", // 1974    
-   "Mauritius", // 1974        
-   "Maldives", // 1974 
-   "Malawi", // 1974   
-   "Mexico", // 1974   
-   "Malaysia", // 1974 
-   "Mozambique", // 1974       
-   "Namibia", // 1974  
-   "New Caledonia", // 1974    
-   "Niger", // 1974    
-   "Norfolk Island", // 1974   
-   "Nigeria", // 1974  
-   "Nicaragua", // 1974        
-   "Netherlands", // 1974      
-   "Norway", // 1974   
-   "Nepal", // 1974    
-   "Nauru", // 1974    
-   "Niue", // 1974     
-   "New Zealand", // 1974      
-   "Oman", // 1974     
-   "Panama", // 1974   
-   "Peru", // 1974     
+   "Northern Mariana Islands", // 1986
+   "Martinique", // 1974
+   "Mauritania", // 1974
+   "Montserrat", // 1974
+   "Malta", // 1974
+   "Mauritius", // 1974
+   "Maldives", // 1974
+   "Malawi", // 1974
+   "Mexico", // 1974
+   "Malaysia", // 1974
+   "Mozambique", // 1974
+   "Namibia", // 1974
+   "New Caledonia", // 1974
+   "Niger", // 1974
+   "Norfolk Island", // 1974
+   "Nigeria", // 1974
+   "Nicaragua", // 1974
+   "Netherlands", // 1974
+   "Norway", // 1974
+   "Nepal", // 1974
+   "Nauru", // 1974
+   "Niue", // 1974
+   "New Zealand", // 1974
+   "Oman", // 1974
+   "Panama", // 1974
+   "Peru", // 1974
    "French Polynesia", // 1974 Code taken from name in French: Polynésie française
-   "Papua New Guinea", // 1974 
-   "Philippines", // 1974      
-   "Pakistan", // 1974 
-   "Poland", // 1974   
-   "Saint Pierre and Miquelon", // 1974        
-   "Pitcairn", // 1974 
-   "Puerto Rico", // 1974      
+   "Papua New Guinea", // 1974
+   "Philippines", // 1974
+   "Pakistan", // 1974
+   "Poland", // 1974
+   "Saint Pierre and Miquelon", // 1974
+   "Pitcairn", // 1974
+   "Puerto Rico", // 1974
    "Palestinian Territory, Occupied", // 1999  Consists of the West Bank and the Gaza Strip
-   "Portugal", // 1974 
-   "Palau", // 1986    
-   "Paraguay", // 1974 
-   "Qatar", // 1974    
-   "Réunion", // 1974 
-   "Romania", // 1974  
+   "Portugal", // 1974
+   "Palau", // 1986
+   "Paraguay", // 1974
+   "Qatar", // 1974
+   "Réunion", // 1974
+   "Romania", // 1974
    "Serbia", //        2006    Code taken from official name: Republic of Serbia (see Serbian country codes)
-   "Russian Federation", // 1992       
-   "Rwanda", // 1974   
-   "Saudi Arabia", // 1974     
+   "Russian Federation", // 1992
+   "Rwanda", // 1974
+   "Saudi Arabia", // 1974
    "Solomon Islands", // 1974  Code taken from former name: British Solomon Islands
-   "Seychelles", // 1974       
-   "Sudan", // 1974    
-   "Sweden", // 1974   
-   "Singapore", // 1974        
+   "Seychelles", // 1974
+   "Sudan", // 1974
+   "Sweden", // 1974
+   "Singapore", // 1974
    "Saint Helena, Ascension and Tristan da Cunha", // 1974     Previous country name used by ISO: Saint Helena
-   "Slovenia", // 1992 
+   "Slovenia", // 1992
    "Svalbard and Jan Mayen", // 1974   Consists of Svalbard and Jan Mayen
    "Slovakia", // 1993 SK previously represented Sikkim
-   "Sierra Leone", // 1974     
-   "San Marino", // 1974       
-   "Senegal", // 1974  
-   "Somalia", // 1974  
-   "Suriname", // 1974 
-   "Sao Tome and Principe", // 1974    
-   "El Salvador", // 1974      
-   "Syrian Arab Republic", // 1974     
-   "Swaziland", // 1974        
-   "Turks and Caicos Islands", // 1974 
+   "Sierra Leone", // 1974
+   "San Marino", // 1974
+   "Senegal", // 1974
+   "Somalia", // 1974
+   "Suriname", // 1974
+   "Sao Tome and Principe", // 1974
+   "El Salvador", // 1974
+   "Syrian Arab Republic", // 1974
+   "Swaziland", // 1974
+   "Turks and Caicos Islands", // 1974
    "Chad", // 1974     Code taken from name in French: Tchad
    "French Southern Territories", // 1979      Covers the territory of the French Southern and Antarctic Lands except Adélie Land, Code taken from name in French: Terres australes françaises
-   "Togo", // 1974     
-   "Thailand", // 1974 
-   "Tajikistan", // 1992       
-   "Tokelau", // 1974  
+   "Togo", // 1974
+   "Thailand", // 1974
+   "Tajikistan", // 1992
+   "Tokelau", // 1974
    "Timor-Leste", //   2002    Name changed from East Timor (TP)
-   "Turkmenistan", // 1992     
-   "Tunisia", // 1974  
-   "Tonga", // 1974    
-   "Turkey", // 1974   
-   "Trinidad and Tobago", // 1974      
-   "Tuvalu", // 1979   
+   "Turkmenistan", // 1992
+   "Tunisia", // 1974
+   "Tonga", // 1974
+   "Turkey", // 1974
+   "Trinidad and Tobago", // 1974
+   "Tuvalu", // 1979
    "Taiwan, Province of China", // 1974        Covers the current jurisdiction of the Republic of China except Kinmen and Lienchiang, Designated as such due to its political status within the United Nations
-   "Tanzania, United Republic of", // 1974     
+   "Tanzania, United Republic of", // 1974
    "Ukraine", // 1974  Previous country name used by ISO: Ukrainian SSR
-   "Uganda", // 1974   
+   "Uganda", // 1974
    // "United Kingdom",
    "United States Minor Outlying Islands", // 1986     Consists of Baker Island, Howland Island, Jarvis Island, Johnston Atoll, Kingman Reef, Midway Islands, Navassa Island, Palmyra Atoll, and Wake Island
-   "United States", // 1974    
-   "Uruguay", // 1974  
-   "Uzbekistan", // 1992       
+   "United States", // 1974
+   "Uruguay", // 1974
+   "Uzbekistan", // 1992
    "Holy See (Vatican City State)", // 1974    Territory of the Holy See Previous country name used by ISO: Vatican City State (Holy See)
-   "Saint Vincent and the Grenadines", // 1974 
+   "Saint Vincent and the Grenadines", // 1974
    "Venezuela, Bolivarian Republic of", // 1974        Previous country name used by ISO: Venezuela
-   "Virgin Islands, British", // 1974  
-   "Virgin Islands, U.S.", // 1974     
-   "Viet Nam", // 1974 
+   "Virgin Islands, British", // 1974
+   "Virgin Islands, U.S.", // 1974
+   "Viet Nam", // 1974
    "Vanuatu", // 1980  Name changed from New Hebrides (NH)
-   "Wallis and Futuna", // 1974        
+   "Wallis and Futuna", // 1974
    "Samoa", // 1974    Code taken from former name: Western Samoa
    "Yemen", // 1974    Previous country name used by ISO: Yemen, Republic of, Code used for North Yemen before 1990
-   "Mayotte", // 1993  
+   "Mayotte", // 1993
    "South Africa", // 1974     Code taken from name in Dutch: Zuid-Afrika
-   "Zambia", // 1974   
+   "Zambia", // 1974
    "Zimbabwe" // 1980  Name changed from Southern Rhodesia (RH)
 };
 
@@ -275,7 +275,7 @@ public class FlagCollection
          sprintf(fn, ":types/countryCode/%s.png", s);
          flags[c] = { fn };
          incref flags[c];
-      }      
+      }
    }
    ~FlagCollection() { flags.Free(); }
 }
@@ -348,7 +348,7 @@ public:
    }
 };
 
-static String subdivisionCategoryNames[SubdivisionCategory] = 
+static String subdivisionCategoryNames[SubdivisionCategory] =
 {
    "(none)",
    "Administration", "Metropolitan Administration",
index af81426..f505799 100644 (file)
@@ -79,7 +79,7 @@ public class Currency : double
             number[len++] = ch;
             if(numDecimals == 2)
                break;
-         }         
+         }
       }
       number[len] = 0;
       return ((bool (*)(void *, void *, const char *))(void *)class(double)._vTbl[__ecereVMethodID_class_OnGetDataFromString])(class(double), &this, number);
index d4df737..2e956a6 100644 (file)
@@ -97,7 +97,7 @@ class WiaDataCallback : MSCOM_IUnknown
       return MSCOM_IUnknown::QueryInterface(iid, ppvObj);
    }
 
-   virtual uint stdcall BandedDataCallback(uint lReason, uint lStatus, uint lPercentComplete, uint lOffset, uint lLength, 
+   virtual uint stdcall BandedDataCallback(uint lReason, uint lStatus, uint lPercentComplete, uint lOffset, uint lLength,
       uint lReserved, uint lResLength, byte * pbBuffer);
 };
 
@@ -114,7 +114,7 @@ class WiaDataTransfer
 class WiaPropertyStorage
 {
    IWiaPropertyStorage *pWiaPropertyStorage;
-   
+
    bool ReadLong(const PROPSPEC *pPropSpec, uint *plResult)
    {
       bool result = true;
@@ -166,7 +166,7 @@ class WiaPropertyStorage
 }
 
 class ScanningProgress : Window
-{  
+{
    autoCreate = false;
    text = "Scanning in progress. Please wait.";
    borderStyle = fixed;
@@ -182,7 +182,7 @@ class MyWiaDataCallback : WiaDataCallback
 {
    TempFile f { };
 
-   uint stdcall BandedDataCallback(uint lReason, uint lStatus, uint lPercentComplete, uint lOffset, uint lLength, 
+   uint stdcall BandedDataCallback(uint lReason, uint lStatus, uint lPercentComplete, uint lOffset, uint lLength,
       uint lReserved, uint lResLength, byte * pbBuffer)
    {
       switch(lReason)
@@ -296,7 +296,7 @@ public:
             {
                PROPSPEC specPages;
                PROPVARIANT varPages;
-                    
+
                specPages.ulKind = PRSPEC_PROPID;
                specPages.propid = WIA_DPS_PAGES;
 
@@ -304,12 +304,12 @@ public:
                varPages.lVal = ALL_PAGES;
 
                scannerProp.WriteMultiple(1, &specPages, &varPages, WIA_DPS_FIRST);
-                
+
                PropVariantClear(&varPages);
             }
          }
          delete scannerProp;
-         
+
          nextPage = true;
          while(nextPage)
          {
index a17db50..3a1ae2e 100644 (file)
@@ -16,7 +16,7 @@ define defaultCompilerName = "Default";
 
 define defaultObjDirExpression = "obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)";
 
-char * settingsDirectoryNames[DirTypes] = 
+char * settingsDirectoryNames[DirTypes] =
 {
    "Include Files",
    "Library Files",
@@ -84,7 +84,7 @@ char * CopyValidateMakefilePath(char * path)
          char * tmp = copy;
          char * start = tmp;
          Array<char *> parts { };
-         
+
          for(c=0; c<len; c++)
          {
             if(tmp[c] == '$')
@@ -230,7 +230,7 @@ private:
          PathCat(defaultConfigFilePath, "App");
          PathCat(defaultConfigFilePath, "DefaultData");
          PathCat(defaultConfigFilePath, "ecereIDE.ini");
-         
+
          if(FileExists(defaultConfigFilePath))
          {
             if(!FileExists(configFilePath))
@@ -242,9 +242,9 @@ private:
             }
             PathCat(path, "Data");
             // the forced settings location will only be
-            // used if the running ide's path matches 
+            // used if the running ide's path matches
             // the PortableApps.com directory structure
-            // and the default ini file is found in 
+            // and the default ini file is found in
             // the DefaultData directory
             settingsLocation = path;
             portable = true;
@@ -319,7 +319,7 @@ private:
                delete data.displayDriver; data.displayDriver = CopyString(oldSettings.displayDriver);
                data.projectDefaultTargetDir = oldSettings.projectDefaultTargetDir;
                data.projectDefaultIntermediateObjDir = oldSettings.projectDefaultIntermediateObjDir;
-                        
+
                Save();
                result = success;
             }
@@ -412,7 +412,7 @@ public:
    bool showLineNumbers;
    bool caretFollowsScrolling;
    char * displayDriver;
-   
+
    // TODO: Classify settings
    //EditorSettings editor { };
 
@@ -480,7 +480,7 @@ private:
       recentProjects.Free();
       delete recentProjects;
       delete docDir;
-   
+
       delete projectDefaultTargetDir;
       delete projectDefaultIntermediateObjDir;
       delete compilerConfigsDir;
@@ -718,7 +718,7 @@ public enum CompilerType
    {
       get { return OnGetString(null, null, null); }
       set
-      {  
+      {
          if(value)
          {
             Platform c;
index 406a091..bbf3174 100644 (file)
@@ -19,7 +19,7 @@ define projectOptions = "Project Options";
 define defaultTargetDir = "Default Target Directory";
 define defaultIntermediateObjDir = "Default Intermediate Objects Directory";
 
-define makeDefaultCommand = (GetRuntimePlatform() == win32) ? "mingw32-make" : 
+define makeDefaultCommand = (GetRuntimePlatform() == win32) ? "mingw32-make" :
 #ifdef __FreeBSD__
    "gmake";
 #else
@@ -95,7 +95,7 @@ class OldIDESettings : GlobalAppSettings
       recentFiles.Free();
       recentProjects.Free();
       delete docDir;
-   
+
       delete projectDefaultTargetDir;
       delete projectDefaultIntermediateObjDir;
 
@@ -106,8 +106,8 @@ class OldIDESettings : GlobalAppSettings
 
    void OnAskReloadSettings()
    {
-      /*if(MessageBox { type = YesNo, master = this, 
-            text = "Global Settings Modified Externally", 
+      /*if(MessageBox { type = YesNo, master = this,
+            text = "Global Settings Modified Externally",
             contents = "The global settings were modified by another instance.\n"
             "Would you like to reload them?" }.Modal() == Yes)*/
       {
@@ -122,7 +122,7 @@ class OldIDESettings : GlobalAppSettings
       {
          Array<String> configNames { };
          CompilerConfig compiler;
-      
+
          CompilerConfig defaultCompiler = MakeDefaultCompiler(defaultCompilerName, true);
          compilerConfigs.Free();
          compilerConfigs.Add(defaultCompiler);
@@ -188,7 +188,7 @@ class OldIDESettings : GlobalAppSettings
          GetGlobalValue("Editing", "UseFreeCaret", integer, &useFreeCaret);
          GetGlobalValue("Editing", "CaretFollowsScrolling", integer, &caretFollowsScrolling);
          GetGlobalValue("Editing", "ShowLineNumbers", integer, &showLineNumbers);
-         
+
          GetGlobalValue("Building", "NumParallelJobs", integer, &defaultCompiler.numJobs);
          {
             delete displayDriver;
@@ -243,7 +243,7 @@ class OldIDESettings : GlobalAppSettings
 
          for(compiler : compilerConfigs; compiler != compilerConfigs.firstIterator.data)
             configNames.Add(CopyString(compiler.name));
-         
+
          PutGlobalValue("Compilers", "Configs", stringList, configNames);
 
          for(compiler : compilerConfigs; compiler != compilerConfigs.firstIterator.data)
@@ -275,7 +275,7 @@ class OldIDESettings : GlobalAppSettings
          }
          configNames.Free();
          delete configNames;
-         
+
          CloseAndMonitor();
       }
       return result;
index 223f53f..6461265 100644 (file)
@@ -137,7 +137,7 @@ class ProjectSettings : Window
       char * nodeName = currentNode && currentNode != project.topNode ? currentNode.name : "";
       char * config = buildTab.selectedConfigName;
       char * platform = buildTab.selectedPlatformName;
-      char * label = new char[strlen(dialogTitle) + 3 + strlen(project.topNode.name) + 3 + 
+      char * label = new char[strlen(dialogTitle) + 3 + strlen(project.topNode.name) + 3 +
                               strlen(nodeName) + 2 + strlen(config) + 1 + strlen(platform) + 1 + 1];
       strcpy(label, dialogTitle);
       strcat(label, " - ");
@@ -325,7 +325,7 @@ class OptionBox<class Z> : CommonControl
          return true;
       }
    };
-   
+
    bool Window::OptionBox_OnRightButtonDown(int x, int y, Modifiers mods)
    {
       OptionBox ob = (OptionBox)id;
@@ -362,7 +362,7 @@ class OptionBox<class Z> : CommonControl
                break;
          }
       }
-      
+
       if(!c)
       {
          label = null;
@@ -441,7 +441,7 @@ class OptionBox<class Z> : CommonControl
          buildTab = (BuildTab)buildTab.master;
       if(buildTab) buildTab.modifiedDocument = true;
    }
-   
+
    void Unset()
    {
       char * platformName = platform ? platform.OnGetString(0,0,0) : null;
@@ -571,7 +571,7 @@ class OptionBox<class Z> : CommonControl
                      skipped = true;
                      break;
                   }
-               }               
+               }
 
                if(skipped && c.options && OptionSet(c.options))
                {
@@ -675,7 +675,7 @@ class OptionBox<class Z> : CommonControl
                      }
                      break;
                   }
-               }               
+               }
 
                nodeConfig = c;
                break;
@@ -882,7 +882,7 @@ class MultiStringOptionBox : OptionBox<Array<String>>
                if(!found) tempStrings.Add(s);
             }
          }
-      }         
+      }
       else
       {
          SetStrings(options ? *(Array<String>*)((byte *)options + option) : null);
@@ -1097,7 +1097,7 @@ class BoolOptionBox : OptionBox<SetBool>
    void RetrieveOption(ProjectOptions options, bool isCfgOrPlt)
    {
       bool checked = ((Button)editor).checked;
-      *(SetBool*)((byte *)options + option) = checked ? true : 
+      *(SetBool*)((byte *)options + option) = checked ? true :
          ((currentNode.parent || isCfgOrPlt) ? false : unset);
    }
 
@@ -1156,7 +1156,7 @@ class DropOptionBox : OptionBox
          ((OptionBox)dropBox.id).Retrieve();
          return true;
       }
-   };   
+   };
 
    void LoadOption(ProjectOptions options)
    {
@@ -1261,7 +1261,7 @@ void DrawStipple(Surface surface, Size clientSize)
 
    surface.LineStipple(0x5555);
    surface.Rectangle(x1, y1, x2, y2);
-   surface.LineStipple(0);            
+   surface.LineStipple(0);
 }
 
 class BuildTab : Tab
@@ -1302,7 +1302,7 @@ class BuildTab : Tab
             if(button && button.id)
             {
                Platform platform = (Platform)button.id;
-               char * platformName = platform ? platform.OnGetString(0,0,0) : null; // all these platformName are leaking, no? 
+               char * platformName = platform ? platform.OnGetString(0,0,0) : null; // all these platformName are leaking, no?
                return platformName;
             }
          }
@@ -1340,7 +1340,7 @@ class BuildTab : Tab
          }
          return SelectorBar::OnKeyDown(key, ch);
       }
-      
+
       bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
       {
          ((BuildTab)master).labelConfigurations.Update(null);
@@ -1385,7 +1385,7 @@ class BuildTab : Tab
          config.options.debug = true;
          config.options.optimization = none;
          config.options.warnings = all;
-         */         
+         */
 
          button =
          {
@@ -1455,7 +1455,7 @@ class BuildTab : Tab
          return true;
       }
    };
-   
+
    Label labelPlatforms
    {
       this, anchor = { left = 8, top = 44 }, labeledWindow = platformSelector;
@@ -1593,7 +1593,7 @@ class BuildTab : Tab
       }
 
       project.topNode.RenameConfig(config.name, *newName);
-      
+
       modifiedDocument = true;
       return true;
    }
@@ -1633,7 +1633,7 @@ class BuildTab : Tab
          if(!node) node = project.topNode;
 
          newNodeRes = node.isInResources;
-         
+
          currentNode = node;
          if(!ignoreAsLastSelection)
             lastSelectedNode = node;
@@ -1682,7 +1682,7 @@ class BuildTab : Tab
             compilerTab.labelIncludeDirs.visible = !newNodeRes;
             compilerTab.includeDirs.visible = !newNodeRes;
          }
-         
+
          if(node == project.topNode)
          {
             compilerTab.objDir.visible = true;
@@ -1728,7 +1728,7 @@ class BuildTab : Tab
          checked = true;
          NotifyClicked = ConfigClicked;
       };
-      
+
       config = null;
 
       if(project.topNode.configurations)
@@ -1743,14 +1743,14 @@ class BuildTab : Tab
          }
       }
    }
-   
+
    void Init()
    {
       Platform p;
       SelectorButton button;
 
       activeConfigName = project.config ? CopyString(project.config.name) : null;
-      
+
       compilerTab.AddNode(project.topNode, null);
 
       CreateConfigButtons();
@@ -1767,7 +1767,7 @@ class BuildTab : Tab
       {
          SelectorButton button
          {
-            platformSelector, master = this, text = p.OnGetString(0,0,0), id = (int64)p; 
+            platformSelector, master = this, text = p.OnGetString(0,0,0), id = (int64)p;
             NotifyClicked = PlatformClicked;
          };
       }
@@ -1959,7 +1959,7 @@ class CompilerTab : Tab
       }
    };
 
-   Window rightPane 
+   Window rightPane
    {
       this, anchor = { left = 196, top = 0, right = 0, bottom = 0 }, background = formColor, tabCycle = true;
    };
@@ -2098,9 +2098,9 @@ class CompilerTab : Tab
 
       row.SetData(null, node);
 
-      if(node.files && node.files.first && node.parent && 
-            !(!node.parent.parent && 
-               (!strcmpi(node.name, "notes") || !strcmpi(node.name, "sources") || 
+      if(node.files && node.files.first && node.parent &&
+            !(!node.parent.parent &&
+               (!strcmpi(node.name, "notes") || !strcmpi(node.name, "sources") ||
                   !strcmpi(node.name, "src") || !strcmpi(node.name, "tools"))))
          row.collapsed = true;
       else if(node.type == folder)
@@ -2123,7 +2123,7 @@ class CompilerTab : Tab
       if(activeChild && activeChild.active)
       {
          Window control = activeChild;
-         control.Deactivate();         
+         control.Deactivate();
          control.Activate();
       }
    }
@@ -2146,14 +2146,14 @@ class LinkerTab : Tab
       this, position = { 8, 24 }, size = { 200, 22 };
       text = $"Target Name", hotKey = altN, option = OPTION(targetFileName);
    };
-   
+
    Label labelTargetType { this, position = { 216, 8 }, labeledWindow = targetType };
    TargetTypeDB targetType
    {
       this, position = { 216, 24 }, size = { 120, 22 };
       text = $"Target Type", hotKey = altT, option = OPTION(targetType);
    };
-   
+
    Label labelTargetDirectory { this, position = { 344, 8 }, labeledWindow = targetDirectory };
    PathOptionBox targetDirectory
    {
@@ -2213,7 +2213,7 @@ class LinkerTab : Tab
       if(activeChild && activeChild.active)
       {
          Window control = activeChild;
-         control.Deactivate();         
+         control.Deactivate();
          control.Activate();
       }
    }
@@ -2256,7 +2256,7 @@ class BuilderTab : Tab
       if(activeChild && activeChild.active)
       {
          Window control = activeChild;
-         control.Deactivate();         
+         control.Deactivate();
          control.Activate();
       }
    }
index 7266311..a411ee5 100644 (file)
@@ -41,7 +41,7 @@ class AboutIDE : Window
          return true;
       }
    };
-   Button button 
+   Button button
    {
       this, text = $"OK", isDefault = true, size = { 80, 20 }, anchor = { right = 13, bottom = 10 };
 
@@ -57,7 +57,7 @@ class AboutIDE : Window
       background = { r = 250, g = 252, b = 255 };
       multiLine = true,
       hasVertScroll = true,
-      contents = 
+      contents =
          "Réjean Loyer\n"
          "   Most of the additional programming on the IDE\n"
          "   Initial EDA design\n"
index 58b76b7..16ca2a2 100644 (file)
@@ -349,10 +349,10 @@ static int StringGetInt(char * string, int start)
 static int TokenizeList(char * string, const char seperator, Array<char *> tokens)
 {
    uint level = 0;
-   
+
    bool quoted = false, escaped = false;
    char * start = string, ch;
-   
+
    for(; (ch = *string); string++)
    {
       if(!start)
@@ -523,7 +523,7 @@ class Debugger
 
    char * targetDir;
    char * targetFile;
-   
+
    GdbExecution gdbExecution;
    DebuggerUserAction userAction;
    DebuggerState state;
@@ -535,7 +535,7 @@ class Debugger
    GdbDataStop stopItem;
    GdbDataBreakpoint bpItem;
    Frame activeFrame;
-   
+
    List<Breakpoint> sysBPs { };
    Breakpoint bpRunToCursor;
    Breakpoint intBpEntry;
@@ -841,7 +841,7 @@ class Debugger
 
       targetDir = null;
       targetFile = null;
-      
+
       _ChangeState(none);
       event = none;
       breakType = none;
@@ -849,7 +849,7 @@ class Debugger
       stopItem = null;
       bpItem = null;
       activeFrame = 0;
-      
+
       bpRunToCursor = null;
 
       delete currentCompiler;
@@ -863,7 +863,7 @@ class Debugger
       /*GdbThread gdbThread
       Timer gdbTimer*/
    }
-   
+
    Debugger()
    {
       _dpl2(_dpct, dplchan::debuggerCall, 0, "Debugger::constructor");
@@ -1063,7 +1063,7 @@ class Debugger
    {
       bool returnedExitCode = false;
       char verboseExitCode[128];
-      
+
       _dpl2(_dpct, dplchan::debuggerCall, 0, "Debugger::HandleExit(", reason, ", ", code, ")");
       _ChangeState(loaded); // this state change seems to be superfluous, might be in case of gdb crash
       targetProcessId = 0;
@@ -1075,7 +1075,7 @@ class Debugger
       }
       else
          verboseExitCode[0] = '\0';
-      
+
       event = exit;
 
       // ClearBreakDisplay();
@@ -1122,7 +1122,7 @@ class Debugger
       }
       ide.Update(null);
    }
-      
+
    DebuggerState StartSession(CompilerConfig compiler, ProjectConfig config, int bitDepth, bool useValgrind, bool restart, bool ignoreBreakpoints)
    {
       DebuggerState result = none;
@@ -1323,7 +1323,7 @@ class Debugger
             *lineTopFrame = stopItem.frame.line;
          else
             *lineTopFrame = 0;
-         
+
          if(*lineTopFrame == *lineCursor && *lineTopFrame)
             *lineTopFrame = 0;
       }
@@ -1387,7 +1387,7 @@ class Debugger
             }
          }
       }
-      
+
       // moving code cursors is futile, on next step, stop, hit, cursors will be offset anyways
    }
 
@@ -1405,9 +1405,9 @@ class Debugger
       while(debuggerFileDialog.Modal())
       {
          strcpy(sourceDir, debuggerFileDialog.filePath);
-         if(!fstrcmp(ide.workspace.projectDir, sourceDir) && 
-                  MessageBox { type = yesNo, master = ide, 
-                              contents = $"This is the project directory.\nWould you like to try again?", 
+         if(!fstrcmp(ide.workspace.projectDir, sourceDir) &&
+                  MessageBox { type = yesNo, master = ide,
+                              contents = $"This is the project directory.\nWould you like to try again?",
                               text = $"Invalid Source Directory" }.Modal() == no)
             return false;
          else
@@ -1420,10 +1420,10 @@ class Debugger
                   break;
                }
             }
-            
-            if(srcDir && 
-                  MessageBox { type = yesNo, master = ide, 
-                              contents = $"This source directory is already specified.\nWould you like to try again?", 
+
+            if(srcDir &&
+                  MessageBox { type = yesNo, master = ide,
+                              contents = $"This source directory is already specified.\nWould you like to try again?",
                               text = $"Invalid Source Directory" }.Modal() == no)
                return false;
             else
@@ -1434,15 +1434,15 @@ class Debugger
                   strcpy(file, sourceDir);
                   PathCat(file, test);
                   result = FileExists(file);
-                  if(!result && 
-                        MessageBox { type = yesNo, master = ide, 
-                                    contents = $"Unable to locate source file.\nWould you like to try again?", 
+                  if(!result &&
+                        MessageBox { type = yesNo, master = ide,
+                                    contents = $"Unable to locate source file.\nWould you like to try again?",
                                     text = $"Invalid Source Directory" }.Modal() == no)
                         return false;
                }
                else
                   result = true;
-               
+
                if(result)
                   return true;
             }
@@ -1456,7 +1456,7 @@ class Debugger
       _dpl2(_dpct, dplchan::debuggerCall, 0, "Debugger::AddSourceDir(", sourceDir, ")");
       ide.workspace.sourceDirs.Add(CopyString(sourceDir));
       ide.workspace.Save();
-      
+
       if(targeted)
       {
          DebuggerState oldState = state;
@@ -1527,7 +1527,7 @@ class Debugger
                }
                if(srcDir)
                   break;
-               
+
                if(SourceDirDialog(title, directory, null, sourceDir))
                {
                   if(IsPathInsideOf(absolutePath, sourceDir))
@@ -1536,8 +1536,8 @@ class Debugger
                      MakePathRelative(absolutePath, sourceDir, relativePath);
                      break;
                   }
-                  else if(MessageBox { type = yesNo, master = ide, 
-                                 contents = $"You must provide a valid source directory in order to place a breakpoint in this file.\nWould you like to try again?", 
+                  else if(MessageBox { type = yesNo, master = ide,
+                                 contents = $"You must provide a valid source directory in order to place a breakpoint in this file.\nWould you like to try again?",
                                  text = $"Invalid Source Directory" }.Modal() == no)
                      return;
                }
@@ -1604,7 +1604,7 @@ class Debugger
       Array<char *> argumentTokens { minAllocSize = 50 };
       DebugListItem item { };
       Argument arg;
-      
+
       //_dpl2(_dpct, dplchan::debuggerCall, 0, "Debugger::ParseFrame()");
       TokenizeList(string, ',', frameTokens);
       for(i = 0; i < frameTokens.count; i++)
@@ -1682,7 +1682,7 @@ class Debugger
          else
             _dpl(0, "Bad frame");
       }
-      
+
       delete frameTokens;
       delete argsTokens;
       delete argumentTokens;
@@ -1808,7 +1808,7 @@ class Debugger
          vsnprintf(string, sizeof(string), format, args);
          string[sizeof(string)-1] = 0;
          va_end(args);
-         
+
          gdbReady = false;
          ide.debugger.serialSemaphore.TryWait();
 
@@ -1832,7 +1832,7 @@ class Debugger
          app.Unlock();
          ide.debugger.serialSemaphore.Wait();
          app.Lock();
-      } 
+      }
    }
 
    bool ValidateBreakpoint(Breakpoint bp)
@@ -2357,7 +2357,7 @@ class Debugger
       }
       else
          ChangeWorkingDir(ide.workspace.projectDir);
-      
+
       ide.SetPath(true, compiler, config, bitDepth);
 
       // TODO: This pollutes the environment, but at least it works
@@ -2586,7 +2586,7 @@ class Debugger
          bp.Reset();
       if(bpRunToCursor)
          bpRunToCursor.Reset();
-      
+
       ide.outputView.debugBox.Logf($"Debugging stopped\n");
       ClearBreakDisplay();
       ide.Update(null);
@@ -2602,7 +2602,7 @@ class Debugger
             progThread.Wait();
             app.Lock();
             delete fifoFile;
-         }         
+         }
          DeleteFile(progFifoPath);
          progFifoPath[0] = '\0';
          rmdir(progFifoDir);
@@ -2644,12 +2644,12 @@ class Debugger
    bool ResolveWatch(Watch wh)
    {
       bool result = false;
-      
+
       _dpl2(_dpct, dplchan::debuggerWatches, 0, "Debugger::ResolveWatch()");
       wh.Reset();
 
       /*delete wh.value;
-      if(wh.type) 
+      if(wh.type)
       {
          FreeType(wh.type);
          wh.type = null;
@@ -2680,9 +2680,9 @@ class Debugger
                SetGlobalContext(codeEditor.globalContext);
                SetGlobalData(&codeEditor.globalData);
             }
-         
+
             exp = ParseExpressionString(wh.expression);
-            
+
             if(exp && !parseError)
             {
                char expString[4096];
@@ -2743,7 +2743,7 @@ class Debugger
                            long v = (long)exp.val.f;
                            sprintf(temp, "%i", v);
                            break;
-                        } 
+                        }
                         case doubleType:
                         {
                            long v = (long)exp.val.d;
@@ -2780,7 +2780,7 @@ class Debugger
                            long v = (long)exp.val.f;
                            sprintf(temp, "0x%x", v);
                            break;
-                        } 
+                        }
                         case doubleType:
                         {
                            long v = (long)exp.val.d;
@@ -2817,7 +2817,7 @@ class Debugger
                            long v = (long)exp.val.f;
                            sprintf(temp, "0o%o", v);
                            break;
-                        } 
+                        }
                         case doubleType:
                         {
                            long v = (long)exp.val.d;
@@ -2892,9 +2892,9 @@ class Debugger
                   case constantExp:
                   case stringExp:
                      // Temporary Code for displaying Strings
-                     if((exp.expType && ((exp.expType.kind == pointerType || 
-                              exp.expType.kind == arrayType) && exp.expType.type.kind == charType)) || 
-                           (wh.type && wh.type.kind == classType && wh.type._class && 
+                     if((exp.expType && ((exp.expType.kind == pointerType ||
+                              exp.expType.kind == arrayType) && exp.expType.type.kind == charType)) ||
+                           (wh.type && wh.type.kind == classType && wh.type._class &&
                               wh.type._class.registered && wh.type._class.registered.type == normalClass &&
                               !strcmp(wh.type._class.registered.name, "String")))
                      {
@@ -2924,7 +2924,7 @@ class Debugger
                            else
                               snprintf(value, sizeof(value), (GetRuntimePlatform() == win32) ? "0x%08I64x " : "0x%08llx ", address);
                            value[sizeof(value)-1] = 0;
-                           
+
                            if(!address)
                               strcat(value, $"Null string");
                            else
@@ -2944,12 +2944,12 @@ class Debugger
                                  {
                                     int c;
                                     char ch;
-                                    
+
                                     for(c = 0; (ch = string[c]) && c<4096; c++)
-                                       value[len++] = ch;                                 
+                                       value[len++] = ch;
                                     value[len++] = ')';
                                     value[len++] = '\0';
-                                    
+
                                  }
                                  else
                                  {
@@ -2970,7 +2970,7 @@ class Debugger
                            wh.value = CopyString(value);
                         }
                      }
-                     else if(wh.type && wh.type.kind == classType && wh.type._class && 
+                     else if(wh.type && wh.type.kind == classType && wh.type._class &&
                               wh.type._class.registered && wh.type._class.registered.type == enumClass)
                      {
                         uint64 value = strtoul(exp.constant, null, 0);
@@ -2986,7 +2986,7 @@ class Debugger
                            wh.value = CopyString($"Invalid Enum Value");
                         result = true;
                      }
-                     else if(wh.type && (wh.type.kind == charType || (wh.type.kind == classType && wh.type._class && 
+                     else if(wh.type && (wh.type.kind == charType || (wh.type.kind == classType && wh.type._class &&
                               wh.type._class.registered && !strcmp(wh.type._class.registered.fullName, "ecere::com::unichar"))) )
                      {
                         unichar value;
@@ -3052,7 +3052,7 @@ class Debugger
                         else
                            snprintf(string, sizeof(string), "\'%s\' (%d)", charString, value);
                         string[sizeof(string)-1] = 0;
-                        
+
                         wh.value = CopyString(string);
                         result = true;
                      }
@@ -3074,7 +3074,7 @@ class Debugger
                         if(exp.member.memberType == propertyMember)
                            snprintf(watchmsg, sizeof(watchmsg), $"Missing property evaluation support for \"%s\"", wh.expression);
                         else
-                           snprintf(watchmsg, sizeof(watchmsg), $"Evaluation failed for \"%s\" of type \"%s\"", wh.expression, 
+                           snprintf(watchmsg, sizeof(watchmsg), $"Evaluation failed for \"%s\" of type \"%s\"", wh.expression,
                                  exp.type.OnGetString(tempString, null, null));
                      }
                      break;
@@ -3084,16 +3084,16 @@ class Debugger
                snprintf(watchmsg, sizeof(watchmsg), $"Invalid expression: \"%s\"", wh.expression);
             if(exp) FreeExpression(exp);
 
-            
+
             SetPrivateModule(backupPrivateModule);
             SetCurrentContext(backupContext);
             SetTopContext(backupContext);
             SetGlobalContext(backupContext);
             SetThisClass(backupThisClass);
          }
-         //else 
+         //else
          //   wh.value = CopyString("No source file found for selected frame");
-         
+
          watchmsg[sizeof(watchmsg)-1] = 0;
          if(!wh.value)
             wh.value = CopyString(watchmsg);
@@ -3282,7 +3282,7 @@ class Debugger
             gdbTimer.Stop();
             gdbHandle.Wait();
             delete gdbHandle;
-            
+
             ide.outputView.debugBox.Logf($"Debugger Fatal Error: GDB lost\n");
             ide.outputView.debugBox.Logf($"Debugging stopped\n");
             ide.Update(null);
@@ -3301,7 +3301,7 @@ class Debugger
       DebugListItem item { };
       DebugListItem item2 { };
       bool setWaitingForPID = false;
-      
+
 #if defined(GDB_DEBUG_CONSOLE) || defined(GDB_DEBUG_GUI)
 #ifdef GDB_DEBUG_CONSOLE
       // _dpl2(_dpct, dplchan::gdbOutput, 0, output);
@@ -3338,7 +3338,7 @@ class Debugger
          if(ide.gdbDialog) ide.gdbDialog.AddOutput(output);
 #endif
 #endif
-      
+
       switch(output[0])
       {
          case '~':
@@ -4771,7 +4771,7 @@ class Breakpoint : struct
 class Watch : struct
 {
    class_no_expansion;
-   
+
    Type type;
    char * expression;
    char * value;
index 9799bd2..a26f304 100644 (file)
@@ -5,10 +5,10 @@ static uint TokenizeList(char * string, const uint maxTokens, const char seperat
 {
    uint count = 0;
    uint level = 0;
-   
+
    bool quoted = false; //bool escaped = false;
    char * start = null;
-   
+
    for(; *string && count < maxTokens; string++)
    {
       if(!start)
@@ -143,7 +143,7 @@ static bool TokenizeListItem(char * string, TempListItem item)
 }
 
 class Output : struct
-{ 
+{
 public:
    Output prev, next;
    char * output;
@@ -156,7 +156,7 @@ public:
 }
 
 class Command : struct
-{ 
+{
 public:
    Command prev, next;
    char * command;
@@ -269,12 +269,12 @@ class GDBDialog : Window
             if(commands.first)
             {
                bool previous = ((SmartKey)key == up);
-               
+
                if(!lastCommand)
                   lastCommand = previous ? commands.last : commands.first;
                else
                   lastCommand = previous ? lastCommand.prev : lastCommand.next;
-               
+
                if(lastCommand)
                {
                   command.contents = lastCommand.command;
@@ -354,7 +354,7 @@ class GDBDialog : Window
          DataRow root, frame, row;
          TempListItem item { };
          Output out;
-         
+
          tree.Clear();
          root = tree.AddString("Output");
 
@@ -364,7 +364,7 @@ class GDBDialog : Window
             {
                t = CopyString(out.output);
                s = t;
-               
+
                switch(s[0])
                {
                   case '^':
@@ -558,12 +558,12 @@ class GDBDialog : Window
       row.AddString(string);
       delete string;
    }
-   
+
    void UpdateTreeFrame(TempListItem item, DataRow frame)
    {
       int k, l, m, frameTksCount, argsTksCount, mTksCount;
       char * frameTokens[3200], * argsTokens[3200], * mTokens[3200];
-      
+
       item.value = StripCurlies(item.value);
       frameTksCount = TokenizeList(item.value, sizeof(frameTokens) / sizeof(char *), ',', frameTokens);
       for(k = 0; k < frameTksCount; k++)
@@ -699,7 +699,7 @@ class GDBDialog : Window
       }
       return true;
    }
-   
+
    ~GDBDialog()
    {
       commands.Free(Command::Free);
index 682bdaa..cbf6048 100644 (file)
@@ -9,21 +9,21 @@ static Class currentClass;
 
 static bool InsideIncl(Location loc, int line, int charPos)
 {
-   //return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) && 
+   //return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) &&
    //       (loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
    return !loc.start.included && loc.start.line <= line && loc.end.line >= line;
 }
 
 static bool Inside(Location loc, int line, int charPos)
 {
-   //return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) && 
+   //return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
    //       (loc.end.line > line || (loc.end.line == line && loc.end.charPos > charPos));
    return !loc.start.included && loc.start.line < line &&  loc.end.line > line;
 }
 
 static bool InsideEndIncl(Location loc, int line, int charPos)
 {
-   //return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) && 
+   //return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
    //       (loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
    return !loc.start.included && loc.start.line < line &&  loc.end.line >= line;
 }
@@ -194,7 +194,7 @@ Identifier DebugFindCtxExpression(Expression exp, int line, int charPos)
       case bracketsExp:
       {
          Expression expression;
-         
+
          for(expression = exp.list->first; expression; expression = expression.next)
          {
             if(InsideIncl(&expression.loc, line, charPos))
@@ -213,7 +213,7 @@ Identifier DebugFindCtxExpression(Expression exp, int line, int charPos)
             idResult = DebugFindCtxExpression(exp.index.exp, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          for(expression = exp.index.index->first; expression; expression = expression.next)
          {
             if(InsideIncl(&expression.loc, line, charPos))
@@ -234,10 +234,10 @@ Identifier DebugFindCtxExpression(Expression exp, int line, int charPos)
             idResult = DebugFindCtxExpression(exp.call.exp, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          if(exp.call.argLoc.start.line > line || (line == exp.call.argLoc.start.line && exp.call.argLoc.start.charPos >= charPos))
             arg = -1;
-         else 
+         else
             arg = 0;
 
          if(exp.call.arguments)
@@ -250,7 +250,7 @@ Identifier DebugFindCtxExpression(Expression exp, int line, int charPos)
                {
                   if(InsideIncl(&expression.loc, line, charPos))
                      idResult = DebugFindCtxExpression(expression, line, charPos);
-                  
+
                   // Break
                   break;
                }
@@ -258,7 +258,7 @@ Identifier DebugFindCtxExpression(Expression exp, int line, int charPos)
             }
 
 
-            if(idResult) 
+            if(idResult)
                return idResult;
          }
          break;
@@ -489,13 +489,13 @@ static Identifier DebugFindCtxStatement(Statement stmt, int line, int charPos)
             idResult = DebugFindCtxStatement(stmt.forStmt.init, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          if(stmt.forStmt.check && InsideIncl(&stmt.forStmt.check.loc, line, charPos))
          {
             idResult = DebugFindCtxStatement(stmt.forStmt.check, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          if(stmt.forStmt.increment)
          {
             for(exp = stmt.forStmt.increment->first; exp; exp = exp.next)
@@ -522,7 +522,7 @@ static Identifier DebugFindCtxStatement(Statement stmt, int line, int charPos)
          if(stmt.expressions)
          {
             Expression exp;
-            
+
             for(exp = stmt.expressions->first; exp; exp = exp.next)
             {
                if(InsideIncl(&exp.loc, line, charPos))
@@ -598,7 +598,7 @@ static Identifier DebugFindCtxInitializer(Initializer initializer, int line, int
       {
          Initializer init;
          Identifier idResult;
-         
+
          for(init = initializer.list->first; init; init = init.next)
          {
             if(InsideIncl(&init.loc, line, charPos))
@@ -631,7 +631,7 @@ static Identifier DebugFindCtxInitDeclarator(InitDeclarator decl, int line, int
 static Identifier DebugFindCtxDeclaration(Declaration decl, int line, int charPos)
 {
    Identifier idResult;
-   
+
    switch(decl.type)
    {
       case structDeclaration:
@@ -658,7 +658,7 @@ static Identifier DebugFindCtxDeclaration(Declaration decl, int line, int charPo
                   if(d.type == DeclaratorStruct && d.declarator && d.declarator.type == DeclaratorIdentifier)
                      return d.declarator.identifier;
                }
-            }   
+            }
          }
          */
          break;
@@ -690,7 +690,7 @@ static Identifier DebugFindCtxDeclaration(Declaration decl, int line, int charPo
                   idResult = DebugFindCtxInitDeclarator(d, line, charPos);
                   if(idResult) return idResult;
                }
-            }   
+            }
          }
          break;
       }
@@ -707,7 +707,7 @@ static Identifier DebugFindCtxFunction(FunctionDefinition func, int line, int ch
    if(func.body && InsideIncl(&func.body.loc, line, charPos))
    {
       Identifier idResult;
-      
+
       Identifier id = GetDeclId(func.declarator);
       Symbol symbol = func.declarator.symbol;
       Type type = symbol.type;
@@ -769,7 +769,7 @@ static Identifier DebugFindCtxInstance(Instantiation inst, int line, int charPos
       MembersInit init;
       MemberInit memberInit;
       for(init = inst.members->first; init; init = init.next)
-      {         
+      {
          if(init.loc.start.line > line || (line == init.loc.start.line && init.loc.start.charPos > charPos))
             break;
 
@@ -815,7 +815,7 @@ static Identifier DebugFindCtxInstance(Instantiation inst, int line, int charPos
       return idResult;
    SetThisClass(oldThisClass);
 
-   return (void *)-1;  // ? 
+   return (void *)-1;  // ?
 }
 
 static Identifier DebugFindCtxClassFunction(ClassFunction func, int line, int charPos)
@@ -823,7 +823,7 @@ static Identifier DebugFindCtxClassFunction(ClassFunction func, int line, int ch
    if(func.body && InsideIncl(&func.body.loc, line, charPos))
    {
       Identifier idResult;
-      
+
       Identifier id = GetDeclId(func.declarator);
       Symbol symbol = func.declarator ? func.declarator.symbol : null;
       Type type = symbol ? symbol.type : null;
@@ -941,7 +941,7 @@ static Identifier DebugFindCtxClassDef(ClassDef def, int line, int charPos)
             SetThisClass(currentClass);
 
             idResult = DebugFindCtxStatement(def.propertyWatch.compound, line, charPos);
-            if(idResult) 
+            if(idResult)
                return idResult;
             SetThisClass(oldThisClass);
          }
@@ -989,7 +989,7 @@ Identifier DebugFindCtxTree(OldList ast, int line, int charPos)
       {
          switch(external.type)
          {
-            case functionExternal: 
+            case functionExternal:
                if(InsideIncl(&external.loc, line, charPos))
                {
                   idResult = DebugFindCtxFunction(external.function, line, charPos);
@@ -997,7 +997,7 @@ Identifier DebugFindCtxTree(OldList ast, int line, int charPos)
                      return (idResult == (void *)-1 || idResult == (void *)-2) ? null : idResult;
                }
                break;
-            case declarationExternal: 
+            case declarationExternal:
                if(InsideIncl(&external.loc, line, charPos))
                {
                   idResult = DebugFindCtxDeclaration(external.declaration, line, charPos);
@@ -1005,7 +1005,7 @@ Identifier DebugFindCtxTree(OldList ast, int line, int charPos)
                      return (idResult == (void *)-1 || idResult == (void *)-2) ? null : idResult;
                }
                break;
-            case classExternal: 
+            case classExternal:
                if(InsideIncl(&external._class.loc, line, charPos))
                {
                   currentClass = external._class.symbol.registered;
index eada163..503ad5f 100644 (file)
@@ -4,7 +4,7 @@ static void CarryExpressionError(Expression exp, Expression expError)
 {
    Expression temp { };
 
-   // This function assumes that expError is contained within exp, 
+   // This function assumes that expError is contained within exp,
    // and therefore these types will be freed when freeing the old contents
    // of the expression we're carying into.
 
@@ -38,7 +38,7 @@ static char GetGdbFormatChar(Type type)
 //          f : Regard the bits of the value as a floating point number and print using typical floating point syntax.
    if(!type)
       return 'x';
-   
+
    switch(type.kind)
    {
       case charType:
@@ -77,7 +77,7 @@ static char GetGdbFormatChar(Type type)
 
 /*static */bool ExpressionIsError(Expression exp)
 {
-   return (exp.type == dereferenceErrorExp || exp.type == symbolErrorExp || exp.type == classMemberSymbolErrorExp || 
+   return (exp.type == dereferenceErrorExp || exp.type == symbolErrorExp || exp.type == classMemberSymbolErrorExp ||
          exp.type == structMemberSymbolErrorExp || exp.type == memoryErrorExp || exp.type == unknownErrorExp ||
          exp.type == noDebuggerErrorExp || exp.type == debugStateErrorExp);
 }
@@ -101,12 +101,12 @@ void DebugComputeExpression(Expression exp)
          Expression expNew;
          TypeKind kind = dummyType;
          Type dataType = exp.expType;
-         
+
          char temp[1024];
          uint64 address;
          bool hasAddress;
          bool isPointer = false;
-         
+
          if(dataType && dataType.kind == classType && dataType._class.registered)
          {
             Class _class = dataType._class.registered;
@@ -130,7 +130,7 @@ void DebugComputeExpression(Expression exp)
          temp[0] = '\0';
          switch(kind)
          {
-            case charType: case shortType: case intType: case int64Type: case longType: case floatType: case doubleType: 
+            case charType: case shortType: case intType: case int64Type: case longType: case floatType: case doubleType:
             case enumType:
             case arrayType:
             case structType:
@@ -531,7 +531,7 @@ void DebugComputeExpression(Expression exp)
                      {
                         exp.address = _strtoui64(exp.constant, null, 0);
                         exp.address *= size;
-                     } 
+                     }
                   }
                }
             }
@@ -550,7 +550,7 @@ void DebugComputeExpression(Expression exp)
          Expression e, n;
          //for(
          //   e = (*exp.list).first, n = e ? e.next : null;
-         //   e; 
+         //   e;
          //   e = n, n = n?(n.next) : null)
 
          for(e = exp.list->first; e; e = n)
@@ -594,15 +594,15 @@ void DebugComputeExpression(Expression exp)
 
             if(!exp.index.exp.isConstant)
                exp.isConstant = false;
-            
+
             // int r[0]
             // 4 == size = ComputeTypeSize(exp.expType);
             // 0 == size = ComputeTypeSize(exp.expType.arrayType);
             // 4 == size = ComputeTypeSize(exp.index.exp.expType);
             // 0 == size = ComputeTypeSize(exp.index.exp.expType.arrayType);
             size = ComputeTypeSize(exp.expType);
-            format = GetGdbFormatChar(exp.expType);            
-            
+            format = GetGdbFormatChar(exp.expType);
+
             for(e = exp.index.index->first; e; e = e.next)
             {
                DebugComputeExpression(e);
@@ -621,7 +621,7 @@ void DebugComputeExpression(Expression exp)
             if(!ExpressionIsError(exp))
             {
                exp.expType = Dereference(exp.index.exp.expType);
-               
+
                if(exp.index.index && exp.index.index->last && ((Expression)exp.index.index->last) && ((Expression)exp.index.index->last).expType &&
                   ((Expression)exp.index.index->last).expType.kind == intType)
                {
@@ -701,7 +701,7 @@ void DebugComputeExpression(Expression exp)
                classSym = FindClass(string);
                _class = classSym ? classSym.registered : null;
             }
-            
+
             if(memberID && _class)
             {
                /*
@@ -762,7 +762,7 @@ void DebugComputeExpression(Expression exp)
                               double value;
                               double (*Get)(double);
                               GetDouble(memberExp, &value);
-                     
+
                               if(convertTo)
                                  Get = (void *)prop.Set;
                               else
@@ -813,7 +813,7 @@ void DebugComputeExpression(Expression exp)
                                        loc = exp.loc;
                                     };
                                     exp.type = instanceExp;
-                              
+
                                     GetInt(value, &intValue);
 
                                     Set(exp.instance.data, intValue);
@@ -832,7 +832,7 @@ void DebugComputeExpression(Expression exp)
                                        loc = exp.loc;
                                     };
                                     exp.type = instanceExp;
-                              
+
                                     GetInt64(value, &intValue);
 
                                     Set(exp.instance.data, intValue);
@@ -851,7 +851,7 @@ void DebugComputeExpression(Expression exp)
                                        loc = exp.loc;
                                     };
                                     exp.type = instanceExp;
-                              
+
                                     GetDouble(value, &doubleValue);
 
                                     Set(exp.instance.data, doubleValue);
@@ -1020,7 +1020,7 @@ void DebugComputeExpression(Expression exp)
                         ExpressionType evalError = dummyExp;
                         uint64 address;
                         Expression prev = exp.prev, next = exp.next;
-                        char format; 
+                        char format;
                         int size;
                         Expression expNew;
                         TypeKind kind = dummyType;
@@ -1029,7 +1029,7 @@ void DebugComputeExpression(Expression exp)
                         if(!dataType)
                            dataType = member.dataType = ProcessTypeString(member.dataTypeString, false);
 
-                        if(dataType.kind == classType && dataType._class.registered && 
+                        if(dataType.kind == classType && dataType._class.registered &&
                               (dataType._class.registered.type == enumClass || dataType._class.registered.type == bitClass || dataType._class.registered.type == unitClass))
                         {
                            if(dataType._class.registered.dataTypeString)
@@ -1062,15 +1062,15 @@ void DebugComputeExpression(Expression exp)
                               address = 0;
                               GetUInt64(memberExp, &address);
                               //printf("Unhandled !!\n");
-                              
+
                               //printf("memberExp.hasAddress = %d\n", memberExp.hasAddress);
                               //printf("memberExp.type = %d\n", memberExp.type);
                               //printf("_class.name = %s, _class.type = %d\n", _class.name, _class.type);
                            }
-                        
+
                            address += offset;
-                     
-                           if((dataType.kind == classType && dataType._class && 
+
+                           if((dataType.kind == classType && dataType._class &&
                                  (!dataType._class.registered || dataType._class.registered.type == normalClass || dataType._class.registered.type == noHeadClass || dataType._class.registered.type == systemClass)) ||
                               (dataType.kind != classType && dataType.kind != arrayType && dataType.kind != structType && dataType.kind != unionType))
                            {
@@ -1118,7 +1118,7 @@ void DebugComputeExpression(Expression exp)
                      }
                      //else
                      //   exp.type = ExpUnknownError;
-                     
+
                      //FreeExpContents(exp);
                      //exp.constant = PrintUInt64(value);
                      //exp.type = constantExp;
@@ -1131,18 +1131,18 @@ void DebugComputeExpression(Expression exp)
                      uint offset = 0;
                      Type memberType = exp.member.member ? FindMemberAndOffset(type, exp.member.member.string, &offset) : null;
                      if(memberType)
-                     {                        
+                     {
                         char * evaluation = null;
                         ExpressionType evalError = dummyExp;
                         uint64 address;
                         Expression prev = exp.prev, next = exp.next;
-                        char format; 
+                        char format;
                         int size = memberType.size;
                         Expression expNew;
                         Type dataType = memberType;
                         TypeKind kind = dummyType;
 
-                        if(dataType.kind == classType && dataType._class.registered && 
+                        if(dataType.kind == classType && dataType._class.registered &&
                               (dataType._class.registered.type == enumClass || dataType._class.registered.type == bitClass || dataType._class.registered.type == unitClass))
                            dataType = dataType._class.registered.dataType;
 
@@ -1152,10 +1152,10 @@ void DebugComputeExpression(Expression exp)
                            address = memberExp.address;
                         else if(memberExp.type == constantExp)
                            GetUInt64(memberExp, &address);
-                     
+
                         address += offset;
-                  
-                        if((dataType.kind == classType && dataType._class && 
+
+                        if((dataType.kind == classType && dataType._class &&
                               (!dataType._class.registered || dataType._class.registered.type == normalClass || dataType._class.registered.type == noHeadClass || dataType._class.registered.type == systemClass)) ||
                            (dataType.kind != classType && dataType.kind != arrayType && dataType.kind != structType && dataType.kind != unionType))
                         {
@@ -1222,7 +1222,7 @@ void DebugComputeExpression(Expression exp)
          Type type = ProcessType(exp.typeName.qualifiers, exp.typeName.declarator);
          FreeExpContents(exp);
          exp.constant = PrintUInt(ComputeTypeSize(type));
-         exp.type = constantExp;         
+         exp.type = constantExp;
          FreeType(type);
          break;
       }
@@ -1246,7 +1246,7 @@ void DebugComputeExpression(Expression exp)
       case castExp:
       {
          DebugComputeExpression(exp.cast.exp);
-         
+
          if(ExpressionIsError(exp.cast.exp)) //.type == ExpSymbolError
             CarryExpressionError(exp, exp.cast.exp);
          else
@@ -1374,7 +1374,7 @@ void DebugComputeExpression(Expression exp)
                      break;
                   }
                   case doubleType:
-                  {  
+                  {
                      double value;
                      GetDouble(exp.cast.exp, &value);
                      FreeExpContents(exp);
@@ -1414,7 +1414,7 @@ void DebugComputeExpression(Expression exp)
          exp.cond.elseExp.destType = exp.destType;
          DebugComputeExpression(exp.cond.elseExp);
          break;
-      }  
+      }
       */
    }
 
index 87da20c..fb4bf4a 100644 (file)
@@ -70,7 +70,7 @@ static bool CALLBACK EnumWindowsSetForeground(HWND hwnd, LPARAM lParam)
          if(parent) hwnd = parent; else break;
       }
       SetForegroundWindow(hwnd); //SetForegroundWindow( GetAncestor(hwnd, GA_ROOTOWNER));
-      return false;                                                                  
+      return false;
    }
    return true;
 }
@@ -97,7 +97,7 @@ static void WaitForViewableWindow(X11Display * xGlobalDisplay, X11Window window)
 {
    int c;
    XFlush(xGlobalDisplay);
-   for(c = 0; c<4; c++) 
+   for(c = 0; c<4; c++)
    // while(true)
    {
       XWindowAttributes attributes = { 0 };
@@ -130,7 +130,7 @@ static void EnumWindowBringToTop(X11Display * xGlobalDisplay, X11Window window,
             // printf("cant get _NET_WM_PID property\n");
             break;
          }
-      
+
          if(data)
          {
             int pid = *(int *)data;
@@ -152,7 +152,7 @@ static void EnumWindowBringToTop(X11Display * xGlobalDisplay, X11Window window,
                      event.send_event = 1;
                      event.format = 32;
                      event.data.l[0] = 0;
-                     
+
                      XSendEvent(xGlobalDisplay, DefaultRootWindow(xGlobalDisplay), bool::false, SubstructureRedirectMask | SubstructureNotifyMask, (union _XEvent *)&event);
                   }
                   else
@@ -234,15 +234,15 @@ int Process_GetChildExeProcessId(const int parentProcessId, const char * exeFile
 #ifdef __WIN32__
    HANDLE hProcessSnap;
    PROCESSENTRY32 pe32;
-   
+
    int childProcessId = 0;
-   
+
    hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
-   
+
    if(hProcessSnap != INVALID_HANDLE_VALUE)
    {
       pe32.dwSize = sizeof(PROCESSENTRY32);
-   
+
       if(Process32First(hProcessSnap, &pe32))
       {
          do
index 47e586c..a283f58 100644 (file)
@@ -91,7 +91,7 @@ static Array<FileType> fileTypes
    { $"Text Files", "txt", never }
 ] };
 
-static char * iconNames[] = 
+static char * iconNames[] =
 {
    "<:ecere>constructs/class.png",
    "<:ecere>constructs/data.png",
@@ -154,10 +154,10 @@ define CloseBracket = '}';
 
 enum MethodAction
 {
-   actionAddMethod = 1, 
-   actionDeleteMethod = 2, 
-   actionDetachMethod = 3, 
-   actionAttachMethod = 4, 
+   actionAddMethod = 1,
+   actionDeleteMethod = 2,
+   actionDetachMethod = 3,
+   actionAttachMethod = 4,
    actionReattachMethod = 5
 };
 
@@ -198,7 +198,7 @@ static void OutputString(File f, char * string)
          f.Puts("\\\\");
       else
          f.Putc(string[c]);
-   }                              
+   }
 }
 
 void OutputType(File f, Type type, bool outputName)
@@ -299,10 +299,10 @@ void DeleteJunkBefore(EditBoxStream f, int pos, int * position)
 {
    char ch;
    int before = 0;
-   
+
    if(position)
       f.Seek(pos - *position, current);
-                                                      
+
    // Try to delete spaces and \n before...
    f.Seek(-1, current);
    for(;f.Getc(&ch);)
@@ -354,7 +354,7 @@ void GetLocText(EditBox editBox, File f, int position, Location loc, char ** tex
    editBox.GetSelPos(&l1, &y1, &x1, &l2, &y2, &x2, false);
 
    // Cut & Paste function
-   
+
    {
       EditLine l1, l2;
       int y1,x1,y2,x2;
@@ -373,7 +373,7 @@ void GetLocText(EditBox editBox, File f, int position, Location loc, char ** tex
       *text = new char[*size+1 + (y2-y1+1) * linePad + pad]; // Add pad for tabs and new name
       editBox.GetSel(*text, false);
    }
-   
+
    editBox.SetSelPos(l1, y1, x1, l2, y2, x2);
    f.Printf(""); // Make the stream point to where the editbox is
 }
@@ -397,7 +397,7 @@ bool Code_IsPropertyModified(Instance test, ObjectInfo selected, Property prop)
       {
          void * dataForm = new0 byte[dataType.structSize];
          void * dataTest = new0 byte[dataType.structSize];
-   
+
          ((void (*)(void *, void *))(void *)prop.Get)(selected.instance, dataForm);
          ((void (*)(void *, void *))(void *)prop.Get)(test, dataTest);
 
@@ -412,10 +412,10 @@ bool Code_IsPropertyModified(Instance test, ObjectInfo selected, Property prop)
       else if(dataType && dataType._vTbl && (dataType.type == normalClass || dataType.type == noHeadClass))
       {
          void * dataForm, * dataTest;
-   
+
          dataForm = ((void *(*)(void *))(void *)prop.Get)(selected.instance);
          dataTest = ((void *(*)(void *))(void *)prop.Get)(test);
-   
+
          if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
          {
             ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
@@ -425,10 +425,10 @@ bool Code_IsPropertyModified(Instance test, ObjectInfo selected, Property prop)
       else if(dataType && dataType._vTbl)
       {
          DataValue dataForm, dataTest;
-   
+
          GetProperty(prop, selected.instance, &dataForm);
          GetProperty(prop, test, &dataTest);
-   
+
          if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, &dataForm, &dataTest))
          {
             SetProperty(prop, test, dataForm);
@@ -441,7 +441,7 @@ bool Code_IsPropertyModified(Instance test, ObjectInfo selected, Property prop)
                   SetProperty(prop, selected.instance, dataForm);
             }
             result = true;
-         }                                          
+         }
       }
    }
    return result;
@@ -452,7 +452,7 @@ bool Code_IsPropertyDisabled(ObjectInfo selected, char * name)
    bool disabled = false;
    if(selected.oClass == selected)
    {
-      ClassDef def;                  
+      ClassDef def;
       if(selected.classDefinition)
       {
          for(def = selected.classDefinition.definitions->first; def; def = def.next)
@@ -509,7 +509,7 @@ bool Code_IsPropertyDisabled(ObjectInfo selected, char * name)
 
 static bool CheckCompatibleMethod(Method method, Type type, Class regClass, bool isForm, Symbol selectedClass)
 {
-   bool result = false;   
+   bool result = false;
    bool reset = false;
    if(!method.dataType)
       method.dataType = ProcessTypeString(method.dataTypeString, false);
@@ -542,7 +542,7 @@ bool Code_IsFunctionEmpty(ClassFunction function, Method method, ObjectInfo obje
          method.dataType = ProcessTypeString(method.dataTypeString, false);
 
       confirmation = false;
-     
+
       // Check if default function should be calling base class:
       if(object.instance._class._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]) // Temp Check for DefaultFunction
       {
@@ -569,7 +569,7 @@ bool Code_IsFunctionEmpty(ClassFunction function, Method method, ObjectInfo obje
          else
          {
             if(stmt)
-               confirmation = true;        
+               confirmation = true;
          }
       }
       else
@@ -586,7 +586,7 @@ bool Code_IsFunctionEmpty(ClassFunction function, Method method, ObjectInfo obje
          }
 
          if(!exp || exp.type != callExp || exp.call.exp.type != identifierExp)
-            confirmation = true;        
+            confirmation = true;
          else
          {
             Identifier id = exp.call.exp.identifier;
@@ -612,7 +612,7 @@ bool Code_IsFunctionEmpty(ClassFunction function, Method method, ObjectInfo obje
                      arg = arg ?arg.next : null;
                   }
                }
-            }                  
+            }
          }
       }
    }
@@ -630,8 +630,8 @@ class CodeEditor : Window
    isActiveClient = true;
    anchor = Anchor { left = 300, right = 150, top = 0, bottom = 0 };
    menu = Menu { };
-   
-   // eWindow_SetX(A_CASCADE); eWindow_SetY(A_CASCADE); 
+
+   // eWindow_SetX(A_CASCADE); eWindow_SetY(A_CASCADE);
    // eWindow_SetWidth(A_RELATIVE|80); eWindow_SetHeight(A_RELATIVE|80);
 
    SheetType sheetSelected;
@@ -648,7 +648,7 @@ class CodeEditor : Window
    OldList classes;
    bool codeModified;
    bool formModified;
-   
+
    ObjectInfo selected;
    ObjectInfo oClass;
 
@@ -676,7 +676,7 @@ class CodeEditor : Window
    bool expectingMove;
 
    BitmapResource icons[CodeObjectType];
-   
+
    FontResource boldFont { $"Tahoma", 8.25f, bold = true, window = this };
    FontResource normalFont { $"Tahoma", 8.25f, window = this };
 
@@ -708,7 +708,7 @@ class CodeEditor : Window
          ide.pos.text = temp;
       }
       if(sheet.codeEditor != this) return;
-      
+
       if(!updatingCode)
       {
          for(classItem = classes.first; classItem; classItem = classItem.next)
@@ -812,7 +812,7 @@ class CodeEditor : Window
    EditBox editBox
    {
       textVertScroll = true, multiLine = true, /*lineNumbers = ideSettings.showLineNumbers,*/
-      freeCaret = ideSettings.useFreeCaret, caretFollowsScrolling = ideSettings.caretFollowsScrolling, 
+      freeCaret = ideSettings.useFreeCaret, caretFollowsScrolling = ideSettings.caretFollowsScrolling,
       tabKey = true, smartHome = true;
       tabSelection = true, /*maxLineSize = 65536, */parent = this, hasHorzScroll = true, hasVertScroll = true;
       selectionColor = selectionColor, selectionText = selectionText,
@@ -953,7 +953,7 @@ class CodeEditor : Window
                            hide = true;
                            break;
                         }
-                        if(!isSpace) 
+                        if(!isSpace)
                            firstChar = false;
                         else if(firstChar)
                         {
@@ -1044,14 +1044,14 @@ class CodeEditor : Window
 
                      editBox.GetCaretPosition(&caret);
 
-                     
+
 
                      // Go back in the buffer until no space before
                      //yydebug = true;
                      codeModified = true;
                      EnsureUpToDate();
                      SetYydebug(false);
-                     { 
+                     {
                         EditBoxStream f { editBox = editBox };
                         oldCharPos = x1;
                         x1--;
@@ -1121,7 +1121,7 @@ class CodeEditor : Window
 
                               membersList.position = { x, y };
                            }
-         
+
                            membersLine = l1;
                            membersLoc.start.line = line - 1;
                            membersLoc.start.charPos = oldCharPos;
@@ -1161,13 +1161,13 @@ class CodeEditor : Window
                   }
                   else if(ch == ')' || ch == '}' || ch == ';')
                   {
-                     codeModified = true;               
+                     codeModified = true;
                      skipModified = true;
                      if(paramsShown)
                         InvokeParameters(false, true, false);
                      skipModified = false;
                   }
-                  else 
+                  else
                   {
                      bool back = codeModified;
                      codeModified = false;
@@ -1220,7 +1220,7 @@ class CodeEditor : Window
                   {
                      loc = &object.instCode.loc;
 
-                     if((before.y+1 < loc->start.line || (before.y+1 == loc->start.line && before.x+1 <= loc->start.charPos)) && 
+                     if((before.y+1 < loc->start.line || (before.y+1 == loc->start.line && before.x+1 <= loc->start.charPos)) &&
                         (after.y+1 > loc->end.line    || (after.y+1 == loc->end.line && after.x+1 >= loc->end.charPos)))
                      {
                         object.instCode = null;
@@ -1235,7 +1235,7 @@ class CodeEditor : Window
                if(oClass.classDefinition)
                {
                   loc = &oClass.classDefinition.loc;
-                  if((before.y+1 < loc->start.line || (before.y+1 == loc->start.line && before.x+1 <= loc->start.charPos)) && 
+                  if((before.y+1 < loc->start.line || (before.y+1 == loc->start.line && before.x+1 <= loc->start.charPos)) &&
                      (after.y+1 > loc->end.line    || (after.y+1 == loc->end.line && after.x+1 >= loc->end.charPos)))
                   {
                      oClass.classDefinition = null;
@@ -1378,7 +1378,7 @@ class CodeEditor : Window
                designer.DroppedObject(control, object, false, classObject.instance);
 
                sheet.AddObject(object, object.name, typeData /* className*/, true);
-               
+
                UpdateFormCode();
                //codeModified = true;
                EnsureUpToDate();
@@ -1410,7 +1410,7 @@ class CodeEditor : Window
                if(!node)
                {
                   char * s;
-                  s = PrintString($"The ", fileName, $" file is not part of any project.\n", 
+                  s = PrintString($"The ", fileName, $" file is not part of any project.\n",
                      $"It can't be compiled.");
                   MessageBox { type = ok, /*parent = ide, */master = ide, text = $"File not in project error", contents = s }.Modal();
                   delete s;
@@ -1504,8 +1504,8 @@ class CodeEditor : Window
       bool OnKeyDown(Key key, unichar ch)
       {
          CodeEditor editor = (CodeEditor) master;
-         if(key == escape || key == leftAlt || key == rightAlt || 
-            (key.ctrl && key.code != left && key.code != right && 
+         if(key == escape || key == leftAlt || key == rightAlt ||
+            (key.ctrl && key.code != left && key.code != right &&
              key.code != leftShift && key.code != rightShift && key.code != space))
          {
             bool result = true;
@@ -1534,7 +1534,7 @@ class CodeEditor : Window
 
             return result;
          }
-         else 
+         else
             return editor.editBox.OnKeyDown(key, ch);
          return false;
       }
@@ -1605,14 +1605,14 @@ class CodeEditor : Window
 
    Window paramsList
    {
-      master = this, 
+      master = this,
       interim = true,
       clickThrough = true,
       autoCreate = false,
       borderStyle = contour,
       cursor = null,
       background = { 255,255,225 },
-      
+
       OnKeyDown = membersList.OnKeyDown;
 
       /*bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
@@ -1691,7 +1691,7 @@ class CodeEditor : Window
                display.FontExtent(boldFont, instanceName, strlen(instanceName), &nameW, null);
             totalW = functionW + nameW;
             surface.TextFont(boldFont);
-         }   
+         }
 
          surface.WriteText(x, y, string, strlen(string));
          x += functionW + spaceW;
@@ -1710,7 +1710,7 @@ class CodeEditor : Window
 
                if(id == editor.paramsID)
                   surface.TextFont(boldFont);
-               
+
                if(methodType.methodClass)
                   surface.TextExtent(methodType.methodClass.name, strlen(methodType.methodClass.name), &tw, null);
 
@@ -1739,7 +1739,7 @@ class CodeEditor : Window
                {
                   surface.WriteText(x, y, ",", 1);
                   x += ((id ==  editor.paramsID) ? commaWB : commaW);
-               }      
+               }
 
                lineW += width;
 
@@ -1785,7 +1785,7 @@ class CodeEditor : Window
                   {
                      surface.WriteText(x, y, ",", 1);
                      x += ((id ==  editor.paramsID) ? commaWB : commaW);
-                  }      
+                  }
 
                   lineW += width;
 
@@ -1857,7 +1857,7 @@ class CodeEditor : Window
                display.FontExtent(boldFont, instanceName, strlen(instanceName), &nameW, null);
             totalW = functionW + nameW + spaceW;
          }
-            
+
          if(editor.functionType)
          {
             if(methodType)
@@ -1895,7 +1895,7 @@ class CodeEditor : Window
                   paramString[0] = 0;
                   PrintType(param, paramString, true, true);
                   display.FontExtent((id == editor.paramsID || param.kind == ellipsisType) ? boldFont : font, paramString, strlen(paramString), &width, null);
-                  if(param.next) 
+                  if(param.next)
                      width += ((id == editor.paramsID) ? commaWB : commaW);
 
                   if(!height)
@@ -2050,7 +2050,7 @@ class CodeEditor : Window
       for(oClass = (classes).first, next = oClass ? oClass.next : null; oClass; oClass = next, next = next ? (next.next) : null)
       {
          ObjectInfo object, next;
-         
+
          for(object = oClass.instances.first; object; object = next)
          {
             next = object.next;
@@ -2204,7 +2204,7 @@ class CodeEditor : Window
          }
          editBox.Save(f, false);
          modifiedDocument = false;
-         
+
          delete f;
          return true;
       }
@@ -2328,7 +2328,7 @@ class CodeEditor : Window
                }
                else
                   bmpRes = breakpointEnabled[i] ? ide.bmpBp : ide.bmpBpDisabled;
-               
+
                DrawLineMarginIcon(surface, bmpRes, breakpointLines[i], lineH, scrollY, boxH);
             }
          }
@@ -2423,7 +2423,7 @@ class CodeEditor : Window
       File f = FileOpen(filePath, read);
       if(f)
       {
-         // Added this here... 
+         // Added this here...
          fileName = filePath;
          loadingFile = true;
          updatingCode = true;
@@ -2593,7 +2593,7 @@ class CodeEditor : Window
                }
             }
          }
-         else 
+         else
             selectedPos = -1;
       }
 
@@ -2659,13 +2659,13 @@ class CodeEditor : Window
       if(this.oClass)
       {
          ObjectInfo _class, next;
-         
+
          for(_class = classes.first; _class; _class = next)
          {
             ObjectInfo object;
 
             next = _class.next;
-            
+
             for(;object = _class.instances.first;)
             {
                if(object.instance)
@@ -2768,7 +2768,7 @@ class CodeEditor : Window
       }
       if(!project)
          project = ide.project;
-         
+
       GetWorkingDir(oldWorkDir, MAX_LOCATION);
       if(project)
          ChangeWorkingDir(project.topNode.path);
@@ -2803,7 +2803,7 @@ class CodeEditor : Window
             case win32: SetSymbolsDir("obj/debug.win32"); break;
             case tux:   SetSymbolsDir("obj/debug.linux"); break;
             case apple: SetSymbolsDir("obj/debug.apple"); break;
-         }         
+         }
          SetIncludeDirs(null);
          SetSysIncludeDirs(null);
       }
@@ -2824,7 +2824,7 @@ class CodeEditor : Window
                }
             }
          }
-         
+
          if(!(strcmpi(mainModuleName, "instance.ec") && strcmpi(mainModuleName, "BinaryTree.ec") &&
             strcmpi(mainModuleName, "dataTypes.ec") && strcmpi(mainModuleName, "OldList.ec") &&
             strcmpi(mainModuleName, "String.ec") && strcmpi(mainModuleName, "BTNode.ec") &&
@@ -2848,7 +2848,7 @@ class CodeEditor : Window
 
             strcpy(symLocation, GetSymbolsDir());
             PathCat(symLocation, symFile);
-            
+
             // if(!GetEcereImported() && !GetBuildingEcereCom())
             if(!strcmp(extension, "ec") || !strcmp(extension, "eh"))
             {
@@ -2914,7 +2914,7 @@ class CodeEditor : Window
 
       SetIncludeDirs(null);
       SetSysIncludeDirs(null);
-      
+
       delete editFile;
       fileInput = null;
       SetFileInput(null);
@@ -2922,7 +2922,7 @@ class CodeEditor : Window
       if(GetAST())
       {
          ast = GetAST();
-         
+
 #ifdef _TIMINGS
          startTime = GetTime();
 #endif
@@ -2982,7 +2982,7 @@ class CodeEditor : Window
                      if(eClass_GetDesigner(regClass) && !GetBuildingEcereComModule())
                      {
                         Instance instance = eInstance_New(regClass);
-                        ObjectInfo classObject 
+                        ObjectInfo classObject
                         {
                            name = CopyString(_class._class.name);
                            instance = instance;
@@ -3025,7 +3025,7 @@ class CodeEditor : Window
                                                 FreeType(propDef.initializer.exp.destType);
                                                 propDef.initializer.exp.destType = MkClassType(propertyClass.name);
                                                 ProcessExpressionType(propDef.initializer.exp);
-                                             
+
                                                 if(propertyClass.type == structClass || propertyClass.type == noHeadClass || propertyClass.type == normalClass)
                                                 {
                                                    Expression computed = CopyExpression(propDef.initializer.exp);
@@ -3036,7 +3036,7 @@ class CodeEditor : Window
                                                       if(prop.Set)
                                                       {
                                                          if(computed.instance._class && computed.instance._class.symbol &&
-                                                            computed.instance._class.symbol.registered && 
+                                                            computed.instance._class.symbol.registered &&
                                                             eClass_IsDerived(computed.instance._class.symbol.registered, propertyClass))
                                                          {
                                                             ((void (*)(void *, void *))(void *)prop.Set)(instance, computed.instance.data);
@@ -3058,7 +3058,7 @@ class CodeEditor : Window
                                                    }
                                                    else
                                                       propDef.variable = true;
-                                                   
+
                                                    FreeExpression(computed);
                                                 }
                                                 else
@@ -3096,7 +3096,7 @@ class CodeEditor : Window
                                           else
                                           {
                                              Method method = eClass_FindMethod(regClass, id.string, this.privateModule);
-                                             if(method && method.type == virtualMethod && propDef.initializer && propDef.initializer.type == expInitializer && 
+                                             if(method && method.type == virtualMethod && propDef.initializer && propDef.initializer.type == expInitializer &&
                                                 propDef.initializer.exp && propDef.initializer.exp.type == identifierExp)
                                              {
                                                 ClassDef def;
@@ -3112,7 +3112,7 @@ class CodeEditor : Window
                                                       }
                                                    }
                                                 }
-                                             }                                          
+                                             }
                                           }
                                        }
                                     }
@@ -3176,8 +3176,8 @@ class CodeEditor : Window
                                           {
                                              Instance control;
                                              object = object ? object.next : classObject.instances.first;
-                                             control = object.instance;                                             
-                                             
+                                             control = object.instance;
+
                                              if(inst.members)
                                              {
                                                 MembersInit members;
@@ -3237,7 +3237,7 @@ class CodeEditor : Window
                                                                      if(propertyClass)
                                                                      {
                                                                         ProcessExpressionType(member.initializer.exp);
-                                       
+
                                                                         if(propertyClass.type == structClass || propertyClass.type == normalClass || propertyClass.type == noHeadClass)
                                                                         {
                                                                            Expression computed;
@@ -3250,13 +3250,13 @@ class CodeEditor : Window
                                                                            if(computed)
                                                                            {
                                                                               ComputeExpression(computed);
-                                                                              
+
                                                                               if(computed.type == instanceExp && computed.isConstant && computed.isConstant)
                                                                               {
                                                                                  if(computed.instance.data)
                                                                                  {
                                                                                     if(computed.instance._class && computed.instance._class.symbol &&
-                                                                                       computed.instance._class.symbol.registered && 
+                                                                                       computed.instance._class.symbol.registered &&
                                                                                        eClass_IsDerived(computed.instance._class.symbol.registered, propertyClass))
                                                                                     {
                                                                                        ((void (*)(void *, void *))(void *)prop.Set)(control, computed.instance.data);
@@ -3388,7 +3388,7 @@ class CodeEditor : Window
                                                                   else
                                                                      member.variable = true;
                                                                }
-                                                               else if(ident && member.initializer && member.initializer.type == expInitializer && member.initializer.exp && 
+                                                               else if(ident && member.initializer && member.initializer.type == expInitializer && member.initializer.exp &&
                                                                   member.initializer.exp.type == memberExp) // identifierExp
                                                                {
                                                                   Method method = eClass_FindMethod(instClass, ident.string, this.privateModule);
@@ -3417,7 +3417,7 @@ class CodeEditor : Window
                                                          break;
                                                       }
                                                    }
-                                                }                                          
+                                                }
                                              }
 
                                              designer.PostCreateObject(object.instance, object, false, classObject.instance);
@@ -3471,7 +3471,7 @@ class CodeEditor : Window
          {
             ObjectInfo check;
             int pos = 0;
-         
+
             for(check = this.oClass.instances.first; check; check = check.next)
             {
                if(check.name && !strcmp(check.name, selectedName))
@@ -3540,7 +3540,7 @@ class CodeEditor : Window
       printf("Total MkExternalImport time is %.3f seconds\n\n", externalImportTotalTime);
       printf("Total FindSymbol time is %.3f seconds\n\n", findSymbolTotalTime);
       // printf("Total Class Members Find time is %.3f seconds\n\n", GetClassFindTime());
-      
+
       printf("Whole ParseCode function took %.3f seconds\n\n", GetTime() - parseCodeStart);
 #endif
       if(inUseDebug && ide.projectView)
@@ -3570,17 +3570,17 @@ class CodeEditor : Window
                Class dataType = prop.dataTypeClass;
                if(!dataType)
                   dataType = prop.dataTypeClass = eSystem_FindClass(this.privateModule, prop.dataTypeString);
-         
+
                if(dataType)
                {
                   if(dataType.type == structClass)
                   {
                      void * dataForm = new0 byte[dataType.structSize];
                      void * dataTest = new0 byte[dataType.structSize];
-               
+
                      ((void (*)(void *, void *))(void *)prop.Get)(control, dataForm);
                      ((void (*)(void *, void *))(void *)prop.Get)(test, dataTest);
-               
+
                      if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
                      {
                         char tempString[1024] = "";
@@ -3588,11 +3588,11 @@ class CodeEditor : Window
                         bool needClass = true;
                         if(*prev)
                            f.Printf(", ");
-                  
+
                         ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
-                  
+
                         string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, dataForm, tempString, null, &needClass);
-                        
+
                         eClass_FindNextMember(_class, curClass, curMember, null, null);
                         if(*curMember != (DataMember)prop)
                            f.Printf("%s = ", prop.name);
@@ -3613,19 +3613,19 @@ class CodeEditor : Window
                   else if(dataType.type == normalClass || dataType.type == noHeadClass)
                   {
                      void * dataForm, * dataTest;
-               
+
                      dataForm = ((void *(*)(void *))(void *)prop.Get)(control);
                      dataTest = ((void *(*)(void *))(void *)prop.Get)(test);
-               
+
                      if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
                      {
                         char tempString[1024] = "";
                         char * string = "";
                         if(*prev)
                            f.Printf(", ");
-                  
+
                         ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
-                  
+
                         eClass_FindNextMember(_class, curClass, curMember, null, null);
                         if(*curMember != (DataMember)prop)
                            f.Printf("%s = ", prop.name);
@@ -3685,16 +3685,16 @@ class CodeEditor : Window
                   else
                   {
                      DataValue dataForm, dataTest;
-               
+
                      GetProperty(prop, control, &dataForm);
                      GetProperty(prop, test, &dataTest);
-               
+
                      if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, &dataForm, &dataTest))
                      {
                         char * string;
                         char tempString[1024] = "";
                         SetProperty(prop, test, dataForm);
-                  
+
                         if(dataType.type != bitClass)
                         {
                            bool needClass = true;
@@ -3716,7 +3716,7 @@ class CodeEditor : Window
                            }
                            else
                               string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, &dataForm, tempString, null, &needClass);
-                     
+
                            if(string && string[0])
                            {
                               if(*prev)
@@ -3772,7 +3772,7 @@ class CodeEditor : Window
       Class _class;
       bool lastIsMethod = true;
       ObjectInfo classObject = object.oClass;
-      
+
       if(inst)
       {
          if(object.deleted)
@@ -3814,7 +3814,7 @@ class CodeEditor : Window
                char ch;
                f.Seek(pos - position, current);
                while(f.Getc(&ch))
-               {  
+               {
                   if(isspace(ch))
                   {
                      f.Seek(-1, current);
@@ -3875,12 +3875,12 @@ class CodeEditor : Window
                         position--;
                         if(count > 6)
                         {
-                           toDelete += count - 6; 
+                           toDelete += count - 6;
                            count = 6;
                         }
-                        else 
+                        else
                            toAdd = 6 - count;
-                        break;                              
+                        break;
                      }
                   }
                   if(toDelete)
@@ -3905,7 +3905,7 @@ class CodeEditor : Window
 
          }
       }
-      else 
+      else
       {
          // Instance not there, create a brand new one
          DeleteJunkBefore(f, position, &position);
@@ -3957,7 +3957,7 @@ class CodeEditor : Window
          Class instClass = eSystem_FindClass(this.privateModule, inst._class.name);
 
          DeleteJunkBefore(f, position, &position);
-         
+
          // Instance already there, clear out the properties
          for(members = inst.members->first; members; members = members.next)
          {
@@ -3991,7 +3991,7 @@ class CodeEditor : Window
                            else
                            {
                               Method method = eClass_FindMethod(instClass, ident.string, this.privateModule);
-                              if(method && method.type == virtualMethod && member.initializer && member.initializer.type == expInitializer && member.initializer.exp && 
+                              if(method && method.type == virtualMethod && member.initializer && member.initializer.type == expInitializer && member.initializer.exp &&
                                  member.initializer.exp.type == memberExp /*ExpIdentifier*/)
                               {
                                  if(((this.methodAction == actionDetachMethod || this.methodAction == actionReattachMethod) && this.method == method && this.selected == object) ||
@@ -4002,7 +4002,7 @@ class CodeEditor : Window
                                     position = member.loc.end.pos;
                                     deleted = true;
                                  }
-                              }                                          
+                              }
                            }
                         }
                      }
@@ -4014,12 +4014,12 @@ class CodeEditor : Window
                         //f.Seek(member.loc.start.pos - position, current);
                         //position = member.loc.start.pos;
                         DeleteJunkBefore(f, member.loc.start.pos, &position);
-                        if(prev) f.Printf(", "); 
+                        if(prev) f.Printf(", ");
                         else if(keptMember) f.Printf(" ");
                         prev = false;
                      }
-                  } 
-               
+                  }
+
                   if(!keptMember || !members.next)
                   {
                      char ch = 0;
@@ -4051,7 +4051,7 @@ class CodeEditor : Window
 
                      f.Seek(members.loc.end.pos - position, current);
                      f.Getc(&ch);
-            
+
                      if(ch == ';')
                      {
                         f.Seek(-1, current);
@@ -4109,7 +4109,7 @@ class CodeEditor : Window
                      */
                      prev = true;
                      lastIsMethod = false;
-                     
+
                   }
                }
                else
@@ -4127,7 +4127,7 @@ class CodeEditor : Window
                   methodPresent = true;
 
                // Delete instance method here
-               if((this.methodAction == actionDeleteMethod || (this.methodAction == actionDetachMethod && this.moveAttached)) && 
+               if((this.methodAction == actionDeleteMethod || (this.methodAction == actionDetachMethod && this.moveAttached)) &&
                   members.function == function)
                {
                   if(this.moveAttached && !*text)
@@ -4146,7 +4146,7 @@ class CodeEditor : Window
 
                   DeleteJunkBefore(f, members.loc.start.pos, &position);
                   lastIsMethod = true;
-                  f.Printf("\n\n      ");               
+                  f.Printf("\n\n      ");
                }
 
                f.Seek(members.loc.end.pos - position, current);
@@ -4192,7 +4192,7 @@ class CodeEditor : Window
                   memmove(*text + movedFuncIdPos + newLen, *text + movedFuncIdPos + movedFuncIdLen, *textSize - movedFuncIdPos - movedFuncIdLen + 1);
                   *textSize += newLen - movedFuncIdLen;
                   memcpy(*text + movedFuncIdPos, method.name, newLen);
-                                          
+
                   // Second, tab right
                   {
                      int c;
@@ -4222,7 +4222,7 @@ class CodeEditor : Window
                   // ADDING METHOD HERE
                   f.Printf("\n      ");
                   OutputType(f, returnType, false);
-            
+
                   f.Printf(" ");
                   if(dataType.thisClass)
                   {
@@ -4243,7 +4243,7 @@ class CodeEditor : Window
                      if(param.next)
                         f.Printf(", ");
                   }
-                  f.Printf(")\n");                  
+                  f.Printf(")\n");
                   f.Printf("      %c\n\n", OpenBracket);
 
                   if(control._class._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]) // Temp Check for DefaultFunction
@@ -4297,15 +4297,15 @@ class CodeEditor : Window
    {
       Property propIt;
       Class regClass = eSystem_FindClass(privateModule, classObject.name);
-     
+
       if(_class.base && _class.base.type != systemClass) OutputClassProperties(_class.base, classObject, f, test);
-      
+
       for(propIt = _class.membersAndProperties.first; propIt; propIt = propIt.next)
       {
          Property prop = eClass_FindProperty(selected.instance._class, propIt.name, privateModule);
          if(prop && prop.isProperty && !prop.conversion)
          {
-            if(prop.Set && prop.Get && prop.dataTypeString && strcmp(prop.name, "name") && !Code_IsPropertyDisabled(classObject, prop.name) && 
+            if(prop.Set && prop.Get && prop.dataTypeString && strcmp(prop.name, "name") && !Code_IsPropertyDisabled(classObject, prop.name) &&
                (!prop.IsSet || prop.IsSet(classObject.instance)))
             {
                Class dataType = prop.dataTypeClass;
@@ -4320,19 +4320,19 @@ class CodeEditor : Window
 
                if(!dataType)
                   dataType = prop.dataTypeClass = eSystem_FindClass(this.privateModule, prop.dataTypeString);
-            
+
                if(dataType && dataType.type == structClass)
                {
                   void * dataForm = new0 byte[dataType.structSize];
                   void * dataTest = new0 byte[dataType.structSize];
-               
+
                   ((void (*)(void *, void *))(void *)prop.Get)(classObject.instance, dataForm);
                   ((void (*)(void *, void *))(void *)prop.Get)(test, dataTest);
 
                   if(((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
                   {
                      bool needClass = true;
-                     
+
                      string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, dataForm, tempString, null, &needClass);
                      ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
                      if(needClass)
@@ -4346,16 +4346,16 @@ class CodeEditor : Window
                else if(dataType && (dataType.type == normalClass || dataType.type == noHeadClass))
                {
                   void * dataForm, * dataTest;
-               
+
                   dataForm = ((void *(*)(void *))(void *)prop.Get)(classObject.instance);
                   dataTest = ((void *(*)(void *))(void *)prop.Get)(test);
-               
+
                   if(((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
                   {
                      char tempString[1024] = "";
                      char * string;
                      ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
-                  
+
                      if(eClass_IsDerived(classObject.instance._class, dataType) && classObject.instance == dataForm)
                      {
                         // Shouldn't go here ...
@@ -4383,10 +4383,10 @@ class CodeEditor : Window
                else if(dataType)
                {
                   DataValue dataForm, dataTest;
-               
+
                   GetProperty(prop, classObject.instance, &dataForm);
                   GetProperty(prop, test, &dataTest);
-               
+
                   if(((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, &dataForm, &dataTest))
                   {
                      SetProperty(prop, test, dataForm);
@@ -4424,7 +4424,7 @@ class CodeEditor : Window
                         else if(string[0])
                            f.Printf("\n   %s%s = %s;", specify ? "property::" : "", prop.name, string);
                      }
-                  }                                          
+                  }
                }
             }
          }
@@ -4447,7 +4447,7 @@ class CodeEditor : Window
          int position = 0;
          char * text = null;
          int textSize;
-         Identifier movedFuncId; 
+         Identifier movedFuncId;
          int movedFuncIdLen = 0, movedFuncIdPos = 0;
          ObjectInfo classObject;
 
@@ -4478,7 +4478,7 @@ class CodeEditor : Window
 
             // Put it in the same desktop window...
             designer.PrepareTestObject(test);
-            
+
             //f.Printf("class %s : %s\n", classObject.name, classObject.oClass.name);
             //f.Printf("%c\n\n", OpenBracket);
 
@@ -4495,7 +4495,7 @@ class CodeEditor : Window
                int back = 0;
                f.Seek(classDef.blockStart.end.pos - position, current);
                position = classDef.blockStart.end.pos;
-               
+
                for(; f.Getc(&ch); count++)
                {
                   if(!isspace(ch))
@@ -4503,15 +4503,15 @@ class CodeEditor : Window
                      f.Seek(-1, current);
                      break;
                   }
-               
+
                   if(ch == '\n')
                      back = 0;
                   else
                      back++;
                }
-            
+
                f.Seek(-count, current);
-            
+
                f.DeleteBytes(count-back);
                //f.Printf("\n");
                position += count-back;
@@ -4529,7 +4529,7 @@ class CodeEditor : Window
                      bool keptMember = false;
                      MemberInit propDef;
                      MemberInit lastKept = null;
-                     
+
                      lastIsDecl = false;
                      DeleteJunkBefore(f, def.loc.start.pos, &position);
                      f.Printf("\n   ");
@@ -4565,7 +4565,7 @@ class CodeEditor : Window
                                        position = propDef.loc.end.pos;
                                        deleted = true;
                                     }
-                                 }                                          
+                                 }
                               }
                            }
                         }
@@ -4575,14 +4575,14 @@ class CodeEditor : Window
                            lastKept = propDef;
                         }
                      }
-                  
+
                      if(!keptMember)
                      {
                         char ch = 0;
                         int count = 0;
                         f.Seek(def.loc.end.pos - position - 1, current);
                         f.Getc(&ch);
-                        
+
                         if(ch == ';')
                         {
                            f.Seek(-1, current);
@@ -4596,7 +4596,7 @@ class CodeEditor : Window
                         {
                            char ch;
                            int count = 0;
-                           
+
                            f.Seek(-1, current);
                            for(;f.Getc(&ch);)
                            {
@@ -4619,7 +4619,7 @@ class CodeEditor : Window
                         {
                            f.Seek(def.loc.end.pos - position, current);
                            position = def.loc.end.pos;
-                        }                
+                        }
                      }
                      break;
                   }
@@ -4674,7 +4674,7 @@ class CodeEditor : Window
                      f.Printf("\n\n   ");
 
                      // Delete _class methods
-                     if((methodAction == actionDeleteMethod || (moveAttached && selected != classObject)) && 
+                     if((methodAction == actionDeleteMethod || (moveAttached && selected != classObject)) &&
                         def.function == function)
                      {
                         char ch;
@@ -4709,7 +4709,7 @@ class CodeEditor : Window
                         position = function.loc.start.pos + movedFuncIdPos + movedFuncIdLen;
                      }
 
-                     if((methodAction == actionAttachMethod || methodAction == actionReattachMethod) && selected == classObject && moveAttached && 
+                     if((methodAction == actionAttachMethod || methodAction == actionReattachMethod) && selected == classObject && moveAttached &&
                         function == def.function)
                      {
                         // In case of attaching methods in the _class, simply rename the method
@@ -4731,7 +4731,7 @@ class CodeEditor : Window
                         firstObject = false;
                         lastIsDecl = true;
                      }
-                     else           
+                     else
                      {
                         f.Printf("\n   ");
                         lastIsDecl = false;
@@ -4748,7 +4748,7 @@ class CodeEditor : Window
                DeleteJunkBefore(f, position, &position);
                f.Printf("\n   %s = %s;\n", method.name, function.declarator.symbol.string);
             }
-            
+
             // ********** INSTANCES ***************
             for(; object; object = object.next)
             {
@@ -4812,7 +4812,7 @@ class CodeEditor : Window
                   f.Printf("\n\n");
                   f.Printf("   ");
                   OutputType(f, returnType, false);
-               
+
                   f.Printf(" ");
                   if(dataType.thisClass && !dataType.classObjectType)
                   {
@@ -4830,7 +4830,7 @@ class CodeEditor : Window
                      if(param.next)
                         f.Printf(", ");
                   }
-                  f.Printf(")\n");                  
+                  f.Printf(")\n");
                   f.Printf("   %c\n\n", OpenBracket);
 
                   if(test._class._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]) // Temp Check for DefaultFunction
@@ -4895,7 +4895,7 @@ class CodeEditor : Window
       if(methodName)
       {
          ObjectInfo object = this.selected;
-         
+
          if(object && object == this.oClass)
          {
             ClassDefinition classDef = object.oClass.classDefinition;
@@ -5153,7 +5153,7 @@ class CodeEditor : Window
                   {
                      if(!testMethod.dataType)
                         testMethod.dataType = ProcessTypeString(testMethod.dataTypeString, false);
-                        
+
                      //if(CheckCompatibleMethod(method, testMethod.dataType, &regClass, false, selectedClass)) // this.selected == this.oClass, selectedClass))
                      if(CheckCompatibleMethod(method, testMethod.dataType, this.oClass.instance._class, false, selectedClass)) // this.selected == this.oClass, selectedClass))
                      //if(CheckCompatibleMethod(method, testMethod.dataType, &regClass, this.selected == this.oClass, FindClass(this.oClass.oClass.name)))
@@ -5189,7 +5189,7 @@ class CodeEditor : Window
             this.method = method;
             ModifyCode();
          }
-         UpdateFormCode();         
+         UpdateFormCode();
          GoToMethod(methodName);
       }
    }
@@ -5201,7 +5201,7 @@ class CodeEditor : Window
          methodAction = actionDeleteMethod;
          this.function = function;
          ModifyCode();
-         UpdateFormCode(); 
+         UpdateFormCode();
 
          Update(null);
       }
@@ -5243,7 +5243,7 @@ class CodeEditor : Window
          this.method = method;
          this.function = function;
          ModifyCode();
-         UpdateFormCode(); 
+         UpdateFormCode();
          Update(null);
       }
    }
@@ -5273,7 +5273,7 @@ class CodeEditor : Window
             {
                char title[1024];
                sprintf(title, $"Attach %s", function.declarator.symbol.string);
-               if(MessageBox { type = yesNo, master = parent, text = title, 
+               if(MessageBox { type = yesNo, master = parent, text = title,
                   contents = $"Method is unused. Move method inside instance?" }.Modal() == yes)
                {
                   moveAttached = true;
@@ -5285,7 +5285,7 @@ class CodeEditor : Window
          this.method = method;
          this.function = function;
          ModifyCode();
-         UpdateFormCode(); 
+         UpdateFormCode();
          Update(null);
       }
    }
@@ -5298,7 +5298,7 @@ class CodeEditor : Window
       {
          Window dialog
          {
-            hasClose = true, borderStyle = sizable, minClientSize = { 300, 55 }, 
+            hasClose = true, borderStyle = sizable, minClientSize = { 300, 55 },
             master = sheet, text = $"Name detached method", background = formColor
          };
          Button cancelButton
@@ -5344,7 +5344,7 @@ class CodeEditor : Window
                strcat(name, this.methodName);
                strcpy(this.methodName, name);
             }
-            
+
             this.moveAttached = true;
          }
 
@@ -5352,7 +5352,7 @@ class CodeEditor : Window
          this.method = method;
          this.function = function;
          ModifyCode();
-         UpdateFormCode(); 
+         UpdateFormCode();
          Update(null);
       }
    }
@@ -5372,11 +5372,11 @@ class CodeEditor : Window
          ObjectInfo check;
          sprintf(name, "%c%s%d", tolower(instance._class.name[0]), instance._class.name+1, id);
 
-         // if(strcmp(name, this.oClass.instance.name)) 
-         
+         // if(strcmp(name, this.oClass.instance.name))
+
          {
             for(check = oClass.instances.first; check; check = check.next)
-               if(!check.deleted && check.name && !strcmp(name, check.name)) 
+               if(!check.deleted && check.name && !strcmp(name, check.name))
                   break;
             if(!check)
             {
@@ -5384,7 +5384,7 @@ class CodeEditor : Window
                break;
             }
          }
-      }            
+      }
       toolBox.controlClass = null;
 
       ModifyCode();
@@ -5450,9 +5450,9 @@ class CodeEditor : Window
          ObjectInfo select = object;
 
          for(;;)
-         {            
+         {
             select = select.prev;
-            if(!select) 
+            if(!select)
             {
                if(looped) break;
                select = object.oClass.instances.last;
@@ -5536,7 +5536,7 @@ class CodeEditor : Window
                BitmapResource bitmap = null;
                if(!subMember.dataType)
                   subMember.dataType = ProcessTypeString(subMember.dataTypeString, false);
-            
+
                if(subMember.dataType && subMember.dataType.kind == classType && subMember.dataType._class)
                {
                   char * bitmapName = (char *)eClass_GetProperty(subMember.dataType._class.registered, "icon");
@@ -5630,11 +5630,11 @@ class CodeEditor : Window
                   else if(member.name && !membersList.FindString(member.name))
                   {
                      DataRow row = membersList.AddString(member.name);
-               
+
                      BitmapResource bitmap = null;
                      if(!member.dataType)
                         member.dataType = ProcessTypeString(member.dataTypeString, false);
-               
+
                      if(member.dataType && member.dataType.kind == classType && member.dataType._class)
                      {
                         char * bitmapName = (char *)eClass_GetProperty(member.dataType._class.registered, "icon");
@@ -5745,11 +5745,11 @@ class CodeEditor : Window
                else if(member.name && (!curString || strcmp(curString, member.name)))
                {
                   DataRow row = membersList.AddString(member.name);
-               
+
                   BitmapResource bitmap = null;
                   if(!member.dataType)
                      member.dataType = ProcessTypeString(member.dataTypeString, false);
-               
+
                   if(member.dataType && member.dataType.kind == classType && member.dataType._class)
                   {
                      char * bitmapName = (char *)eClass_GetProperty(member.dataType._class.registered, "icon");
@@ -5778,7 +5778,7 @@ class CodeEditor : Window
       if(type && (type.kind == classType || type.kind == structType || type.kind == unionType))
       {
          Class _class;
-         
+
          if(type.kind == classType)
          {
             if(type._class)
@@ -6055,9 +6055,9 @@ class CodeEditor : Window
       {
          DataRow row = membersList.FindSubString(string);
          if(!row)
-            listedEnums = false;      
+            listedEnums = false;
       }
-      
+
       if(!insideClass && exp && exp.destType && exp.destType.kind == functionType && GetThisClass())
       {
          ListClassMembersMatch(GetThisClass(), exp.destType);
@@ -6068,7 +6068,7 @@ class CodeEditor : Window
          Symbol symbol = null;
          {
             if(GetThisClass())
-            { 
+            {
                ListClassMembers(GetThisClass(), false);
             }
 
@@ -6090,7 +6090,7 @@ class CodeEditor : Window
                      {
                         row.icon = icons[typeEnumValue];
                      }
-                     else 
+                     else
                      {
                         BitmapResource bitmap = null;
                         if(symbol.type && symbol.type.kind == classType && symbol.type._class && symbol.type._class)
@@ -6148,7 +6148,7 @@ class CodeEditor : Window
                      {
                         row.icon = icons[typeEnumValue];
                      }
-                     else 
+                     else
                      {
                         BitmapResource bitmap = null;
                         if(data.dataType && data.dataType.kind == classType && data.dataType._class && data.dataType._class)
@@ -6215,7 +6215,7 @@ class CodeEditor : Window
          OutputType(f, returnType, false);
 
          f.Printf(" ");
-         
+
          if(dataType.thisClass && !dataType.classObjectType && (!isInstance || !insideClass || !eClass_IsDerived(insideClass, dataType.thisClass.registered)))
          {
             if(dataType.thisClass.shortName)
@@ -6236,7 +6236,7 @@ class CodeEditor : Window
                   f.Printf(", ");
             }
          }
-         f.Printf(")\n");                  
+         f.Printf(")\n");
          if(extraIndent) f.Printf("   ");
          f.Printf("   %c\n", OpenBracket);
 
@@ -6244,7 +6244,7 @@ class CodeEditor : Window
 
          f.Printf("\n");
 
-         if(!_class || 
+         if(!_class ||
             (
                (isInstance ? _class : _class.base)._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad] ||
                (isInstance ? _class : _class.base)._vTbl[method.vid] == DummyMethod)) // Temp Check for DefaultFunction
@@ -6316,7 +6316,7 @@ class CodeEditor : Window
       }
 
       editBox.GetSelPos(&l1, &y1, &x1, &l2, &y2, &x2, false);
-      { 
+      {
          EditBoxStream f { editBox = editBox };
 
          updatingCode = true;
@@ -6347,7 +6347,7 @@ class CodeEditor : Window
          else if(!pointer)
          {
             editBox.GetSelPos(&l1, &y1, &x1, &l2, &y2, &x2, false);
-            { 
+            {
                EditBoxStream f { editBox = editBox };
                char ch = 0;
 
@@ -6612,7 +6612,7 @@ class CodeEditor : Window
                         editBox.SetSelPos(l1, y1, idStart.charPos-1, l2, y2, idStart.charPos-1);
                      editBox.GetCaretPosition(caret);
                      editBox.SetSelPos(l1, y1, x1, l2, y2, x2);
-               
+
                      membersList.master = this;
 
                      caret.y += editBox.GetCaretSize();
@@ -6659,7 +6659,7 @@ class CodeEditor : Window
                   }
                   if(row)
                      membersList.SetScrollPosition(0, row.index * membersList.rowHeight);
-               }            
+               }
             }
          }
       }
@@ -6685,7 +6685,7 @@ class CodeEditor : Window
       EnsureUpToDate();
 
       editBox.GetSelPos(&l1, &y1, &x1, &l2, &y2, &x2, false);
-      { 
+      {
          EditBoxStream f { editBox = editBox };
          char ch;
 
@@ -6720,7 +6720,7 @@ class CodeEditor : Window
          delete f;
          updatingCode = false;
       }
-      
+
       charPos = Min(charPos, l1.count + 1);
       if(!caretMove)
          FindParamsTree(ast, lineNum, charPos);
@@ -6742,7 +6742,7 @@ class CodeEditor : Window
          if(this.functionType != ::functionType || this.instanceType != ::instanceType)
             reposition = false;
 
-         if(!this.paramsShown || reposition || paramsInsideExp != functionExp || ::instanceType) // Added instanceType here, otherwise instance popups never reposition... 
+         if(!this.paramsShown || reposition || paramsInsideExp != functionExp || ::instanceType) // Added instanceType here, otherwise instance popups never reposition...
                                                                                                           // ( Dummy exp: always ends up with same memory)
          {
             editBox.GetSelPos(&l1, &y1, &x1, &l2, &y2, &x2, false);
index f4f7261..eed292e 100644 (file)
@@ -33,7 +33,7 @@ class CodeObject : struct
       int nameLen = strlen(name);
 
       Bitmap icon = bitmap ? bitmap.bitmap : editor.icons[type].bitmap;
-     
+
       textOffset = this.indent * indent + (icon ? (/*icon.width + 4*/ 20) : 0);
       if(overriden || object)
          surface.TextFont(editor.boldFont.font);
@@ -85,7 +85,7 @@ class CodeObject : struct
       {
          deleteBtn.Destroy(0);
          delete deleteBtn;
-      } 
+      }
       if(detachBtn)
       {
          detachBtn.Destroy(0);
index bc03153..86fcafb 100644 (file)
@@ -26,7 +26,7 @@ class Designer : DesignerBase
 
    void CodeAddObject(Instance instance, ObjectInfo * object)
    {
-      codeEditor.AddObject(instance, object);      
+      codeEditor.AddObject(instance, object);
    }
 
    void SheetAddObject(ObjectInfo object)
@@ -38,7 +38,7 @@ class Designer : DesignerBase
    {
       ((IDEWorkSpace)master).toolBox.AddControl(_class);
    }
-   
+
    void AddDefaultMethod(Instance instance, Instance classInstance)
    {
       Class _class = instance._class;
@@ -130,7 +130,7 @@ class Designer : DesignerBase
 
    void SelectObjectFromDesigner(ObjectInfo object)
    {
-      codeEditor.SelectObjectFromDesigner(object);      
+      codeEditor.SelectObjectFromDesigner(object);
    }
 
    borderStyle = sizable;
index 45e86c6..a022f51 100644 (file)
@@ -438,7 +438,7 @@ class Sheet : Window
          categorized.disabled = true;
 
          methods.Activate();
-                       
+
          // ((IDEWorkSpace)master).SheetSelected(Methods);
          return true;
       }
@@ -498,7 +498,7 @@ class Sheet : Window
       {
          CodeObject object = control.GetData(methodName);
          if(object)
-            codeEditor.AddMethod(object.method);   
+            codeEditor.AddMethod(object.method);
          return false;
       }
 
@@ -629,7 +629,7 @@ class Sheet : Window
       this, bevelOver = true, checked = true, inactive = true, position = { 0, 25 }, size = { 24, 24 };
       bitmap = { "<:ecere>elements/orderCategorized.png" };
       // isRadio = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          if(!categorized.checked)
@@ -654,7 +654,7 @@ class Sheet : Window
             dropBox.Clear();
             dropField.userData = codeEditor;
             methodName.userData = codeEditor;
-            
+
             if(codeEditor)
                codeEditor.EnumerateObjects(this);
           }
@@ -697,9 +697,9 @@ class Sheet : Window
       else if(key == escape)
       {
          Window activeClient = ide.activeClient;
-         if(activeClient) 
+         if(activeClient)
             activeClient.Activate();
-         else 
+         else
             ide.RepositionWindows(true);
       }
       return true;
@@ -721,7 +721,7 @@ class Sheet : Window
    {
       DataRow row = dropBox.currentRow;
       ObjectInfo selected = row ? (ObjectInfo)row.tag : null;
-      
+
       //int scroll = 0;
       bool categorized = this.categorized.checked;
       bool currentRow = false;
@@ -737,7 +737,7 @@ class Sheet : Window
             char * propName;
             while(propRow && propRow.parent && !propRow.parent.isHeader)
                propRow = row.parent;
-            
+
             propName = propRow.GetData(propertyName);
             strcpy(this.selectedProp, propName);
             selectedScroll = properties.scroll.y;
@@ -780,7 +780,7 @@ class Sheet : Window
                if(propIt.isProperty)
                {
                   Property prop = eClass_FindProperty(selected.instance._class, propIt.name, GetPrivateModule());
-                  
+
                   if(prop && prop.Set && prop.Get && prop.compiled && (!prop.category || strcmpi(prop.category, $"Deprecated")))
                   {
                      bool disabled = Code_IsPropertyDisabled(selected, prop.name);
@@ -791,7 +791,7 @@ class Sheet : Window
 
                      if(!strcmp(_class.name, "DesignerBase"))
                         disabled = true;
-                     bold = !disabled && Code_IsPropertyModified(test, selected, prop);                           
+                     bold = !disabled && Code_IsPropertyModified(test, selected, prop);
 
                      if(dataType)
                      {
@@ -801,7 +801,7 @@ class Sheet : Window
                         Category category = categories.FindName(name, false);
 
                         // Hide properties like this for now..
-                        if(name && !strcmp(name, "Private")) 
+                        if(name && !strcmp(name, "Private"))
                         {
                            delete info;
                            continue;
@@ -841,7 +841,7 @@ class Sheet : Window
                         if(!dataType.noExpansion && (dataType.type == structClass || dataType.type == normalClass || dataType.type == noHeadClass || dataType.type == bitClass))
                         {
                            DataMember member;
-                           
+
                            if(clear)
                               row.collapsed = true;
 
@@ -862,7 +862,7 @@ class Sheet : Window
                                     }
                                     else
                                        subRow = row.FindRow((int64)subProp);
-                                    
+
                                     subRow.SetData(propertyName, subProp.name);
                                     subRow.SetData(propertyValue, info);
                                  }
@@ -917,7 +917,7 @@ class Sheet : Window
             if(!properties.currentRow)
             {
                bool found = false;
-               
+
                for(_class = selected.instance._class; _class; _class = _class.base)
                {
                   Property prop;
@@ -933,7 +933,7 @@ class Sheet : Window
                            row = category ? (categorized ? category.row.FindRow((int64)prop) : properties.FindRow((int64)prop)) : null;
                            properties.currentRow = row;
                            found = true;
-                           break;                                                                                                                              
+                           break;
                         }
                      }
                   }
@@ -971,10 +971,10 @@ class Sheet : Window
       }
 
       row = (DataRow)dropBox.AddRowAfter(after);
-      
+
       row.tag = (int64)object;
 
-      codeObject = 
+      codeObject =
       {
          object = object;
          name = name;
@@ -989,7 +989,7 @@ class Sheet : Window
          codeObject.bitmap = { bitmap };
          AddResource(codeObject.bitmap);
       }
-      
+
       row.SetData(null, codeObject);
 
       if(select)
@@ -1006,7 +1006,7 @@ class Sheet : Window
       if(row)
       {
          CodeObject codeObject = row.GetData(null);
-     
+
          if(codeObject.bitmap)
             RemoveResource(codeObject.bitmap);
          dropBox.DeleteRow(row);
@@ -1045,7 +1045,7 @@ class Sheet : Window
       Property prop = propertyPtr ? propertyPtr.prop : null;
       Instance object = this.object;
       if(prop)
-      {   
+      {
          Class dataType = prop.dataTypeClass;
          if(!dataType)
             dataType = prop.dataTypeClass = eSystem_FindClass(codeEditor.privateModule, prop.dataTypeString);
@@ -1143,7 +1143,7 @@ class Sheet : Window
          else
          {
             SetPropValue(prop, object, (uint32)setValue);
-         }      
+         }
          Code_FixProperty(propertyPtr.prop, object);
 
          properties.Update(null);
@@ -1209,7 +1209,7 @@ class Sheet : Window
       ClassFunction function = (ClassFunction)selection.id;
       CodeObject object = methods.GetData(methodName);
       if(object)
-         codeEditor.AddMethod(object.method);   
+         codeEditor.AddMethod(object.method);
       return true;
    }
 
@@ -1244,14 +1244,14 @@ class Sheet : Window
    {
       DataRow row = (DataRow)button.id;
       CodeObject object = row.GetData(methodName);
-      codeEditor.AddMethod(object.method);   
+      codeEditor.AddMethod(object.method);
       return true;
    }
 
    void CreateButtons(CodeObject codeObject, int y, int h, DataRow row)
    {
       BitmapResource bitmap;
-      
+
       if(codeObject.overriden)
       {
          if(codeObject.overriden == 1)
@@ -1276,7 +1276,7 @@ class Sheet : Window
                      sprintf(title, $"Delete %s", codeObject.name);
                      if(MessageBox
                         {
-                           master = parent, type = okCancel, text = title, 
+                           master = parent, type = okCancel, text = title,
                            contents = $"Method still contains code. Are you sure you want to delete it?"
                         }.Modal() == ok)
                         confirmation = false;
@@ -1308,7 +1308,7 @@ class Sheet : Window
 
          if(codeObject.overriden == 2 || !codeObject.function.attached.count)
          {
-            codeObject.detachBtn = Button 
+            codeObject.detachBtn = Button
             {
                methods,
                master = methods.master,
@@ -1353,7 +1353,7 @@ class Sheet : Window
                   PopupMenu popupMenu;
 
                   Menu menu { };
-                  
+
                   for(compatible = object.compatible.first; compatible; compatible = compatible.next)
                   {
                      ClassFunction function = compatible.data;
@@ -1362,8 +1362,8 @@ class Sheet : Window
                   attachMethod = object.method;
 
                   popupMenu = PopupMenu
-                  { 
-                     master = this, menu = menu, 
+                  {
+                     master = this, menu = menu,
                      position =
                      {
                         button.absPosition.x - app.desktop.position.x,
@@ -1409,7 +1409,7 @@ static void CopyInstanceData(Class dataType, Instance propObject, Instance curre
    {
       DataMember member;
       for(member = _class.membersAndProperties.first; member; member = member.next)
-      {               
+      {
          Class memberType = member.dataTypeClass;
          if(!memberType)
             memberType = member.dataTypeClass = eSystem_FindClass(((Designer)GetActiveDesigner()).codeEditor.privateModule, member.dataTypeString);
@@ -1448,7 +1448,7 @@ public:
 
       surface.TextFont(font.font);
       if(disabled)
-      {  
+      {
          surface.SetBackground(Color { 170, 170, 170 });
          surface.Area(0,0, x+width-1, y+100);
       }
@@ -1458,13 +1458,13 @@ public:
          Module module = ((Designer)GetActiveDesigner()).codeEditor.privateModule;
          if(!dataType)
             dataType = prop.dataTypeClass = eSystem_FindClass(module, prop.dataTypeString);
-         
+
          if(dataType && prop.Get)
          {
             void * dataPtr, * data = null, * subData = null;
             DataValue valueData, valueSubData;
             uint64 bitValue;
-            
+
             // Get main prop
             if(dataType.type == structClass)
             {
@@ -1481,7 +1481,7 @@ public:
                else
                   dataPtr = &valueData;
             }
-            
+
             // Get sub prop
             if(this.subMember)
             {
@@ -1542,7 +1542,7 @@ public:
    {
       Window editData = null;
       Property prop = this.prop;
-      
+
       dataBox.SetData = Sheet::EditSetData;
       if(prop && prop.dataTypeString && !this.disabled)
       {
@@ -1557,7 +1557,7 @@ public:
             void * dataPtr, * data = null, * subData = null;
             DataValue valueData, valueSubData;
             uint64 bitValue;
-            
+
             // Get main prop
             if(dataType.type == structClass)
             {
@@ -1573,7 +1573,7 @@ public:
                else
                   dataPtr = &valueData;
             }
-            
+
             // Get sub prop
             if(this.subMember)
             {
@@ -1653,7 +1653,7 @@ public:
 
       if(!category1) category1 = $"Misc";
       if(!category2) category2 = $"Misc";
-      
+
       if(!prop)
       {
          // result = String::OnCompare((String)category1, (String)category2);
@@ -1726,7 +1726,7 @@ public:
          if(!mainDataType)
             mainDataType = prop.dataTypeClass = eSystem_FindClass(((Designer)GetActiveDesigner()).codeEditor.privateModule, prop.dataTypeString);
          dataType = mainDataType;
-         
+
          // Prepare main prop
          if(dataType.type == structClass)
          {
@@ -1739,7 +1739,7 @@ public:
          else if(dataType.type == normalClass || dataType.type == noHeadClass)
          {
             dataPtr = &valueData;
-            
+
             if(this.subMember || this.subProperty)
             {
                Class _class;
@@ -1750,14 +1750,14 @@ public:
          }
          else
          {
-            
+
             if(this.subMember || this.subProperty)
                GetProperty(prop, object, &valueData);
-            
+
             dataPtr = &valueData;
             propObject = &valueData;
          }
-         
+
          // Prepare sub prop
          if(this.subMember)
          {
@@ -1778,9 +1778,9 @@ public:
          {
             Property subProperty = this.subProperty;
             Class subDataType = subProperty.dataTypeClass;
-            
+
             if(!subDataType)
-               subDataType = subProperty.dataTypeClass = 
+               subDataType = subProperty.dataTypeClass =
                   eSystem_FindClass(((Designer)GetActiveDesigner()).codeEditor.privateModule, subProperty.dataTypeString);
             if(!subProperty.Get) subDataType = null;
             if(subDataType)
@@ -1820,7 +1820,7 @@ public:
                         ((void(*)(void *,byte))(void *)this.subProperty.Set)(propObject, valueSubData.uc);
                      else if(!strcmp(dataType.dataTypeString, "uint16"))
                         ((void(*)(void *,uint16))(void *)this.subProperty.Set)(propObject, valueSubData.us);
-                     else 
+                     else
                         ((void (*)(void *, uint))(void *)this.subProperty.Set)(propObject, valueSubData.ui);
                   }
                   else
index 34ba2b9..03fdc77 100644 (file)
@@ -61,7 +61,7 @@ class ToolBox : Window
    {
       set
       {
-         if(value != selectedClass || 
+         if(value != selectedClass ||
             (value && value.instance && (!selectedClass.instance || selectedClass.instance._class != value.instance._class)))
          {
             Button control, next;
@@ -141,7 +141,7 @@ class ToolBox : Window
       {
          ((Designer)GetActiveDesigner()).isDragging = false;
          ReleaseCapture();
-         return rootWindow.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonUp, 
+         return rootWindow.MouseMessage(__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonUp,
             x + absPosition.x + clientStart.x, y + absPosition.y + clientStart.y, &mods, false, false);
       }
       return true;
index 774cd9a..637019b 100644 (file)
@@ -13,19 +13,19 @@ static bool isAfterEqual;
 
 static bool InsideIncl(Location loc, int line, int charPos)
 {
-   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) && 
+   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) &&
           (loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
 }
 
 static bool Inside(Location loc, int line, int charPos)
 {
-   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) && 
+   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
           (loc.end.line > line || (loc.end.line == line && loc.end.charPos > charPos));
 }
 
 static bool InsideEndIncl(Location loc, int line, int charPos)
 {
-   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) && 
+   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
           (loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
 }
 
@@ -197,7 +197,7 @@ Identifier FindCtxExpression(Expression exp, int line, int charPos)
       case bracketsExp:
       {
          Expression expression;
-         
+
          for(expression = exp.list->first; expression; expression = expression.next)
          {
             if(InsideIncl(&expression.loc, line, charPos))
@@ -216,7 +216,7 @@ Identifier FindCtxExpression(Expression exp, int line, int charPos)
             idResult = FindCtxExpression(exp.index.exp, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          for(expression = exp.index.index->first; expression; expression = expression.next)
          {
             if(InsideIncl(&expression.loc, line, charPos))
@@ -237,10 +237,10 @@ Identifier FindCtxExpression(Expression exp, int line, int charPos)
             idResult = FindCtxExpression(exp.call.exp, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          if(exp.call.argLoc.start.line > line || (line == exp.call.argLoc.start.line && exp.call.argLoc.start.charPos >= charPos))
             arg = -1;
-         else 
+         else
             arg = 0;
 
          if(exp.call.arguments)
@@ -248,14 +248,14 @@ Identifier FindCtxExpression(Expression exp, int line, int charPos)
             Expression expression;
 
             ctxInsideExp = null;
+
             for(expression = exp.call.arguments->first; expression; expression = expression.next)
             {
                if(InsideIncl(&expression.loc, line, charPos) || (expression.loc.end.line > line || (line == expression.loc.end.line && expression.loc.end.charPos > charPos)))
                {
                   if(Inside(&expression.loc, line, charPos))
                      idResult = FindCtxExpression(expression, line, charPos);
-                  
+
                   // Break
                   break;
                }
@@ -279,7 +279,7 @@ Identifier FindCtxExpression(Expression exp, int line, int charPos)
                   return idResult ? idResult : (void *)-1;
                }
             }
-            if(idResult) 
+            if(idResult)
                return idResult;
          }
          break;
@@ -337,10 +337,10 @@ Identifier FindCtxExpression(Expression exp, int line, int charPos)
       case dummyExp:
          return (void *)-2;
    }
-   
+
    if(exp.destType && !exp.destType.truth) // && !exp.addedThis)
       return (void *)-1;
-   
+
    ctxInsideExp = oldExp;
    return null;
 }
@@ -516,13 +516,13 @@ static Identifier FindCtxStatement(Statement stmt, int line, int charPos)
             idResult = FindCtxStatement(stmt.forStmt.init, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          if(stmt.forStmt.check && InsideIncl(&stmt.forStmt.check.loc, line, charPos))
          {
             idResult = FindCtxStatement(stmt.forStmt.check, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          if(stmt.forStmt.increment)
          {
             for(exp = stmt.forStmt.increment->first; exp; exp = exp.next)
@@ -549,7 +549,7 @@ static Identifier FindCtxStatement(Statement stmt, int line, int charPos)
          if(stmt.expressions)
          {
             Expression exp;
-            
+
             for(exp = stmt.expressions->first; exp; exp = exp.next)
             {
                if(InsideIncl(&exp.loc, line, charPos))
@@ -625,7 +625,7 @@ static Identifier FindCtxInitializer(Initializer initializer, int line, int char
       {
          Initializer init;
          Identifier idResult;
-         
+
          for(init = initializer.list->first; init; init = init.next)
          {
             if(InsideIncl(&init.loc, line, charPos))
@@ -659,7 +659,7 @@ static Identifier FindCtxInitDeclarator(InitDeclarator decl, int line, int charP
 static Identifier FindCtxDeclaration(Declaration decl, int line, int charPos)
 {
    Identifier idResult;
-   
+
    switch(decl.type)
    {
       case structDeclaration:
@@ -686,7 +686,7 @@ static Identifier FindCtxDeclaration(Declaration decl, int line, int charPos)
                   if(d.type == DeclaratorStruct && d.declarator && d.declarator.type == DeclaratorIdentifier)
                      return d.declarator.identifier;
                }
-            }   
+            }
          }
          */
          break;
@@ -718,7 +718,7 @@ static Identifier FindCtxDeclaration(Declaration decl, int line, int charPos)
                   idResult = FindCtxInitDeclarator(d, line, charPos);
                   if(idResult) return idResult;
                }
-            }   
+            }
          }
          break;
       }
@@ -735,7 +735,7 @@ static Identifier FindCtxFunction(FunctionDefinition func, int line, int charPos
    if(func.body && Inside(&func.body.loc, line, charPos))
    {
       Identifier idResult;
-      
+
       Identifier id = GetDeclId(func.declarator);
       Symbol symbol = func.declarator.symbol;
       Type type = symbol.type;
@@ -816,7 +816,7 @@ static Identifier FindCtxInstance(Instantiation inst, int line, int charPos)
       MembersInit init;
       MemberInit memberInit;
       for(init = inst.members->first; init; init = init.next)
-      {         
+      {
          if(init.loc.start.line > line || (line == init.loc.start.line && init.loc.start.charPos > charPos))
             break;
 
@@ -938,7 +938,7 @@ static Identifier FindCtxClassFunction(ClassFunction func, int line, int charPos
    if(func.body && Inside(&func.body.loc, line, charPos))
    {
       Identifier idResult;
-      
+
       Identifier id = GetDeclId(func.declarator);
       Symbol symbol = func.declarator ? func.declarator.symbol : null;
       Type type = symbol ? symbol.type : null;
@@ -1139,7 +1139,7 @@ Identifier FindCtxTree(OldList ast, int line, int charPos)
       {
          switch(external.type)
          {
-            case functionExternal: 
+            case functionExternal:
                if(Inside(&external.loc, line, charPos))
                {
                   idResult = FindCtxFunction(external.function, line, charPos);
@@ -1147,7 +1147,7 @@ Identifier FindCtxTree(OldList ast, int line, int charPos)
                      return (idResult == (void *)-1 || idResult == (void *)-2) ? null : idResult;
                }
                break;
-            case declarationExternal: 
+            case declarationExternal:
                if(InsideIncl(&external.loc, line, charPos))
                {
                   idResult = FindCtxDeclaration(external.declaration, line, charPos);
@@ -1155,7 +1155,7 @@ Identifier FindCtxTree(OldList ast, int line, int charPos)
                      return (idResult == (void *)-1 || idResult == (void *)-2) ? null : idResult;
                }
                break;
-            case classExternal: 
+            case classExternal:
                if(Inside(&external._class.loc, line, charPos))
                {
                   currentClass = external._class.symbol.registered;
index d196a2d..8b9e971 100644 (file)
@@ -6,7 +6,7 @@ static Class currentClass;
 
 static bool Inside(Location loc, int line, int charPos)
 {
-   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) && 
+   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) &&
           (loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
 }
 
@@ -35,7 +35,7 @@ Expression FindExpExpression(Expression exp, int line, int charPos)
          }
          break;
       case identifierExp:
-         
+
          break;
       case instanceExp:
          if(Inside(&exp.instance.loc, line, charPos))
@@ -69,7 +69,7 @@ Expression FindExpExpression(Expression exp, int line, int charPos)
       case bracketsExp:
       {
          Expression expression;
-         
+
          for(expression = exp.list->first; expression; expression = expression.next)
          {
             if(Inside(&expression.loc, line, charPos))
@@ -88,7 +88,7 @@ Expression FindExpExpression(Expression exp, int line, int charPos)
             expResult = FindExpExpression(exp.index.exp, line, charPos);
             if(expResult) return expResult;
          }
-         
+
          for(expression = exp.index.index->first; expression; expression = expression.next)
          {
             if(Inside(&expression.loc, line, charPos))
@@ -106,7 +106,7 @@ Expression FindExpExpression(Expression exp, int line, int charPos)
             expResult = FindExpExpression(exp.call.exp, line, charPos);
             if(expResult) return expResult;
          }
-         
+
          if(exp.call.arguments)
          {
             Expression expression;
@@ -357,13 +357,13 @@ static Expression FindExpStatement(Statement stmt, int line, int charPos)
             expResult = FindExpStatement(stmt.forStmt.init, line, charPos);
             if(expResult) return expResult;
          }
-         
+
          if(stmt.forStmt.check && Inside(&stmt.forStmt.check.loc, line, charPos))
          {
             expResult = FindExpStatement(stmt.forStmt.check, line, charPos);
             if(expResult) return expResult;
          }
-         
+
          if(stmt.forStmt.increment)
          {
             for(exp = stmt.forStmt.increment->first; exp; exp = exp.next)
@@ -390,7 +390,7 @@ static Expression FindExpStatement(Statement stmt, int line, int charPos)
          if(stmt.expressions)
          {
             Expression exp;
-            
+
             for(exp = stmt.expressions->first; exp; exp = exp.next)
             {
                if(Inside(&exp.loc, line, charPos))
@@ -441,7 +441,7 @@ static Expression FindExpStatement(Statement stmt, int line, int charPos)
                }
             }
          }
-         break;   
+         break;
       }
    }
    return null;
@@ -455,7 +455,7 @@ static Expression FindExpInitializer(Initializer initializer, int line, int char
       {
          Initializer init;
          Expression expResult;
-         
+
          for(init = initializer.list->first; init; init = init.next)
          {
             if(Inside(&init.loc, line, charPos))
@@ -570,7 +570,7 @@ static Expression FindExpSpecifier(Specifier spec, int line, int charPos)
 static Expression FindExpDeclaration(Declaration decl, int line, int charPos)
 {
    Expression expResult;
-   
+
    switch(decl.type)
    {
       case structDeclaration:
@@ -616,7 +616,7 @@ static Expression FindExpDeclaration(Declaration decl, int line, int charPos)
                   expResult = FindExpInitDeclarator(d, line, charPos);
                   if(expResult) return expResult;
                }
-            }   
+            }
          }
          break;
       }
@@ -633,7 +633,7 @@ static Expression FindExpFunction(FunctionDefinition func, int line, int charPos
    if(func.body && Inside(&func.body.loc, line, charPos))
    {
       Expression result;
-      
+
       Identifier id = GetDeclId(func.declarator);
       Symbol symbol = func.declarator.symbol;
       Type type = symbol.type;
@@ -706,7 +706,7 @@ static Expression FindExpClassFunction(ClassFunction func, int line, int charPos
    if(func.body && Inside(&func.body.loc, line, charPos))
    {
       Expression result;
-      
+
       Identifier id = GetDeclId(func.declarator);
       Symbol symbol = func.declarator ? func.declarator.symbol : null;
       Type type = symbol?symbol.type:null;
@@ -828,17 +828,17 @@ Expression FindExpTree(OldList ast, int line, int charPos)
          {
             switch(external.type)
             {
-               case functionExternal: 
+               case functionExternal:
                   expResult = FindExpFunction(external.function, line, charPos);
                   if(expResult)
                      return expResult;
                   break;
-               case declarationExternal: 
+               case declarationExternal:
                   expResult = FindExpDeclaration(external.declaration, line, charPos);
                   if(expResult)
                      return expResult;
                   break;
-               case classExternal: 
+               case classExternal:
                   currentClass = external._class.symbol.registered;
                   expResult = FindExpClass(external._class, line, charPos);
                   currentClass = null;
index fa7fcae..2c98519 100644 (file)
@@ -16,22 +16,22 @@ static bool allocedDummyExp;
 static bool InsideIncl(Location loc, int line, int charPos)
 {
    /*
-   return (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) && 
+   return (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) &&
           (loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
           */
-   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) && 
+   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) &&
           (loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
 }
 
 static bool Inside(Location loc, int line, int charPos)
 {
-   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) && 
+   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
           (loc.end.line > line || (loc.end.line == line && loc.end.charPos > charPos));
 }
 
 static bool InsideEndIncl(Location loc, int line, int charPos)
 {
-   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) && 
+   return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
           (loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
 }
 
@@ -110,7 +110,7 @@ Identifier FindParamsExpression(Expression exp, int line, int charPos)
       case bracketsExp:
       {
          Expression expression;
-         
+
          for(expression = exp.list->first; expression; expression = expression.next)
          {
             if(InsideIncl(&expression.loc, line, charPos))
@@ -129,7 +129,7 @@ Identifier FindParamsExpression(Expression exp, int line, int charPos)
             idResult = FindParamsExpression(exp.index.exp, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          for(expression = exp.index.index->first; expression; expression = expression.next)
          {
             if(InsideIncl(&expression.loc, line, charPos))
@@ -152,15 +152,15 @@ Identifier FindParamsExpression(Expression exp, int line, int charPos)
             if(!functionType && !instanceType)
             {
                functionType = type;
-               if(paramsInsideExp == exp.call.exp) 
+               if(paramsInsideExp == exp.call.exp)
                   paramsInsideExp = exp;
             }
             if(idResult) return idResult;
          }
-         
+
          if(exp.call.argLoc.start.line > line || (line == exp.call.argLoc.start.line && exp.call.argLoc.start.charPos >= charPos))
             arg = -1;
-         else 
+         else
             arg = 0;
 
          if(exp.call.arguments)
@@ -429,13 +429,13 @@ static Identifier FindParamsStatement(Statement stmt, int line, int charPos)
             idResult = FindParamsStatement(stmt.forStmt.init, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          if(stmt.forStmt.check && InsideIncl(&stmt.forStmt.check.loc, line, charPos))
          {
             idResult = FindParamsStatement(stmt.forStmt.check, line, charPos);
             if(idResult) return idResult;
          }
-         
+
          if(stmt.forStmt.increment)
          {
             for(exp = stmt.forStmt.increment->first; exp; exp = exp.next)
@@ -462,7 +462,7 @@ static Identifier FindParamsStatement(Statement stmt, int line, int charPos)
          if(stmt.expressions)
          {
             Expression exp;
-            
+
             for(exp = stmt.expressions->first; exp; exp = exp.next)
             {
                if(InsideIncl(&exp.loc, line, charPos))
@@ -538,7 +538,7 @@ static Identifier FindParamsInitializer(Initializer initializer, int line, int c
       {
          Initializer init;
          Identifier idResult;
-         
+
          for(init = initializer.list->first; init; init = init.next)
          {
             if(InsideIncl(&init.loc, line, charPos))
@@ -658,7 +658,7 @@ static Identifier FindParamsSpecifier(Specifier spec, int line, int charPos)
 static Identifier FindParamsDeclaration(Declaration decl, int line, int charPos)
 {
    Identifier idResult;
-   
+
    switch(decl.type)
    {
       case structDeclaration:
@@ -704,7 +704,7 @@ static Identifier FindParamsDeclaration(Declaration decl, int line, int charPos)
                   idResult = FindParamsInitDeclarator(d, line, charPos);
                   if(idResult) return idResult;
                }
-            }   
+            }
          }
          break;
       }
@@ -721,7 +721,7 @@ static Identifier FindParamsFunction(FunctionDefinition func, int line, int char
    if(func.body && Inside(&func.body.loc, line, charPos))
    {
       Identifier idResult;
-      
+
       Identifier id = GetDeclId(func.declarator);
       Symbol symbol = func.declarator.symbol;
       Type type = symbol.type;
@@ -877,7 +877,7 @@ static Identifier FindParamsInstance(Instantiation inst, int line, int charPos)
    }
    if(!insideParams && sym && sym.registered && InsideIncl(&inst.insideLoc, line, charPos) && insideBrackets && !insideSomething)
    {
-      if(dataMember && !method) 
+      if(dataMember && !method)
       {
          if(!dataMember.dataType)
             dataMember.dataType = ProcessTypeString(dataMember.dataTypeString, false);
@@ -933,7 +933,7 @@ static Identifier FindParamsClassFunction(ClassFunction func, int line, int char
    if(func.body && Inside(&func.body.loc, line, charPos))
    {
       Identifier idResult;
-      
+
       Identifier id = GetDeclId(func.declarator);
       Symbol symbol = func.declarator ? func.declarator.symbol : null;
       Type type = symbol ? symbol.type : null;
@@ -1095,7 +1095,7 @@ Identifier FindParamsTree(OldList ast, int line, int charPos)
       {
          switch(external.type)
          {
-            case functionExternal: 
+            case functionExternal:
                if(Inside(&external.loc, line, charPos))
                {
                   idResult = FindParamsFunction(external.function, line, charPos);
@@ -1103,7 +1103,7 @@ Identifier FindParamsTree(OldList ast, int line, int charPos)
                      return (idResult == (void *)-1) ? null : idResult;
                }
                break;
-            case declarationExternal: 
+            case declarationExternal:
                if(InsideIncl(&external.loc, line, charPos))
                {
                   idResult = FindParamsDeclaration(external.declaration, line, charPos);
index 12e6a98..b6b5d33 100644 (file)
@@ -25,7 +25,7 @@ class ActiveCompilerDialog : Window
          return true;
       }*/
    };
-   
+
    Button cancel
    {
       this, size = { 80 }, position = { 480, 8 };
index 1cf2e00..c20f909 100644 (file)
@@ -18,7 +18,7 @@ class CompilersDetectionDialog : Window
    text = $"Compilers Detection";
 
    CompilerType selectedCompilerType;
-   
+
    //property Array<NamedString> compilerEnvVars
    property CompilerConfig compilerConfig
    {
@@ -63,8 +63,8 @@ class CompilersDetectionDialog : Window
                               equal[0] = '\0';
                               TrimLSpaces(var, var);
                               TrimRSpaces(var, var);
-                              if(!strcmpi(var, "VSINSTALLDIR") || !strcmpi(var, "VCINSTALLDIR") || 
-                                    !strcmpi(var, "FrameworkDir") || !strcmpi(var, "FrameworkVersion") || !strcmpi(var, "FrameworkSDKDir") || 
+                              if(!strcmpi(var, "VSINSTALLDIR") || !strcmpi(var, "VCINSTALLDIR") ||
+                                    !strcmpi(var, "FrameworkDir") || !strcmpi(var, "FrameworkVersion") || !strcmpi(var, "FrameworkSDKDir") ||
                                     !strcmpi(var, "DevEnvDir") || !strcmpi(var, "LIBPATH"))
                               {
                                  result.environmentVars.Add(NamedString { name = CopyString(var), string = CopyString(val) });
@@ -136,7 +136,7 @@ class CompilersDetectionDialog : Window
          return true;
       }
    };
-   
+
    Button
    {
       this, hotKey = escape, text = $"Cancel";
index 297fbb7..0a91332 100644 (file)
@@ -14,7 +14,7 @@ class FindInFilesDialog : Window
    tabCycle = true;
    size = { 440, 208 };
    autoCreate = false;
-   
+
 public:
    property char * searchString { set { findContent.contents = value; } get { return findContent.contents; } };
    property bool contentWholeWord { set { contentWholeWord.checked = value; } get { return contentWholeWord.checked; } };
@@ -433,7 +433,7 @@ private:
          return true;
       }
    };
-   
+
    SearchThread searchThread { findDialog = this };
    FileDialog fileDialog { master = this, type = selectDir, text = $"Select Search Location..." };
 
@@ -500,7 +500,7 @@ private:
 
       findWhere.disabled = disabled;
       subDirs.disabled = disabled;*/
-      
+
       findContent.Activate();
       return true;
    }
@@ -508,7 +508,7 @@ private:
    void SearchStart()
    {
       char text[2048];
-      
+
       searchThread.active = true;
       searchThread.project = null;
       searchThread.projectNode = null;
@@ -534,7 +534,7 @@ private:
       //searchThread.nameWholeWord = nameWholeWord.checked;
       searchThread.contentMatchCase = contentMatchCase.checked;
       searchThread.contentWholeWord = contentWholeWord.checked;
-      
+
       searchThread.filter = filters[fileFilter];
 
       strcpy(searchThread.nameCriteria, fileName.contents);
@@ -544,11 +544,11 @@ private:
       searchThread.replaceMode = replaceMode;
 
       //cancel.text = "Stop";
-      
+
       ide.outputView.ShowClearSelectTab(find);
 
       Destroy(0);
-      
+
       searchThread.Create();
    }
 
@@ -654,7 +654,7 @@ private:
       //double lastTime = GetTime();
       SearchStackFrame stack[stackSize];
       FindInFilesMode mode = this.mode;
-      
+
       EditBox replaceEdit = null;
 
       abort = false;
@@ -701,12 +701,12 @@ private:
                      project.name, filterName, substring, and, containing);
          }
       app.Unlock();
-      
+
       if(replaceMode)
       {
          replaceEdit = EditBox
          {
-            multiLine = true,textHorzScroll = true,textVertScroll = true, 
+            multiLine = true,textHorzScroll = true,textVertScroll = true,
             text = $"Replacing Editbox", size = Size { 640,480 }/*,maxLineSize = 65536*/
          };
       }
@@ -714,7 +714,7 @@ private:
       if(mode == directory)
       {
          strcpy(stack[0].path, dir);
-         stack[0].fileList = FileListing { dir, extensions = filter.extensions };  // there should be a sorted = true/false 
+         stack[0].fileList = FileListing { dir, extensions = filter.extensions };  // there should be a sorted = true/false
 
          for(frame = 0; frame >= 0 && frame < stackSize && !abort; )
          {
@@ -736,7 +736,7 @@ private:
                   {
                      MakePathRelative(stack[frame].fileList.path, dir, fileRelative);
                      relative = true;
-                     
+
                      filesSearchedCount++;
                      if(match && contentCriteria[0])
                      {
@@ -856,7 +856,7 @@ private:
                      }
                      break;
                   case file:
-                  {   
+                  {
                      bool relative = true;
                      char fileRelative[MAX_LOCATION];
                      char filePath[MAX_LOCATION];
@@ -1132,7 +1132,7 @@ private:
             // todo
             /*else
                f.Seek(-strlen(contentCriteria), current);*/
-               
+
          }
          delete f;
          if(replaceCount)
index 0ae497a..680c0db 100644 (file)
@@ -22,14 +22,14 @@ class GlobalSettingsDialog : Window
    IDESettings ideSettings;
    IDESettingsContainer settingsContainer;
    String workspaceActiveCompiler;
-   
+
    TabControl tabControl { this, background = formColor, anchor = { left = 8, top = 8, right = 8, bottom = 40 } };
-   
+
    EditorTab editorTab { this, tabControl = tabControl };
    CompilersTab compilersTab { this, tabControl = tabControl };
    ProjectOptionsTab projectOptionsTab { this, tabControl = tabControl };
    WorkspaceOptionsTab workspaceOptionsTab { this, tabControl = tabControl };
-   
+
    property bool settingsModified
    {
       get
@@ -72,7 +72,7 @@ class GlobalSettingsDialog : Window
             bool compilerSettingsChanged = false;
             bool projectOptionsChanged = false;
             bool workspaceOptionsChanged = false;
-            
+
             if(editorTab.modifiedDocument)
             {
                if(editorTab.useFreeCaret.checked != ideSettings.useFreeCaret ||
@@ -85,7 +85,7 @@ class GlobalSettingsDialog : Window
                   editorSettingsChanged = true;
                }
             }
-            
+
             if(compilersTab.modifiedDocument)
             {
                Workspace workspace = ide.workspace;
@@ -138,7 +138,7 @@ class GlobalSettingsDialog : Window
             projectOptionsTab.modifiedDocument = false;
             workspaceOptionsTab.modifiedDocument = false;
          }
-         
+
          Destroy(DialogResult::ok);
          return true;
       }
@@ -193,7 +193,7 @@ class GlobalSettingsDialog : Window
          activateCompiler = readonlyCompiler;
       if(!activateCompiler && ideSettings.compilerConfigs.count)
          activateCompiler = ideSettings.compilerConfigs[0];
-      
+
       for(compiler : ideSettings.compilerConfigs)
          compilersTab.AddCompiler(compiler.Copy(), compiler == activateCompiler);
       compilersTab.compilerConfigsDir.path = ideSettings.compilerConfigsDir;
@@ -201,7 +201,7 @@ class GlobalSettingsDialog : Window
       // ProjectOptionsTab
       projectOptionsTab.defaultTargetDir.path = ideSettings.projectDefaultTargetDir;
       projectOptionsTab.defaultIntermediateObjDir.path = ideSettings.projectDefaultIntermediateObjDir;
-      
+
       return true;
    }
 
@@ -263,7 +263,7 @@ static void DrawStipple(Surface surface, Size clientSize)
 
    surface.LineStipple(0x5555);
    surface.Rectangle(x1, y1, x2, y2);
-   surface.LineStipple(0);            
+   surface.LineStipple(0);
 }
 
 class CompilersTab : GlobalSettingsSubTab
@@ -298,7 +298,7 @@ class CompilersTab : GlobalSettingsSubTab
          }
          return SelectorBar::OnKeyDown(key, ch);
       }
-      
+
       bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
       {
          ((CompilersTab)master).labelCompilers.Update(null);
@@ -322,7 +322,7 @@ class CompilersTab : GlobalSettingsSubTab
    };
 
    TabControl tabControl { this, background = formColor, anchor = { left = 8, top = 68, right = 8, bottom = 8 } };
-   
+
    CompilerDirectoriesTab dirsTab { this, tabControl = tabControl };
    CompilerToolchainTab toolchainTab { this, tabControl = tabControl };
    CompilerEnvironmentTab environmentTab { this, tabControl = tabControl };
@@ -621,10 +621,10 @@ class CompilerDirectoriesTab : CompilersSubTab
             }
          };
          incref dirs[c];
-         
+
          if(c)
             dirs[c].visible = false;
-         
+
          // (width) Should be 324 for text...
          //field[c] = { dataType = class(char *), editable = true };
          //dirs[c].AddField(field[c]);
@@ -657,7 +657,7 @@ class CompilerDirectoriesTab : CompilersSubTab
          else if(c == executables)
             dirTypeTglBtn[c].hotKey = altE;
          }
-      }   
+      }
       currentDirs = dirs[includes];
       dirTypeTglBtn[includes].checked = true;
       return true;
@@ -895,14 +895,14 @@ class CompilerOptionsTab : CompilersSubTab
       bool OnKeyDown(Key key, unichar ch)
       {
          if((SmartKey)key == enter)
-         {  
+         {
             DataBox::OnKeyDown(key, ch);
             return true;
          }
          else
             return DataBox::OnKeyDown(key, ch);
       }
-      
+
       bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
       {
          if(!active)
@@ -1087,7 +1087,7 @@ class CompilerOptionsTab : CompilersSubTab
          excludedLibraries.strings = compiler.excludeLibs;
          compilerFlags.strings = compiler.compilerFlags;
          linkerFlags.strings = compiler.linkerFlags;
-         
+
          labelTargetPlatform.disabled = disabled;
          targetPlatform.disabled = disabled;
 
@@ -1153,7 +1153,7 @@ class ProjectOptionsTab : GlobalSettingsSubTab
    };
 }
 
-// COMPILER TOFIX: if class GlobalSettingsSubTab is after class WorkspaceOptionsTab the OnPostCreate 
+// COMPILER TOFIX: if class GlobalSettingsSubTab is after class WorkspaceOptionsTab the OnPostCreate
 //                 of WorkspaceOptionsTab will *not* be called!
 class GlobalSettingsSubTab : Tab
 {
@@ -1196,7 +1196,7 @@ class WorkspaceOptionsTab : GlobalSettingsSubTab
          for(compiler : dialog.ideSettings.compilerConfigs)
          {
             row = defaultCompilerDropBox.AddString(compiler.name);
-            if(dialog.ideSettings.defaultCompiler && dialog.ideSettings.defaultCompiler[0] && 
+            if(dialog.ideSettings.defaultCompiler && dialog.ideSettings.defaultCompiler[0] &&
                   !strcmp(compiler.name, dialog.ideSettings.defaultCompiler))
                defaultCompilerDropBox.currentRow = row;
          }
index f938355..023b9bb 100644 (file)
@@ -231,7 +231,7 @@ class NewProjectDialog : Window
       parent = this, text = $"Create Form", hotKey = altF, position = { 200, 30 };
       isCheckbox = true, checked = true;
    };
-   
+
    EditBox projectName
    {
       parent = this, textHorzScroll = true, position = { 10, 30 }, size = { 160 };
@@ -395,7 +395,7 @@ class QuickProjectDialog : Window
             MessageBox { type = ok, master = this, text = tempDir, contents = $"Temporary directory does not exist." }.Modal();
             return true;
          }
-         
+
          ide.tmpPrjDir = tempDir;
 
          strcpy(filePath, tempDir);
@@ -408,7 +408,7 @@ class QuickProjectDialog : Window
          debug = ProjectConfig
          {
             name = CopyString("Debug");
-            options = 
+            options =
             {
                optimization = none;
                fastMath = false;
@@ -459,7 +459,7 @@ class QuickProjectDialog : Window
             strcpy(workspaceFile, filePath);
             ChangeExtension(workspaceFile, WorkspaceExtension, workspaceFile);
             workspace = Workspace { compiler = ideSettings.defaultCompiler, workspaceFile = workspaceFile };
-         } 
+         }
 
          workspace.projects.Add(project);
          ide.findInFilesDialog.AddProjectItem(project);
@@ -575,13 +575,13 @@ class QuickProjectDialog : Window
          return true;
       }
    };
-   
+
    Button
    {
       parent = this, position = { 240, 70 }, size = { 60 }, hotKey = escape, text = $"Cancel";
       NotifyClicked = ButtonCloseDialog;
    };
-   
+
    QuickProjectDialog()
    {
       DataRow row;
index 5cd4bd6..8a835c0 100644 (file)
@@ -22,7 +22,7 @@ class NodeProperties : Window
       anchor = { left = 10, top = 80, right = 10 };
       NotifyModified = PathNotifyModified;
    };
-   
+
    Label absolutePathLabel { parent = this, position = { 10, 110 }, labeledWindow = absolutePath };
    EditBox absolutePath
    {
@@ -30,7 +30,7 @@ class NodeProperties : Window
       position = { 10, 130 }, size = { 260 }, text = $"Absolute Path";
       anchor = { left = 10, top = 130, right = 10 };
    };
-   
+
    Label nameLabel { parent = this, position = { 10, 10 }, labeledWindow = name };
    EditBox name
    {
@@ -96,7 +96,7 @@ class NodeProperties : Window
       set
       {
          Size minSize = { 280, 260 };
-         
+
          // name              { 10,  10 }    { 10,  30 }
          // path              { 10,  60 }    { 10,  80 }
          // absolutePath      { 10, 110 }    { 10, 130 }
@@ -130,13 +130,13 @@ class NodeProperties : Window
                }
             }
 
-            // project:    - name path absolute - 
+            // project:    - name path absolute -
             // file
-            //   in res:   - name path absolute - 
-            //   not:      - name path absolute - 
+            //   in res:   - name path absolute -
+            //   not:      - name path absolute -
             // folder:     - name               -
             // resources:  - name path          -
-            
+
             {
                char * s;
                text = (s = PrintString(node.name, $" Properties"));
index 8d2739f..f85ed3a 100644 (file)
@@ -50,7 +50,7 @@ class ProjectActiveConfig : Window
          return true;
       }
    };
-   
+
    Button cancel
    {
       this, size = { 80 }, position = { 480, 8 };
@@ -64,5 +64,5 @@ class ProjectActiveConfig : Window
       this, position = { 160, 8 }, size = { 220 };
       text = $"Active Configuration", hotKey = altA;
    };
-   
+
 }
index 2babbb6..a882ff0 100644 (file)
@@ -22,7 +22,7 @@ class ProjectTab : Tab
       text = $"Module Version", hotKey = altV;
       NotifyModified = ProjectControlModified;
    };
-   
+
    Label lcompilerConfigsDir { this, position = { 8, 96 }, labeledWindow = compilerConfigsDir };
    PathBox compilerConfigsDir
    {
@@ -62,7 +62,7 @@ class ProjectTab : Tab
          project.description = s = description.multiLineContents; delete s;
          project.license = s = license.multiLineContents; delete s;
          project.compilerConfigsDir = compilerConfigsDir.path;
-         
+
          project.topNode.modified = true;
          project.ModifiedAllConfigs(true, false, true, false);
          ide.projectView.modifiedDocument = true;
index f0f60c7..a73bf58 100644 (file)
@@ -23,7 +23,7 @@ class ModelView : Window
       diffuse = white, specular = white;
    }; // light.diffuse.r = light.diffuse.g = light.diffuse.b = 1; light.specular.r = light.specular.g = light.specular.b = 1;
    Window help;
-   
+
    Timer timer
    {
       userData = this, delay = 0.05;
@@ -31,12 +31,12 @@ class ModelView : Window
       {
          if(model)
             model.Animate(model.frame + 1);
-            
+
          Update(null);
          return true;
       }
    };
-   
+
    property char * modelFile
    {
       set
@@ -85,7 +85,7 @@ class ModelView : Window
    {
       //eObject_Free(model, null);
    }
-   
+
    void OnRedraw(Surface surface)
    {
       surface.SetBackground(lightBlue);
@@ -189,7 +189,7 @@ class ModelView : Window
       {
          case wheelDown: case minus: camera.position.z *= 1.1111111f; break;
          case wheelUp: case equal: camera.position.z *= 0.9f; break;
-         
+
          /*
             case minus: camera.position.z += 10; break;
             case equal: camera.position.z -= 10; break;
index edebcc5..4957f35 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2003 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    pictureEdit.ec - Picture Editor Control
 ****************************************************************************/
 #ifdef ECERE_STATIC
@@ -47,9 +47,9 @@ class PictureEdit : Window
    float zoomFactor;
    char fileName[MAX_LOCATION];
    Bitmap bitmap;
-   
+
    //saveDialog = pictureEditFileDialog;
-   
+
    Menu fileMenu { menu, $"File", f }
       MenuItem { fileMenu, $"Save", s, ctrlS, NotifySelect = MenuFileSave };
       MenuItem { fileMenu, $"Save As...", a, NotifySelect = MenuFileSaveAs };
@@ -120,7 +120,7 @@ class PictureEdit : Window
             }
          };
          #endif
-   
+
    property char * bitmapFile
    {
       set
@@ -145,14 +145,14 @@ class PictureEdit : Window
                   clientSize = size;
 
                   /*
-                  Move(eWindow_GetStartX(window), eWindow_GetStartY(window), 
-                     (!eWindow_GetStartWidth(window)) ? (A_CLIENT|bitmap.width) : eWindow_GetStartWidth(window), 
+                  Move(eWindow_GetStartX(window), eWindow_GetStartY(window),
+                     (!eWindow_GetStartWidth(window)) ? (A_CLIENT|bitmap.width) : eWindow_GetStartWidth(window),
                      (!eWindow_GetStartHeight(window)) ? (A_CLIENT|bitmap.height) : eWindow_GetStartHeight(window));
                   */
 
                   /*
-                  Move(eWindow_GetStartX(window), eWindow_GetStartY(window), 
-                     (!) ? (A_CLIENT|bitmap.width) : eWindow_GetStartWidth(window), 
+                  Move(eWindow_GetStartX(window), eWindow_GetStartY(window),
+                     (!) ? (A_CLIENT|bitmap.width) : eWindow_GetStartWidth(window),
                      (!eWindow_GetStartHeight(window)) ? (A_CLIENT|bitmap.height) : eWindow_GetStartHeight(window));
                   */
                }
@@ -186,15 +186,15 @@ class PictureEdit : Window
          int h = (int)(bitmap.height * zoomFactor);
          if(w == bitmap.width && h == bitmap.height)
          {
-            surface.Blit(bitmap, 
-               Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2), 
+            surface.Blit(bitmap,
+               Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2),
                scroll.x, scroll.y, w, h);
          }
          else
          {
-            surface.Filter(bitmap, 
-               Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2), 
-               (int)(scroll.x / zoomFactor), (int)(scroll.y / zoomFactor), w, h, 
+            surface.Filter(bitmap,
+               Max(0, (clientSize.w - w) / 2), Max(0, (clientSize.h - h) / 2),
+               (int)(scroll.x / zoomFactor), (int)(scroll.y / zoomFactor), w, h,
                bitmap.width, bitmap.height);
          }
       }
@@ -214,16 +214,16 @@ class PictureEdit : Window
             if(bitmap && zoomFactor < 25)
             {
                float x = 0.5f, y = 0.5f;
-               if(bitmap.width * zoomFactor > clientSize.w) 
+               if(bitmap.width * zoomFactor > clientSize.w)
                   x = scroll.x / (bitmap.width * zoomFactor - clientSize.w);
-               if(bitmap.height * zoomFactor > clientSize.h) 
+               if(bitmap.height * zoomFactor > clientSize.h)
                   y = scroll.y / (bitmap.height * zoomFactor - clientSize.h);
 
                zoomFactor *= 1.5;
                scrollArea = Size { bitmap.width * zoomFactor,  bitmap.height * zoomFactor };
 
-               scroll = Point { 
-                     (int)(Max(0, bitmap.width * zoomFactor - clientSize.w) * x), 
+               scroll = Point {
+                     (int)(Max(0, bitmap.width * zoomFactor - clientSize.w) * x),
                      (int)(Max(0, bitmap.height * zoomFactor - clientSize.h) * y) };
 
                Update(null);
@@ -234,15 +234,15 @@ class PictureEdit : Window
             if(bitmap && zoomFactor > 0.05)
             {
                float x = 0.5f, y = 0.5f;
-               if(bitmap.width * zoomFactor > clientSize.w) 
+               if(bitmap.width * zoomFactor > clientSize.w)
                   x = scroll.x / (bitmap.width * zoomFactor - clientSize.w);
-               if(bitmap.height * zoomFactor > clientSize.w) 
+               if(bitmap.height * zoomFactor > clientSize.w)
                   y = scroll.y / (bitmap.height * zoomFactor - clientSize.h);
 
                zoomFactor /= 1.5;
                scrollArea = Size { bitmap.width * zoomFactor, bitmap.height * zoomFactor };
 
-               scroll = Point { 
+               scroll = Point {
                      (int)(Max(0, bitmap.width * zoomFactor - clientSize.w) * x),
                      (int)(Max(0, bitmap.height * zoomFactor - clientSize.h) * y) };
 
@@ -258,7 +258,7 @@ class PictureEdit : Window
       bool result = false;
       if(bitmap)
       {
-         if(bitmap.Save(fileName, 
+         if(bitmap.Save(fileName,
             ((FileType *)pictureEditFileDialog.types)[pictureEditFileDialog.fileType].typeExtension, (void *) bool::true))
          {
             modifiedDocument = false;
@@ -267,7 +267,7 @@ class PictureEdit : Window
       }
       return result;
    }
-   
+
    PictureEdit()
    {
       zoomFactor = 1.0f;
@@ -335,7 +335,7 @@ class AdjustHSV : Window
          double tolH = 1;
          double tolS = 1;
          double tolV = 1;
-         
+
          h = target.h - replace.h;
          s = target.s / replace.s;
          v = target.v / replace.v;
index 8c2d331..d23125a 100644 (file)
@@ -211,7 +211,7 @@ class IDEToolbar : ToolBar
 
    /* Edit options */
    // Cut
-   // Copy 
+   // Copy
    // Paste
    // Undo
    // Redo
@@ -420,7 +420,7 @@ class IDEWorkSpace : Window
    BitmapResource bmpTopFrameError     { ":codeMarks/topFrameError.png", window = this };
    BitmapResource bmpTopFrameHalf      { ":codeMarks/topFrameHalf.png", window = this };
    BitmapResource bmpTopFrameHalfError { ":codeMarks/topFrameHalfError.png", window = this };
-   
+
    Debugger debugger { };
 
    ProjectView projectView;
@@ -443,9 +443,9 @@ class IDEWorkSpace : Window
       {
          switch(key)
          {
-            case escape: 
+            case escape:
                if(activeBox != findBox || !ide.findInFilesDialog || !ide.findInFilesDialog.SearchAbort())
-                  ide.ShowCodeEditor(); 
+                  ide.ShowCodeEditor();
                break;
             default:
             {
@@ -565,7 +565,7 @@ class IDEWorkSpace : Window
          }
       }
    };
-   
+
    WatchesView watchesView { parent = this };
    ThreadsView threadsView
    {
@@ -648,7 +648,7 @@ class IDEWorkSpace : Window
                         gotWhatWeWant = true;
                   }
                   if(gotWhatWeWant ||
-                     MessageBox { type = yesNo, master = this, text = $"Error opening file", 
+                     MessageBox { type = yesNo, master = this, text = $"Error opening file",
                      contents = $"Open a different file?" }.Modal() == no)
                   {
                      if(!projectView && gotWhatWeWant)
@@ -783,7 +783,7 @@ class IDEWorkSpace : Window
       }
 
    MenuPlacement editMenu { menu, $"Edit", e };
-   
+
    Menu projectMenu { menu, $"Menu"."Project", p, hasMargin = true };
       MenuItem projectNewItem
       {
@@ -860,7 +860,7 @@ class IDEWorkSpace : Window
                {
                   if(OpenFile(ideProjectFileDialog.filePath, normal, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, add, mods.ctrl && mods.shift))
                      break;
-                  if(MessageBox { type = yesNo, master = this, text = $"Error opening project file", 
+                  if(MessageBox { type = yesNo, master = this, text = $"Error opening project file",
                         contents = $"Add a different project?" }.Modal() == no)
                   {
                      break;
@@ -1577,7 +1577,7 @@ class IDEWorkSpace : Window
       }
    };
 #endif
-   
+
    bool NotifySelectDisplayDriver(MenuItem selection, Modifiers mods)
    {
       //app.driver = app.drivers[selection.id];
@@ -1625,12 +1625,12 @@ class IDEWorkSpace : Window
       {
          this;
          fileName = fileName;
-         
+
          void NotifyDestroyed(Window window, DialogResult result)
          {
             projectView = null;
             text = titleECEREIDE;
-            
+
             AdjustMenus();
          }
       };
@@ -1690,10 +1690,10 @@ class IDEWorkSpace : Window
          bool outputVisible = expand ? false : outputView.visible;
          int topDistance = (callStackVisible || threadsVisible) ? 200 : 0;
          int bottomDistance = (outputVisible || watchesVisible || breakpointsVisible) ? 240 : 0;
-         
+
          for(child = firstChild; child; child = child.next)
          {
-            if(child._class == class(CodeEditor) || child._class == class(Designer) || 
+            if(child._class == class(CodeEditor) || child._class == class(Designer) ||
                child._class == class(Sheet) || child._class == class(ProjectView))
             {
                Anchor anchor = child.anchor;
@@ -1708,7 +1708,7 @@ class IDEWorkSpace : Window
             }
             else if(expand)
             {
-               if(child._class == class(OutputView) || child._class == class(CallStackView) || child._class == class(ThreadsView) || child._class == class(WatchesView) || 
+               if(child._class == class(OutputView) || child._class == class(CallStackView) || child._class == class(ThreadsView) || child._class == class(WatchesView) ||
                   child._class == class(BreakpointsView))
                   child.visible = false;
             }
@@ -1723,7 +1723,7 @@ class IDEWorkSpace : Window
       if(activeClient)
          activeClient.Activate();
       else if(projectView)
-      { 
+      {
          projectView.visible = true;
          projectView.Activate();
       }
@@ -2143,13 +2143,13 @@ class IDEWorkSpace : Window
    {
       if(debugger.isActive)
       {
-         if(MessageBox { type = yesNo, master = ide, 
-                           contents = $"Do you want to terminate the debugging session in progress?", 
+         if(MessageBox { type = yesNo, master = ide,
+                           contents = $"Do you want to terminate the debugging session in progress?",
                            text = title }.Modal() == no)
             return true;
          /*
-         MessageBox msg { type = yesNo, master = ide, 
-                           contents = "Do you want to terminate the debugging session in progress?", 
+         MessageBox msg { type = yesNo, master = ide,
+                           contents = "Do you want to terminate the debugging session in progress?",
                            text = title };
          if(msg.Modal() == no)
          {
@@ -2213,7 +2213,7 @@ class IDEWorkSpace : Window
                   {
                      Project project;
                      Workspace workspace = null;
-                     
+
                      if(FileExists(filePath))
                      {
                         if(!strcmp(extension, ProjectExtension))
@@ -2306,16 +2306,16 @@ class IDEWorkSpace : Window
 
                         findInFilesDialog.mode = FindInFilesMode::project;
                         findInFilesDialog.currentDirectory = ide.project.topNode.path;
-                        
+
                         {
                            char location[MAX_LOCATION];
                            StripLastDirectory(ide.project.topNode.path, location);
                            ChangeProjectFileDialogDirectory(location);
                         }
-                        
+
                         break;
                      }
-                     else 
+                     else
                      {
                         if(MessageBox { type = yesNo, master = this, text = $"Error opening project", contents = $"Open a different project?" }.Modal() == yes)
                         {
@@ -2351,7 +2351,7 @@ class IDEWorkSpace : Window
                }
                if(prj)
                {
-                  MessageBox { type = ok, parent = parent, master = this, text = $"Same Project", 
+                  MessageBox { type = ok, parent = parent, master = this, text = $"Same Project",
                         contents = $"This project is already present in workspace." }.Modal();
                }
                else
@@ -2407,8 +2407,8 @@ class IDEWorkSpace : Window
             !strcmp(extension, "jpeg") || !strcmp(extension, "png"))
       {
          if(FileExists(filePath))
-            document = PictureEdit { hasMaximize = true, hasMinimize = true, hasClose = true, borderStyle = sizable, 
-                                       hasVertScroll = true, hasHorzScroll = true, parent = this, state = state, 
+            document = PictureEdit { hasMaximize = true, hasMinimize = true, hasClose = true, borderStyle = sizable,
+                                       hasVertScroll = true, hasHorzScroll = true, parent = this, state = state,
                                        visible = visible, bitmapFile = filePath, OnClose = PictureEditOnClose/*why?--GenericDocumentOnClose*/;
                                     };
          if(!document)
@@ -2418,8 +2418,8 @@ class IDEWorkSpace : Window
       else if(!strcmp(extension, "3ds"))
       {
          if(FileExists(filePath))
-            document = ModelView { hasMaximize = true, hasMinimize = true, hasClose = true, borderStyle = sizable, 
-                                    hasVertScroll = true, hasHorzScroll = true, parent = this, state = state, 
+            document = ModelView { hasMaximize = true, hasMinimize = true, hasClose = true, borderStyle = sizable,
+                                    hasVertScroll = true, hasHorzScroll = true, parent = this, state = state,
                                     visible = visible, modelFile = filePath, OnClose = ModelViewOnClose/*why?--GenericDocumentOnClose*/
                                     };
 
@@ -2468,10 +2468,10 @@ class IDEWorkSpace : Window
                workspace.UpdateOpenedFileInfo(filePath, opened);
          }
       }
-      
+
       if(!document && createIfFails != no)
       {
-         if(createIfFails != yes && !needFileModified && 
+         if(createIfFails != yes && !needFileModified &&
                MessageBox { type = yesNo, master = this, text = filePath, contents = $"File doesn't exist. Create?" }.Modal() == yes)
             createIfFails = yes;
          if(createIfFails == yes || createIfFails == whatever)
@@ -2500,11 +2500,11 @@ class IDEWorkSpace : Window
             editor.editBox.scroll = scroll;
             editor.openedFileInfo.holdTracking = false;
          }
-         
+
          if(needFileModified)
             document.OnFileModified = OnFileModified;
          document.NotifySaved = DocumentSaved;
-         
+
          if(isProject)
             ideSettings.AddRecentProject(document.fileName);
          else
@@ -2512,7 +2512,7 @@ class IDEWorkSpace : Window
          ide.UpdateRecentMenus();
          ide.AdjustFileMenus();
          settingsContainer.Save();
-         
+
          return document;
       }
       else
@@ -2817,12 +2817,12 @@ class IDEWorkSpace : Window
             SetCurrentContext(codeEditor.globalContext);
             SetTopContext(codeEditor.globalContext);
             SetGlobalContext(codeEditor.globalContext);
-            
+
             SetDefines(&codeEditor.defines);
             SetImports(&codeEditor.imports);
 
             SetActiveDesigner(codeEditor.designer);
-            
+
             sheet.codeEditor = codeEditor;
             toolBox.codeEditor = codeEditor;
 
@@ -2929,7 +2929,7 @@ class IDEWorkSpace : Window
                   if(isCObject)
                      ChangeExtension(node.name, "c", nodeName);
                   sprintf(name, $"Compile %s", isCObject ? nodeName : node.name);
-                  projectCompileItem = 
+                  projectCompileItem =
                   {
                      copyText = true, text = name, c, ctrlF7, disabled = projectView.buildInProgress;
 
@@ -3333,29 +3333,29 @@ class IDEWorkSpace : Window
       {
          driverItems[c] = MenuItem { driversMenu, app.drivers[c], NotifySelect = NotifySelectDisplayDriver };
          driverItems[c].id = c;
-         driverItems[c].isRadio = true;         
+         driverItems[c].isRadio = true;
       }
 */
       driverItems = new MenuItem[2];
 #if defined(__unix__)
          driverItems[0] = MenuItem { driversMenu, "X", NotifySelect = NotifySelectDisplayDriver };
          driverItems[0].id = 0;
-         driverItems[0].isRadio = true;         
+         driverItems[0].isRadio = true;
 #else
          driverItems[0] = MenuItem { driversMenu, "GDI", NotifySelect = NotifySelectDisplayDriver };
          driverItems[0].id = 0;
-         driverItems[0].isRadio = true;         
+         driverItems[0].isRadio = true;
 #endif
          driverItems[1] = MenuItem { driversMenu, "OpenGL", NotifySelect = NotifySelectDisplayDriver };
          driverItems[1].id = 1;
-         driverItems[1].isRadio = true;         
+         driverItems[1].isRadio = true;
 
 /*      skinItems = new MenuItem[app.numSkins];
       for(c = 0; c < app.numSkins; c++)
       {
          skinItems[c] = MenuItem {skinsMenu, app.skins[c], NotifySelect = NotifySelectDisplaySkin };
          skinItems[c].id = c;
-         skinItems[c].isRadio = true;         
+         skinItems[c].isRadio = true;
       }
 */
       ideFileDialog.master = this;
index afc497d..b445c1a 100644 (file)
@@ -14,7 +14,7 @@ class BreakpointsView : Window
    size.h = 240;
 
    bool moved, logging;
-   
+
    ListBox listBox
    {
       parent = this, resizable = true, hasHeader = true, alwaysEdit = true, collapseControl = true, size = { 206, 624 };
@@ -89,7 +89,7 @@ class BreakpointsView : Window
          }
          return true;
       }
-      
+
       bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
       {
          if((SmartKey)key == enter)
@@ -113,7 +113,7 @@ class BreakpointsView : Window
          return true;
       }
    };
-   
+
    // TODO: set field size based on font and i18n header string
    // TODO: save column widths to ide settings
    DataField locationField    { "char *", true , width = 220, header = $"Location" };
@@ -122,7 +122,7 @@ class BreakpointsView : Window
    DataField ignoreField      { "char *", true , width =  80, header = $"Ignore Count" };
    DataField levelField       { "char *", true , width =  74, header = $"Stack Depth" };
    DataField conditionField   { "char *", true , width = 130, header = $"Condition" };
-   
+
    BreakpointsView()
    {
       listBox.AddField(locationField);
@@ -157,7 +157,7 @@ class BreakpointsView : Window
       int lineH;
       int scrollY = listBox.scroll.y;
       int boxH = clientSize.h;
-      
+
       displaySystem.FontExtent(listBox.font.font, " ", 1, null, &lineH);
       //Window::OnRedraw(surface);
       ide.debugger.GetCallStackCursorLine(&error, &lineActive, &lineUser);
@@ -209,7 +209,7 @@ class BreakpointsView : Window
       ide.callStackView.Update(null);
       Update(null);
    }
-   
+
    void UpdateBreakpoint(DataRow row)
    {
       if(row && row.tag)
@@ -241,7 +241,7 @@ class BreakpointsView : Window
          row.SetData(breaksField, bp.breaks);
       }
    }
-   
+
    void Clear()
    {
       listBox.Clear();
index a65f843..2302420 100644 (file)
@@ -20,7 +20,7 @@ class CallStackView : Window
 
    bool moved, logging;
    FindDialog findDialog { master = this, editBox = editBox, isModal = true, autoCreate = false, text = $"Find" };
-   
+
    EditBox editBox
    {
       parent = this, freeCaret = true, autoEmpty = true, multiLine = true, readOnly = true;
@@ -70,7 +70,7 @@ class CallStackView : Window
 
    Menu editMenu { menu, $"Edit", e };
    MenuItem item;
-   
+
    MenuItem copyItem
    {
       editMenu, $"Copy", c, ctrlC;
index 40bf319..6575f76 100644 (file)
@@ -39,7 +39,7 @@ class OutputView : Window
          return true;
       }
    };
-   
+
    Button debugBtn
    {
       this, inactive = true, text = "Debug", bevelOver = true, isRadio = true, bitmap = null;
@@ -52,7 +52,7 @@ class OutputView : Window
          return true;
       }
    };
-   
+
    Button findBtn
    {
       this, inactive = true, text = "Find", bevelOver = true, isRadio = true, bitmap = null;
@@ -115,7 +115,7 @@ class OutputView : Window
 
    EditBox activeBox;
    activeBox = buildBox;
-   
+
    LogBox buildBox
    {
       parent = this, freeCaret = true, autoEmpty = true, multiLine = true;
@@ -125,7 +125,7 @@ class OutputView : Window
       background = outputBackground;
       foreground = outputText;
       selectionColor = selectionColor, selectionText = selectionText;
-      
+
       bool NotifyDoubleClick(EditBox editBox, EditLine line, Modifiers mods)
       {
          OnGotoError(editBox.line.text, mods.ctrl && mods.shift);
@@ -142,7 +142,7 @@ class OutputView : Window
          return true;
       }
    };
-   
+
    LogBox debugBox
    {
       parent = this, freeCaret = true, autoEmpty = true, multiLine = true;
@@ -169,7 +169,7 @@ class OutputView : Window
          return true;
       }
    };
-   
+
    LogBox findBox
    {
       parent = this, freeCaret = true, autoEmpty = true, multiLine = true;
@@ -209,7 +209,7 @@ class OutputView : Window
       selectionColor = selectionColor, selectionText = selectionText;
    };
 #endif
-   
+
    Menu editMenu { menu, $"Edit", e };
 
    MenuItem item;
@@ -342,7 +342,7 @@ class LogBox : EditBox
       if(len > 1023)
       {
          char * newStart, * start = entry;
-         
+
          while(len > 1023)
          {
             char backup[3];
index 0b02522..527b2ed 100644 (file)
@@ -18,7 +18,7 @@ class ThreadsView : Window
 
    bool moved, logging;
    FindDialog findDialog { master = this, editBox = editBox, isModal = true, autoCreate = false, text = "Find" };
-   
+
    BitmapResource bmpCursor            { ":codeMarks/cursor.png", window = this };
    BitmapResource bmpCursorError       { ":codeMarks/cursorError.png", window = this };
    BitmapResource bmpTopFrame          { ":codeMarks/topFrame.png", window = this };
@@ -94,7 +94,7 @@ class ThreadsView : Window
 
    Menu editMenu { menu, $"Edit", e };
    MenuItem item;
-   
+
    MenuItem copyItem
    {
       editMenu, $"Copy", c, ctrlC;
@@ -188,7 +188,7 @@ class ThreadsView : Window
       int boxH = clientSize.h;
       int lineNumber;
       int activeThread, hitThread, signalThread;
-      
+
       if(OnGetThreadsInfo(&activeThread, &hitThread, &signalThread))
       {
          EditLine line;
index 4f23d56..4a1166a 100644 (file)
@@ -23,13 +23,13 @@ class WatchesView : Window
       bool NotifyChanged(ListBox listBox, DataRow row)
       {
          char * expression = row.GetData(expressionField);
-         
+
          if(expression && expression[0])
          {
             TrimLSpaces(expression, expression);
             TrimRSpaces(expression, expression);
          }
-         
+
          if(expression && expression[0])
          {
             row.SetData(valueField, null);
@@ -177,7 +177,7 @@ class WatchMultiLineString : String
             modifyVirtualArea = false,
             anchor = { 0, 0, 0, 0 };
             //position = { x + dataBox.absPosition.x, y + dataBox.absPosition.y };
-            //size = { w, h * 4 }; 
+            //size = { w, h * 4 };
             multiLine = true;
 
             bool OnKeyDown(Key key, unichar ch)
@@ -198,11 +198,11 @@ class WatchMultiLineString : String
 
             void DataBox::NotifyUpdate(EditBox editBox)
             {
-               Modified();          
+               Modified();
 
             }
          };
-         dataBox.size = { w, h * 4 + 2 }; 
+         dataBox.size = { w, h * 4 + 2 };
          if(dataBox.size.h + dataBox.position.y > dataBox.parent.clientSize.h)
             dataBox.position.y = dataBox.parent.clientSize.h - dataBox.size.h;
          if(dataBox.size.w + dataBox.position.x > dataBox.parent.clientSize.w)
index ecfb53d..bf25e88 100644 (file)
@@ -97,7 +97,7 @@ void ProjectNode::LegacyBinaryLoadNode(File f)
    fileNameLen += len;
    path = new char[len+1];
    f.Read(path, sizeof(char), len+1);
-   
+
    /*
    fileName = new char[fileNameLen+2];
    strcpy(fileName, path);
@@ -107,7 +107,7 @@ void ProjectNode::LegacyBinaryLoadNode(File f)
 
    f.Read(&type, sizeof(type), 1);
    f.Read(&count, sizeof(count), 1);
-   
+
    if(type == file)
    {
       nodeType = file;
@@ -194,7 +194,7 @@ void ProjectNode::LegacyAsciiSaveNode(File f, char * indentation, char * insideP
       if(path && path[0])
          f.Printf("%s   Path = %s\n", indentation, path);
    }
-   
+
    /*if(buildExclusions.first && type != project)
    {
       for(item = buildExclusions.first; item; item = item.next)
@@ -219,7 +219,7 @@ void ProjectNode::LegacyAsciiSaveNode(File f, char * indentation, char * insideP
       f.Printf("\n");
    }
    */
-   
+
    if(type == project && (files.count /*|| preprocessorDefs.first*/))
    {
       f.Printf("\n");
@@ -569,7 +569,7 @@ int OutputFileList(File f, char * name, Array<String> list, Map<String, int> var
       {
          if(numOfBreaks > 1)
             f.Printf("%s%d =", name, c+1);
-         
+
          len = 3;
          itemCount = breaks[c];
          for(n=offset; n<offset+itemCount; n++)
@@ -678,7 +678,7 @@ static void OutputLibraries(File f, Array<String> libraries)
                strcpy(temp, item);
             StripExtension(temp);
             s = temp;
-         } 
+         }
          f.Puts(" \\\n\t$(call _L,");
          usedFunction = true;
       }
@@ -1266,7 +1266,7 @@ private:
       }
       else
          PathCatSlash(string, targetFileName);
-      
+
       switch(targetType)
       {
          case executable:
@@ -1375,8 +1375,8 @@ private:
          if(c && ((c.options && cfg.options && cfg.options.console != c.options.console) ||
                (!c.options || !cfg.options)))
             cfg.symbolGenModified = true;
-         if(c && ((c.options && cfg.options && 
-               ( (cfg.options.libraries && c.options.libraries && cfg.options.libraries.OnCompare(c.options.libraries)) || (!cfg.options.libraries || !c.options.libraries)) ) 
+         if(c && ((c.options && cfg.options &&
+               ( (cfg.options.libraries && c.options.libraries && cfg.options.libraries.OnCompare(c.options.libraries)) || (!cfg.options.libraries || !c.options.libraries)) )
             || (!c.options || !cfg.options)))
             cfg.linkingModified = true;
 
@@ -1419,7 +1419,7 @@ private:
          ide.workspace.modified = true;
       }
    }
-   
+
    void RotateActiveConfig(bool forward, bool syncAllProjects)
    {
       if(configurations.first && configurations.last != configurations.first)
@@ -1515,7 +1515,7 @@ private:
       DynamicString windres { };
 
       /*
-      if(bitDepth == 64 && compiler.targetPlatform == win32) 
+      if(bitDepth == 64 && compiler.targetPlatform == win32)
          gnuToolchainPrefix = "x86_64-w64-mingw32-";
       else if(bitDepth == 32 && compiler.targetPlatform == win32)
          gnuToolchainPrefix = "i686-w64-mingw32-";
@@ -1783,7 +1783,7 @@ private:
                         {
                            // Silence warnings for compiled eC
                            char * objDir = strstr(moduleName, objDirExp.dir);
-                        
+
                            if(linking)
                            {
                               if((pointer = strstr(line, "undefined"))  ||
@@ -1945,7 +1945,7 @@ private:
                ide.outputView.buildBox.Logf("%d %s, ", numErrors, (numErrors > 1) ? $"errors" : $"error");
             else
                ide.outputView.buildBox.Logf($"no error, ");
-   
+
             if(numWarnings)
                ide.outputView.buildBox.Logf("%d %s\n", numWarnings, (numWarnings > 1) ? $"warnings" : $"warning");
             else
@@ -2218,14 +2218,14 @@ private:
       strcpy(makeFilePath, topNode.path);
       CatMakeFileName(makeFile, config);
       PathCatSlash(makeFilePath, makeFile);
-      
+
       if(compiler.type.isVC)
       {
          bool result = false;
          char oldwd[MAX_LOCATION];
          GetWorkingDir(oldwd, sizeof(oldwd));
          ChangeWorkingDir(topNode.path);
-         
+
          // TODO: justPrint support
          sprintf(command, "%s /useenv /clean /nologo /logcommands %s.sln %s|Win32", compiler.makeCommand, name, config.name);
          if(justPrint)
@@ -2273,7 +2273,7 @@ private:
    }
 
    void Run(char * args, CompilerConfig compiler, ProjectConfig config, int bitDepth)
-   {   
+   {
       String target = new char[maxPathLen];
       char oldDirectory[MAX_LOCATION];
       char * executableLauncher = compiler.executableLauncher;
@@ -3518,7 +3518,7 @@ private:
 
       ReplaceSpaces(objDirNoSpaces, objDirExp);
       ReplaceSpaces(fixedModuleName, moduleName);
-      
+
       //sprintf(fixedModuleName, "%s.main", fixedPrjName);
       //strcat(fixedModuleName, ".main");
 
@@ -3690,13 +3690,13 @@ Project LegacyBinaryLoadProject(File f, char * filePath)
 
       PathCatSlash(topNodePath, filePath);
       project.filePath = topNodePath;
-      
+
       /* THIS IS ALREADY DONE BY filePath property
       StripLastDirectory(topNodePath, topNodePath);
       project.topNode.path = CopyString(topNodePath);
       */
       // Shouldn't this be done BEFORE the StripLastDirectory? project.filePath = topNodePath;
-      
+
       // newConfig.options.defaultNameSpace = "";
       /*newConfig.objDir.dir = "obj";
       newConfig.targetDir.dir = "";*/
@@ -3740,7 +3740,7 @@ Project LegacyBinaryLoadProject(File f, char * filePath)
 
          f.Read(&temp, sizeof(int),1);
          project./*config.*/options.debug = temp ? true : false;
-         f.Read(&temp, sizeof(int),1);         
+         f.Read(&temp, sizeof(int),1);
          project./*config.*/options.optimization = temp ? speed : none;
          f.Read(&temp, sizeof(int),1);
          project./*config.*/options.profile = temp ? true : false;
@@ -3767,7 +3767,7 @@ Project LegacyBinaryLoadProject(File f, char * filePath)
             project.options.libraryDirs = { };
             for(c = 0; c < count; c++)
             {
-               char * name;            
+               char * name;
                f.Read(&len, sizeof(int),1);
                name = new char[len+1];
                f.Read(name, sizeof(char), len+1);
@@ -3822,7 +3822,7 @@ Project LegacyBinaryLoadProject(File f, char * filePath)
 }
 
 void ProjectConfig::LegacyProjectConfigLoad(File f)
-{  
+{
    delete options;
    options = { };
    while(!f.Eof())
@@ -3833,7 +3833,7 @@ void ProjectConfig::LegacyProjectConfigLoad(File f)
       char * equal;
       int len;
       uint pos;
-      
+
       pos = f.Tell();
       f.GetLine(buffer, 65536 - 1);
       TrimLSpaces(buffer, buffer);
@@ -4296,7 +4296,7 @@ void SplitPlatformLibraries(Project project)
                }
             }
          }
-      }      
+      }
    }
 }
 
@@ -4334,16 +4334,16 @@ void CombineIdenticalConfigOptions(Project project)
                      if(cfg.options.targetType != staticLibrary)
                      {
                         int result;
-                        
+
                         if(type.type == noHeadClass || type.type == normalClass)
                         {
-                           result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, 
+                           result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type,
                               *(void **)((byte *)firstConfig.options + member.offset + member._class.offset),
                               *(void **)((byte *)cfg.options         + member.offset + member._class.offset));
                         }
                         else
                         {
-                           result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, 
+                           result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type,
                               (byte *)firstConfig.options + member.offset + member._class.offset,
                               (byte *)cfg.options         + member.offset + member._class.offset);
                         }
@@ -4353,30 +4353,30 @@ void CombineIdenticalConfigOptions(Project project)
                            break;
                         }
                      }
-                  }                  
+                  }
                }
                if(same)
                {
                   if(type.type == noHeadClass || type.type == normalClass)
                   {
-                     if(!((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, 
+                     if(!((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type,
                         *(void **)((byte *)firstConfig.options + member.offset + member._class.offset),
                         *(void **)((byte *)nullOptions         + member.offset + member._class.offset)))
                         continue;
                   }
                   else
                   {
-                     if(!((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, 
+                     if(!((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type,
                         (byte *)firstConfig.options + member.offset + member._class.offset,
                         (byte *)nullOptions         + member.offset + member._class.offset))
                         continue;
                   }
 
                   if(!project.options) project.options = { };
-                  
+
                   /*if(type.type == noHeadClass || type.type == normalClass)
                   {
-                     ((void (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCopy])(type, 
+                     ((void (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCopy])(type,
                         (byte *)project.options + member.offset + member._class.offset,
                         *(void **)((byte *)firstConfig.options + member.offset + member._class.offset));
                   }
@@ -4384,12 +4384,12 @@ void CombineIdenticalConfigOptions(Project project)
                   {
                      void * address = (byte *)firstConfig.options + member.offset + member._class.offset;
                      // TOFIX: ListBox::SetData / OnCopy mess
-                     ((void (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCopy])(type, 
+                     ((void (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCopy])(type,
                         (byte *)project.options + member.offset + member._class.offset,
-                        (type.typeSize > 4) ? address : 
-                           ((type.typeSize == 4) ? (void *)*(uint32 *)address : 
-                              ((type.typeSize == 2) ? (void *)*(uint16*)address : 
-                                 (void *)*(byte *)address )));                              
+                        (type.typeSize > 4) ? address :
+                           ((type.typeSize == 4) ? (void *)*(uint32 *)address :
+                              ((type.typeSize == 2) ? (void *)*(uint16*)address :
+                                 (void *)*(byte *)address )));
                   }*/
                   memcpy(
                      (byte *)project.options + member.offset + member._class.offset,
@@ -4400,16 +4400,16 @@ void CombineIdenticalConfigOptions(Project project)
                      if(cfg.options.targetType == staticLibrary)
                      {
                         int result;
-                        
+
                         if(type.type == noHeadClass || type.type == normalClass)
                         {
-                           result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, 
+                           result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type,
                               *(void **)((byte *)firstConfig.options + member.offset + member._class.offset),
                               *(void **)((byte *)cfg.options         + member.offset + member._class.offset));
                         }
                         else
                         {
-                           result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type, 
+                           result = ((int (*)(void *, void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnCompare])(type,
                               (byte *)firstConfig.options + member.offset + member._class.offset,
                               (byte *)cfg.options         + member.offset + member._class.offset);
                         }
@@ -4420,16 +4420,16 @@ void CombineIdenticalConfigOptions(Project project)
                      {
                         if(type.type == noHeadClass || type.type == normalClass)
                         {
-                           ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type, 
+                           ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type,
                               *(void **)((byte *)cfg.options + member.offset + member._class.offset));
                         }
                         else
                         {
-                           ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type, 
+                           ((void (*)(void *, void *))(void *)type._vTbl[__ecereVMethodID_class_OnFree])(type,
                               (byte *)cfg.options + member.offset + member._class.offset);
                         }
                         memset((byte *)cfg.options + member.offset + member._class.offset, 0, type.typeSize);
-                     }                     
+                     }
                   }
                   memset((byte *)firstConfig.options + member.offset + member._class.offset, 0, type.typeSize);
                }
@@ -4540,15 +4540,15 @@ Project LoadProject(char * filePath, char * activeConfigName)
          {
             project.resNode = project.topNode.Add(project, "Resources", project.topNode.files.last, resources, archiveFile, false);
          }
-         
+
          if(!project.moduleName)
             project.moduleName = CopyString(project.name);
-         if(project.config && 
+         if(project.config &&
             (!project.options || !project.options.targetFileName || !project.options.targetFileName[0]) &&
             (!project.config.options.targetFileName || !project.config.options.targetFileName[0]))
          {
             //delete project.config.options.targetFileName;
-            
+
             project.options.targetFileName = /*CopyString(*/project.moduleName/*)*/;
             project.config.options.optimization = none;
             project.config.options.debug = true;
index b393677..e344d0d 100644 (file)
@@ -470,7 +470,7 @@ private:
             (!postbuildCommands || !postbuildCommands.count) &&
             (!installCommands || !installCommands.count))
             return true;
-         return false;          
+         return false;
       }
    }
 }
index f47dc32..cee70a6 100644 (file)
@@ -35,7 +35,7 @@ bool eString_PathInsideOfMore(char * path, char * of, char * pathRest)
       strcpy(pathRest, path);
       for(; ofRest[0] && pathRest[0];)
       {
-         SplitDirectory(ofRest, ofPart, ofRest);      
+         SplitDirectory(ofRest, ofPart, ofRest);
          SplitDirectory(pathRest, pathPart, pathRest);
          if(fstrcmp(pathPart, ofPart))
             return false;
@@ -436,14 +436,14 @@ private:
    // For folders, it includes the folder it refers to. If there is a name difference between the
    // file system folder and the grouping folder of the project view, it maps to that folder.
    char * path;
-   
+
    NodeTypes type;
    NodeIcons icon;
    int indent;
    DataRow row;
 
    bool modified;
-   
+
    // This is only set for Top Nodes
    Project project;
 
@@ -644,7 +644,7 @@ private:
          while(n && n.type != project) n = n.parent;
          return n ? (*&n.project) : null;
       }
-   }   
+   }
 
    void RenameConfig(char * oldName, char * newName)
    {
@@ -675,7 +675,7 @@ private:
          {
             ProjectConfig config = c.data;
             if(!strcmp(configToDelete.name, config.name))
-            {               
+            {
                c.Remove();
                delete config;
                break;
@@ -942,7 +942,7 @@ private:
          result.b = exp;
       }
       delete exclusionInfo;
-      
+
       return result;
    }
 
@@ -990,7 +990,7 @@ private:
 
       if(options && options.excludeFromBuild)
          output[unknown] = options.excludeFromBuild;
-      
+
       if(config && config.options && config.options.excludeFromBuild)
          output[unknown] = config.options.excludeFromBuild;
 
@@ -1298,8 +1298,8 @@ private:
       {
          showConfig = false;
          projectView = ide.projectView;
-      }         
-      
+      }
+
       bmp = projectView.icons[icon].bitmap;
       xStart = /*indent * indent + */x + (bmp ? (bmp.width + 5) : 0);
 
@@ -1342,7 +1342,7 @@ private:
          }
       }
       len = strlen(label);
-      
+
       if(!bmp)
       {
          if(type == folder || type == folderOpen)
@@ -1353,15 +1353,15 @@ private:
       surface.TextOpacity(false);
       surface.TextExtent(label, len, &w, &h);
       h = Max(h, 16);
-    
+
       // Draw the current row stipple
       if(displayFlags.selected)
          //surface.Area(xStart - 1, y, xStart - 1, y + h - 1);
          //surface.Area(xStart + w - 1, y, xStart + w + 1, y + h - 1);
          surface.Area(xStart - 3, y, xStart + w + 1, y + h - 1);
-      
+
       surface.WriteTextDots(alignment, xStart, y + 2, width, label, len);
-      
+
       if(!app.textMode)
       {
          if(displayFlags.current)
@@ -1471,7 +1471,7 @@ private:
          }
       }
    }
-   
+
    int GenMakefilePrintNode(File f, Project project, GenMakefilePrintTypes printType,
       Map<String, NameCollisionInfo> namesInfo, Array<String> items,
       ProjectConfig prjConfig, bool * containsCXX)
@@ -1989,7 +1989,7 @@ private:
 
             info = namesInfo[moduleName];
             collision = info ? info.IsExtensionColliding(extension) : false;
-            
+
             ReplaceSpaces(modulePath, path);
             if(modulePath[0]) strcat(modulePath, SEPS);
 
@@ -2090,7 +2090,7 @@ private:
             if(!strcmpi(extension, "ec"))
                f.Printf("$(OBJ)%s.o: $(OBJ)%s.c\n", moduleName, moduleName);
             else
-               f.Printf("$(OBJ)%s%s%s.o: %s%s.%s\n", moduleName, 
+               f.Printf("$(OBJ)%s%s%s.o: %s%s.%s\n", moduleName,
                      collision ? "." : "", collision ? extension : "", modulePath, moduleName, extension);
             if(!strcmpi(extension, "cc") || !strcmpi(extension, "cpp") || !strcmpi(extension, "cxx"))
                f.Printf("\t$(CXX)");
index 21171aa..48c5355 100644 (file)
@@ -67,7 +67,7 @@ static Array<FileType> projectTypes
    { $"Ecere IDE Workspace", WorkspaceExtension }
 ] };
 
-static char * iconNames[] = 
+static char * iconNames[] =
 {
    "<:ecere>mimeTypes/file.png",                   /*genFile*/
    "<:ecere>mimeTypes/textEcereWorkspace.png",     /*ewsFile*/
@@ -116,10 +116,10 @@ class ProjectView : Window
    size = { 300 };
    anchor = Anchor { left = 0, top = 0, bottom = 0 };
    menu = Menu { };
-   
+
    //hasMinimize = true;
    saveDialog = projectFileDialog;
-   
+
    DataRow resourceRow;
    BuildState buildInProgress;
    BitmapResource icons[NodeIcons];
@@ -156,7 +156,7 @@ class ProjectView : Window
       }
       get { return workspace; }
    }
-   
+
    bool drawingInProjectSettingsDialog;
    bool drawingInProjectSettingsDialogHeader;
    ProjectSettings projectSettingsDialog;
@@ -202,7 +202,7 @@ class ProjectView : Window
          if(!active) Update(null);
          return ListBox::OnActivate(active, previous, goOnWithActivation, direct);
       }
-      
+
       bool NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
       {
          // Prevent the double click from reactivating the project view (returns false if we opened something)
@@ -224,7 +224,7 @@ class ProjectView : Window
             {
                bool na = buildInProgress; // N/A - buildMenuUnavailable
                Menu pop { };
-               
+
                if(node.type == NodeTypes::project)
                {
                   MenuItem mi;
@@ -339,11 +339,11 @@ class ProjectView : Window
                   MenuItem { pop, $"Properties...", p, Key { enter, alt = true }, NotifySelect = FileProperties };
                }
 
-               popupMenu = 
+               popupMenu =
                {
                   master = this, menu = pop;
                   position = {
-                     x + clientStart.x + absPosition.x - app.desktop.position.x, 
+                     x + clientStart.x + absPosition.x - app.desktop.position.x,
                      y + clientStart.y + absPosition.y - app.desktop.position.y };
 
                   void NotifyDestroyed(Window window, DialogResult result)
@@ -377,7 +377,7 @@ class ProjectView : Window
             {
                case altEnter: case Key { keyPadEnter, alt = true }:
                {
-                  NodeProperties { parent = parent, master = this, 
+                  NodeProperties { parent = parent, master = this,
                      position = { position.x + 100, position.y + 100 }, node = node }.Create();
                   return false;
                }
@@ -457,7 +457,7 @@ class ProjectView : Window
             case Key { keyPadEnter, true, true }:  OpenSelectedNodes(true);   break;
             case enter: case keyPadEnter:          OpenSelectedNodes(false);  break;
             case del:                              RemoveSelectedNodes();     break;
-            case escape:                      
+            case escape:
             {
                Window activeClient = ide.activeClient;
                if(activeClient)
@@ -551,7 +551,7 @@ class ProjectView : Window
       ide.watchesView.Clear();
       ide.threadsView.Clear();
       ide.breakpointsView.Clear();
-      ide.outputView.ShowClearSelectTab(find); // why this? 
+      ide.outputView.ShowClearSelectTab(find); // why this?
    }
 
    bool OnSaveFile(char * fileName)
@@ -677,7 +677,7 @@ class ProjectView : Window
          char makefileName[MAX_LOCATION];
          bool exists;
          LogBox logBox = ide.outputView.buildBox;
-         
+
          strcpy(makefilePath, project.topNode.path);
          project.CatMakeFileName(makefileName, config);
          PathCatSlash(makefilePath, makefileName);
@@ -720,7 +720,7 @@ class ProjectView : Window
       }
       return false;
    }
-   
+
    bool BuildInterrim(Project prj, BuildType buildType, CompilerConfig compiler, ProjectConfig config, int bitDepth, bool justPrint)
    {
       if(ProjectPrepareForToolchain(prj, normal, true, true, compiler, config))
@@ -1296,7 +1296,7 @@ class ProjectView : Window
       if(row)
       {
          ProjectNode node = (ProjectNode)row.tag;
-         NodeProperties { parent = parent, master = this, node = node, 
+         NodeProperties { parent = parent, master = this, node = node,
                position = { position.x + 100, position.y + 100 } }.Create();
       }
       return true;
@@ -1442,7 +1442,7 @@ class ProjectView : Window
       }
       return prj;
    }
-   
+
    void SelectNextProject(bool backwards)
    {
       DataRow row = fileList.currentRow;
@@ -1535,7 +1535,7 @@ class ProjectView : Window
                char command[MAX_LOCATION];
 
                ide.SetPath(false, compiler, config, bitDepth);
-               
+
                GetWorkingDir(oldwd, sizeof(oldwd));
                ChangeWorkingDir(project.topNode.path);
 
@@ -1553,13 +1553,13 @@ class ProjectView : Window
          }
       }
       delete compiler;
-      return result;      
+      return result;
    }
 
    void GoToError(const char * line, const bool noParsing)
    {
       char * colon;
-      
+
       while(isspace(*line)) line++;
       colon = strstr(line, ":");
 
@@ -1611,7 +1611,7 @@ class ProjectView : Window
             if(comma)
                col = atoi(comma+1);
          }
-         
+
          {
             char moduleName[MAX_LOCATION], filePath[MAX_LOCATION] = "";
             char ext[MAX_EXTENSION] = "";
@@ -1748,7 +1748,7 @@ class ProjectView : Window
                   strcpy(filePath, project.topNode.path);
                   PathCatSlash(filePath, moduleName);
                }
-      
+
                codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal, noParsing);
                if(!codeEditor && !strcmp(ext, "c"))
                {
@@ -1825,9 +1825,9 @@ class ProjectView : Window
 
       row.SetData(null, node);
 
-      if(node.files && node.files.first && node.parent && 
-            !(!node.parent.parent && 
-               (!strcmpi(node.name, "notes") || !strcmpi(node.name, "sources") || 
+      if(node.files && node.files.first && node.parent &&
+            !(!node.parent.parent &&
+               (!strcmpi(node.name, "notes") || !strcmpi(node.name, "sources") ||
                   !strcmpi(node.name, "src") || !strcmpi(node.name, "tools"))))
          row.collapsed = true;
       else if(node.type == folder)
@@ -1867,7 +1867,7 @@ class ProjectView : Window
             for(p : ide.workspace.projects)
             {
                if(p.topNode.modified)
-               { 
+               {
                   modPrj = p;
                   break;
                }
@@ -1986,7 +1986,7 @@ class ProjectView : Window
       {
          //bool isFolder = toNode.type == folder;
          //bool isRes = toNode.isInResources;
-         
+
          FileDialog fileDialog = importFileDialog;
          fileDialog.master = parent;
          if(fileDialog.Modal() == ok)
@@ -2013,7 +2013,7 @@ class ProjectView : Window
                break;
             after = node;
          }
-         
+
          if(name && name[0])
             folderNode = parentNode.Add(prj, name, after, folder, folder, true);
          else
@@ -2038,10 +2038,10 @@ class ProjectView : Window
             Update(null);
             folderNode.row = parentNode.row.AddRowAfter(after ? after.row : null);
             folderNode.row.tag = (int64)folderNode;
-               
+
             folderNode.row.SetData(null, folderNode);
             fileList.currentRow = folderNode.row;
-            
+
             if(showProperties)
             {
                nodeProperties = NodeProperties
@@ -2085,7 +2085,7 @@ class ProjectView : Window
                addThisFile = false;
             else if(!exists)
             {
-               if(MessageBox { master = ide, type = yesNo, text = filePath, 
+               if(MessageBox { master = ide, type = yesNo, text = filePath,
                      contents = $"File doesn't exist. Create?" }.Modal() == yes)
                {
                   File f = FileOpen(filePath, write);
@@ -2096,7 +2096,7 @@ class ProjectView : Window
                   }
                   else
                   {
-                     MessageBox { master = ide, type = ok, text = filePath, 
+                     MessageBox { master = ide, type = ok, text = filePath,
                            contents = $"Couldn't create file."}.Modal();
                      addThisFile = false;
                   }
@@ -2134,7 +2134,7 @@ class ProjectView : Window
                strcat(message, s);
                strcat(message, "\n");
             }
-            MessageBox { master = ide, type = ok, text = $"Name Conflict", 
+            MessageBox { master = ide, type = ok, text = $"Name Conflict",
                   contents = message }.Modal();
             delete message;
          }
@@ -2209,7 +2209,7 @@ class ProjectView : Window
          project.ModifiedAllConfigs(true, false, false, true);
          projectNode.row = parentNode.row.AddRowAfter(after ? after.row : null);
          projectNode.row.tag =(int64)projectNode;
-            
+
          projectNode.row.SetData(null, projectNode);
          fileList.currentRow = projectNode.row;
 
@@ -2251,7 +2251,7 @@ class ProjectView : Window
          }
       }
       //visible = false;
-      return codeEditor;   
+      return codeEditor;
    }
 
    // Returns true if we opened something
@@ -2281,7 +2281,7 @@ class ProjectView : Window
    {
       OldList selection;
       OldLink item, next;
-      
+
       fileList.GetMultiSelection(selection);
 
       // Remove children of parents we're deleting
index e2ed155..39d6288 100644 (file)
@@ -81,7 +81,7 @@ class OpenedFileInfo
          ide.workspace.modified = true;
       }
    }
-   
+
    void Activate()
    {
       if(trackingAllowed)
@@ -92,7 +92,7 @@ class OpenedFileInfo
          {
             files.Move(it.pointer, files.GetPrev(files.GetLast()));
             ide.workspace.modified = true;
-         } 
+         }
       }
    }
    ~OpenedFileInfo()
@@ -182,7 +182,7 @@ public:
          if(project)
          {
             projectDir = CopyString(project.topNode.path);
-            
+
             if(!project.config && activeConfig && activeConfig[0])
             {
                ProjectConfig cfg;
@@ -215,7 +215,7 @@ public:
    {
       bool bkpts = false;
       File file;
-      
+
       file = FileOpen(workspaceFile, write);
       if(file)
       {
@@ -230,16 +230,16 @@ public:
                   file.Printf("Breakpoint=0,%d,%s,%s\n", bp.line, bp.absoluteFilePath, bp.relativeFilePath);
             }
          }
-         
+
          for(wh : watches)
             file.Printf("Watch=%s\n", wh.expression);
-         
+
          for(dir : sourceDirs)
             file.Printf("SourceDir=%s\n", dir);
 
          if(debugDir && debugDir[0])
             file.Printf("DebugDir=%s\n", debugDir);
-         
+
          if(commandLineArgs && commandLineArgs[0])
             file.Printf("CommandLineArgs=%s\n", commandLineArgs);
          */
@@ -253,7 +253,7 @@ public:
          file.Printf("\nWorkspace\n");
          file.Printf("\n   Active Compiler = %s\n", compiler ? compiler : defaultCompilerName);
          file.Printf("\n   Active Bit Depth = %d\n", bitDepth);
-         
+
          if(projects.first)
          {
             file.Printf("\n   Projects\n\n");
@@ -266,7 +266,7 @@ public:
                //strcat(location, ".epj");
 
                file.Printf("    %s %s\n", "-", location);
-               
+
                if(prj.config)
                   file.Printf("         Active Configuration = %s\n", prj.config.name);
                for(cfg : prj.configurations)
@@ -278,7 +278,7 @@ public:
                }
             }
          }
-         
+
          file.Printf("\n   Execution Data\n");
          if(commandLineArgs && commandLineArgs[0])
          {
@@ -408,7 +408,7 @@ public:
                return CopyString(absolute);
          }
       }
-      
+
       return null;
    }
 
@@ -465,15 +465,15 @@ public:
       int c, numTokens;
 
       sourceDirs.Free();
-      
+
       for(s : dirs)
          sourceDirs.Add(CopyString(s));
-      
+
       DropInvalidBreakpoints(null);
 
       delete dirs;
    }
-   
+
    void RemoveProject(Project project)
    {
       Iterator<Project> it { projects };
@@ -731,14 +731,14 @@ public:
       }
       ide.breakpointsView.Update(null);
    }
-   
+
    void Free()
    {
       delete workspaceFile;
       delete workspaceDir;
       delete commandLineArgs;
       delete debugDir;
-      
+
       //project = null;
 
       projects.Free();
@@ -756,7 +756,7 @@ public:
       ide.breakpointsView.Clear();
 
       property::debugDir = "";
-      
+
       SetSourceDirs(sourceDirs);
    }
 
@@ -796,10 +796,10 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
          char buffer[65536];
          char * equal;
          int len;
-         
+
          Watch wh;
          Breakpoint bp;
-         
+
          file.GetLine(buffer, 65536 - 1);
          TrimLSpaces(buffer, buffer);
          TrimRSpaces(buffer, buffer);
@@ -850,7 +850,7 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
                   char * strLevel = null;
                   char * strLine = null;
                   char * strFile = null;
-                  
+
                   strEnabled = equal;
                   if(strEnabled && strEnabled[0])
                   {
@@ -876,7 +876,7 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
                      strFile[0] = '\0';
                      strFile++;
                   }
-                  if(strEnabled && strEnabled[0] && strIgnore && strIgnore[0] && 
+                  if(strEnabled && strEnabled[0] && strIgnore && strIgnore[0] &&
                         strLevel && strLevel[0] && strLine && strLine[0] && strFile && strFile[0])
                   {
                      bool enabled;
@@ -976,7 +976,7 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
                      }
                   }
                   PathCatSlash(absolutePath, equal);
-                     
+
                   if(state == closed || FileExists(absolutePath))
                      workspace.openedFiles.Add(OpenedFileInfo { path = CopyString(absolutePath), state = state, lineNumber = lineNumber, position = position, scroll = scroll });
                   else
@@ -1231,7 +1231,7 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
             item = openedFilesNotFound.first;
             if(item.next)
                strcpy(s, "s");
-            
+
             for(item = openedFilesNotFound.first; item; item = item.next)
             {
                c++;
@@ -1246,7 +1246,7 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
 
             sprintf(title, $"File%s not found", s);
             sprintf(msg, $"The following file%s could not be re-opened.%s", s, files);
-            
+
             MessageBox { type = ok, master = ide, contents = msg, text = title }.Modal();
 
             delete files;
@@ -1260,10 +1260,10 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
    else if(fromProjectFile)
    {
       //MessageBox { type = Ok, master = ide, contents = "Worspace load file failed", text = "Worspace Load File Error" }.Modal();
-      
+
       char projectFile[MAX_LOCATION];
       Project newProject;
-      
+
       //strcpy(projectFile, filePath);
       //ChangeExtension(projectFile, ProjectExtension, projectFile);
       newProject = LoadProject(fromProjectFile /*projectFile*/, null);
@@ -1277,7 +1277,7 @@ Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
          workspace.Save();
       }
    }
-   
+
    if(workspace)
    {
       ide.ChangeFileDialogsDirectory(workspace.workspaceDir, false);
index 1a60d4a..1e42403 100644 (file)
@@ -79,7 +79,7 @@ void GenerateVSSolutionFile(Project project, CompilerConfig compiler)
       f.Print(""); f.Printf("\r\n");
       f.Print("Microsoft Visual Studio Solution File, Format Version ", compiler.type.solutionFileVersionString); f.Printf("\r\n");
       f.Print("# Visual Studio ", compiler.type.yearString); f.Printf("\r\n");
-      f.Print("Project(\"{", slnGUID, "}\") = \"", projectName, "\", \"", projectName, ".", 
+      f.Print("Project(\"{", slnGUID, "}\") = \"", projectName, "\", \"", projectName, ".",
             compiler.type.projectFileExtension, "\", \"{", prjGUID, "}\"", attribSep); f.Printf("\r\n");
       f.Print("EndProject"); f.Printf("\r\n");
       f.Print("Global"); f.Printf("\r\n");
@@ -100,7 +100,7 @@ void GenerateVSSolutionFile(Project project, CompilerConfig compiler)
       f.Print("\t\tHideSolutionNode = FALSE"); f.Printf("\r\n");
       f.Print("\tEndGlobalSection"); f.Printf("\r\n");
       f.Print("EndGlobal"); f.Printf("\r\n");
-   
+
       delete f;
    }
 }
@@ -151,7 +151,7 @@ void GenerateVCProjectFile(Project project, CompilerConfig compiler, int bitDept
             f.Print(attribIndent, "/>", tagLine);
          IndentPop();
          f.Print(tagIndent, "</Platforms>", tagLine);
-         
+
          f.Print(tagIndent, "<ToolFiles>", tagLine);
          f.Print(tagIndent, "</ToolFiles>", tagLine);
 
@@ -175,7 +175,7 @@ void GenerateVCProjectFile(Project project, CompilerConfig compiler, int bitDept
                f.Print(attribIndent, "Filter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"", attribSep);
                f.Print(attribIndent, "UniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"", attribSep);
                f.Print(attribIndent, ">", tagLine);
-            
+
                PrintNodes(f, project, project.topNode, namesInfo, source, false, usePrecompiledHeaders);
             IndentPop();
             f.Print(tagIndent, "</Filter>", tagLine);
@@ -186,7 +186,7 @@ void GenerateVCProjectFile(Project project, CompilerConfig compiler, int bitDept
                f.Print(attribIndent, "Filter=\"h;hpp;hxx;hm;inl;inc;xsd\"", attribSep);
                f.Print(attribIndent, "UniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"", attribSep);
                f.Print(attribIndent, ">", tagLine);
-            
+
                PrintNodes(f, project, project.topNode, namesInfo, header, false, usePrecompiledHeaders);
             IndentPop();
             f.Print(tagIndent, "</Filter>", tagLine);
@@ -197,7 +197,7 @@ void GenerateVCProjectFile(Project project, CompilerConfig compiler, int bitDept
                f.Print(attribIndent, "Filter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav\"", attribSep);
                f.Print(attribIndent, "UniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"", attribSep);
                f.Print(attribIndent, ">", tagLine);
-            
+
                PrintNodes(f, project, project.resNode, namesInfo, resource, false, usePrecompiledHeaders);
             IndentPop();
             f.Print(tagIndent, "</Filter>", tagLine);
@@ -207,10 +207,10 @@ void GenerateVCProjectFile(Project project, CompilerConfig compiler, int bitDept
 
          f.Print(tagIndent, "<Globals>", tagLine);
          f.Print(tagIndent, "</Globals>", tagLine);
-      
+
       IndentPop();
       f.Print("</VisualStudioProject>", tagLine);
-   
+
       namesInfo.Free();
       delete namesInfo;
       delete f;
@@ -419,7 +419,7 @@ void PrintConfiguration(File f, Project project, CompilerConfig compiler, Projec
          f.Print(attribIndent, "GenerateDebugInformation=\"true\"", attribSep);
          f.Print(attribIndent, "SubSystem=\"1\"", attribSep);
       if(optimize)
-      {      
+      {
          f.Print(attribIndent, "OptimizeReferences=\"2\"", attribSep);
          f.Print(attribIndent, "EnableCOMDATFolding=\"2\"", attribSep);
       }
@@ -491,7 +491,7 @@ void CollectPlatformSpecificDirs(Project project, ProjectConfig config, Array<St
    Platform platform = win32;
    //for(platform = firstPlatform; platform <= lastPlatform; platform++)
    //for(platform = win32; platform <= apple; platform++)
-   
+
    //for(platform = (Platform)1; platform < Platform::enumSize; platform++)
    //{
       PlatformOptions projectPlatformOptions = null;
@@ -717,7 +717,7 @@ void PrintFile(File f, Project prj, ProjectNode node, Map<String, NameCollisionI
       IndentPush();
       f.Print(attribIndent, "RelativePath=\"", relativePath, "\"", attribSep);
       f.Print(attribIndent, ">", tagLine);
-      
+
       for(config : prj.configurations)
       {
          node.CollectPerFileAndDirOptions(config, perFilePreprocessorDefs, perFileIncludeDirs);
index 48cd912..17be634 100644 (file)
@@ -158,7 +158,7 @@ class OperatorsApp : Application
          byte a = 0x20;
          PrintLn((a & 0x20) == 0x20);
       }
-      
+
       system("pause");
    }
 }
index e9340f4..45fef0e 100644 (file)
@@ -11,7 +11,7 @@ char GetOperation()
 {
    char operation = 0;
    PrintLn("Chose an operation to perform: +, -, *, /, ^. q to quit.");
-   do 
+   do
    {
       char input[1024];
       gets(input);
@@ -21,7 +21,7 @@ char GetOperation()
             operation = input[0];
             break;
          default:
-            PrintLn("Invalid Operation"); 
+            PrintLn("Invalid Operation");
       }
    } while(!operation);
    return operation;
@@ -36,7 +36,7 @@ double GetOperand()
    {
       PrintLn("Print enter a valid numeric value");
       gets(input);
-   } 
+   }
    return operand;
 }
 
@@ -70,16 +70,16 @@ class Lab4App : Application
          double operand1, operand2;
          char operation = GetOperation();
          if(operation == 'q') break;
-         
+
          PrintLn("Enter the first operand:");
          operand1 = GetOperand();
          PrintLn("Enter the second operand:");
          operand2 = GetOperand();
          if(operation == '/' && operand2 == 0)
             PrintLn("Cannot divide by 0");
-         else            
+         else
          {
-            double result = ComputeOperation(operation, operand1, operand2);        
+            double result = ComputeOperation(operation, operand1, operand2);
             PrintLn(operand1, " ", operation, " ", operand2, " = ", result);
          }
       }
index 59162f5..c5d53c4 100644 (file)
@@ -16,7 +16,7 @@ char GetOperation()
 {
    char operation = 0;
    PrintLn("Chose an operation to perform: +, -. q to quit.");
-   do 
+   do
    {
       char input[1024];
       gets(input);
@@ -26,7 +26,7 @@ char GetOperation()
             operation = input[0];
             break;
          default:
-            PrintLn("Invalid Operation"); 
+            PrintLn("Invalid Operation");
       }
    } while(!operation);
    return operation;
@@ -41,7 +41,7 @@ KnownColor GetOperand()
    {
       Print("Please enter a known color (black, red, green, blue, yellow, magenta, cyan or white)");
       gets(input);
-   } 
+   }
    return operand;
 }
 
@@ -63,7 +63,7 @@ class Lab5ColorsApp : Application
          KnownColor operand1, operand2;
          char operation = GetOperation();
          if(operation == 'q') break;
-         
+
          PrintLn("Enter the first operand:");
          operand1 = GetOperand();
          PrintLn("Enter the second operand:");
index f92c49c..157e8ec 100644 (file)
@@ -16,7 +16,7 @@ char GetOperation()
 {
    char operation = 0;
    PrintLn("Chose an operation to perform: +, -, *, /, m (module/length). q to quit.");
-   do 
+   do
    {
       char input[1024];
       gets(input);
@@ -26,7 +26,7 @@ char GetOperation()
             operation = input[0];
             break;
          default:
-            PrintLn("Invalid Operation"); 
+            PrintLn("Invalid Operation");
       }
    } while(!operation);
    return operation;
@@ -41,7 +41,7 @@ float GetScalar()
    {
       PrintLn("Print enter a valid numeric value");
       gets(input);
-   } 
+   }
    return scalar;
 }
 
@@ -54,7 +54,7 @@ Vector GetVector()
    {
       PrintLn("Print enter a valid 2D vector value");
       gets(input);
-   } 
+   }
    return vector;
 }
 
@@ -68,7 +68,7 @@ class Lab5VectorApp : Application
          float scalar;
          char operation = GetOperation();
          if(operation == 'q') break;
-         
+
          PrintLn("Enter the first operand:");
          vector1 = GetVector();
 
@@ -82,7 +82,7 @@ class Lab5VectorApp : Application
          }
          if(operation == '/' && scalar == 0)
             PrintLn("Cannot divide by 0");
-         else            
+         else
          {
             switch(operation)
             {
index 7becd52..268655a 100644 (file)
@@ -7,7 +7,7 @@ public:
    int difficulty;
    int damage;
    int manaCost;
-    
+
    virtual void Backfire(Creature self, Creature opponent)
    {
       self.health -= damage/4;
@@ -23,7 +23,7 @@ public:
 
 class FireBall : Spell { difficulty = 20, damage = 8; manaCost = 5; };
 class Lightning : Spell  { difficulty = 10, damage = 4; manaCost = 3; };
-class Healing : Spell 
+class Healing : Spell
 {
    difficulty = 20;
    manaCost = 5;
@@ -88,7 +88,7 @@ public:
          int howBad = 0;
          EquipmentSlot slot;
          int damage;
-         
+
          if(where < 60)
          {
             slot = body;
@@ -104,7 +104,7 @@ public:
             slot = legs;
             howBad = 1;
          }
-         else 
+         else
          {
             slot = feet;
             howBad = 1;
@@ -273,7 +273,7 @@ class RPGApp : Application
             }
             break;
          }
-         case realm:            
+         case realm:
             PrintLn("You are wandering in the realm. What would you like to do?");
             PrintLn("[F]ight bad guys   Visit the [S]hop   [R]est     St[a]ts");
             if(player.xp >= 1000)
@@ -398,7 +398,7 @@ class RPGApp : Application
                      if(slot == ring)
                         while(player.equipment[slot] && slot < ring4)
                            slot++;
-                     
+
                      if(slot == rightHand && eq.twoHands)
                      {
                         if(player.equipment[EquipmentSlot::leftHand])
@@ -413,7 +413,7 @@ class RPGApp : Application
                      }
                      else if(player.equipment[slot])
                         tradeIn1 = player.equipment[slot];
-                      
+
                      tradeIn = ((tradeIn1 ? tradeIn1.value : 0) + (tradeIn2 ? tradeIn2.value : 0)) / 2;
                      if(player.gold + tradeIn < eq.value)
                         PrintLn("You do not have enough gold!");
@@ -583,7 +583,7 @@ class RPGApp : Application
       PrintLn("gaining experience and equipment in the process. You will need to reach");
       PrintLn("at least 1000 experience points to search for the sorcerer's hideout.");
       PrintLn("At any time you can [Q]uit.");
-      while(state != end)      
+      while(state != end)
       {
          PrintStatus();
          GetCommand();
index 961d349..02d8ad8 100644 (file)
@@ -116,11 +116,11 @@ void ExtractFileFromArchive(ProgressBar progressBar, char * path, char * outputF
 
             FileGetSize(path, &dataSize);
             GetLastDirectory(outputFile, fileName);
-            
+
             ((GuiApplication)__thisModule).SignalEvent();
             //((GuiApplication)__thisModule).ProcessInput();
             //((GuiApplication)__thisModule).UpdateDisplay();
-            
+
             for(c = 0; c<dataSize && !abortInstall; c += BUFFERSIZE)
             {
                uint size = (dataSize > c + BUFFERSIZE) ? BUFFERSIZE : (dataSize - c);
@@ -218,7 +218,7 @@ struct Component
             if(requiredSize)
             {
                uint p = installProgress.progressBar.progress;
-               ExtractFileFromArchive(installProgress.progressBar, source, path); 
+               ExtractFileFromArchive(installProgress.progressBar, source, path);
             }
          }
          if(subComponents)
@@ -435,7 +435,7 @@ class Installer : Window
    Button browse
    {
       master = this, autoCreate = false, inactive = true, text = "...";
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          DataRow row = componentsBox.currentRow;
@@ -456,7 +456,7 @@ class Installer : Window
    CheckListBox componentsBox
    {
       this, size = { 460, 112 }, position = { 160, 160 }, hasHeader = true;
-      fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true, 
+      fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true,
       noDragging = true;
       rowHeight = 18;
       selectionColor = { 145, 150, 140 };
@@ -534,7 +534,7 @@ class Installer : Window
          component->requiredSize = 0;
          if(component->selected)
          {
-            component->requiredSize += component->size; 
+            component->requiredSize += component->size;
             if(component->subComponents)
                for(c = 0; component->subComponents[c].name; c++)
                   component->requiredSize += component->subComponents[c].requiredSize;
@@ -546,7 +546,7 @@ class Installer : Window
          }
          else
             row.UnsetData(reqField);
-         if(!component->parent) 
+         if(!component->parent)
          {
             totalSize += component->requiredSize;
             {
@@ -575,7 +575,7 @@ class Installer : Window
    CheckListBox optionsBox
    {
       this, size = { 460, 94 }, position = { 160, 284 };
-      fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true, 
+      fullRowSelect = false, collapseControl = true, treeBranches = true, rootCollapseButton = true,
       noDragging = true;
       rowHeight = 18;
       opacity = 0;
@@ -662,7 +662,7 @@ class Installer : Window
    };
    EditBox label7
    {
-      this, opacity = 0, borderStyle = none, inactive = true, size = { 136, 53 }, position = { 14, 280 }, noSelect = true, 
+      this, opacity = 0, borderStyle = none, inactive = true, size = { 136, 53 }, position = { 14, 280 }, noSelect = true,
       multiLine = true,
       contents = $"Select icons to install, file\n"
       "associations, and system\n"
@@ -756,7 +756,7 @@ class Installer : Window
       if(component.defInstallPath)
          PathCat(path, component.defInstallPath);
       component.parent = parent;
-         
+
       row.SetData(null, CheckItem { component.name, component, (component.arch == bits32 && osIS64bit) } );
 
       if(component.defInstallPath)
@@ -807,7 +807,7 @@ class Installer : Window
 
       while(!FileExists(path) && path[0])
          StripLastDirectory(path, path);
-      
+
       if(path[0])
          GetFreeSpace(path, &avSize);
       else
@@ -843,7 +843,7 @@ class Installer : Window
       GetEnvironment("APPDATA", appData, sizeof(appData));
       GetEnvironment("HOMEDRIVE", homeDrive, sizeof(homeDrive));
       GetEnvironment("windir", winDir, sizeof(winDir));
-      
+
       componentsBox.AddField(componentField);
       componentsBox.AddField(locationField);
       componentsBox.AddField(reqField);
@@ -883,7 +883,7 @@ class Installer : Window
       }
       else
          strcpy(installDir, "C:\\Ecere SDK");
-      
+
       if(appData && appData[0])
       {
          static char defSamplesPath[MAX_LOCATION];
@@ -896,7 +896,7 @@ class Installer : Window
          PathCat(defExtrasPath, "Ecere SDK\\extras");
          additional[extras].defInstallPath = defExtrasPath;
       }
-         
+
       destBox.path = installDir;
 
       {
@@ -1036,7 +1036,7 @@ static void AddPath(char * sysPaths[200], int sysCount, char * paths[200], int *
    if(!found)
    {
       char * start;
-      if(*count) 
+      if(*count)
       {
          strcat(userPath, ";");
          start = paths[(*count)-1] + strlen(paths[(*count)-1])+1;
@@ -1125,7 +1125,7 @@ void AssociateExtension(char * extension, char * description, char *name, char *
 
    sprintf(keyName, "%s\\shell\\%s\\command", name, action);
    RegCreateKeyEx(HKEY_CLASSES_ROOT, keyName, 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &key, &status);
-   
+
    sprintf(keyName, path);
    strcat(keyName, " \"%L\"");
    {
@@ -1282,7 +1282,7 @@ class InstallThread : Thread
          }
 
          // Add paths
-         if(pathOptions[PathOptions::AddECEREPaths].selected 
+         if(pathOptions[PathOptions::AddECEREPaths].selected
 #ifndef NOMINGW
             || pathOptions[PathOptions::AddMinGWPaths].selected
 #endif
@@ -1302,14 +1302,14 @@ class InstallThread : Thread
             installProgress.installing.text = "Registering paths...";
             ((GuiApplication)__thisModule).Unlock();
             ((GuiApplication)__thisModule).SignalEvent();
-                        
+
             if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, KEY_QUERY_VALUE, &systemKey) == ERROR_SUCCESS)
             {
                size = sizeof(wSystemPath);
                RegQueryValueExW(systemKey, L"path", null, null, (byte *)wSystemPath, &size);
                UTF16toUTF8Buffer(wSystemPath, systemPath, sizeof(systemPath));
             }
-            
+
             RegCreateKeyEx(HKEY_CURRENT_USER, "Environment", 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, null, &userKey, &status);
             if(status == REG_OPENED_EXISTING_KEY)
             {
@@ -1463,7 +1463,7 @@ class InstallThread : Thread
             installProgress.installing.text = $"Resgistering File Types...";
             ((GuiApplication)__thisModule).Unlock();
             ((GuiApplication)__thisModule).SignalEvent();
-            
+
             if(associateOptions[AssociateOptions::AssociateEPJ].selected)
             {
                AssociateExtension(".epj", "Ecere IDE Project", "epj_file", "Open", idePath);
index 1b0c846..e8a0f2c 100644 (file)
@@ -52,7 +52,7 @@ class Test3DS : Window
             else if(key == k2)   cameraObject = model.Find("Camera02");
             else if(key == k3)   cameraObject = model.Find("Camera03");
             else if(key == k4)   cameraObject = model.Find("Full Scree");
-            
+
             camera = cameraObject.camera;
             camera.Setup(clientSize.w, clientSize.h, null);
             Update(null);
index caf514d..5dde702 100644 (file)
@@ -37,7 +37,7 @@ Light diffuseLight
 Object specularLight
 {
    flags = { light = true; };
-   light = 
+   light =
    {
       multiplier = 1;
       diffuse = white;
@@ -67,7 +67,7 @@ class ColorSpheres : Object
                object.transform.scaling = { scaling, scaling, scaling };
                object.material = Material
                {
-                  opacity = 1, 
+                  opacity = 1,
                   diffuse = ColorRGB { (x + 1) / 2.0f, (y + 1) / 2.0f, (z + 1) / 2.0f };
                   ambient = ColorRGB { (x + 1) / 2.0f, (y + 1) / 2.0f, (z + 1) / 2.0f };
                   specular = white;
@@ -113,13 +113,13 @@ class Test3D : Window
          pitch -= (double)diffTime / 3 * pitch;
          if(yaw < 0.0001) yaw = 0;
          if(pitch < 0.0001) pitch = 0;
-                     
+
          spin.yaw = yaw * signYaw;
          spin.pitch = pitch * signPitch;
 
          temp.Multiply(orientation, thisSpin);
          orientation.Normalize(temp);
-         
+
          cube.transform.orientation = orientation;
          cube.UpdateTransform();
       }
@@ -133,12 +133,12 @@ class Test3D : Window
       cube.Create(displaySystem);
       return true;
    }
+
    void OnResize(int w, int h)
    {
       camera.Setup(w, h, null);
    }
+
    void OnRedraw(Surface surface)
    {
       int x, y;
index b9d297e..cab6200 100644 (file)
@@ -19,7 +19,7 @@ class CubeApp : GuiApplication
 Camera camera
 {
    fixed,
-   position = { 0, 0, -200 }, 
+   position = { 0, 0, -200 },
    orientation = Euler { 0, 0, 0 },
    fov = 53;
 };
@@ -75,7 +75,7 @@ class Test3D : Window
 
          temp.Multiply(orientation, thisSpin);
          orientation.Normalize(temp);
-         
+
          cube.transform.orientation = orientation;
          cube.UpdateTransform();
          Update(null);
@@ -93,13 +93,13 @@ class Test3D : Window
          delete textures[c];
          delete group.material;
       }
-      
+
    }
    bool OnLoadGraphics()
    {
       char * hiragana[6] = { "あ", "い", "う", "え", "お", "ん" };
       int c;
-      
+
       PrimitiveGroup group;
       Font font;
       DisplaySystem lfbSystem { };
@@ -109,19 +109,19 @@ class Test3D : Window
       //font = lfbSystem.LoadFont("Arial Unicode MS", 180, 0);
       //font = lfbSystem.LoadFont("MingLiu", 150, 0);
       font = lfbSystem.LoadFont("FreeSans.ttf", 175, 0);
-      
+
       for(group = cube.mesh.groups.first, c = 0; c<6; c++, group = group.next)
       {
          Surface surface;
          int tw, th;
          textures[c] = Bitmap { };
          textures[c].Allocate(null, 256, 256, 0, pixelFormat888, false);
-         
+
          surface = textures[c].GetSurface(0,0, null);
          surface.TextFont(font);
          surface.SetBackground(ColorAlpha { 255/*64*/, beige });
          surface.Clear(colorBuffer);
-         surface.SetForeground(ColorAlpha { 255/*128*/, ColorHSV { 60 * c, 100, 50 }}); 
+         surface.SetForeground(ColorAlpha { 255/*128*/, ColorHSV { 60 * c, 100, 50 }});
          surface.TextExtent(hiragana[c], strlen(hiragana[c]), &tw, &th);
          //surface.WriteText((256 - tw) / 2, (256 - th) / 2 /*+ 20*/, hiragana[c], strlen(hiragana[c]));
          surface.WriteText(12,-45, hiragana[c], strlen(hiragana[c]));
@@ -145,12 +145,12 @@ class Test3D : Window
       cube.UpdateTransform();
       return true;
    }
+
    void OnResize(int w, int h)
    {
       camera.Setup(w, h, null);
    }
+
    void OnRedraw(Surface surface)
    {
       surface.Clear(colorAndDepth);
index 6117267..cbbd974 100644 (file)
@@ -29,13 +29,13 @@ class eModelApp : GuiApplication
          bool selected = false;
          if(argc > 1)
          {
-            selected = true;         
+            selected = true;
             strcpy(fileDialog.filePath, argv[1]);
          }
          else
          {
             strcpy(fileDialog.filePath, "toyota.3ds");
-            //selected = true;         
+            //selected = true;
          }
          while(selected || fileDialog.Modal() == ok)
          {
@@ -53,7 +53,7 @@ class ModelViewer : Window
    {
       attached,
       fov = 53,
-      position = { 0, 0,-100 }, 
+      position = { 0, 0,-100 },
       orientation = Euler { 0, 30, 0 },
       zMin = 0.01f;
 
@@ -82,7 +82,7 @@ class ModelViewer : Window
             model.frame++;
             // cameraObject.frame++;
          }
-            
+
          Update(null);
          return true;
       }
@@ -236,7 +236,7 @@ class ModelViewer : Window
          case g:
             fillMode = (fillMode == wireframe) ? solid : wireframe;
             break;
-         case h: 
+         case h:
             help.visible ^= true;
             break;
          case k1: case k2: case k3: case k4:
@@ -244,7 +244,7 @@ class ModelViewer : Window
             else if(key == k2)   cameraObject = model.Find("Camera02");
             else if(key == k3)   cameraObject = model.Find("Camera03");
             else if(key == k4)   cameraObject = model.Find("Camera04");
-            
+
             camera = cameraObject.camera;
             camera.Setup(clientSize.w, clientSize.h, null);
             Update(null);
index a5e38fe..29f8ce6 100644 (file)
@@ -105,7 +105,7 @@ class EngineSettings : Window
       driverBox.AddString("Direct3D 9").tag = (int)"Direct3D";
       driverBox.AddString("Direct3D 8").tag = (int)"Direct3D8";
       driverBox.currentRow = driverBox.firstRow;
-      
+
       resBox.AddString("Current");
       resBox.AddString("640x480").tag = Resolution::res640x480;
       resBox.AddString("800x600").tag = Resolution::res800x600;
index 3ae2cb0..034bb55 100644 (file)
@@ -34,7 +34,7 @@ class GLDemo : Window
       }
    };
 
-   void UpdateObjects(Time diffTime) 
+   void UpdateObjects(Time diffTime)
    {
       Quaternion orientation = cube.transform.orientation;
       orientation.RotateYawPitch((Degrees)diffTime * 0.5, (Degrees)diffTime * 0.5);
@@ -52,7 +52,7 @@ class GLDemo : Window
       cube.UpdateTransform();
       return true;
    }
-   
+
    void OnResize(int w, int h)
    {
       camera.Setup(w, h, null);
index be6da35..dacd706 100644 (file)
@@ -32,7 +32,7 @@ class Snippet : Window
       float blue[] = {0.3f, 0.2f, 1, 1};
       float ambient[4] = { 0.2f, 0.2f, 0.2f };
       float power = 0;
-      float light[] = { -0.810f, -0.585f, 0.468f, 0 };     
+      float light[] = { -0.810f, -0.585f, 0.468f, 0 };
 
       Matrix view
       {
index 70c0677..5006e25 100644 (file)
@@ -9,7 +9,7 @@ class MyApp : GuiApplication
 Camera camera
 {
    fixed,
-   position = Vector3D { 0, 0, -300 }, 
+   position = Vector3D { 0, 0, -300 },
    orientation = Euler { 0, 0, 0 },
    fov = 53;
 };
@@ -63,12 +63,12 @@ class Test3D : Window
       cube.UpdateTransform();
       return true;
    }
+
    void OnResize(int w, int h)
    {
       camera.Setup(w, h, null);
    }
+
    void OnRedraw(Surface surface)
    {
       surface.Clear(depthBuffer);
index 34271e2..9195443 100644 (file)
@@ -22,7 +22,7 @@ class ModelViewer : Window
    Camera camera
    {
       attachedQuaternion,
-      position = Vector3D { 0, 0, -250 }, 
+      position = Vector3D { 0, 0, -250 },
       orientation = Euler { 120, 30, 0 },
       zMin = 0.01f;
       fov = 53;
index daf57cf..97ff3c1 100644 (file)
@@ -9,7 +9,7 @@ class MyApp : GuiApplication
 Camera camera
 {
    fixed,
-   position = Vector3D { 0, 0, -200 }, 
+   position = Vector3D { 0, 0, -200 },
    orientation = Euler { 0, 0, 0 },
    fov = 53;
 };
@@ -92,11 +92,11 @@ public:
                uint16 indices[6][4] =
                {
                   // up, front, down, back, right, left
-                  { 17,21,20,16 }, 
-                  { 0,3,2,1 }, 
-                  { 22,18,19,23 }, 
-                  { 5,6,7,4 }, 
-                  { 9,10,14,13 }, 
+                  { 17,21,20,16 },
+                  { 0,3,2,1 },
+                  { 22,18,19,23 },
+                  { 5,6,7,4 },
+                  { 9,10,14,13 },
                   { 12,15,11,8 }
                };
 
@@ -163,12 +163,12 @@ class Test3D : Window
       cube.UpdateTransform();
       return true;
    }
+
    void OnResize(int w, int h)
    {
       camera.Setup(w, h, null);
    }
+
    void OnRedraw(Surface surface)
    {
       surface.Clear(depthBuffer);
index 68fd631..cf4e15d 100644 (file)
@@ -19,7 +19,7 @@ class CubeApp : GuiApplication
 Camera camera
 {
    fixed,
-   position = { 0, 0, -200 }, 
+   position = { 0, 0, -200 },
    orientation = Euler { 0, 0, 0 },
    fov = 53;
 };
@@ -80,7 +80,7 @@ class Test3D : Window
 
          temp.Multiply(orientation, thisSpin);
          orientation.Normalize(temp);
-         
+
          cube.transform.orientation = orientation;
          cube.UpdateTransform();
          Update(null);
@@ -92,7 +92,7 @@ class Test3D : Window
    bool OnLoadGraphics()
    {
       display.ambient = ColorRGB { 0.7f, 0.7f, 0.7f };
-      
+
       material.baseMap = texture.bitmap;
       cube.Create(displaySystem);
       cube.mesh.ApplyMaterial(material);
@@ -103,12 +103,12 @@ class Test3D : Window
 
       return true;
    }
+
    void OnResize(int w, int h)
    {
       camera.Setup(w, h, null);
    }
+
    void OnRedraw(Surface surface)
    {
       surface.Clear(colorAndDepth);
index 0c4d26f..241b02d 100644 (file)
@@ -8,7 +8,7 @@ class MyApp : GuiApplication
 Camera camera
 {
    fixed,
-   position = Vector3D { 0, 0, -300 }, 
+   position = Vector3D { 0, 0, -300 },
    orientation = Euler { 0, 0, 0 },
    fov = 53;
 };
@@ -39,13 +39,13 @@ class Hello3D : Window
       cube.UpdateTransform();
       return true;
    }
+
    void OnResize(int w, int h)
    {
       camera.Setup(w, h, null);
       camera.Update();
    }
+
    void OnRedraw(Surface surface)
    {
       surface.Clear(depthBuffer);
index fd2ec53..aebecf5 100644 (file)
@@ -111,7 +111,7 @@ static bool CreateBack(Mesh mesh, int width, int height, int depth, DisplaySyste
          };
          uint16 indices[4] =
          {
-            5,6,7,4, 
+            5,6,7,4,
          };
 
          CopyBytes(mesh.vertices, vertices, sizeof(vertices));
@@ -252,9 +252,9 @@ static bool CreateSide(Mesh mesh, int width, int height, int depth, DisplaySyste
          uint16 indices[16] =
          {
             // up, down, right, left
-            17,21,20,16 , 
-            22,18,19,23, 
-            9,10,14,13, 
+            17,21,20,16 ,
+            22,18,19,23,
+            9,10,14,13,
             12,15,11,8
          };
 
@@ -281,7 +281,7 @@ static bool CreateSide(Mesh mesh, int width, int height, int depth, DisplaySyste
 class Desktop3D : Window
 {
    text = "Orbiting 3D Desktop", size = Size { WINDOW_WIDTH,WINDOW_HEIGHT };
-      
+
    Object lookAt {};
    Camera camera
    {
@@ -340,7 +340,7 @@ class Desktop3D : Window
             dock.speed = 0;
             dock.currentIcon--;
             if(dock.currentIcon < 0)
-               dock.currentIcon += NUM_ICONS;                  
+               dock.currentIcon += NUM_ICONS;
             dockTimer.Stop();
          }
          return true;
@@ -386,13 +386,13 @@ class Desktop3D : Window
             if(sliding == 1 && switching == 1 && entering == 1)
             {
                globalPosition += (double)diffTime * ORBIT_SPEED;
-         
+
                for(child = firstChild; child; child = child.next)
                {
                   if(child.display != display)
                   {
                      Window3D window3D = Desktop3DGetWindowHandle(child);
-               
+
                      if(window3D.position < window3D.wantedPosition - 0.000001)
                      {
                         window3D.wantedPosition += (double)diffTime * ORBIT_SPEED;
@@ -481,7 +481,7 @@ class Desktop3D : Window
             position.x = fromPosition.x + factor * (toPosition.x - fromPosition.x);
             position.y = fromPosition.y + factor * (toPosition.y - fromPosition.y);
             position.z = fromPosition.z + factor * (toPosition.z - fromPosition.z);
-            
+
             camera.AdjustAngle(angle);
             camera.AdjustPosition(position);
          }
@@ -507,7 +507,7 @@ class Desktop3D : Window
       // sliding = 1;
       switching = 1;
       entering = 1;
-      
+
       light.diffuse = white;
       light.specular = white;
       light.orientation = Euler {  }; //Quaternion { 1,0,Pi,0 };
@@ -584,7 +584,7 @@ class Desktop3D : Window
          icon -= 2;
          if(icon < 0) icon += NUM_ICONS;
       /*
-         eSurface_Blit(surface, dock.background, 0,0,0,0, 
+         eSurface_Blit(surface, dock.background, 0,0,0,0,
             dock.background->width, dock.background->height);
       */
          for(c = 0; c<NUM_ICONS; c++)
@@ -658,7 +658,7 @@ class Desktop3D : Window
    void OnRedraw(Surface surface)
    {
       Window child;
-      
+
       surface.Clear(depthBuffer);
 
       //PrintLn("position: ", camera.cPosition);
@@ -730,7 +730,7 @@ class Desktop3D : Window
 
                camera.Unproject(startPositionProjected, startPositionView);
                camera.Untransform(startPositionView, startPositionWorld);
-               
+
                finalPosition.x = (float)(cos(window3D.position) * ORBIT_RADIUS);
                finalPosition.y = 0;
                finalPosition.z = (float)(sin(window3D.position) * ORBIT_RADIUS);
@@ -788,8 +788,8 @@ class Desktop3D : Window
          }
       }
 
-      // display.DrawObject(knot);   
-     
+      // display.DrawObject(knot);
+
       display.SetCamera(null, null);
 
       Dock_OnRedraw(surface);
@@ -813,7 +813,7 @@ class Desktop3D : Window
          display.DrawObject(window3D.cube.Find("Front"));
       }
       else
-      {     
+      {
          HitRecord hit;
          OldList list;
 
@@ -827,7 +827,7 @@ class Desktop3D : Window
             }
          }
          display.GetHits(list);
-        
+
          hit = list.first;
          if(hit && hit.numTags)
          {
@@ -921,7 +921,7 @@ class Desktop3D : Window
             }
          }
       }
-      
+
       return true;
    }
 
@@ -963,14 +963,14 @@ class Desktop3D : Window
    {
       int mx, my;
       bool back;
-      
+
       Window clickedWindow = GetCursorLocation(x, y, &mx, &my, &back);
       if(clickedWindow)
       {
          Desktop3DMouseMessage(clickedWindow, 26, mx, my, &mods, false, true);
 
       }
-            
+
       if(moving)
       {
          ReleaseCapture();
@@ -982,7 +982,7 @@ class Desktop3D : Window
    bool OnKeyHit(Key key, unichar character)
    {
       static int id = 0;
-      static char * shotFileNames[] = 
+      static char * shotFileNames[] =
       {
          ":shot1.jpg", ":shot2.jpg", ":shot3.jpg", ":shot4.jpg"
       };
@@ -1067,7 +1067,7 @@ class Desktop3D : Window
                   {
                      EditBox
                      {
-                        this, multiLine = true, is3D = true, borderStyle = Fixed, hasClose = true, text = "Video", 
+                        this, multiLine = true, is3D = true, borderStyle = Fixed, hasClose = true, text = "Video",
                         size = Size { WINDOW_WIDTH, WINDOW_HEIGHT }, fileName = ":430.flc"
                      }.Create();
                   }
@@ -1075,7 +1075,7 @@ class Desktop3D : Window
                   {
                      Picture
                      {
-                        this, is3D = true, borderStyle = fixed, hasClose = true, text = "3D Window", 
+                        this, is3D = true, borderStyle = fixed, hasClose = true, text = "3D Window",
                         size = Size { WINDOW_WIDTH, WINDOW_HEIGHT }, image = BitmapResource { fileName = shotFileNames[id] }, opacity = 1, inactive = false
                      }.Create();
                   }
@@ -1275,11 +1275,11 @@ static Window3D Setup3DWindow(Window window, int w, int h)
          if(child == window)
             child3D = window3D;
 
-         child3D.wantedPosition = virtualDesktop.globalPosition + 
+         child3D.wantedPosition = virtualDesktop.globalPosition +
             child3D.id * 2*Pi / (virtualDesktop.numWindows+1);
          if(child == window)
             window3D.position = window3D.wantedPosition;
-         virtualDesktop.poppingBiggest = Max(virtualDesktop.poppingBiggest, 
+         virtualDesktop.poppingBiggest = Max(virtualDesktop.poppingBiggest,
             child3D.position - child3D.wantedPosition);
       }
    }
@@ -1300,7 +1300,7 @@ static void Update3DWindow(Window window, Box box)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 
-   glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 
+   glCopyTexSubImage2D(GL_TEXTURE_2D, 0,
       box.left,
       window.size.h - h - box.top,
       box.left + virtualDesktop.clientStart.x,
index cdb7bee..cfc7d21 100644 (file)
@@ -201,7 +201,7 @@ class RenderThread : Thread
       for(y = start; y <= end && !view3D.abort; y++)
       {
          Box box { 0, y, bitmap.width, y };
-         
+
          for(x = 0; x < bitmap.width && !view3D.abort; x++)
          {
             Vector3D v, end;
@@ -233,11 +233,11 @@ class RenderThread : Thread
             g /= count*count;
             b /= count*count;
 
-            picture[y * stride + x] = 
+            picture[y * stride + x] =
             {
-               (byte)Min(255, Max(0, a*255)), 
+               (byte)Min(255, Max(0, a*255)),
                { (byte)Min(255, Max(0, r*255)), (byte)Min(255, Max(0, g*255)), (byte)Min(255, Max(0, b*255)) }
-            };            
+            };
          }
       }
       done = true;
@@ -294,10 +294,10 @@ class RTView : BaseView3D
 
             Update(null);
             UpdateDisplay();
-            
+
             camera.Setup(bitmap.width, bitmap.height, null);
             camera.Update();
-            
+
             for(lt : scene.lights)
             {
                Light * light = lt;
@@ -332,7 +332,7 @@ class RTView : BaseView3D
                Update(null);
                UpdateDisplay();
             }
-            
+
             for(t = 0; t < numThreads; t++)
                delete threads[t];
 
@@ -354,7 +354,7 @@ class RTObject
 
    virtual void Compute();
    virtual bool Render(Line ray, ColorARGBd * color, Vector3D intersect, Vector3D vIntersect)
-   {  
+   {
       return false;
    }
 }
@@ -378,7 +378,7 @@ class RTScene
       for(o : objects)
       {
          ColorARGBd newColor;
-         
+
          // TOFIX: &ray here has different behavior?
          if(o.Render(ray, newColor, null, vIntersect) && vIntersect.z < z)
          {
@@ -437,11 +437,11 @@ class RTCube : RTObject
       uint16 indices[6][4] =
       {
          // up, front, down, back, right, left
-         { 17,21,20,16 }, 
-         { 0,3,2,1 }, 
-         { 22,18,19,23 }, 
-         { 5,6,7,4 }, 
-         { 9,10,14,13 }, 
+         { 17,21,20,16 },
+         { 0,3,2,1 },
+         { 22,18,19,23 },
+         { 5,6,7,4 },
+         { 9,10,14,13 },
          { 12,15,11,8 }
          //{ 8,11,15,12 }
       };
@@ -506,7 +506,7 @@ class RTCube : RTObject
                   }
                }
             }
-               
+
             if(visible && gotIntersect)
             {
                Vector3D v;
@@ -640,7 +640,7 @@ class RTMandelbulb : RTCube
          firstPointInside = true;
          l.delta.Scale(l.delta, -1);
       }
-      
+
       while(true)
       {
          Vector3D p
@@ -673,7 +673,7 @@ class RTMandelbulb : RTCube
                l.p0.z - l.delta.z * stopT
             };
             is = p;
-            return true;            
+            return true;
          }
          if(refine == refineCount)
          {
@@ -693,11 +693,11 @@ class RTMandelbulb : RTCube
          Vector3D rayDirection;
          Vector3D localIntersect;
          Vector3D p;
-         Line toBulb;         
+         Line toBulb;
 
          rayDirection.MultMatrix(ray.delta, inverse);
          localIntersect.MultMatrix(intersect, inverse);
-         
+
          rayDirection.Normalize(rayDirection);
          toBulb.p0 = localIntersect;
          toBulb.delta = rayDirection;
@@ -712,7 +712,7 @@ class RTMandelbulb : RTCube
                Angle phi = atan2(p.y, p.x);
                Vector3D normal { };
                int count = 0;
-               //Angle 
+               //Angle
                offset = 2 * asin(angleOffset / (2*r));
 
 
@@ -765,7 +765,7 @@ class RTMandelbulb : RTCube
 
                      toBulb2.delta = toBulb2.p0;
                      toBulb2.delta.Normalize(toBulb2.delta);
-                     
+
                      //if(WalkTowards(toBulb2, pp, ((r * safetyFactor) - r) / 2.0, 30))
                      if(WalkTowards(toBulb2, pp, (r + startOffDistance - r) / 2.0, 30, true))
                      {
@@ -781,7 +781,7 @@ class RTMandelbulb : RTCube
                   if(numFound >= 2)
                   {
                      Plane normalPlane { };
-                     
+
                      double d1 = (found[0] && found[2]) ? (distances[0] * distances[1]) : MAXDOUBLE;
                      double d2 = (found[1] && found[2]) ? (distances[1] * distances[2]) : MAXDOUBLE;
                      double d3 = (found[2] && found[3]) ? (distances[2] * distances[3]) : MAXDOUBLE;
@@ -853,7 +853,7 @@ class RTMandelbulb : RTCube
                         R.Normalize(R);
                         l = R.DotProduct(localCameraDirection);
                         if(l < 0) l = 0;
-                        
+
                         r += pow(l, material.power) * light->multiplier * light->specular.r * material.specular.r;
                         g += pow(l, material.power) * light->multiplier * light->specular.g * material.specular.g;
                         b += pow(l, material.power) * light->multiplier * light->specular.b * material.specular.b;
@@ -885,11 +885,11 @@ class MandelbulbApp : GuiApplication
       scene.lights.Add(&light2);
       //scene.lights.Add(&light3);
       //scene.objects.Add(RTCube { center = { }, size = { 100, 100, 100 } });
-      scene.objects.Add(RTMandelbulb { 
-         material.power = 16; 
-         material.ambient = blanchedAlmond; 
-         material.specular = blanchedAlmond; 
-         material.diffuse = blanchedAlmond, 
+      scene.objects.Add(RTMandelbulb {
+         material.power = 16;
+         material.ambient = blanchedAlmond;
+         material.specular = blanchedAlmond;
+         material.diffuse = blanchedAlmond,
          center = { }, orientation = Euler { yaw = 0, pitch = 220 /*-140*/ }, size = { 100, 100, 100 } });
       //scene.objects.Add(RTCube { center = { -40, 0, 0 }, orientation = Euler { 143, -138, 0 }, size = { 50, 50, 50 } });
       //scene.objects.Add(RTCube { center = {  40, 0, 0}, orientation = Euler { -145, -22, 0 }, size = { 30, 30, 30 } });
index c64e1c9..af754b7 100644 (file)
@@ -127,7 +127,7 @@ static void ShowShadowVector3D(Camera camera, Surface surface, BallSprite sprite
 static void RotateSprite(BallSprite sprite, Degrees amount)
 {
        if((sprite.t+=amount * ROTATESPEED)>=2*Pi)sprite.t-=2*Pi;
-   
+
        sprite.r = (int)(1+sin(NUMPETALS*(sprite.t))*FACTOR1);
        sprite.x = (int)(sprite.r*cos(sprite.t));
        sprite.y = (float)(sprite.r*sin(sprite.t) - BALLHEIGHT);
@@ -141,7 +141,7 @@ static void RotateSprite(BallSprite sprite, Degrees amount)
        sprite.y += sprite.yi * amount;
    sprite.y = Min(Max(sprite.y, CEILING), FLOORALT);
    if(Sgn(sprite.yi) == 1)
-   {  
+   {
       if(sprite.y >= FLOORALT) sprite.yi *= -1;
    }
    else
@@ -201,7 +201,7 @@ class Balls : Window
       timer.Start();
       timerStarted = true;
       lastTime = GetTime();
-      
+
       display.SetPalette(palette, true);
       return true;
    }
@@ -286,9 +286,9 @@ class Balls : Window
       float minZ, maxZ;
       // Background
       float layers[] = { 0, 0.5f, 0.51f, 0.525f, 0.55f, 0.65f, 0.8f, 1.0f };
-      ColorAlpha colors[] = 
-      { 
-         palette[16], 
+      ColorAlpha colors[] =
+      {
+         palette[16],
    #ifdef GRAYBACKGROUND
          palette[17],palette[18],palette[19], palette[20],palette[21],palette[22]
    #else
@@ -319,14 +319,14 @@ class Balls : Window
          if(sprites[c].transformed.z > maxZ) maxZ = (float)sprites[c].transformed.z;
       }
 
-       for(z=(int)maxZ; z>=(int)minZ; z--)
-               for(c=0; c<NUMBALLS; c++)
+      for(z=(int)maxZ; z>=(int)minZ; z--)
+         for(c=0; c<NUMBALLS; c++)
          {
-                       if((int)sprites[c].transformed.z == z) 
+            if((int)sprites[c].transformed.z == z)
                ShowSpriteVector3D(camera, surface, sprites[c]);
          }
    }
-   
+
 #ifndef ECERE_MODULE
    bool OnStateChange(WindowState state, Modifiers mods)
    {
index 879127c..ea80c69 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001-2010 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    demo.ec - Main Module
 ****************************************************************************/
 import "ecere"
@@ -249,7 +249,7 @@ class Scene : Window
    bool OnLoadGraphics()
    {
       Bitmap map { };
-      
+
       light.ambient = { 0.2f, 0.2f, 0.2f };
       light.diffuse = light.specular = white;
       light.orientation = { 1,0,0,0 };
@@ -266,7 +266,7 @@ class Scene : Window
             textures[c].Allocate(null, 256, 256, 0, map.pixelFormat, true);
             if(map.pixelFormat == pixelFormat8)
                memcpy(textures[c].palette, map.palette, 256*4);
-            textures[c].Grab(map, 
+            textures[c].Grab(map,
                      (c % across) * textures[c].width,
                      (c / across) * textures[c].height);
             textures[c].MakeMipMaps(displaySystem);
@@ -330,7 +330,7 @@ class Scene : Window
 
       if(!filled) display.fillMode = wireframe;
       terrainMesh.RenderMesh(display, null, textures);
-      if(!filled) display.fillMode = solid; 
+      if(!filled) display.fillMode = solid;
 
       display.DrawObject(dna);
       display.DrawObject(player);
@@ -339,7 +339,7 @@ class Scene : Window
 
       surface.SetForeground(black);
       //surface.WriteTextf(10,10, "Detail: %.0f, ZMax: %.02f, FPS: %.02f", detailBias, zMax, frameRate.fps);
-      
+
       frameRate.Step();
    }
 
@@ -357,16 +357,16 @@ class Scene : Window
             acquiredInput = false;
             GetMousePosition(&lastMousePosition.x, &lastMousePosition.y);
             break;
-         case a: 
+         case a:
             acquiredInput = AcquireInput(true);
             break;
-         case k0: 
-            camera.type = fixed; 
+         case k0:
+            camera.type = fixed;
             camera.position = camera.cPosition;
             camera.orientation = camera.cOrientation;
             break;
-         case k1: 
-            /*camera.type = attached; 
+         case k1:
+            /*camera.type = attached;
             camera.position = { 0, 0, -30 };
             camera.Slerp(0.1f);
             */
@@ -375,8 +375,8 @@ class Scene : Window
             camera.orientation = Euler { 180, 20, 0 };
             camera.Slerp(0.3f);
             break;
-         case k2: 
-            camera.type = lookAt; 
+         case k2:
+            camera.type = lookAt;
             camera.position = camera.cPosition; //{ 1000, -3000, 0 };
             camera.position.z -= 50;
             camera.orientation = { 1,0,0,0 };
index eed3748..2c5ca30 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    dna.ec - DNA 3D Model
 ****************************************************************************/
 public import "ecere"
@@ -136,11 +136,11 @@ public:
          uint16 indices[36] =
          {
             // up, front, down, back, right, left
-            21,20,16, 17,21,16, 
-            3,2,1, 0,3,1, 
-            18,19,23, 22,18,23, 
-            6,7,4, 5,6,4, 
-            10,14,13, 9,10,13, 
+            21,20,16, 17,21,16,
+            3,2,1, 0,3,1,
+            18,19,23, 22,18,23,
+            6,7,4, 5,6,4,
+            10,14,13, 9,10,13,
             15,11,8, 12,15,8
          };
 
@@ -180,7 +180,7 @@ public:
       PrimitiveGroup group;
       uint16 num = (uint16)(curveSegments*numCurves);
       int vertexCount = (num+1)*4;
-      
+
       if(Allocate({ vertices = true, texCoords1 = true }, vertexCount, displaySystem))
       {
          uint16 v;
@@ -377,13 +377,13 @@ public:
                char name[20];
                Vector3D pos;
 
-               // Pick texture         
+               // Pick texture
                int b1 = GetRandom(0,3);
                int b2 = 3-b1;
                Quaternion angle { 1,0,0,0 };
                Vector3D position;
                Matrix matrix;
-               
+
                // Change Rotation
                angle.Yaw(-rotation*c);
                matrix.RotationQuaternion(angle);
@@ -413,7 +413,7 @@ public:
                base.UpdateTransform();
                pos.MultMatrix(position, matrix); base.transform.position = pos;
                base.material = displaySystem.GetMaterial(names[b2]);
-               
+
                //*******************  DESOXYRIBOSE  *******************
                sprintf(name, "Desoxyribose%02d", c*2);
                desoxyribose = { }; AddName(desoxyribose, name);
index c6cb415..8f7d96b 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001-2010 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    dted.ec - DTED data loader
 ****************************************************************************/
 import "terrain"
index 0f01540..93322fc 100644 (file)
@@ -36,7 +36,7 @@ static float fsqrt(float x, float y, float z)
 {
    float ix = Abs(x),iy = Abs(y), iz = Abs(z);
    float tmp;
-        
+
    if(ix < iy) { tmp = ix; ix = iy; iy = tmp; }
    if(ix < iz) { tmp = ix; ix = iz; iz = tmp; }
    if(iz > iy) { iz = iy; }
@@ -114,7 +114,7 @@ class BinTri : struct
       rightChild.rightChild = null;
 
       leftChild.tv0 = tva;
-      rightChild.tv1 = tva;   
+      rightChild.tv1 = tva;
       leftChild.tva = tvc;
       rightChild.tva = tvc;
       leftChild.tv1 = tv0;
@@ -125,7 +125,7 @@ class BinTri : struct
 
       leftChild.v0 = va;
       rightChild.v1 = va;
-      leftChild.va = vc;   
+      leftChild.va = vc;
       rightChild.va = vc;
       leftChild.v1 = v0;
       rightChild.v0 = v1;
@@ -162,7 +162,7 @@ class BinTri : struct
    }
 
    void Split(struct BinTri * stack, int * triIndex,
-              byte level, float resolutionX, float resolutionY, int positionX, int positionY, int positionZ, 
+              byte level, float resolutionX, float resolutionY, int positionX, int positionY, int positionZ,
               Elevation * heightMap, byte maxVarLevel, int detailBias, Elevation * variance, byte maxLevel)
    {
       int distance;
@@ -219,13 +219,13 @@ class BinTri : struct
       if(ix < iz) { tmp = ix; ix = iz; iz = tmp; }
       if(iz > iy) { iz = iy; }
       distance = ix + (iz>>1);
-      
+
       // *** Find the variance table index ***
       varIndex = index;
       if(level > maxVarLevel)
          varIndex >>= (level - maxVarLevel);
       varIndex--;
-   
+
       if(distance < detailBias * variance[varIndex])
       {
          // *** Split Further ***
@@ -251,7 +251,7 @@ class Patch : struct
    Elevation *leftVariance, *rightVariance;
    Elevation maxHeight, minHeight;
 
-   Elevation CalcVariance(Elevation * variance, int patchSize, int numBinTris, int numVarTris, 
+   Elevation CalcVariance(Elevation * variance, int patchSize, int numBinTris, int numVarTris,
                           int i, /*struct */Point v0, /*struct */Point va, /*struct */Point v1, /*struct */Point vc)
    {
       Elevation real, avg;
@@ -294,9 +294,9 @@ class TerrainPatch : struct
    PrimitiveGroup group;
    bool shown:1;
 
-   void Create(Mesh mesh, int wide, int patchSize, 
+   void Create(Mesh mesh, int wide, int patchSize,
                float resolutionX, float resolutionY,
-               int acrossX, int acrossY, int tilingMult, int detailMult, Bitmap * detail, 
+               int acrossX, int acrossY, int tilingMult, int detailMult, Bitmap * detail,
                bool invertX, bool invertY)
    {
       int x,y,v;
@@ -322,7 +322,7 @@ class TerrainPatch : struct
          dy = ((wide - 1 - patch.y) % pptY) * (patchSize - 1);
       else
          dy = (patch.y % pptY) * (patchSize - 1);
-         
+
       // *** Compute the Vertices ***
       for(v = 0, y = 0; y<patchSize; y++)
       {
@@ -346,14 +346,14 @@ class TerrainPatch : struct
                mesh.texCoords[v].x *= tilingMult;
                mesh.texCoords[v].y *= tilingMult;
             }
-         }  
+         }
       }
    }
 };
 
 class PatchNode : struct
 {
-   TerrainPatch patch;   
+   TerrainPatch patch;
    PatchNode child[4];
    Elevation maxHeight, minHeight;
    Vector3D block;
@@ -428,7 +428,7 @@ class PatchNode : struct
          radius = Max(dx, dy) * SQR2;
 
          child[0] = child[1] = child[2] = child[3] = null;
-      }  
+      }
       return true;
    }
 
@@ -448,7 +448,7 @@ class PatchNode : struct
          shown = camera.SphereVisible(block, radius);
          if(shown)
          {
-            if(patch) 
+            if(patch)
                patch.shown = true;
             else if(child[0])
             {
@@ -464,13 +464,13 @@ class PatchNode : struct
    void QuadClear(int patchesWide)
    {
       int x,y;
-      
+
       TerrainPatch terrainPatch;
 
       if(!shown) return;
 
       terrainPatch = patch;
-      
+
       if(terrainPatch)
       {
          struct TerrainPatch * terrainPatchPtr = (void *)terrainPatch;
@@ -519,7 +519,7 @@ class PatchNode : struct
    }
 
    void QuadSplit(TerrainMesh terrainMesh,
-                  byte maxVarLevel, byte maxLevel, float resolutionX, float resolutionY, 
+                  byte maxVarLevel, byte maxLevel, float resolutionX, float resolutionY,
                   int positionX, int positionY, int positionZ, int detailBias)
    {
       TerrainPatch patch = this.patch;
@@ -527,9 +527,9 @@ class PatchNode : struct
 
       if(patch)
       {
-         patch.leftTri.Split(terrainMesh.binTriStack, &terrainMesh.index, 0, resolutionX, resolutionY, positionX, positionY, positionZ, 
+         patch.leftTri.Split(terrainMesh.binTriStack, &terrainMesh.index, 0, resolutionX, resolutionY, positionX, positionY, positionZ,
             patch.patch.heightMap, maxVarLevel, detailBias, patch.patch.leftVariance, maxLevel);
-         patch.rightTri.Split(terrainMesh.binTriStack, &terrainMesh.index, 0, resolutionX, resolutionY, positionX, positionY, positionZ, 
+         patch.rightTri.Split(terrainMesh.binTriStack, &terrainMesh.index, 0, resolutionX, resolutionY, positionX, positionY, positionZ,
             patch.patch.heightMap, maxVarLevel, detailBias, patch.patch.rightVariance, maxLevel);
       }
       else if(child[0])
@@ -561,7 +561,7 @@ class PatchNode : struct
          }
       }
       else
-      {           
+      {
          child[0].QuadTriangles(terrainMesh);
          child[1].QuadTriangles(terrainMesh);
          child[2].QuadTriangles(terrainMesh);
@@ -577,7 +577,7 @@ class TerrainMesh : struct
    struct TerrainPatch * patches;
    PatchNode nodes { };
    int acrossX, acrossY;
-   
+
    // *** Runtime Stuff ***
    int nTriangles;
    int maxTris;
@@ -747,7 +747,7 @@ class TerrainMesh : struct
 
       nodes.QuadCheck((int)camera.cPosition.x, (int)camera.cPosition.y, (int)camera.cPosition.z, distance, camera);
       nodes.QuadClear(terrain.wide);
-      nodes.QuadSplit(this, (byte)terrain.maxVarLevel, (byte)terrain.maxLevel, 
+      nodes.QuadSplit(this, (byte)terrain.maxVarLevel, (byte)terrain.maxLevel,
          terrain.resolutionX, terrain.resolutionY,
          (int)camera.cPosition.x, (int)camera.cPosition.y, (int)camera.cPosition.z, (int)bias);
       nodes.QuadTriangles(this);
@@ -760,10 +760,10 @@ class TerrainMesh : struct
 
       object.transform.scaling = { 1, 1, 1 };
       object.UpdateTransform();
-      
+
       object.matrix.Identity();
       display.PushMatrix();
-      
+
       display.SetTransform(object.matrix, false);
       for(c = 0; c<terrain.numPatches; c++)
       {
@@ -818,7 +818,7 @@ class TerrainMesh : struct
          if((patches = new0 struct TerrainPatch[terrain.numPatches]))
          {
             result = true;
-   
+
             // *** Set up Patches ***
             for(c = 0, y = 0; y<terrain.wide; y++)
             {
@@ -841,7 +841,7 @@ class TerrainMesh : struct
                      if(patch.group)
                      {
                         patch.group.material = patch.material;
-                        patch.Create(patch.mesh, terrain.wide, terrain.patchSize, 
+                        patch.Create(patch.mesh, terrain.wide, terrain.patchSize,
                            terrain.resolutionX, terrain.resolutionY,
                            acrossX, acrossY, 0, 0, null, invertX, invertY);
                         patch.mesh.UnlockPrimitiveGroup(patch.group);
@@ -891,7 +891,7 @@ class Terrain
    {
       bool result = false;
 
-      if((1 << log2i(size - 1)) + 1 != size) 
+      if((1 << log2i(size - 1)) + 1 != size)
          Log("Invalid terrain size.\n");
       else if(1 << log2i(patchesCount) != patchesCount || ((size-1) / patchesCount) > 128)
          Log("Invalid patch size.\n");
@@ -933,7 +933,7 @@ class Terrain
             numVarTris = (1 << (maxVarLevel + 1)) - 1;
 
             result = true;
-      
+
             // *** Set up Patches ***
             for(c = 0, y = 0; y < patchesCount; y++)
             {
@@ -951,7 +951,7 @@ class Terrain
                   // *** Set up Height Map ***
                   patch.heightMap = new Elevation[numSamples];
                   if(!patch.heightMap) { result = false; break; };
-            
+
                   k = (y*(size-1)) * this.size + (x * (size-1));
                   for(h = 0, j = 0; j<size; j++)
                   {
@@ -987,10 +987,10 @@ class Terrain
                      patch.rightTri.tva = size-1;
                   }
 
-                  patch.leftTri.vc = 
+                  patch.leftTri.vc =
                   {
-                     (patch.leftTri.v0.x + patch.leftTri.v1.x) / 2, 
-                     (patch.leftTri.v0.y + patch.leftTri.v1.y) / 2 
+                     (patch.leftTri.v0.x + patch.leftTri.v1.x) / 2,
+                     (patch.leftTri.v0.y + patch.leftTri.v1.y) / 2
                   };
                   patch.leftTri.tvc = (patch.leftTri.tv0 + patch.leftTri.tv1)/2;
 
@@ -1011,7 +1011,7 @@ class Terrain
                   if(!patch.rightVariance) { result = false; break; };
 
                   // *** Compute Variance ***
-                  patch.CalcVariance(patch.leftVariance, 
+                  patch.CalcVariance(patch.leftVariance,
                      patchSize, numBinTris, numVarTris,
                      1, patch.leftTri.v0,patch.leftTri.va,
                      patch.leftTri.v1, patch.leftTri.vc);
index 5878805..86949b9 100644 (file)
@@ -2,7 +2,7 @@ import "EcereAudio"
 
 // There are 12 half-tones in an octave, and the frequency doubles in an octave.
 define Do = 1.0;
-define Do_ = 1.0594630943592952645618252949463; // The root 12 of 2. 
+define Do_ = 1.0594630943592952645618252949463; // The root 12 of 2.
 define Re = Do_*Do_;
 define Re_ = Re*Do_;
 define Mi = Re_*Do_;
index 0a8d2fa..ff1ac01 100644 (file)
@@ -226,7 +226,7 @@ class S3M
          mixer.Release();
       }
    }
-   
+
    void PlayNote(Mixer mixer, Instrument ins, uint16 note, uint16 octave, byte volume, uint16 channel)
    {
       uint32 note_st3period;
@@ -250,7 +250,7 @@ class S3M
             double freq = 14317456.0 / note_st3period / 22150/2;
             //double freq = 500.0/note_st3period;
             Voice v = voices[channel-1];
-            
+
             if(!v)
             {
                v = mixer.Play(ins.sound, vol, bal, freq);
@@ -431,7 +431,7 @@ class S3M
 
 // There are 12 half-tones in an octave, and the frequency doubles in an octave.
 define Do = 1.0;
-define Do_ = 1.0594630943592952645618252949463; // The root 12 of 2. 
+define Do_ = 1.0594630943592952645618252949463; // The root 12 of 2.
 define Re = Do_*Do_;
 define Re_ = Re*Do_;
 define Mi = Re_*Do_;
@@ -467,7 +467,7 @@ class MainWindow : Window
       //s3m.Load("forgivme.s3m");
       //s3m.Load("quiadroi.s3m");
       //s3m.Load("everyido.s3m");
-      //s3m.Load("saywords.s3m");      
+      //s3m.Load("saywords.s3m");
       //s3m.Load("keven1.s3m");
 
       instrument = s3m.instruments[0].sound;
@@ -478,7 +478,7 @@ class MainWindow : Window
    {
       delete mixer;
    }
-   
+
    Timer pbTimer
    {
       this, 0.01, true;
index 5dc0b69..7f7e3d7 100644 (file)
@@ -15,10 +15,10 @@ class EDABetterTestForm : Window
    DataSource ds { };
    Database db;
    Table tbl;
-   
+
    Label groupDrv { this, anchor = { left = 8, top = 8, right = 8 }, size = { h = 60 }, text = "Driver", inactive = false, isGroupBox = true };
-   
-   DropBox driver 
+
+   DropBox driver
    {
       groupDrv, this, "Driver", size = { 136, 24 }, position = { 16, 24 };
 
@@ -83,10 +83,10 @@ class EDABetterTestForm : Window
 
       bool OnPostCreate(void)
       {
-         //AddField({ "subclass(DataSourceDriver)" });  // won't compile, should be done differently? 
+         //AddField({ "subclass(DataSourceDriver)" });  // won't compile, should be done differently?
          //AddRow().SetData(null, GetDataDriver("EDB"));
          //AddRow().SetData(null, GetDataDriver("MySQL"));
-         
+
          AddString("EDB");
          AddString("MemoryEDB");
          AddString("MySQL");
@@ -100,7 +100,7 @@ class EDABetterTestForm : Window
    };
 
    Label groupDs { this, anchor = { left = 8, top = 76, right = 8 }, size = { h = 60 }, text = "Datasource (Host, Port, Username, Password)", inactive = false, isGroupBox = true, disabled = true };
-   
+
    EditBox host { groupDs, this, size = { 142, 24 }, position = { 16, 24 } };
    EditBox port { groupDs, this, size = { 70, 24 }, position = { 168, 24 } };
    EditBox username { groupDs, this, size = { 150, 24 }, position = { 264, 24 } };
@@ -108,7 +108,7 @@ class EDABetterTestForm : Window
    Button openDs
    {
       groupDs, this, text = "Open", position = { 552, 24 };
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          ds.driver = driver.currentRow.string;
@@ -143,7 +143,7 @@ class EDABetterTestForm : Window
    Button closeDs
    {
       groupDs, this, text = "Close", position = { 598, 24 }, disabled = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          ds.driver = null;
@@ -162,7 +162,7 @@ class EDABetterTestForm : Window
    Button testDs
    {
       groupDs, this, text = "Test", position = { 644, 24 }, disabled = false;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          int c;
@@ -175,8 +175,8 @@ class EDABetterTestForm : Window
          return true;
       }
    };
-   
-   
+
+
    Label groupDb { this, text = "Database (List, Name)", anchor = { left = 8, top = 152, right = 8 }, size = { h = 120 }, inactive = false, isGroupBox = true, disabled = true };
 
    ListBox listDatabases
@@ -198,7 +198,7 @@ class EDABetterTestForm : Window
    Button openDb
    {
       groupDb, this, "Open", position = { 448, 24 };
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          db = ds.OpenDatabase(nameDb.contents, dbCreate.checked ? create : no);
@@ -225,7 +225,7 @@ class EDABetterTestForm : Window
    Button closeDb
    {
       groupDb, this, "Close", position = { 496, 24 }, disabled = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          delete db;
@@ -244,7 +244,7 @@ class EDABetterTestForm : Window
    Button deleteDb
    {
       groupDb, this, "Delete", position = { 544, 24 }, disabled = false;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          if(!ds.DeleteDatabase(nameDb.contents))
@@ -276,7 +276,7 @@ class EDABetterTestForm : Window
    Button openTbl
    {
       groupTbl, this, "Open", position = { 448, 24 };
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          tbl = db.OpenTable(nameTbl.contents, { type = tableRows, create = tblCreate.checked ? create : no });
@@ -309,7 +309,7 @@ class EDABetterTestForm : Window
                   tblFields.GUIListBoxAddRowsField(listFields, "Name");
                delete tblFields;
             }
-            
+
             tableBox.text = tbl.name;
             tbl.GUIListBoxAddFields(tableBox);
             tbl.GUIListBoxAddRows(tableBox);
@@ -320,7 +320,7 @@ class EDABetterTestForm : Window
    Button closeTbl
    {
       groupTbl, this, "Close", position = { 496, 24 }, disabled = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          delete tbl;
@@ -342,7 +342,7 @@ class EDABetterTestForm : Window
 
    ListBox listFields { groupFld, this, size = { 200, 88 }, position = { 16, 24 } };
    EditBox nameFld { groupFld, this, size = { 200, 24 }, position = { 232, 24 } };
-   DropBox fldDataType 
+   DropBox fldDataType
    {
       groupFld, this, "Data Type", size = { 136, 24 }, position = { 448, 24 };
 
@@ -363,7 +363,7 @@ class EDABetterTestForm : Window
    Button createFld
    {
       groupFld, this, "Create", position = { 600, 24 };
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          if(tbl.AddField(nameFld.contents, fldDataType.currentRow.GetData(null), 0))
@@ -382,7 +382,7 @@ class EDABetterTestForm : Window
    Button addRow
    {
       this, text = "AddRow", anchor = { left = 10, bottom = 10 };
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          Row row { tbl };
@@ -396,7 +396,7 @@ class EDABetterTestForm : Window
    Button find
    {
       this, text = "Find", anchor = { left = 110, bottom = 10 };
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          Row row { tbl };
@@ -427,7 +427,7 @@ class EDABetterTestForm : Window
             DataRow curRow = listBox.firstRow;
             Row row { tbl };
             int sysID = 0;
-            
+
             while(row.Next() && curRow)
             {
                if(curRow == listBox.currentRow)
index 3c3af99..e7acf69 100644 (file)
@@ -201,7 +201,7 @@ class MedTesting : Window
                else
                {
                   boxCommercialNames.Load();
-                  boxGenericName.Clear();               
+                  boxGenericName.Clear();
                }
                boxSubClass.Clear();
                boxClass.Clear();
@@ -210,7 +210,7 @@ class MedTesting : Window
 
                answers.disabled = false;
             }
-         }         
+         }
          return true;
       }
    };
@@ -225,7 +225,7 @@ class MedTesting : Window
          SubClass subClass = row.subClass;
          DrugClass drugClass = row.drugClass;
          Restriction restriction = row.restriction;
-         FormConcentrations formConcentrations = row.formConcentrations;         
+         FormConcentrations formConcentrations = row.formConcentrations;
 
          // if(commercialNames.OnCompare(*(void **)boxCommercialNames.data))
          if(class(StringList)._vTbl[__ecereVMethodID_class_OnCompare](class(StringList), commercialNames, *(void **)boxCommercialNames.data))
@@ -234,7 +234,7 @@ class MedTesting : Window
          // if(genericName.OnCompare(*(void **)boxGenericName.data))
          if(class(String)._vTbl[__ecereVMethodID_class_OnCompare](class(String), genericName, *(void **)boxGenericName.data))
             boxGenericName.foreground = red;
-         
+
          if(drugClass.OnCompare(boxClass.data))
             boxClass.foreground = red;
 
index 77c97b4..a686c29 100644 (file)
@@ -10,7 +10,7 @@ class ConcentrationEditor : Window
 {
    DataBox formEditor;
    DataBox amountEditor;
-   DataBox unitEditor;   
+   DataBox unitEditor;
 }
 
 default:
@@ -27,7 +27,7 @@ class Concentration
 {
 public:
    Form form;
-   double amount;   
+   double amount;
    Unit unit;
 
    bool Window::NotifyChanged(bool closed)
@@ -97,7 +97,7 @@ public:
          editor.amountEditor.SaveData();
       return false;
    }
-   
+
    void OnFree() { }    // WE DON'T WANT THE LISTBOX TO DELETE THE INSTANCES...
 };
 
@@ -118,7 +118,7 @@ dbtable "DrugClasses" DrugClass
    String name "name";
 };
 
-dbtable "SubClasses" SubClass 
+dbtable "SubClasses" SubClass
 {
    SubClass   id    "id";
    String     name  "name";
index 5a6d7b3..6acb481 100644 (file)
@@ -7,7 +7,7 @@ class MoviesReportDetail : Detail
    font = { "Arial", 10 };
 
    keepTogether = true;
-   
+
    Label movieName      { this, anchor = { left = 4, top = 2, right = 0.60, bottom = 2 } };
    Label mediaType      { this, anchor = { left = 0.40, top = 2, right = 0.45, bottom = 2 } };
    Label dateAdded      { this, anchor = { left = 0.55, top = 2, right = 0.30, bottom = 2 } };
@@ -17,7 +17,7 @@ class MoviesReportDetail : Detail
    {
       String s;
       RowMovies row = (RowMovies)report.groupings[0].row;
-      
+
       s = row.name; movieName.text = s; delete s;
       s = PrintString(row.mediaType); mediaType.text = s; delete s;
       s = PrintString((ShortDate)row.dateAdded); dateAdded.text = s; delete s;
index e90644a..ae446c5 100644 (file)
@@ -8,7 +8,7 @@ class BorrowerReportDetail : Detail
    font = { "Arial", 10 };
 
    keepTogether = true;
-   
+
    Label movieName      { this, anchor = { left = 44, top = 2, right = 0.30, bottom = 2 } };
    Label dateBorrowed   { this, anchor = { left = 0.5, top = 2, right = 0.20, bottom = 2 } };
 
@@ -17,7 +17,7 @@ class BorrowerReportDetail : Detail
       String s;
       BorrowerReport report = (BorrowerReport)((ReportDestination)master).GetReport();
       RowMovies row = (RowMovies)report.groupings[1].row;
-      
+
       s = row.name; movieName.text = s; delete s;
       s = PrintString((ShortDate)row.dateBorrowed); dateBorrowed.text = s; delete s;
       return true;
@@ -45,7 +45,7 @@ class BorrowerGroupHeader : Detail
    font = { "Arial", 10, bold = true };
 
    keepTogether = true;
-   
+
    Label name { this, anchor = { left = 4, top = 7, right = 0.65, bottom = 2 } };
    Label phone { this, anchor = { left = 0.4, top = 7, right = 4, bottom = 2 } };
 
@@ -72,7 +72,7 @@ class BorrowerGroupContinuation : Detail
    font = { "Arial", 10, bold = true };
 
    keepTogether = true;
-   
+
    Label name { this, anchor = { left = 4, top = 7, right = 0.65, bottom = 2 } };
 
    bool OnCreate(void)
@@ -80,7 +80,7 @@ class BorrowerGroupContinuation : Detail
       String s;
       BorrowerReport report = (BorrowerReport)((ReportDestination)master).GetReport();
       RowBorrowers row = (RowBorrowers)report.groupings[0].row;
-      
+
       s = PrintString(row.name, " (Continued)"); name.text = s; delete s;
       return true;
    }
@@ -100,7 +100,7 @@ class BorrowerGroupFooter : Detail
    font = { "Arial", 10, bold = true };
 
    keepTogether = true;
-   
+
    Label title { this, anchor = { left = 0.85, top = 9, right = 0.03, bottom = 2 }, text = "Total count:" };
    Label total { this, anchor = { left = 0.97, top = 9, right = 9, bottom = 2 } };
 
@@ -162,7 +162,7 @@ class BorrowerReport : CommonReport
       if(daysAgo)
       {
          static char reportTitle[256];
-         sprintf(reportTitle, "Movies borrowed for more than %d days", daysAgo); 
+         sprintf(reportTitle, "Movies borrowed for more than %d days", daysAgo);
          title = reportTitle;
       }
       else
index aa54564..ef2ccb2 100644 (file)
@@ -4,7 +4,7 @@ struct ShortDate : Date
 {
    char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
    {
-      static const char months[12][4] = 
+      static const char months[12][4] =
       {
          "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
       };
@@ -19,7 +19,7 @@ struct ShortDate : Date
 class CommonReportHeader : Detail
 {
    size = { 500, 100 };
-   
+
    ReportTitle       { this, anchor = { left = 0, top = 4, right = 0 }, text = "Movie Collection Report" };
    ReportTitle title { this, size = { h = 28 }, anchor = { left = 0, top = 42, right = 0 }, font = { "Arial", 12, bold = true } };
 
@@ -34,15 +34,15 @@ class CommonReportHeader : Detail
 class CommonReportPageFooter : Detail
 {
    size = { 500, 32 };
-   
+
    Label pageNumber { this, anchor = { top = 0, right = 0 } };
-   
+
    void OnRedraw(Surface surface)
    {
       int x = clientSize.w - 1;
       surface.DrawLine(0, 0, x, 0);
    }
-   
+
    bool OnCreate(void)
    {
       char number[64];
@@ -56,7 +56,7 @@ class CommonReportPageFooter : Detail
 class CommonReportFooter : Detail
 {
    size = { 500, 32 };
-  
+
    void OnRedraw(Surface surface)
    {
       int x = clientSize.w - 1;
@@ -70,7 +70,7 @@ class PreviewWindow : Window
 {
    size = { 1024, 768 };
    state = maximized;
-   
+
    hasClose = true;
    fullRender = true;
    background = activeBorder;
index 493f84c..2cb9ec7 100644 (file)
@@ -8,7 +8,7 @@ public class FindPrime
    bool HasPrimeFactor(int x)
    {
       int max = (int)floor(sqrt((double)x));
-     
+
       for(i : primeList)
       {
          if(i > max) break;
index fb90a86..e3dfd6c 100644 (file)
@@ -8,16 +8,16 @@ class Sha256Test : Application
        byte bytes[4096] = { 0x00 };
        AmpheckSHA256 ctx { };
        byte digest[32];
-       
+
        ctx.Init();
       for (i = 0; i < 262144; ++i)
                ctx.Update(bytes, 4096);
-       
+
        ctx.Finish(digest);
-       
+
        for (i = 0; i < 32; ++i)
                printf("%02x", digest[i]);
-       
+
        printf("\n");
    }
 }
index 1a62ea5..60f9605 100644 (file)
@@ -15,7 +15,7 @@ class Form1 : Window
 
    bool OnCreate(void)
    {
-      
+
       return true;
    }
 
@@ -23,7 +23,7 @@ class Form1 : Window
    {
       if (ch=='\r')
          DoParse(true);
-      
+
       return true;
    }
 
index 6dd69e4..2e851d1 100644 (file)
@@ -87,18 +87,18 @@ bool Expression::SanitizeSingleArgument(void) {
 class FunctionList : Dictionary {
    Array<CASFunctionDefinition> f {};
    FunctionList() {
-      CASFunction i;                   
+      CASFunction i;
       for (i=0; i<CASFunction::enumSize; i++)
          array.Add(StrDup(function_string[i]));
       f.size = CASFunction::enumSize;
       f[CASFunction::sum] = {
-         
+
       };
       f[CASFunction::product] = {
-         
+
       };
       f[CASFunction::polynomial] = {
-         
+
       };
       f[CASFunction::exp] = {
          bool Expression::Sanitize()
@@ -117,31 +117,31 @@ class FunctionList : Dictionary {
       };
       f[CASFunction::ln] = {
          Sanitize = SanitizeSingleArgument;
-         
+
       };
       f[CASFunction::sin] = {
          Sanitize = SanitizeSingleArgument;
-         
+
       };
       f[CASFunction::cos] = {
          Sanitize = SanitizeSingleArgument;
-         
+
       };
       f[CASFunction::tan] = {
          Sanitize = SanitizeSingleArgument;
-         
+
       };
       f[CASFunction::arcsin] = {
          Sanitize = SanitizeSingleArgument;
-         
+
       };
       f[CASFunction::arccos] = {
          Sanitize = SanitizeSingleArgument;
-         
+
       };
       f[CASFunction::arctan] = {
          Sanitize = SanitizeSingleArgument;
-         
+
       };
    }
    //these functions check to make sure the input is a function of correct range before executing
@@ -172,7 +172,7 @@ class ExprChildWalker {
 public:
    Expression expr;
    Expression user0, user1, user2;
-   
+
    void Go(void) {
       switch (expr.ExprClass()) {
          case prefix:
@@ -307,7 +307,7 @@ public:
             break;
       }
    }
-   
+
    void Free(void) {
       ExprChildWalker w {this;
          bool On(Expression *e) {
@@ -374,7 +374,7 @@ public:
       }
       return ret;
    }
-   
+
    //collect terms in this expression separated by the binary operator op
    //e.g. separate x^2+3x+1 by plus into [x^2, 3x, 1]
    //Will separate (x^2+3x+1)/2 by plus into [(x^2+3x+1)/2]
@@ -444,14 +444,14 @@ public:
             fprintf(stderr, "BUG:  Attempted to call Unlink on non-unary node.\n");
       }
    }
-   
+
    //Note that FromString likes to toy with the string, but anything done to the string will be undone.
    bool FromString(char *str, CASDictionary dictionary) {
       ExpressionFromString(this, str, dictionary);
       return Sanitize(this, dictionary);
    }
    char *ToString(void) {
-      
+
    }
    const char *OpString(void) {
       if (type==prefix && prefix.op<PrefixOperator::enumSize)
@@ -490,7 +490,7 @@ public:
          return nullary;
    }
    void Simplify(CASDictionary dict) {
-      
+
    }
 };
 
@@ -741,7 +741,7 @@ void ExpressionFromString(Expression expr, char *str, CASDictionary dictionary)
    char borrow;
 
    expr.Free();
-   
+
    s = str;
    e = s;
    while (*s) {
index 0958420..5ca5403 100644 (file)
@@ -41,7 +41,7 @@ class CharFlags {
    /*property char * {
       set { charsSet = value; }
    }*/
-   
+
    byte flags[256]; //flags[c] indicates whether character c is selected
    void Clear(void) {
       memset(flags, 0, sizeof(flags));
index d39fb5a..a1067e8 100644 (file)
@@ -12,7 +12,7 @@ enum Health
 {
    POOR,
    OK,
-   GOOD  
+   GOOD
 };
 
 struct Example
index 049d455..6cf8e75 100644 (file)
@@ -648,9 +648,9 @@ class Blokus : Window
          Piece * piece = &pieces[selectedPiece];
          int w = (direction & 1) ? piece->h : piece->w;
          int h = (direction & 1) ? piece->w : piece->h;
-         drag = { offset.x + mx, offset.y + my }; 
+         drag = { offset.x + mx, offset.y + my };
 
-         if(mx - squareDragged.x * squareWidth >= boardStartX - 10 && mx - squareDragged.x * squareWidth < boardStartX + ((boardSize-w)+1) * squareWidth + 10 && 
+         if(mx - squareDragged.x * squareWidth >= boardStartX - 10 && mx - squareDragged.x * squareWidth < boardStartX + ((boardSize-w)+1) * squareWidth + 10 &&
             my - squareDragged.y * squareWidth >= boardStartY - 10 && my - squareDragged.y * squareWidth < boardStartY + ((boardSize-h)+1) * squareWidth + 10)
          {
             int x, y;
@@ -758,7 +758,7 @@ class Blokus : Window
             squareDragged = { w-1-y, x };
          else
             squareDragged = { y, h-1-x };
-            
+
          offset.x -= squareDragged.x * squareWidth;
          offset.y -= squareDragged.y * squareWidth;
 
@@ -873,7 +873,7 @@ class Blokus : Window
             empty.b + lightValue * (full.b - empty.b)
          };
       }
-      
+
       surface.foreground = aqua;
       for(c = 0; c <= boardSize; c++)
       {
@@ -1010,7 +1010,7 @@ class Blokus : Window
                         drag.y + y * squareWidth,
                         colorPlayed,
                         gameStarted && gameState.colorTurn == colorPlayed && gameState.validPieces[selectedPiece]);
-                     
+
                      if(x == 0 || !PieceBlock(selectedPiece, x-1, y, direction, flip))
                      {
                         surface.foreground = white;
index ff3181d..fbb48a1 100644 (file)
@@ -36,7 +36,7 @@ class Bomb : Window
 {
    borderStyle = sizable, hasMaximize = true, hasMinimize = true, hasClose = true;
    text = "Bomb Squad", clientSize = Size { 640,400 };
-      
+
    bool fullScreen;
    char board[DIMY][DIMX];
 
@@ -81,8 +81,8 @@ class Bomb : Window
    };
    EditBox passEdit
    {
-      this, textHorzScroll = true, text = "Password", 
-      anchor = Anchor { left = 0.03, top = 0.05, right = 0.84, bottom = 0.80 }, 
+      this, textHorzScroll = true, text = "Password",
+      anchor = Anchor { left = 0.03, top = 0.05, right = 0.84, bottom = 0.80 },
       autoCreate = false
    };
    Bitmap buffer {};
@@ -227,7 +227,7 @@ class Bomb : Window
             surface.Blit(gfx[PLAYER],
                offX + player.x*mapSize.w, offY + player.y*mapSize.h,
                0,0,mapSize.w,mapSize.h);
-            
+
             surface.SetForeground(TIMEBAR);
             surface.Rectangle(0,buffer.height - 20,buffer.width-1,buffer.height-1);
             width = (int)((buffer.width - 2)*(MAXTIME-secPassed)/MAXTIME);
@@ -250,7 +250,7 @@ class Bomb : Window
       }
 
       delete surface;
-      surface2.Stretch(buffer, 0,0, 0,0, clientSize.w, clientSize.h, 
+      surface2.Stretch(buffer, 0,0, 0,0, clientSize.w, clientSize.h,
          buffer.width, buffer.height);
    }
 
@@ -284,7 +284,7 @@ class Bomb : Window
          switch(key)
          {
             case s: LoadLevel(1); break;
-            case p:    
+            case p:
                state = STATE_PASSWORD;
                passEdit.Create();
                break;
@@ -295,10 +295,10 @@ class Bomb : Window
       }
       switch(key)
       {
-         case escape: 
+         case escape:
             if(state == STATE_GAME)
                timer.Stop();
-            state = STATE_MENU; 
+            state = STATE_MENU;
             SetPalette(true);
             Update(null);
             break;
index 00121e2..3b2b6e7 100644 (file)
@@ -55,7 +55,7 @@ class MainWindow : Window
    {
       player1.Join();
       player2.Join();
-      
+
       player1.NewGame();
    }
 
@@ -64,7 +64,7 @@ class MainWindow : Window
       Bitmap board = boardBmp.bitmap;
       Bitmap bmp = res.bitmap;
       int bw = (int)(board.width * scale;
-      int bh = clientSize.h;      
+      int bh = clientSize.h;
       int bx = (clientSize.w - bw) / 2;
       int by = (clientSize.h - bh) / 2;
 
@@ -82,9 +82,9 @@ class MainWindow : Window
          int x = (int)(upperLeftX + (p1.x+0.5)*spaceX + (p2.x - p1.x)/3 * c * spaceX / 4 - (smileBmp.bitmap.width*3)/2);
          int y = (int)(upperLeftY + (p1.y+0.5)*spaceY + (p2.y - p1.y)/3 * c * spaceY / 4 - (smileBmp.bitmap.height*3)/2);
          DrawBitmap(surface, smileBmp, x, y, 3);
-      }      
+      }
    }
-      
+
    void DrawStone(Surface surface, Point where, Stone color)
    {
       Bitmap stone = stoneBmps[color].bitmap;
@@ -98,7 +98,7 @@ class MainWindow : Window
       Bitmap board = boardBmp.bitmap;
       Bitmap remove = removeBmp.bitmap;
       Bitmap wStone = stoneBmps[Stone::white].bitmap;
-      
+
       int x, y;
       Stone c;
 
@@ -117,7 +117,7 @@ class MainWindow : Window
             DrawBitmap(surface, stoneBmps[c],
                drawerX - stone.width/2, topDrawer + r*wStone.height*2/3, 1);
       }
-      
+
       // Draw the stones
       for(y = 0; y < 4; y++)
       {
index 2196f40..a62481f 100644 (file)
@@ -44,7 +44,7 @@ class BrainStonzGame
             stones[sy][sx] = none;
             takeOut = false;
             played = true;
-            
+
          }
       }
       else if(movesLeft && !stones[sy][sx])
@@ -53,7 +53,7 @@ class BrainStonzGame
          int symbol = symbols[sy][sx];
          if(numStones[turn] > 0)
             numStones[turn]--;
-         
+
          for(y = 0; y < 4; y++)
          {
             int x;
@@ -65,7 +65,7 @@ class BrainStonzGame
                   break;
                }
          }
-         
+
          stones[sy][sx] = turn;
 
          // Check for win
@@ -126,7 +126,7 @@ public:
       }
       return color;
    }
-    
+
    void NewGame()
    {
       game.NewGame();
index 9891558..d894a9f 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    bet.ec - Poker Bet Window
 ****************************************************************************/
 import "poker.ec"
index d5ba09e..dcd461e 100644 (file)
@@ -3,13 +3,13 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    player.ec - Poker Player Window
 ****************************************************************************/
 import "poker.ec"
 import "pokerUtils.ec"
 
-static char handTypes[10][20] = 
+static char handTypes[10][20] =
 {
    "NOTHING",
    "ONE PAIR",
@@ -63,7 +63,7 @@ class Player : Window
       else if(gameOver)
       {
          surface.SetForeground(red);
-         if(winner) 
+         if(winner)
             surface.WriteTextf(10, 130, "WINNER");
          surface.SetForeground(blue);
          surface.WriteTextf(80, 130, "%s", handTypes[handType]);
index a857519..a68ee23 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    poker.ec - Poker Main Window
 ****************************************************************************/
 import "ecere"
@@ -14,16 +14,16 @@ import "bet.ec"
 enum PokerHand { nothing, onePair, twoPair, threeOfAKind, straight, flush, fullHouse, fourOfAKind, straightFlush, royalFlush };
 
 /*
-ROYAL FLUSH        0.0002 % 
-STRAIGHT FLUSH     0.0012 % 
-FOUR OF A KIND     0.0240 % 
-FULL HOUSE         0.1441 % 
-FLUSH              0.1967 % 
-STRAIGHT           0.3532 % 
-THREE OF A KIND    2.1128 % 
-TWO PAIR           4.7539 % 
-ONE PAIR          42.2569 % 
-NOTHING           50.1570 % 
+ROYAL FLUSH        0.0002 %
+STRAIGHT FLUSH     0.0012 %
+FOUR OF A KIND     0.0240 %
+FULL HOUSE         0.1441 %
+FLUSH              0.1967 %
+STRAIGHT           0.3532 %
+THREE OF A KIND    2.1128 %
+TWO PAIR           4.7539 %
+ONE PAIR          42.2569 %
+NOTHING           50.1570 %
 */
 
 enum Facing { faceDown, faceUp };
@@ -178,7 +178,7 @@ class Poker : Window
 
       if(!created) return;
 
-      if(numPlayersLeft >= 2) 
+      if(numPlayersLeft >= 2)
       {
          currentBet = 0;
          for(p = 0; p<numPlayers; p++)
@@ -209,9 +209,9 @@ class Poker : Window
             eInstance_DecRef(bet);
 
             if(!created) return;
-            
+
             //player.thisBet = 0;
-         
+
             if(player.thisBet < currentBet)
             {
                player.folded = true;
@@ -306,17 +306,17 @@ class Poker : Window
    // --- Poker Games Definitions ---
 
    /*
-   TEXAS HOLDEM - The most popular poker game in Blackhawk. A variation of 7-Card 
+   TEXAS HOLDEM - The most popular poker game in Blackhawk. A variation of 7-Card
    Stud where every player gets dealt 2 cards face down and there is a community
    board of 5 cards. Players Ise the 2 cards in their hand plus the 5 community
    cards to make the best possible 5 card hand. A dealers button moves around the
-   table each hand. The player to the left of the dealer button is dealt the 
-   first card. Also the person to the left of the button has to post a blind. 
-   There is a betting round after the players receive their first 2 cards. Then the 
-   dealer places 3 cards on the board (the flop) and there is a betting round. Then 
-   the dealer places another card on the board (the turn) and there is another 
-   betting round. Then the dealer places the final card (the river) on the board 
-   and there is a final betting round. Games may have 1 blind or 2 blinds. Games 
+   table each hand. The player to the left of the dealer button is dealt the
+   first card. Also the person to the left of the button has to post a blind.
+   There is a betting round after the players receive their first 2 cards. Then the
+   dealer places 3 cards on the board (the flop) and there is a betting round. Then
+   the dealer places another card on the board (the turn) and there is another
+   betting round. Then the dealer places the final card (the river) on the board
+   and there is a final betting round. Games may have 1 blind or 2 blinds. Games
    vary from $2-5 betting to straight $5 betting.
    */
    void TexasHoldem()
@@ -335,19 +335,19 @@ class Poker : Window
    }
 
    /*
-   OMAHA - A games similar to Texas Holdem except the players are dealt 4 cards 
+   OMAHA - A games similar to Texas Holdem except the players are dealt 4 cards
    face down. There is a board of 5 community cards and you must Ise 2 cards out
-   of your hand to make the best possible hand. The game may be played straight 
-   high or high/lowHand. There is a dealer button that moves around the table each 
-   hand and the player that has the dealers button may choose to play the game 
-   straight high or high/lowHand. The player to the left of the dealer button has 
-   to post a small blind of $1 and the person to his/her left has to post the 
-   large blind of $2. To qualify for a lowHand hand, the player must have 5 cards 
-   that are 8 or lowHander. There is a betting round after the players receive their 
-   4 cards. Then the dealer places 3 cards on the board (the flop). After the 
-   betting round, the dealer places another card on the board (the turn) and there 
-   is another betting round. Then the dealer places the last card (the river) on 
-   the board and there is a final betting round. The betting limits are Isually 
+   of your hand to make the best possible hand. The game may be played straight
+   high or high/lowHand. There is a dealer button that moves around the table each
+   hand and the player that has the dealers button may choose to play the game
+   straight high or high/lowHand. The player to the left of the dealer button has
+   to post a small blind of $1 and the person to his/her left has to post the
+   large blind of $2. To qualify for a lowHand hand, the player must have 5 cards
+   that are 8 or lowHander. There is a betting round after the players receive their
+   4 cards. Then the dealer places 3 cards on the board (the flop). After the
+   betting round, the dealer places another card on the board (the turn) and there
+   is another betting round. Then the dealer places the last card (the river) on
+   the board and there is a final betting round. The betting limits are Isually
    $2-$5.
    */
    void OmahaHoldem()
@@ -391,7 +391,7 @@ class Poker : Window
       {
          int i;
          cardBack.LoadT(":ecereCard.png",null,displaySystem);
-      
+
          for(i = 0; i < 52; i++)
          {
             bitmapCards[i] = Bitmap {};
index 389b490..8f1bf45 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    pokerutils.c - Poker Backend Utilities
 ****************************************************************************/
 import "poker.ec"
@@ -61,7 +61,7 @@ static bool POKER_Same(int cards[5], int howMany, int what[2], int rest[3])
          what[numPairs++] = card;
       }
    }
-   if(numPairs) 
+   if(numPairs)
    {
       int d;
       qsort(what, numPairs, sizeof(int), Compare);
@@ -81,7 +81,7 @@ static bool POKER_Same(int cards[5], int howMany, int what[2], int rest[3])
 // --- External Functions ---
 
 void POKER_SortCards(int * cards, int numCards)
-{               
+{
    qsort(cards, numCards, sizeof(int), Compare);
 }
 
@@ -120,7 +120,7 @@ void POKER_ShuffleDeck(int deck[52])
       for(c = 0; c<52; c++)
       {
          int whichCut;
-         
+
          if(indexCut[0] < numCut[0] && indexCut[1] < numCut[1])
             whichCut = GetRandom(0,1);
          else if(indexCut[0] < numCut[0])
index d6ed6bb..cf458de 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    widow.ec - Widow Window
 ****************************************************************************/
 import "poker.ec"
index fbcff75..101c45c 100644 (file)
@@ -79,18 +79,18 @@ int AI_ComputeBet(Player player)
         0,  0,  0,  0,  0,  0,  0,  0,
         0,  0,  0,  0,  0,  0,  0,  0,
         5,  5,  5, 10, 10, 15, 15, 15,
-       20, 20, 20, 25, 25, 25, 30, 30, 
+       20, 20, 20, 25, 25, 25, 30, 30,
        30, 35, 35, 35, 40, 40, 40, 45,
-       45, 45, 50, 50, 50, 55, 55, 55, 
+       45, 45, 50, 50, 50, 55, 55, 55,
        60, 60, 60, 65, 65, 65, 70, 70,
-       70, 75, 75, 75, 80, 80, 80, 85, 
+       70, 75, 75, 75, 80, 80, 80, 85,
        90, 95, 100
    };
    static const int kindTable[37] =
    {
       0,
       5, 5, 10, 10, 10, 15,
-      15, 15, 20, 20, 20, 25, 
+      15, 15, 20, 20, 20, 25,
       25, 25, 30, 30, 30, 35,
       35, 35, 40, 40, 40, 45,
       50, 55, 60, 65, 70, 75,
@@ -111,7 +111,7 @@ int AI_ComputeBet(Player player)
 
    for(kind=0; kind<(Kind)4; kind++)
    {
-      if(numberOfKind[kind] >= 3 && 
+      if(numberOfKind[kind] >= 3 &&
          (trump == none || high[kind] > high[trump] || (high[kind] == high[trump] && numberOfKind[kind] > numberOfKind[trump])))
          trump = kind;
    }
@@ -127,7 +127,7 @@ int AI_ComputeBet(Player player)
       case 8: kindScore = Min(kindScore, 80); break;
    }
 
-   if(trump == none || betTable[highTotal] > betTable[highTotal - high[trump]] + kindScore) 
+   if(trump == none || betTable[highTotal] > betTable[highTotal - high[trump]] + kindScore)
    {
       trump = none;
       bet = betTable[highTotal];
@@ -175,10 +175,10 @@ static bool DoesNotMakeNude(Player player, Card whichCard)
    for(c=0; c<9; c++)
    {
       Card * card = &player.cards[c];
-      if(card->kind == whichCard.kind && 
-         card->number != whichCard.number && 
-         card->number != ace && 
-         card->number != _10 && 
+      if(card->kind == whichCard.kind &&
+         card->number != whichCard.number &&
+         card->number != ace &&
+         card->number != _10 &&
          card->number != _5)
          return true;
    }
@@ -231,7 +231,7 @@ static int Discard(Player player, char * numbers, TrumpFlag trumpFlag)
             switch(trumpFlag)
             {
                case AnyCard: return c;
-               case NoTrump: 
+               case NoTrump:
                   if(trump == kindRequested || card->kind != trump)
                      return c;
                   break;
@@ -275,7 +275,7 @@ void AI_RequestCard(Player player)
    // Count the remaining trump
    if(trump != none)
    {
-      int count = 0;      
+      int count = 0;
       for(c = 0; c<9; c++)
          if(!player.left[trump][c])
             count++;
@@ -410,7 +410,7 @@ void AI_InformNewRound(Player player, int round, PlayerPosition shuffle, Card *
    for(kind = 0; kind<4; kind++)
       for(c = 0; c<9; c++)
          player.left[kind][c] = true;
-   player.trumpLeft[0] = player.trumpLeft[1] = 
+   player.trumpLeft[0] = player.trumpLeft[1] =
    player.trumpLeft[2] = player.trumpLeft[3] = true;
 
    for(c = 0; c<9; c++)
@@ -434,7 +434,7 @@ void AI_InformCardPlayed(Player player, int who, Kind kind, Number number)
 {
    RuffGame * game = player.game;
    Round * round = &game->rounds[game->round];
-   
+
    player.left[kind][number] = false;
    // Mark this player as not having trump anymore
    if(game->played[game->start].kind == round->bet.trump &&
index 19dc461..1799eb8 100644 (file)
@@ -36,7 +36,7 @@ class BetDialog : Window
 
    EditBox edit { this, size = Size { 80, 20 }, anchor = Anchor { top = 10 }; };
 
-   bool OnPostCreate()  
+   bool OnPostCreate()
    {
       edit.Activate();
       return true;
index 88f873b..946c923 100644 (file)
@@ -130,7 +130,7 @@ void Player_InformStartGame(Player * player)
    ruff.lastPlayed[0].kind = ruff.lastPlayed[1].kind =
    ruff.lastPlayed[2].kind = ruff.lastPlayed[3].kind = None;
    game.gameStarted = true;
-   
+
    Setup_EnableButtons(ruff.setup);
    eWindow_Update(window, null);
    eWindow_Update(ruff.scores, null);
@@ -495,4 +495,4 @@ void Player_Request4CardsAck(Player * player, int winner, int scores0, int score
       }
    }
 }
-*/         
+*/
index 9d4d5f7..cc1dedb 100644 (file)
@@ -323,7 +323,7 @@ void Player_InformStartGame(Player player)
    ruff.lastPlayed[0].kind = ruff.lastPlayed[1].kind =
    ruff.lastPlayed[2].kind = ruff.lastPlayed[3].kind = none;
    game->gameStarted = true;
-   
+
    ruff.setup.EnableButtons();
    ruff.Update(null);
    ruff.scores.Update(null);
@@ -770,8 +770,8 @@ class Ruff : Window
 
             // The selected card
             if(selectedCard != None && player->cards[selectedCard].kind != none)
-               RUFF_DrawCard(surface, 
-                  selectedCard * 20 + player->cards[selectedCard].kind * 71, 0, 
+               RUFF_DrawCard(surface,
+                  selectedCard * 20 + player->cards[selectedCard].kind * 71, 0,
                   &player->cards[selectedCard]);
          }
 
@@ -825,7 +825,7 @@ class Ruff : Window
          surface.CenterTextf(namePos[c].x, namePos[c].y,game.players[c].name);
       }
    }
-   
+
    bool OnLeftButtonDown(int x, int y, Modifiers mods)
    {
       if(selectedCard != None && playedPlayer != none)
@@ -941,7 +941,7 @@ class Ruff : Window
       if(ptrCardLoad.Load(":cards.pcx",null,null))
       {
          int i;
-         cardBack.LoadT(":ecereCard.png",null,displaySystem);      
+         cardBack.LoadT(":ecereCard.png",null,displaySystem);
          for(i=0;i<52;i++)
          {
             bitmapCards[i] = Bitmap {};
@@ -949,7 +949,7 @@ class Ruff : Window
             CopyBytesBy4(bitmapCards[i].palette, ptrCardLoad.palette, 256);
             bitmapCards[i].Grab(ptrCardLoad,0,(ptrCardLoad.height/52)*i);
             bitmapCards[i].transparent = true;
-            bitmapCards[i].MakeDD(displaySystem);  
+            bitmapCards[i].MakeDD(displaySystem);
          }
       }
       delete ptrCardLoad;
@@ -972,7 +972,7 @@ class Ruff : Window
          // 5, 7, 8, 9,10,  J,  Q,  K, A
          4, 6, 7, 8, 9, 10, 11, 12, 0
       };
-      
+
       if(card != null)
          bitmap = bitmapCards[cardNo[card.number] * 4 + card.kind];
       else
index dcb76be..ffa0aba 100644 (file)
@@ -15,7 +15,7 @@ class Scores : Window
    isRemote = true;
    background = white;
    borderStyle = fixed, hasVertScroll = true, text = "The Scores", anchor = Anchor { horz = 0.3, vert = 0.1 }, clientSize = Size { 316,441 };
-   
+
    bool OnPostCreate()
    {
       SetScrollLineStep(1, 20);
@@ -49,7 +49,7 @@ class Scores : Window
        int r;
        int scores[2]={0,0};
       Ruff ruff = (Ruff)master;
-      
+
        if(ruff.game.players)
        {
          int scoreScroll = vertScroll.thumbPosition / 20;
@@ -101,7 +101,7 @@ class Scores : Window
                        surface.CenterTextf(37,40+r*20,"%c",ruff.game.players[shuffle].name[0]);
 
                        // Bet
-            if(r + scoreScroll < ruff.game.round || 
+            if(r + scoreScroll < ruff.game.round ||
                (r + scoreScroll == ruff.game.round && !ruff.game.betting && ruff.game.gameStarted))
             {
                int x = (round->bet.player%2) ? 188 : 162;
@@ -135,7 +135,7 @@ class Scores : Window
                        scores[0] += round->scores[0];
                        scores[1] += round->scores[1];
 
-            if(r < ruff.game.round || 
+            if(r < ruff.game.round ||
                (r == ruff.game.round && !ruff.game.betting && ruff.game.gameStarted))
             {
                           // Winning box
@@ -150,7 +150,7 @@ class Scores : Window
                                              surface.Area(201,41+(r-scoreScroll)*20,299,59+(r-scoreScroll)*20);
                   }
                }
-                                  
+
                           // Current Score
                ShowScore(surface,  75, 40 + (r-scoreScroll) * 20, round->scores[0], r);
                ShowScore(surface, 225, 40 + (r-scoreScroll) * 20, round->scores[1], r);
index 6d12e13..01297dd 100644 (file)
@@ -94,7 +94,7 @@ static void Server_ShuffleDeck(Card * deck)
       for(c = 0; c<NUMCARDS; c++)
       {
          int whichCut;
-         
+
          if(indexCut[0] < numCut[0] && indexCut[1] < numCut[1])
             whichCut = GetRandom(0,1);
          else if(indexCut[0] < numCut[0])
@@ -288,7 +288,7 @@ void Server_Ack4Cards(RuffGame game, Player player)
       else
       {
          for(c = 0; c<4; c++)
-            Player_InformNewRound(&game.players[c], game.round, game.rounds[game.round].shuffle, 
+            Player_InformNewRound(&game.players[c], game.round, game.rounds[game.round].shuffle,
             game.players[c].cards);
       }
    }
@@ -311,7 +311,7 @@ void Server_PlayCard(RuffGame game, Player player, int card)
       Card theCard = player.cards[card];
 
       for(c = 0; c<4; c++)
-         Player_InformCardPlayed(&game.players[c], player.id, 
+         Player_InformCardPlayed(&game.players[c], player.id,
             theCard.kind, theCard.number);
 
       game.played[player.id] = theCard;
index bd12f56..8569715 100644 (file)
@@ -129,7 +129,7 @@ class ClientSocket : Socket
          Player_InformStopGame(setup.player);
          setup.player->socket = null;
       }
-      
+
       setup.connected = false;
       setup.player = null;
       setup.EnableButtons();
@@ -485,10 +485,10 @@ class Setup : Window
       strcpy(game->players[3].name, "Arnold");
       game->players[0].ruff = game->players[1].ruff =
       game->players[2].ruff = game->players[3].ruff = (Ruff)master;
-      
+
       playerNames[0] = EditBox { this, text = "Player 1", NotifyModified = PlayerNamedChanged,
          position = Point { 10,30 }, size = Size { 140 }, id = 0, hotKey = alt1 };
-      
+
       playerTypes[0] = DropBox { this, position = Point { 160,30 }, id = 0, NotifySelect = PlayerTypeSelect };
 
       playerNames[1] = EditBox { this, text = "Player 2", NotifyModified = PlayerNamedChanged,
index 7b2d45a..7730d7f 100644 (file)
@@ -25,10 +25,10 @@ class Trump : Kind
 
       OnGetString(name, trumpDialog, null);
       len = strlen(name);
-      
+
       surface.TextExtent(name, len, &w, &h);
       surface.WriteText(xStart, y, name, len);
+
       // Draw the current row stipple
       if(flags.selected)
       {
@@ -45,7 +45,7 @@ class Trump : Kind
          surface.Rectangle(xStart - 3, y, xStart + w + 1, y + h - 1);
          surface.LineStipple(0);
       }
+
       if(icon)
       {
          surface.SetForeground(white);
index 6889307..de2779d 100644 (file)
@@ -11,7 +11,7 @@ import "ecere"
 typedef struct
 {
    int typeOfHouse;
-   
+
    union
    {
       struct straight
@@ -31,7 +31,7 @@ typedef struct
 {
    int numCards;
    int cardValues[13];
-   House houseDown[4]; 
+   House houseDown[4];
    int numHouseDown;
    bool cardLifted[13];
    bool callTag;
@@ -105,7 +105,7 @@ int CheckHouse(int cardsToCheck,int * checkIfHouse)
       {
          house++;    //possible 3or4 of a kind house
       }
-   }     
+   }
    if(straight == cardsToCheck-1)
       return 0;
    else if(house == cardsToCheck-1)
@@ -116,7 +116,7 @@ int CheckHouse(int cardsToCheck,int * checkIfHouse)
 
 int CompareInteger(int * a, int * b)
 {
-   if(*a > *b) 
+   if(*a > *b)
       return 1;
    else if(*b > *a)
       return -1;
@@ -128,7 +128,7 @@ void SortPlayerCards()
    int c;
    for(c=0;c<numOfPlayers;c++)
    {
-      qsort(player[c].cardValues,player[c].numCards,sizeof(int),CompareInteger); 
+      qsort(player[c].cardValues,player[c].numCards,sizeof(int),CompareInteger);
       //qsort(tempHouse,tempCtr,sizeof(int),CompareInteger);
    }
 }
@@ -175,7 +175,7 @@ class TongIts : Window
       Bitmap ptrCardLoad {};
       ptrCardLoad.Load(":cards.pcx",null,null);
       cardBack.LoadT(":ecereCard.png", null, displaySystem);
-      
+
       for(i=0;i<52;i++)
       {
          Bitmap bitmap { transparent = true };
@@ -195,12 +195,12 @@ class TongIts : Window
       for(i=0;i<52;i++)
          bitmapCards[i].Free();
    }
-   
+
    void GameOver()
    {
       /*
       Window gameOverBox
-      { 
+      {
          this, hasClose = true, background = LightBlue, text = "Game Over", [position.y] = A_CENTER|20, size = Size { 300, 200 }
       };
       Button { gameOverBox, text = "Close", [position.y] = A_CENTER|80, size = Size { 80,20 } };
@@ -213,7 +213,7 @@ class TongIts : Window
       int h=0,i=0,j=0,k=0,x=0;
 
       surface.Rectangle(375, 315, 495, 475);
-   
+
       if(gameOver)
       {
          surface.SetForeground(blue);
@@ -265,12 +265,12 @@ class TongIts : Window
                   h++;
                }
             }
-            
+
             if(player[j].houseDown[i].typeOfHouse == 1)
             {
                for(k=0;k<4;k++) //player[j].houseDown[i].kind.suits[k]
                {
-                  if(player[j].houseDown[i].kind.suits[k] == true)   
+                  if(player[j].houseDown[i].kind.suits[k] == true)
                   {
                      Bitmap bitmap = bitmapCards[MCARD((k),(player[j].houseDown[i].kind.number))];
                      surface.Blit(bitmap,xyPositions[j].x + OFFSETTER1 * h,xyPositions[j].y + 75,0,0, bitmap.width,bitmap.height);
@@ -354,7 +354,7 @@ class TongIts : Window
       }
       suit = KIND(discard[discardCounter-1]);
       number = NUMBER(discard[discardCounter-1]);
-      tempHouse[tempCtr++] = discard[discardCounter-1];  
+      tempHouse[tempCtr++] = discard[discardCounter-1];
       for(i=0;i<player[currentPlayer].numCards;i++)
       {
          if(player[currentPlayer].cardLifted[i])
@@ -365,7 +365,7 @@ class TongIts : Window
       if(tempCtr >= 3)
       {
          int checkResult;
-         
+
          qsort(tempHouse,tempCtr,sizeof(int),CompareInteger);
          checkResult = CheckHouse(tempCtr,tempHouse);
          switch(checkResult)
@@ -376,10 +376,10 @@ class TongIts : Window
                House * house = &player[currentPlayer].houseDown[player[currentPlayer].numHouseDown];
                house->typeOfHouse = checkResult;
                for(i=0;i<tempCtr;i++)
-               {  
+               {
                   house->kind.number = NUMBER(tempHouse[i]);
-                  house->kind.suits[KIND(tempHouse[i])] = true;  
-               }   
+                  house->kind.suits[KIND(tempHouse[i])] = true;
+               }
                player[currentPlayer].numHouseDown++;
                break;
             }
@@ -389,7 +389,7 @@ class TongIts : Window
                house->typeOfHouse = checkResult;
                house->straight.first = NUMBER(tempHouse[0]);
                house->straight.last = NUMBER(tempHouse[tempCtr-1]);
-               house->straight.suit = KIND(tempHouse[0]);  
+               house->straight.suit = KIND(tempHouse[0]);
                player[currentPlayer].numHouseDown++;
                break;
             }
@@ -408,14 +408,14 @@ class TongIts : Window
                j++;
             }
          }
-         player[currentPlayer].numCards = j;   
+         player[currentPlayer].numCards = j;
          discard[discardCounter--];
          drawButton[currentPlayer].disabled = true;
          chowButton[currentPlayer].disabled = true;
          callButton[currentPlayer].disabled = true;
          showButton[currentPlayer].disabled = false;
          dumpButton[currentPlayer].disabled = false;
-         Update(null);    
+         Update(null);
       }
      if(player[currentPlayer].numCards == 0)
      {
@@ -425,7 +425,7 @@ class TongIts : Window
   }
 
    bool DumpClicked(Button button, int x, int y, Modifiers mods)
-   {  
+   {
       MessageBox { text = button.text }.Create();
       return true;
    }
@@ -465,10 +465,10 @@ class TongIts : Window
                House * house = &player[currentPlayer].houseDown[player[currentPlayer].numHouseDown];
                house->typeOfHouse = checkResult;
                for(i=0;i<tempCtr;i++)
-               {  
+               {
                   house->kind.number = NUMBER(tempHouse[i]);
-                  house->kind.suits[KIND(tempHouse[i])] = true;  
-               }   
+                  house->kind.suits[KIND(tempHouse[i])] = true;
+               }
                player[currentPlayer].numHouseDown++;
                break;
             }
@@ -478,7 +478,7 @@ class TongIts : Window
                house->typeOfHouse = checkResult;
                house->straight.first = NUMBER(tempHouse[0]);
                house->straight.last = NUMBER(tempHouse[tempCtr-1]);
-               house->straight.suit = KIND(tempHouse[0]);  
+               house->straight.suit = KIND(tempHouse[0]);
                player[currentPlayer].numHouseDown++;
                break;
             }
@@ -497,12 +497,12 @@ class TongIts : Window
                j++;
             }
          }
-         player[currentPlayer].numCards = j;   
+         player[currentPlayer].numCards = j;
          if(player[currentPlayer].numCards == 0)
          {
             GameOver();
          }
-         Update(null);    
+         Update(null);
       }
       return true;
    }
@@ -545,8 +545,8 @@ class TongIts : Window
                width = bitmap.width;
                height = bitmap.height;
                xCursorPositionAtCard = (xyPositions[currentPlayer].x + (OFFSETTER1 * i)) - x;
-               yCursorPositionAtCard = (player[currentPlayer].cardLifted[i] ? 
-                  (xyPositions[currentPlayer].y - OFFSETTER2 - y - 20) : 
+               yCursorPositionAtCard = (player[currentPlayer].cardLifted[i] ?
+                  (xyPositions[currentPlayer].y - OFFSETTER2 - y - 20) :
                   (xyPositions[currentPlayer].y - OFFSETTER2 - y));
                flagButtonDown = true;
                OnMouseMove(x,y,mods);
@@ -564,7 +564,7 @@ class TongIts : Window
       Box boxCard = {x + xCursorPositionAtCard,y + yCursorPositionAtCard, x + xCursorPositionAtCard + width - 1, y + yCursorPositionAtCard + height - 1};
       if(flagButtonDown)
       {
-         if(boxCard.Overlap(boxDiscard))      
+         if(boxCard.Overlap(boxDiscard))
          {
             xLeftButtonUp = 400;
             yLeftButtonUp = 350;
@@ -603,8 +603,8 @@ class TongIts : Window
             for(j=0;j<numOfPlayers;j++)
             {
                Bitmap bitmap = cardBack;
-               Box boxHouseDown = 
-               { 
+               Box boxHouseDown =
+               {
                   xyPositions[j].x,xyPositions[j].y + 75,
                   0, xyPositions[j].y + 75 + bitmap.height
                };
@@ -616,7 +616,7 @@ class TongIts : Window
                         (player[j].houseDown[i].straight.last - player[j].houseDown[i].straight.first) * OFFSETTER1 - 1;
                      if(boxCard.Overlap(boxHouseDown))
                      {
-                        if(dragCard == MCARD((player[j].houseDown[i].straight.suit),(player[j].houseDown[i].straight.first)) - 4) 
+                        if(dragCard == MCARD((player[j].houseDown[i].straight.suit),(player[j].houseDown[i].straight.first)) - 4)
                         {
                            player[j].houseDown[i].straight.first --;
                            CopyBytesBy4(&player[currentPlayer].cardValues[cardToReposition],
@@ -626,7 +626,7 @@ class TongIts : Window
                            player[j].callTag = true;
                            j = numOfPlayers;
                            break;
-                           
+
                         }
                         else if(dragCard == MCARD((player[j].houseDown[i].straight.suit),(player[j].houseDown[i].straight.last )) + 4)
                         {
@@ -640,7 +640,7 @@ class TongIts : Window
                            break;
                         }
                      }
-                     boxHouseDown.left += 
+                     boxHouseDown.left +=
                         (player[j].houseDown[i].straight.last - player[j].houseDown[i].straight.first + 2) * OFFSETTER1;
                   }
                   else if(player[j].houseDown[i].typeOfHouse == 1)
@@ -677,7 +677,7 @@ class TongIts : Window
          flagButtonDown = false;
          ReleaseCapture();
          Update(null);
-      }   
+      }
       return true;
    }
 
@@ -699,7 +699,7 @@ class TongIts : Window
             Update(null);
             return false;
          }
-      
+
       }
       return true;
    }
@@ -717,7 +717,7 @@ class TongIts : Window
                xyPositions[currentPlayer].x + (OFFSETTER1 * i),
                (player[currentPlayer].cardLifted[i] ? (xyPositions[currentPlayer].y - OFFSETTER2 - 20) :(xyPositions[currentPlayer].y - OFFSETTER2)),
                bitmap.width + (xyPositions[currentPlayer].x + OFFSETTER1 * i),
-               bitmap.height + (player[currentPlayer].cardLifted[i] ? (xyPositions[currentPlayer].y - OFFSETTER2 - 20) : (xyPositions[currentPlayer].y - OFFSETTER2)) 
+               bitmap.height + (player[currentPlayer].cardLifted[i] ? (xyPositions[currentPlayer].y - OFFSETTER2 - 20) : (xyPositions[currentPlayer].y - OFFSETTER2))
                }.IsPointInside(Point{x,y}) && drawButton[currentPlayer].disabled)
 
             {
@@ -726,8 +726,8 @@ class TongIts : Window
                width = bitmap.width;
                height = bitmap.height;
                xCursorPositionAtCard = (xyPositions[currentPlayer].x + (OFFSETTER1 * i)) - x;
-               yCursorPositionAtCard = (player[currentPlayer].cardLifted[i] ? 
-                  (xyPositions[currentPlayer].y - OFFSETTER2 - y - 20) : 
+               yCursorPositionAtCard = (player[currentPlayer].cardLifted[i] ?
+                  (xyPositions[currentPlayer].y - OFFSETTER2 - y - 20) :
                   (xyPositions[currentPlayer].y - OFFSETTER2 - y));
                flagButtonDown = true;
                OnMouseMove(x,y,mods);
@@ -742,9 +742,9 @@ class TongIts : Window
    bool OnRightButtonUp(int x, int y, Modifiers mods)
    {
       Bitmap bitmap = cardBack;
-      int swapCard,dest,source,i; 
+      int swapCard,dest,source,i;
       Box boxPlayerCards={xyPositions[currentPlayer].x,xyPositions[currentPlayer].y - OFFSETTER2,
-         xyPositions[currentPlayer].x + player[currentPlayer].numCards * OFFSETTER1 + bitmap.width, 
+         xyPositions[currentPlayer].x + player[currentPlayer].numCards * OFFSETTER1 + bitmap.width,
          xyPositions[currentPlayer].y - OFFSETTER2 + bitmap.height};
       Box boxCard = {x + xCursorPositionAtCard,y + yCursorPositionAtCard, x + xCursorPositionAtCard,y + yCursorPositionAtCard + height - 1};
 
@@ -752,7 +752,7 @@ class TongIts : Window
       {
          if(boxCard.Overlap(boxPlayerCards))
          {
-            swapCard = (x  + xCursorPositionAtCard >= player[currentPlayer].numCards * 15 + xyPositions[currentPlayer].x) ? 
+            swapCard = (x  + xCursorPositionAtCard >= player[currentPlayer].numCards * 15 + xyPositions[currentPlayer].x) ?
                (player[currentPlayer].numCards-1) : ((x  + xCursorPositionAtCard - xyPositions[currentPlayer].x) / 15);
             if(cardToReposition > swapCard)
             {
@@ -769,15 +769,15 @@ class TongIts : Window
                MoveBytes(&player[currentPlayer].cardValues[dest],
                   &player[currentPlayer].cardValues[source],(swapCard - cardToReposition) * sizeof(int));
                   player[currentPlayer].cardValues[swapCard] = dragCard;
-               //player[currentPlayer].cardLifted[swapCard] = false;   
+               //player[currentPlayer].cardLifted[swapCard] = false;
             }
 
          }
-      
+
          for(i=0;i<player[currentPlayer].numCards;i++)
          {
             player[currentPlayer].cardLifted[i] = false;
-         }   
+         }
 
          flagButtonDown = false;
          ReleaseCapture();
index c9e6073..04888c6 100644 (file)
@@ -44,7 +44,7 @@ class Othello : Window
    OthelloService service { port = OTHELLO_PORT, othello = this };
 
    // Default properties
-   background = black, tabCycle = true, text = "ECERE Othello", borderStyle = sizable, hasClose = true, 
+   background = black, tabCycle = true, text = "ECERE Othello", borderStyle = sizable, hasClose = true,
    size.h = 480, clientSize.w = NUM_COLUMNS*WIDTH;
 
    // --- Othello Utilities ---
@@ -52,20 +52,20 @@ class Othello : Window
    {
       int x,y;
       int numChips = 0;
-   
+
       sx += dx;
       sy += dy;
-   
+
       // Out of the board...
       if(sx < 0 || sx >= NUM_COLUMNS || sy < 0 || sy >= NUM_ROWS)
          return 0;
-   
+
       // Chip of the same color...
       if(board[sy][sx] == color || board[sy][sx] == empty)
          return 0;
-   
-      for(x = sx, y = sy; 
-          x >= 0 && x < NUM_COLUMNS && y >= 0 && y < NUM_ROWS; 
+
+      for(x = sx, y = sy;
+          x >= 0 && x < NUM_COLUMNS && y >= 0 && y < NUM_ROWS;
           x += dx, y += dy)
       {
          // Chip of the same color at the end of the line...
@@ -73,11 +73,11 @@ class Othello : Window
          {
             if(turn)
             {
-               for(x = sx, y = sy; 
+               for(x = sx, y = sy;
                    x >= 0 && x < NUM_COLUMNS && y >= 0 && y < NUM_ROWS;
                    x += dx, y += dy)
                {
-                  if(board[y][x] == color) 
+                  if(board[y][x] == color)
                      break;
                   else
                      board[y][x] = color;
@@ -92,11 +92,11 @@ class Othello : Window
          else
             numChips ++;
       }
-   
+
       // No chip of the same color at the end...
       return 0;
    }
-   
+
    bool PossibleMove()
    {
       bool validMove = false;
@@ -107,12 +107,12 @@ class Othello : Window
                validMove = true;
       return validMove;
    }
-   
+
    int TurnChips(int sx, int sy, ChipColor color, int turn)
    {
       int x,y;
       int numChips = 0;
-   
+
       for(y = -1; y <= 1; y++)
          for(x = -1; x <= 1; x++)
             if(x || y)
@@ -123,23 +123,23 @@ class Othello : Window
          this.numChips[color] += numChips + 1;
          this.numChips[1-color] -= numChips;
          this.turn = 1-color;
-   
+
          if(!PossibleMove())
          {
             this.turn = color;
             if(!PossibleMove())
                gameOver = true;
          }
-         
+
          Update(null);
       }
       return numChips;
    }
-   
+
    void NewGame()
    {
       int x,y;
-   
+
       for(y = 0; y<NUM_ROWS; y++)
          for(x = 0; x<NUM_COLUMNS; x++)
             board[y][x] = empty;
@@ -150,7 +150,7 @@ class Othello : Window
       gameOver = false;
       Update(null);
    }
-   
+
    void EnableButtons()
    {
       join.disabled = false;
@@ -158,25 +158,25 @@ class Othello : Window
       disconnect.disabled = false;
       stop.disabled = false;
       localGame.disabled = false;
-      
+
       if(gameRunning || hosting || sockets[SERVER])
          localGame.disabled = true;
-      if(!hosting) 
+      if(!hosting)
          stop.disabled = true;
       if(!gameRunning && !sockets[SERVER])
          disconnect.disabled = true;
-   
+
       if(hosting || sockets[SERVER] || local)
          host.disabled = true;
-         
+
       if(sockets[SERVER] || local || hosting)
          join.disabled = true;
-   
+
       address.disabled = join.disabled;
    }
 
    // Children
-   Button localGame 
+   Button localGame
    {
       parent = this, text = "Local Game", position = Point{ 160, 330 }, size = Size { 100, 20 }, hotKey = altL;
 
@@ -333,7 +333,7 @@ class Othello : Window
             surface.WriteTextf(50, 420, "It is your turn to move.");
       }
    }
+
    bool OnKeyDown(Key key, unichar ch)
    {
       if(key == escape) Destroy(0);
@@ -358,7 +358,7 @@ class Othello : Window
          }
       }
       return true;
-   }                    
+   }
 }
 
 // --- Othello Communication ---
@@ -377,7 +377,7 @@ class OthelloSocket : Socket
          othello.sockets[SERVER] = null;
          othello.gameRunning = false;
       }
-   
+
       othello.EnableButtons();
       othello.Update(null);
    }
@@ -401,7 +401,7 @@ class OthelloSocket : Socket
       }
       return 0;
    }
-   
+
    void OnConnect()
    {
       othello.sockets[SERVER] = this;
@@ -409,7 +409,7 @@ class OthelloSocket : Socket
       othello.EnableButtons();
       othello.NewGame();
    }
-   
+
    property Othello othello { set { othello = value; } }
 }
 
@@ -421,10 +421,10 @@ class OthelloService : Service
       if(!othello.sockets[CLIENT] && !othello.gameRunning)
       {
          OPacket packet { newGame };
-   
+
          othello.sockets[CLIENT] = OthelloSocket { this, othello = othello };
          othello.sockets[CLIENT].Send((byte *)&packet, sizeof(OPacket));
-   
+
          othello.NewGame();
          othello.gameRunning = true;
          othello.EnableButtons();
index 20e2de7..041d8d6 100644 (file)
@@ -115,7 +115,7 @@ class ScrabbleGame
          LoadWords(dicos[value]);
       }
    }
-   
+
    Letters board[15][15];
    Letters blankValues[15][15];
    PlayedMove curMove;
@@ -161,12 +161,12 @@ class ScrabbleGame
          move.tiles[move.numTiles++].letter = letter;
       }
    }
-   
+
    void NewGame()
    {
       int c;
       int numPlayers = 0;
-      
+
       for(c = 0; c<MaxPlayers; c++)
          if(players[c])
             numPlayers++;
@@ -177,9 +177,9 @@ class ScrabbleGame
          Letters l;
          PlayerList list { };
          PlayedMove tiles { };
-         
+
          numLettersAvailable = 0;
-         
+
          for(l = 0; l<Letters::empty; l++)
          {
             numLettersAvailable += lettersCount[language][l];
@@ -231,17 +231,17 @@ class ScrabbleGame
             char word[100];
             f.GetLine(word, sizeof(word));
             dictionary.Add(CopyString(word));
-         }        
+         }
          delete f;
       }
-      
+
       /*{
          IteratorPointer test1, test2;
          test1 = dictionary.Find("gewurztraminer");
          test2 = dictionary.Find("gewurstraminer");
          Print("");
       }*/
-      
+
    }
 
    bool CheckWord(Letters newBoard[15][15], Direction direction, int where, int start, int end, int * score)
@@ -345,7 +345,7 @@ class ScrabbleGame
       }
 
       for(c = first; c>=0; c--)
-      {         
+      {
          Letters letter = direction ? newBoard[c][where] : newBoard[where][c];
          if(letter == empty) break;
          wordStart = c;
@@ -353,7 +353,7 @@ class ScrabbleGame
             anchored = true;
       }
       for(c = last; c<15; c++)
-      {         
+      {
          Letters letter = direction ? newBoard[c][where] : newBoard[where][c];
          if(letter == empty) break;
          wordEnd = c;
@@ -371,7 +371,7 @@ class ScrabbleGame
             int a;
 
             for(a = where; a>=0; a--)
-            {         
+            {
                Letters letter = direction ? newBoard[c][a] : newBoard[a][c];
                if(letter == empty) break;
                wordStart = a;
@@ -379,7 +379,7 @@ class ScrabbleGame
                   anchored = true;
             }
             for(a = where; a<15; a++)
-            {         
+            {
                Letters letter = direction ? newBoard[c][a] : newBoard[a][c];
                if(letter == empty) break;
                wordEnd = a;
@@ -429,7 +429,7 @@ public:
          delete scrabbleGame.players[player.id];
          delete player;
          scrabbleGame.EndGame();
-      }      
+      }
    }
 
    int Join()
@@ -538,7 +538,7 @@ public:
       {
          int c;
          PlayedMove newTiles { };
-                  
+
          for(c = 0; c<move.numTiles; c++)
          {
             int d;
@@ -548,7 +548,7 @@ public:
                   memmove(player.letters + d, player.letters + d + 1, sizeof(int) * (player.numLetters - d - 1));
                   player.numLetters--;
                   break;
-               }                        
+               }
          }
 
          scrabbleGame.GetTiles(scrabbleGame.curPlayer, newTiles);
@@ -556,7 +556,7 @@ public:
          for(c = 0; c<move.numTiles; c++)
          {
             scrabbleGame.lettersAvailable[move.tiles[c].letter]++;
-            scrabbleGame.numLettersAvailable++;                  
+            scrabbleGame.numLettersAvailable++;
          }
 
          scrabbleGame.curMove = { }; // TODO: Add informing other players of number of exchanged letters when passing...
index 537e384..6864c86 100644 (file)
@@ -136,7 +136,7 @@ class DefineBlank : Window
       for(c = 0; c<Letters::blank; c++)
       {
          list.AddRow().SetData(field, c);
-      }         
+      }
    }
 }
 
@@ -212,7 +212,7 @@ class Scrabble : Window
          char ch = (char)a + 'A';
          surface.SetForeground(blank ? gray : black);
          surface.TextFont(letterFont.font);
-         surface.WriteText(x + 5, y, &ch, 1); 
+         surface.WriteText(x + 5, y, &ch, 1);
 
          if(!blank)
          {
@@ -276,7 +276,7 @@ class Scrabble : Window
 
          if(boardLetters[cy][cx] == empty)
          {
-            surface.Area(x + 2, y + 2, x + TileSize - 1, y + TileSize - 1); 
+            surface.Area(x + 2, y + 2, x + TileSize - 1, y + TileSize - 1);
             surface.SetForeground(black);
             if(cx == 7 && cy == 7)
             {
@@ -307,8 +307,8 @@ class Scrabble : Window
       else if(boardLetters[cy][cx] == empty)
       {
          surface.SetBackground(burlyWood);
-         surface.Area(x + 2, y + 2, x + TileSize - 1, y + TileSize - 1); 
-      }         
+         surface.Area(x + 2, y + 2, x + TileSize - 1, y + TileSize - 1);
+      }
    }
 
    void OnRedraw(Surface surface)
@@ -321,7 +321,7 @@ class Scrabble : Window
          surface.HLine(BoardX, BoardX + TileSize * 15, BoardY + y * TileSize);
          surface.HLine(BoardX, BoardX + TileSize * 15, BoardY + y * TileSize+1);
       }
-      
+
       for(x = 0; x<16; x++)
       {
          surface.VLine(BoardY + 0, BoardY + TileSize * 15, BoardX + x * TileSize);
@@ -332,7 +332,7 @@ class Scrabble : Window
          {
             DrawSquare(surface, x, y);
          }
-      
+
       for(c = 0; c<numLetters; c++)
       {
          if(dragging && c == dragLetter)
@@ -361,7 +361,7 @@ class Scrabble : Window
       // Picking Letters on the board
       if(gameStarted && turn == playerID)
       {
-         if(mx > BoardX && mx < BoardX + TileSize * 15 && 
+         if(mx > BoardX && mx < BoardX + TileSize * 15 &&
             my > BoardY && my < BoardY + TileSize * 15)
          {
             int x = (mx - BoardX) / TileSize;
@@ -375,7 +375,7 @@ class Scrabble : Window
                blankValues[y][x] = empty;
                numLetters++;
                dragging = true;
-               
+
                dragY = my;
                dragPos = -1;
                Capture();
@@ -428,7 +428,7 @@ class Scrabble : Window
 
          numLetters++;
          dragging = true;
-         
+
          dragY = my;
          dragPos = -1;
          Capture();
@@ -455,7 +455,7 @@ class Scrabble : Window
       else if(posA > posB)
          return 1;
       else
-         return 0;      
+         return 0;
    }
 
    bool OnMouseMove(int mx, int my, Modifiers mods)
@@ -479,7 +479,7 @@ class Scrabble : Window
 
          for(c = 0; c<numLetters; c++)
             ordered[c] = c;
-         
+
          if(y < TileSize && y > -TileSize && moveX + TileSize >= 0 && moveX <= TrayWidth)
          {
             qsort(ordered, numLetters, sizeof(int), ComparePositions);
@@ -504,7 +504,7 @@ class Scrabble : Window
                   memmove(ordered + dragPos + 1, ordered + dragPos, (pos - dragPos) * sizeof(int));
                   ordered[dragPos] = dragLetter;
                }
-               
+
                ordered[dragPos] = dragLetter;
                ordered[pos] = oldValue;
             }
@@ -524,11 +524,11 @@ class Scrabble : Window
                if(out && c != numLetters)
                   collision = true;
             }
-            
+
             if(moveX >= lastX || collision)
             {
                int end;
-               
+
                for(c = 0; c<numLetters; c++)
                {
                   if(ordered[c] == dragLetter)
@@ -537,7 +537,7 @@ class Scrabble : Window
                      break;
                   }
                }
-                  
+
                end = moveX + TileSize;
 
                for(; c < numLetters; c++)
@@ -551,7 +551,7 @@ class Scrabble : Window
                   }
                   end = ((ordered[c] == dragLetter) ? moveX : positions[ordered[c]]) + TileSize;
                }
-               
+
                // RIGHT LIMIT
                end = TrayWidth;
                for(c = numLetters-1; c>= 0; c--)
@@ -621,7 +621,7 @@ class Scrabble : Window
          // Dropping On the board
          if(gameStarted && turn == playerID)
          {
-            if(mx > BoardX && mx < BoardX + TileSize * 15 && 
+            if(mx > BoardX && mx < BoardX + TileSize * 15 &&
                my > BoardY && my < BoardY + TileSize * 15)
             {
                x = (mx - BoardX) / TileSize;
@@ -643,7 +643,7 @@ class Scrabble : Window
       int end;
       int ordered[7];
       int c;
-      
+
       for(c = 0; c<numLetters; c++)
          ordered[c] = c;
       qsort(ordered, numLetters, sizeof(int), ComparePositions);
@@ -656,7 +656,7 @@ class Scrabble : Window
             positions[ordered[c]] = end;
          end = positions[ordered[c]] + TileSize;
       }
-      
+
       // RIGHT LIMIT
       end = TrayWidth;
       for(c = numLetters-1; c>= 0; c--)
@@ -673,7 +673,7 @@ class Scrabble : Window
       {
          dragging = false;
          ReleaseCapture();
-        
+
          if(my > ThrowHeight)
          {
             throwLetters[numThrowLetters++] = letters[dragLetter];
@@ -687,7 +687,7 @@ class Scrabble : Window
          // Dropping Letters on the board
          if(gameStarted && turn == playerID)
          {
-            if(mx > BoardX && mx < BoardX + TileSize * 15 && 
+            if(mx > BoardX && mx < BoardX + TileSize * 15 &&
                my > BoardY && my < BoardY + TileSize * 15)
             {
                int x = (mx - BoardX) / TileSize;
@@ -721,13 +721,13 @@ class Scrabble : Window
    }
 
    DataField scoreFields[MaxPlayers];
-   
-   Button playBtn 
+
+   Button playBtn
    {
       this, text = "Play", bevel = false, position = { 520, 540 };
       font = { "Arial", 20, true };
       opacity = 0; drawBehind = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          if(!numThrowLetters && gameStarted && turn == playerID)
@@ -786,7 +786,7 @@ class Scrabble : Window
       this, text = "Throw / Pass", bevel = false, position = { 430, 622 };
       font = { "Arial", 20, true };
       opacity = 0; drawBehind = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          bool placed = false;
@@ -820,7 +820,7 @@ class Scrabble : Window
       this, text = "Connect", bevel = false, position = { 520, 122 };
       font = { "Arial", 20, true };
       opacity = 0; drawBehind = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          if(!server)
@@ -885,13 +885,13 @@ class Scrabble : Window
                      int y = move.tiles[c].y;
                      scrabble.boardLetters[y][x] = move.tiles[c].letter;
                      scrabble.blankValues[y][x] = move.tiles[c].blankValue;
-                  }                              
+                  }
                   scrabble.playerScores[move.player] += move.score;
                   scrabble.scores.AddRow().SetData(scrabble.scoreFields[move.player], scrabble.playerScores[move.player]);
 
                   scrabble.Update(null);
                   memcpy(scrabble.lastBoard, scrabble.boardLetters, sizeof(scrabble.lastBoard));
-                  
+
                   do
                   {
                      scrabble.turn++;
@@ -917,7 +917,7 @@ class Scrabble : Window
       this, text = "Start", bevel = false, position = { 520, 222 };
       font = { "Arial", 20, true };
       opacity = 0; drawBehind = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          if(scrabbleGame)
@@ -930,7 +930,7 @@ class Scrabble : Window
       this, text = "Host (Français)", bevel = false, position = { 520, 322 };
       font = { "Arial", 16, true };
       opacity = 0; drawBehind = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          if(!scrabbleGame || !scrabbleGame.gameStarted)
@@ -953,7 +953,7 @@ class Scrabble : Window
       this, text = "Host (English)", bevel = false, position = { 520, 362 };
       font = { "Arial", 16, true };
       opacity = 0; drawBehind = true;
-      
+
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          if(!scrabbleGame || !scrabbleGame.gameStarted)
index fd0cc01..1ba9506 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001-2007 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    tetris.ec - Tetris
 ****************************************************************************/
 import "ecere"
@@ -275,7 +275,7 @@ class Tetris : Window
       host.disabled = false;
       disconnect.disabled = false;
       stop.disabled = false;
-      
+
       if(!hosting)
          stop.disabled = true;
       if(!sockets[SERVER])
@@ -283,7 +283,7 @@ class Tetris : Window
 
       if(hosting || sockets[SERVER])
          host.disabled = true;
-         
+
       if(sockets[CLIENT] || hosting)
          join.disabled = true;
 
@@ -331,7 +331,7 @@ class Tetris : Window
                      case 0: case 2: rx += piece->x0; break;
                      case 1: case 3: rx += piece->x1; break;
                   }
-                  
+
                   square = piece->data[y * piece->w + x];
                   if(square)
                      surface.Blit(squares[square-1], (rx + playerx) * 16, (ry + playery) * 16, 0, 0, 16, 16);
@@ -357,7 +357,7 @@ class Tetris : Window
                   case 0: case 2: rx += piece->x0; break;
                   case 1: case 3: rx += piece->x1; break;
                }
-               
+
                square = piece->data[y * piece->w + x];
                if(square)
                   surface.Blit(squares[square-1], rx * 16 + (WIDTH + 2) * 16, ry * 16 + 10, 0, 0, 16, 16);
@@ -480,7 +480,7 @@ class Tetris : Window
                memmove(&board[1], &board, y * WIDTH);
             memset(&board, 0, WIDTH);
             y++;
-         }  
+         }
       }
 
       NewPiece();
@@ -493,7 +493,7 @@ class Tetris : Window
          playery++;
       }
       playery--;
-      FreezePiece();  
+      FreezePiece();
    }
 
    bool CheckPiece()
@@ -554,7 +554,7 @@ class Tetris : Window
                playerx = Min(playerx, 12 - ((angle == 0 || angle == 2) ? (piece->x0 + piece->w) : (piece->x1 + piece->h)));
                if(CheckPiece())
                {
-                  if(key == left) playerx++; else playerx--;               
+                  if(key == left) playerx++; else playerx--;
                }
                break;
             case down:
@@ -565,7 +565,7 @@ class Tetris : Window
                   FreezePiece();
                }
                break;
-            case up: 
+            case up:
             {
                int oldx = playerx;
                angle++;
index 6556a20..00e7bdd 100644 (file)
@@ -21,7 +21,7 @@ class Form1 : Window
 
       listBox1.AddField( field1 );
       listBox1.AddField( field2 );
-      
+
       listBox1.currentRow = listBox1.AddRow();
       listBox1.SetData( field1, 2 );
 
index b169291..3f2dbf2 100644 (file)
@@ -9,7 +9,7 @@ class HelloForm : Window
 
    Label label
    {
-      this, position = { 10, 10 }, font = { "Arial", 30 }, 
+      this, position = { 10, 10 }, font = { "Arial", 30 },
       text = "Hello, World!!"
    };
 };
index 8d21716..019e9e3 100644 (file)
@@ -15,7 +15,7 @@ class MainWindow : Window
    void OnRedraw(Surface surface)
    {
       Bitmap bitmap = castleGfx.bitmap;
-      
+
       if(bitmap)
          surface.Blit(bitmap, 100, 100, 0,0, bitmap.width, bitmap.height);
    }
index 0a1af5c..72da700 100644 (file)
@@ -26,7 +26,7 @@ class WorldObject
             surface.foreground = white;
             surface.Rectangle(x-2, y-2, x + bmp.width+1, y + bmp.height+1);
          }
-      }      
+      }
    }
 
 public:
@@ -38,7 +38,7 @@ class Dragon : WorldObject { res = dragonGfx; }
 class Mage : WorldObject { res = mageGfx; selectable = true; }
 class Archer : WorldObject { res = archerGfx; selectable = true; }
 class Castle : WorldObject { res = castleGfx; }
+
 Array<WorldObject> objects
 { [
    Castle { 180, 150 },
@@ -49,7 +49,7 @@ Array<WorldObject> objects
    Dragon { 320, 50 }
 ] };
 
-WorldObject selected;   
+WorldObject selected;
 
 class WorldObjectController : WindowController<WorldObject>
 {
index 1ea2014..7513388 100644 (file)
@@ -26,7 +26,7 @@ class WorldObject
             surface.foreground = white;
             surface.Rectangle(x-2, y-2, x + bmp.width+1, y + bmp.height+1);
          }
-      }      
+      }
    }
 
 public:
@@ -49,7 +49,7 @@ Array<WorldObject> objects
    Dragon { 320, 50 }
 ] };
 
-WorldObject selected;   
+WorldObject selected;
 
 class MainWindow : Window
 {
index 56d5937..1b992a8 100644 (file)
@@ -26,7 +26,7 @@ class WorldObject
             surface.foreground = white;
             surface.Rectangle(x-2, y-2, x + bmp.width+1, y + bmp.height+1);
          }
-      }      
+      }
    }
 
 public:
@@ -38,7 +38,7 @@ class Dragon : WorldObject { res = dragonGfx; }
 class Mage : WorldObject { res = mageGfx; selectable = true; }
 class Archer : WorldObject { res = archerGfx; selectable = true; }
 class Castle : WorldObject { res = castleGfx; }
+
 Array<WorldObject> objects
 { [
    Castle { 180, 150 },
@@ -49,7 +49,7 @@ Array<WorldObject> objects
    Dragon { 320, 50 }
 ] };
 
-WorldObject selected;   
+WorldObject selected;
 
 class MainWindow : Window
 {
index 30cc782..a913417 100644 (file)
@@ -28,7 +28,7 @@ class Dragon : WorldObject { res = dragonGfx; }
 class Mage : WorldObject { res = mageGfx; }
 class Archer : WorldObject { res = archerGfx; }
 class Castle : WorldObject { res = castleGfx; }
+
 Array<WorldObject> objects
 { [
    Castle { 180, 150 },
index 098f1d3..043c2e3 100644 (file)
@@ -6,7 +6,7 @@ class Child : Window
    size = Size { 300, 200 };
    borderStyle = sizable;
    text = "Sizable";
-   
+
    Button
    {
       this, text = "Push Me", position = { 100, 20 }, size = { 80, 30 };
index cde7177..cc15158 100644 (file)
@@ -40,12 +40,12 @@ class Form1 : Window
       surface.Clear(colorBuffer);
       time.GetLocalTime();
       surface.SetForeground({ 128, darkGray });
-      surface.WriteTextf(0,0, "%02d:%02d:%02d", 
+      surface.WriteTextf(0,0, "%02d:%02d:%02d",
          time.hour, time.minute, time.second);
       surface.SetForeground({ 192, teal });
-      surface.WriteTextf(2, 2, "%02d:%02d:%02d", 
+      surface.WriteTextf(2, 2, "%02d:%02d:%02d",
          time.hour, time.minute, time.second);
-      
+
    }
 }
 
index dea4d56..b3824d5 100644 (file)
@@ -42,7 +42,7 @@ class Form1 : Window
       for (i=0; i<=d; i++)
          surface.DrawLine(0,i*h/d,i*w/d,h);
    }
-   
+
    /*void OnRedraw(Surface surface)
    {
       int i,w,h,d;
@@ -67,9 +67,9 @@ class Gadget : Window
 
    bool OnLeftButtonDown(int x, int y, Modifiers mods)
    {
-      
+
       return true;
-   }   
+   }
 };
 
 define skinBackground = Color { r = 40, g = 40, b = 40 };
@@ -92,7 +92,7 @@ class Slider : Gadget
          surface.Area(0, clientSize.h / 2 - 3, clientSize.w-1, clientSize.h/2 + 3);
          surface.SetForeground(black);
          surface.Rectangle(1, clientSize.h / 2 - 2, clientSize.w-2, clientSize.h/2 + 2);
-          
+
          surface.SetBackground(darkGray);
          surface.Area(pos - 3, 0, pos + 3, clientSize.h-1);
          surface.SetForeground(white);
index 29d2f67..3966b35 100644 (file)
@@ -1,5 +1,5 @@
 import "ecere"
+
 class ColorFun : Window
 {
    text = "Fun With Colors and Data Boxes";
@@ -11,41 +11,41 @@ class ColorFun : Window
    nativeDecorations = true;
    tabCycle = true;
    size = { 640, 480 };
+
    Color color;
    color = activeBorder;
    SavingDataBox colorBox
-   {      
+   {
       this, size = { 116, 20 }, position = { 176, 104 }; data = &color; type = class(Color);
+
       bool NotifyChanged(bool closingDropDown)
       {
          background = color;
          return true;
       }
    };
+
    Date date;
    DateTime now;
    date = (now.GetLocalTime(), Date { now.year, now.month, now.day });
    SavingDataBox dateBox
-   {      
+   {
       this, size = { 200, 20 }, position = { 376, 104 }; data = &date; type = class(Date);
    };
 
    DateTime dateTime;
    dateTime = now;
    SavingDataBox dateTimeBox
-   {      
+   {
       this, size = { 200, 20 }, position = { 376, 304 }; data = &dateTime; type = class(DateTime);
    };
+
    double d;
    d = Pi;
    SavingDataBox doubleBox
-   {      
+   {
       this, size = { 116, 20 }, position = { 176, 204 }; data = &d; type = class(double);
    };
 }
+
 ColorFun form {};
index dc6e840..04dcee2 100644 (file)
@@ -5,7 +5,7 @@ define app = ((GuiApplication)__thisModule);
 struct WindowAsteroid {
    Window win;
    int dx, dy;
-   
+
    property int x {
       get { return win.position.x; }
       set { win.position.x = value; }
@@ -29,7 +29,7 @@ public:
    Window holder;
    uint count;
    WindowAsteroid *item;
-   
+
    void Initialize(uint wcount, Window win[]) {
       uint i;
       count = wcount;
@@ -43,7 +43,7 @@ public:
          } while (!item[i].dx && !item[i].dy);
       }
    }
-   
+
    void Advance(void) {
       WindowAsteroid *i = item;
       uint d = count;
@@ -56,7 +56,7 @@ public:
             i->dy = -i->dy;
       }
    }
-   
+
    ~WindowAsteroidField() {
       delete item;
    }
@@ -125,8 +125,8 @@ class Form2 : Window
          return true;
       }
    };
-   Button button4 
-   {      
+   Button button4
+   {
       this, text = "Enabled", position = { 288, 88 }, isCheckbox = true, checked = true;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -137,8 +137,8 @@ class Form2 : Window
    };
    EditBox editBox1 { this, text = "editBox1", contents = "0", position = { 96, 56 }, readOnly = true };
    EditBox editBox2 { this, text = "editBox2", contents = "0", position = { 296, 56 }, readOnly = true };
-   Button button3 
-   {      
+   Button button3
+   {
       this, text = "Enabled", position = { 88, 88 }, isCheckbox = true, checked = true;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -147,8 +147,8 @@ class Form2 : Window
          return true;
       }
    };
-   Button button2 
-   {      
+   Button button2
+   {
       this, text = "Up Me", size = { 119, 21 }, position = { 280, 24 };
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -158,8 +158,8 @@ class Form2 : Window
          return true;
       }
    };
-   Button button1 
-   {      
+   Button button1
+   {
       this, text = "Up Me", size = { 95, 21 }, position = { 88, 24 };
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
index c748454..4413616 100644 (file)
@@ -74,13 +74,13 @@ class eNodepadWindow : Window
       }
       return false;
    }
-   EditBox editBox 
+   EditBox editBox
    {
       this, font = { "Lucida Console", 10 }, anchor = { left = 0.0, top = 0.0, right = 0.0, bottom = 0.0 }, hasHorzScroll = true, hasVertScroll = true, multiLine = true;
 
       bool OnFileModified(FileChange fileChange, char * param)
       {
-         
+
          return true;
       }
 
@@ -125,14 +125,14 @@ class eNotepad : GuiApplication
    bool Init()
    {
       app = this;
-      
+
       if(argc == 2)
          strcpy(paramLocation, argv[1]); // how to check if the path is valid?
       else
          paramLocation[0] = '\0';
 
       appWindow = eNodepadWindow { };
-      
+
       return true;
    }
 }
index 7d4f5d5..d67b646 100644 (file)
@@ -3,13 +3,13 @@
 
    Copyright (c) 2001 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    FliPlayApp.ec - Main Module
 ****************************************************************************/
 import "fliPlay"
 
 class FliPlayApp : GuiApplication
-{   
+{
    appName = "ECERE FLC Player";
 
    // driver = "OpenGL";
@@ -21,7 +21,7 @@ class FliPlayApp : GuiApplication
       {
          FliPlay
          {
-            borderStyle = sizable, hasClose = true, hasMaximize = true, hasMinimize = true, 
+            borderStyle = sizable, hasClose = true, hasMaximize = true, hasMinimize = true,
             text = "ECERE FLC Player", anchor = { left = 0.125, top = 0.125, right = 0.125, bottom = 0.125 },
             animation = argv[1]
          };
index bdb5e0c..704c3d4 100644 (file)
@@ -29,7 +29,7 @@ void FloodFill(Surface surface, int x0, int y0, ColorAlpha newColor)
       while(stack.count > 0)
       {
          ShortPoint point = stack.Pop();
-        
+
          picture = (ColorAlpha *)bitmap.picture + (point.y * bitmap.stride) + point.x;
          if(*picture == oldColor)
          {
@@ -37,7 +37,7 @@ void FloodFill(Surface surface, int x0, int y0, ColorAlpha newColor)
             int x = point.x, sx = point.x;
             int y = point.y;
             bool upIn = false, downIn = false;
-            
+
             while(x > 0)
             {
                x--;
@@ -45,7 +45,7 @@ void FloodFill(Surface surface, int x0, int y0, ColorAlpha newColor)
                if(*picture != oldColor) break;
                sx = x;
             }
-            
+
             pic = picture = (ColorAlpha *)bitmap.picture + (y * bitmap.stride) + sx;
             pictureUp = (y > 0) ? (picture - bitmap.stride) : null;
             pictureDown = (y < bitmap.height - 1) ? (picture + bitmap.stride) : null;
@@ -100,10 +100,10 @@ class DrawingArea : Window
    hasVertScroll = true;
    hasHorzScroll = true;
    borderStyle = deep;
-      
+
    Bitmap bitmap
    {
-      
+
    };
 
    void OnRedraw(Surface surface)
@@ -224,8 +224,8 @@ class PaintWindow : Window
          delete dialog;
          return true;
       }
-     
-   }; 
+
+   };
    DrawingArea drawingArea
    {
       this,
@@ -244,8 +244,8 @@ class PaintWindow : Window
          return true;
       }
    };
-   Button fillBtn 
-   {      
+   Button fillBtn
+   {
       this, text = "Fill", position = { 24, 64 };
       toggle = true;
 
@@ -256,8 +256,8 @@ class PaintWindow : Window
          return true;
       }
    };
-   Button clearBtn 
-   {      
+   Button clearBtn
+   {
       this, text = "Clear", position = { 24, 104 };
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
index 318c354..8429c70 100644 (file)
@@ -178,13 +178,13 @@ class Form1 : Window
          running_b = value;
          goItem.checked = value;
          wheelSpinner.started = value;
-         
+
          centerItem.disabled = value;
          nudgeLeftItem.disabled = value;
          nudgeRightItem.disabled = value;
          nudgeUpItem.disabled = value;
          nudgeDownItem.disabled = value;
-         
+
          if (!value)
             Update(null);
       }
@@ -196,13 +196,13 @@ class Form1 : Window
    Timer wheelSpinner {this, 0.015, started=false;
       bool DelayExpired() {
          double t = GetTime();
-         
+
          this.modifiedDocument = true;
-         
+
          //game.FrameMulti(LOGICAL_FPS/DRAWN_FPS*2);
          game.FrameMulti((uint)((t-lastFrameTime)*LOGICAL_FPS));
          lastFrameTime = t;
-         
+
          //let's center the camera on the ball
          {
             Coord2D p = game.vehicles[0].location;
@@ -244,7 +244,7 @@ class Form1 : Window
 
          bool NotifySelect(MenuItem selection, Modifiers mods)
          {
-            if (MessageBox {master=this, text = "OpenRider", 
+            if (MessageBox {master=this, text = "OpenRider",
                contents="Are you sure you want to clear the current track and start a new one?",
                type=yesNo}.Modal() != yes)
                return true;
@@ -278,7 +278,7 @@ class Form1 : Window
    MenuItem fileSaveAsItem { fileMenu, "Save As...", a, Key {a, ctrl = true}, NotifySelect=MenuFileSaveAs }
    MenuDivider {fileMenu};
    MenuItem exitItem {fileMenu, "Exit", x, altF4, NotifySelect = MenuFileExit };
-   
+
    Menu viewMenu {menu, "View", v};
    MenuItem centerItem {viewMenu, "Center on ball", c, tab;
       bool NotifySelect(MenuItem selection, Modifiers mods) {
@@ -308,14 +308,14 @@ class Form1 : Window
    MenuItem nudgeRightItem {viewMenu, "Right", r, right, NotifySelect = NudgeCallback, id=1}
    MenuItem nudgeUpItem {viewMenu, "Up", u, up, NotifySelect = NudgeCallback, id=2}
    MenuItem nudgeDownItem {viewMenu, "Down", d, down, NotifySelect = NudgeCallback, id=3}
-   
+
    bool NudgeCallback(MenuItem selection, Modifiers mods) {
       Camera2D *c = camera;
       double nudgeAmount = 20.0 / c->zoom;
-      
+
       if (running)
          return true;
-      
+
       if (selection.id == 0)
          c->x -= nudgeAmount;
       else if (selection.id == 1)
@@ -324,12 +324,12 @@ class Form1 : Window
          c->y -= nudgeAmount;
       else
          c->y += nudgeAmount;
-      
+
       Update(null);
-      
+
       return true;
    }
-   
+
    Menu toolMenu {menu, "Tool", t};
    MenuItem browseItem {toolMenu, "Browse", b, b, checked=false, isRadio=true, NotifySelect = MyCustomMenu};
    MenuItem pencilItem {toolMenu, "Draw", d, d, checked=true, isRadio=true, NotifySelect = MyCustomMenu};
@@ -340,7 +340,7 @@ class Form1 : Window
    MenuItem speedItem {toolMenu, "Right accelerator", r, r, checked=false, isRadio=true, NotifySelect = MyCustomMenu};
    MenuItem slowItem {toolMenu, "Left accelerator", f, f, checked=false, isRadio=true, NotifySelect = MyCustomMenu};
    MenuItem decorItem {toolMenu, "Decoration", c, c, checked=false, isRadio=true, NotifySelect = MyCustomMenu};
-   
+
    Menu controlMenu {menu, "Control", c};
    MenuItem goItem {controlMenu, "Go", g, Key {g, ctrl=true}, checked=false, checkable=true;
       bool NotifySelect(MenuItem selection, Modifiers mods)
@@ -369,7 +369,7 @@ class Form1 : Window
          drawingTool = line;
       else if (eraserItem.checked)
          drawingTool = eraser;
-      
+
       if (normalItem.checked)
          gameLineType = regular;
       else if (speedItem.checked)
@@ -429,7 +429,7 @@ class Form1 : Window
       f.Read(vn, 1, 16);
       vn[15] = 0;
       f.Get(mv);
-      
+
       if (mv > max_version_code_supported) {
          const char *vnp = *vn ? vn : "www.thedailywtf.com";
          const char *message_format = "This track was created by a newer version of OpenRider (version %s).  Continue opening it?";
@@ -474,7 +474,7 @@ class Form1 : Window
 
       for (i=0; i<ROTATION_RESOLUTION; i++)
          wheel[i] = CreateRotatedBitmap(wheel_orig, 48.0/64.0, (double)i*2*Pi/ROTATION_RESOLUTION, wheel_background);
-      
+
       for (i=0; i<ROTATION_RESOLUTION; i++)
          wheel[i].MakeDD(displaySystem);
       #else
@@ -482,7 +482,7 @@ class Form1 : Window
       for (i=0; i<ROTATION_RESOLUTION; i++)
          wheel[i] = wheel_orig;
       #endif
-      
+
       return true;
    }
 
@@ -591,7 +591,7 @@ class Form1 : Window
             Zoom(1/1.05, true);
             break;
          case wheelUp:
-            Zoom(1.05, true); 
+            Zoom(1.05, true);
             break;
          case minus:
             Zoom(1/1.25, false);
@@ -610,7 +610,7 @@ class Form1 : Window
          bool needUpdate = false;
          int x,y;
          double fx, fy;
-         
+
          GetMousePosition(&x, &y);
          fx = (double)(x-(clientSize.w>>1))/c->zoom+c->x;
          fy = (double)(y-(clientSize.h>>1))/c->zoom+c->y;
@@ -635,7 +635,7 @@ class Form1 : Window
                   needUpdate = true;
             }
          }
-         
+
          if (navigating || (drawing && drawingTool==browse)) {
             double ox = nx-(double)x;
             double oy = ny-(double)y;
@@ -645,7 +645,7 @@ class Form1 : Window
             c->y = cstarty + oy;
             needUpdate = true;
          }
-         
+
          if (needUpdate)
             Update(null);
          return true;
@@ -659,7 +659,7 @@ class Form1 : Window
        int y= (int)((ball.location.y-c->y)*c->zoom)+(clientSize.h>>1);
          int rwidth = (int)(ball.radius*2*c->zoom);
          Bitmap w = wheel[angle2index(ball.angle)];
-         
+
          if (w) {
             x -= rwidth>>1;
             y -= rwidth>>1;
@@ -668,7 +668,7 @@ class Form1 : Window
             else
                surface.Filter(w, x,y, 0,0, rwidth,rwidth, w.width,w.height);
          }
-         
+
          #if 0
          if (!running && fabs(camera.zoom-1.0)>0.01) {
             double newradius = ball.radius*camera.zoom;
@@ -727,7 +727,7 @@ class Form1 : Window
                surface.SetForeground(red);
                break;
          }
-         
+
          DrawThickLine(x0, y0, x1, y1);
       }
    };
index ae6af2c..47a6093 100644 (file)
@@ -147,7 +147,7 @@ class GameBall : GameVehicle {
             double dp;
             double elasticity_cur;
             bool clockcont = false; //if positive angle velocity contributes to speed toward parallel of ball velocity
-            
+
             //printf("COLLIDE! (location=(%f, %f), p = <%f, %f>)\n",location.x, location.y, soonest_line->x0-location.x,soonest_line->y0-location.y);
 
             //if (soonest.t<0.0)
@@ -156,7 +156,7 @@ class GameBall : GameVehicle {
             //   PrintLn("Negative time after subtract", soonest.t);
 
             soonest.t-=0.01; //don't fall all the way in, or we'll have multiple collisions after this
-            
+
             //compensate for the time taken to get to the collision
             location.x += velocity.x*soonest.t;
             location.y += velocity.y*soonest.t;
@@ -182,7 +182,7 @@ class GameBall : GameVehicle {
                if ((v_normal.x<0 && v_parallel.y>0) || (v_normal.x>0 && v_parallel.y<0))
                   clockcont = true;
             }
-            
+
             //we need a reference to this before v_normal gets zeroed if elasticity_cur is 0.
             v_parallel_normalized = {-v_normal.y, v_normal.x};
             v_parallel_normalized.Normalize();
@@ -194,7 +194,7 @@ class GameBall : GameVehicle {
             //elastic collision:  multiply the normal by negative elasticity
             v_normal.x *= elasticity_cur;
             v_normal.y *= elasticity_cur;
-            
+
             //an attempt at the effects of angular velocity and friction
             {
                double gs; //goal velocity squared
@@ -233,7 +233,7 @@ class GameBall : GameVehicle {
                else
                   angle_velocity = -g/radius;
             }
-            
+
             velocity.Add(v_parallel, v_normal);
 
             //at last, we'll handle speed/slow lines by simply changing the angular velocity
@@ -266,7 +266,7 @@ public:
    uint version_code; //which version of OpenRider to act like
 
    version_code = max_version_code_supported;
-   
+
    ~Game() { FreeAll(); }
    void FreeAll(void) {
       for (i:vehicles)
@@ -344,7 +344,7 @@ public:
       for (;count--;c+=2)
          lines.Add({c[0],c[1],c[2],c[3],regular,floor});
    }
-   
+
    //returns true if any lines were erased
    bool EraseAtBox(double x0, double y0, double x1, double y1) {
       uint erasures = 0;
@@ -362,7 +362,7 @@ public:
       lines.size -= erasures;
       return !!erasures;
    }
-   
+
    //used for efficiency, not for precision
    //This only checks for lines in box by looking at the bounding boxes of lines in question
    void FindLinesInBox(double x0, double y0, double x1, double y1, bool tolerance) {
@@ -395,7 +395,7 @@ public:
       }
       #undef Swap
    }
-   
+
    virtual void Instance::DrawLine(GameLine line);
    virtual void Instance::DrawBall(GameBall ball);
 }
index 84863f5..cff5b0a 100644 (file)
@@ -109,12 +109,12 @@ static void ball_line_collide_sub(BallLineReturn ret,double r,const Vector2D a,c
 {
        Vector2D pc1;
        double t_pa,t_pb,t_c0,t_c1;
-       
+
        //TODO:  Consider |b|=0
-       
+
        t_pa=LineIntersect(a,b,pa);
        t_pb=LineIntersect(a,b,pb);
-       
+
    ret.s = b;
        if (t_pa<t_pb && t_pa!=INF)
        {
@@ -126,9 +126,9 @@ static void ball_line_collide_sub(BallLineReturn ret,double r,const Vector2D a,c
                ret.t=t_pb;
                goto finalize;
        }
-       
+
        t_c0=CircleIntersect(a,r,pc);
-       
+
        if (t_c0!=INF)
        {
                ret.t=t_c0;
@@ -136,10 +136,10 @@ static void ball_line_collide_sub(BallLineReturn ret,double r,const Vector2D a,c
                ret.s.y = pc.x - a.x*t_c0;
                goto finalize;
        }
-       
+
    pc1.Add(pc, b);
        t_c1=CircleIntersect(a,r,pc1);
-       
+
        if (t_c1!=INF)
        {
                ret.t=t_c1;
@@ -147,7 +147,7 @@ static void ball_line_collide_sub(BallLineReturn ret,double r,const Vector2D a,c
                ret.s.y = pc1.x - a.x*t_c1;
                goto finalize;
        }
-       
+
        ret.t=INF;
        return;
 finalize:
@@ -161,9 +161,9 @@ void BallLineCollide(BallLineReturn ret,double r,const Vector2D a,const Vector2D
        Vector2D a2; //copy of 'a' that can be reversed for backtracing
        char backtracing=0;
    //printf("Colliding %f, <%f,%f>, <%f,%f>, <%f,%f>\n", r, a.x, a.y, b.x, b.y, pc.x, pc.y);
-       
+
        //TODO:  Consider |b|=0
-       
+
        //initialize some vectors
    a2 = a;
    p.x = b.y;
@@ -175,14 +175,14 @@ void BallLineCollide(BallLineReturn ret,double r,const Vector2D a,const Vector2D
    pb.Add(pc,p);
        p.x*=2.0;
        p.y*=2.0;
-       
+
        //Find out if the ball is inside the line (and thus if we need to backtrace)
        {
-               
+
                double dist_ca,dist_cb;
                double b_squared,p_squared,v_dot_b,v_dot_p;
                double pcx=pc.x,pcy=pc.y;
-               
+
                dist_ca=pcx*pcx+pcy*pcy;
                pcx+=b.x;
                pcy+=b.y;
index 7d1797f..2381445 100644 (file)
@@ -45,7 +45,7 @@ public class PictureRotate : Window
          delete image;
          AddResource(value);
          RemoveResource(image);
-         image = value;         
+         image = value;
          material.baseMap = image ? image.bitmap : null;
          material.opacity = 0.5f;
          material.flags.translucent = true;
@@ -80,7 +80,7 @@ public class PictureRotate : Window
       type = fixed;
       position = { 0, -1000, 0 };
       zMin = 0.1f,
-      orientation = Euler { 0, 90, 0 }; 
+      orientation = Euler { 0, 90, 0 };
    };
 
    bool OnLoadGraphics()
@@ -91,7 +91,7 @@ public class PictureRotate : Window
       plane.Create(displaySystem);
       //plane.transform.scaling = { 20 / 2 / 0.707, 20 /2 / 0.707f, 20 /2/ 0.707f };
       plane.transform.scaling = { 1.0f, 1.5f, 1.0f };
-      
+
       // plane.transform.scaling = { image.bitmap.width, 1.5f, image.bitmap.height };
       //plane.transform.scaling = { Max(image.bitmap.width, image.bitmap.height), 1.5f, Max(image.bitmap.width, image.bitmap.height) };
       //camera.aspectRatio = 1.0f;
@@ -129,7 +129,7 @@ public class PictureRotate : Window
          else
             *w = 80;
       }
-         
+
       if(!size.h && (!anchor.top.type || !anchor.bottom.type))
       {
          if(bitmap)
@@ -153,7 +153,7 @@ public class PictureRotate : Window
       display.DrawObject(plane);
       display.SetCamera(surface, null);
    }
-   
+
    Material material
    {
       emissive = white;
index 499df35..fb16cb7 100644 (file)
@@ -49,7 +49,7 @@ class ReminderWindow : Window
    }
 
    Label note { this, text = "Note", position = { 16, 160 }, anchor = { left = 10, bottom = 10 } };
-   Button remindMe 
+   Button remindMe
    {
       this, caption = "Remind Me", escape, anchor = { right = 54, bottom = 10 };
 
@@ -69,8 +69,8 @@ class ReminderWindow : Window
          return true;
       }
    };
-   Button done 
-   {      
+   Button done
+   {
       this, text = "Done", anchor = { right = 10, bottom = 10 };
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
index d4a7859..f967499 100644 (file)
@@ -48,16 +48,16 @@ class Replace : Window
          int entriesReplaced;
          EditBox replaceEdit
          {
-            multiLine = true,textHorzScroll = true,textVertScroll = true, 
+            multiLine = true,textHorzScroll = true,textVertScroll = true,
             text = "Replacing Editbox", size = Size { 640,480 },maxLineSize = 65536
          };
-            
+
          log.Clear();
-         
+
          app.UpdateDisplay();
 
          entriesReplaced =
-            ReplaceInDirectory(directory.contents, findWhat.contents, replaceWith.contents, 
+            ReplaceInDirectory(directory.contents, findWhat.contents, replaceWith.contents,
                matchCase.checked, wholeWord.checked, recurse.checked, replaceEdit, log);
          log.Printf("SEARCH & REPLACE COMPLETED: %d ENTRIES REPLACED.\n", entriesReplaced);
 
@@ -73,7 +73,7 @@ class Replace : Window
       this, noCaret = true, multiLine = true, autoEmpty = true, textHorzScroll = true, hasVertScroll = true, anchor = Anchor { left = 420, top = 30, right = 10, bottom = 10 }
    };
 
-   int ReplaceInDirectory(char * directory, char * findWhat, char * replaceWith, 
+   int ReplaceInDirectory(char * directory, char * findWhat, char * replaceWith,
                             bool matchCase, bool wholeWord, bool recurse, EditBox edit, EditBox log)
    {
       FileListing listing { directory, "htm, html, css, ec" };
@@ -102,7 +102,7 @@ class Replace : Window
                delete f;
 
                for(entriesReplaced = 0;
-                   edit.Find(findWhat, wholeWord, matchCase, true) == found; 
+                   edit.Find(findWhat, wholeWord, matchCase, true) == found;
                    entriesReplaced++)
                   edit.PutS(replaceWith);
                if(entriesReplaced)
index 5918e86..f6c4608 100644 (file)
@@ -90,7 +90,7 @@ class AcovelSkin_Window : Window
             deepBottom = (((BorderBits)borderStyle).sizable && isNormal) ? bottom : border;
          }
 
-         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop, 
+         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop,
             size.w - deepBorder - deepBorder, size.h - deepBottom - deepTop);
       }
 
@@ -104,7 +104,7 @@ class AcovelSkin_Window : Window
             surface.SetForeground(activeBorder);
             surface.Rectangle(2, 2, size.w-3, size.h-3);
 
-            // Resizeable frame is 1 pixel thicker 
+            // Resizeable frame is 1 pixel thicker
             if(((BorderBits)borderStyle).sizable && isNormal)
                surface.Rectangle(3, 3, size.w - 4, size.h - 4);
          }
@@ -114,7 +114,7 @@ class AcovelSkin_Window : Window
             surface.Gradient(gradient, sizeof(gradient) / sizeof(ColorKey), GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
          else
-            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey), 
+            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey),
             GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
 
@@ -140,7 +140,7 @@ class AcovelSkin_Window : Window
          {
             int buttonsSize = border +
                ((hasMaximize || hasMinimize) ? 52 : 18);
-            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET, 
+            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET,
                size.w - (buttonsSize + border + 4), name, strlen(name));
          }
       }
@@ -521,12 +521,12 @@ class AcovelSkin_Button : Button
             surface.SetForeground(Color { Min((int)c.r * 16/10, 255), Min((int)c.g * 16/10, 255), Min((int)c.b * 16/10,255) });
             surface.HLine(0 + isDefault, clientSize.w-2 - isDefault,  isDefault);
             surface.VLine(1 + isDefault, clientSize.h-2 - isDefault,  isDefault);
-            
-            
+
+
             surface.SetForeground(selectionColor);
             surface.HLine(1 + isDefault, clientSize.w-2 - isDefault, clientSize.h-2 - isDefault);
             surface.VLine(1 + isDefault, clientSize.h-3 - isDefault, clientSize.w-2 - isDefault);
-            
+
             if(bevel)
             {
                //surface.SetForeground(skinForeground);
@@ -596,7 +596,7 @@ class AcovelSkin_ScrollBar : ScrollBar
       downBtn.background = Color {  70 * 6/10, 130* 6/10, 180* 6/10 }; //skinBackground;
       downBtn.bitmap = { "<:ecere>elements/arrowDown.png", monochrome = true };
       thumb.background = Color {  70 * 6/10, 130* 6/10, 180* 6/10 }; //skinBackground;
-   }   
+   }
 }
 
 class AcovelSkin_DropBox : DropBox
@@ -608,7 +608,7 @@ class AcovelSkin_DropBox : DropBox
       background = skinBackground;
       foreground = skinForeground;
       this.selectionColor = ::selectionColor;
-   }   
+   }
 }
 
 class AcovelSkin_ListBox : ListBox
@@ -619,7 +619,7 @@ class AcovelSkin_ListBox : ListBox
       background = skinBackground;
       foreground = skinForeground;
       this.selectionColor = ::selectionColor;
-   }   
+   }
 }
 
 public class AcovelSkin : Skin
index a6bd5c7..360b0d8 100644 (file)
@@ -3,7 +3,7 @@ public import "ecere"
 #define BORDER       5 //4
 #define TOP          3
 #define BOTTOM       (4 + 2)
-#define CORNER       (BORDER * 2 + 6) 
+#define CORNER       (BORDER * 2 + 6)
 #define CAPTION      22 // 20
 #define DEAD_BORDER  0 //3
 #define MIN_WIDTH    68
@@ -120,18 +120,18 @@ static void Button::ThumbOnRedraw(Surface surface)
    int w = 14;// * sizeW / 14;
    int sideH = 10; // * sizeW / 14;
    int middleH = size.h - 2 * (sideH + y);
-   
+
    surface.Stretch(left.bitmap, x, y, 0,0, w, sideH, left.bitmap.width, left.bitmap.height);
    surface.HTile(middle.bitmap, x, y + sideH, w, middleH);
    surface.Stretch(right.bitmap, x, y + sideH + middleH, 0,0, w, sideH, right.bitmap.width, right.bitmap.height);
-   
+
    /*
    surface.Filter(left.bitmap, x, y, 0,0, w, sideH, left.bitmap.width, left.bitmap.height);
    surface.FilterVTile(middle.bitmap, x, y + sideH, w, middleH);
    surface.Filter(right.bitmap, x, y + sideH + middleH, 0,0, w, sideH, right.bitmap.width, right.bitmap.height);
    */
 }
-   
+
 static bool Button::ThumbIsInside(int x, int y)
 {
    return (x >= 0 && y >= 0 && x < size.w && y < size.h);
@@ -199,7 +199,7 @@ public class MySkin_ScrollBar : ScrollBar
       }
       return true;
    }
-   
+
    void OnRedraw(Surface surface)
    {
       surface.VTile(bmpScrollVert.bitmap, 0, 0, clientSize.w, clientSize.h);
@@ -283,7 +283,7 @@ public class MySkin_Button : Button
    }
 
    void OnRedraw(Surface surface)
-   {  
+   {
       if(bitmap)
       {
          ((void (*)(Window, Surface))(void *)PUREVTBL(Button)[__ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRedraw])(this, surface);
@@ -310,7 +310,7 @@ public class MySkin_Button : Button
          surface.Filter(left.bitmap, x, y, 0,0, sideW, h, left.bitmap.width, left.bitmap.height);
          surface.FilterHTile(middle.bitmap, x + sideW, y, middleW, h);
          surface.Filter(right.bitmap, x + sideW + middleW, y, 0,0, sideW, h, left.bitmap.width, left.bitmap.height);
-         
+
 
          surface.CenterTextf(clientSize.w/2 + offset, (clientSize.h - textH * 1.1) / 2 + offset, text);
       }
@@ -318,7 +318,7 @@ public class MySkin_Button : Button
 }
 
 
-char * cursorsBitmaps[] = 
+char * cursorsBitmaps[] =
 {
    "<:ecere>cursors/arrow.png",
    "<:ecere>cursors/iBeam.png",
@@ -572,7 +572,7 @@ public class MySkin_Window : Window
             deepBottom = (((BorderBits)borderStyle).fixed /*sizable*/ && isNormal) ? bottom : border;
          }
 
-         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop, 
+         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop,
             size.w - deepBorder - deepBorder, size.h - deepBottom - deepTop);
       }
 
@@ -584,7 +584,7 @@ public class MySkin_Window : Window
          surface.SetForeground(activeBorder);
          surface.Rectangle(2, 2, size.w-3, size.h-3);
 
-         // Resizeable frame is 1 pixel thicker 
+         // Resizeable frame is 1 pixel thicker
          if(((BorderBits)borderStyle).sizable && isNormal)
             surface.Rectangle(3, 3, size.w - 4, size.h - 4);
 
@@ -594,7 +594,7 @@ public class MySkin_Window : Window
             surface.Gradient(gradient, sizeof(gradient) / sizeof(ColorKey), GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
          else
-            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey), 
+            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey),
             GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
          */
@@ -608,7 +608,7 @@ public class MySkin_Window : Window
          // surface.blend = rootWindow != this;
 
          surface.Blit(bmpTopLeftBorder.bitmap, 0, 0, 0, 0, bmpTopLeftBorder.bitmap.width, bmpTopLeftBorder.bitmap.height);
-         surface.Stretch(bmpTopBorder.bitmap, bmpTopLeftBorder.bitmap.width, 0, 0, 0, size.w - 2 * bmpTopLeftBorder.bitmap.width, bmpTopBorder.bitmap.height, 
+         surface.Stretch(bmpTopBorder.bitmap, bmpTopLeftBorder.bitmap.width, 0, 0, 0, size.w - 2 * bmpTopLeftBorder.bitmap.width, bmpTopBorder.bitmap.height,
             bmpTopBorder.bitmap.width, bmpTopBorder.bitmap.height);
          surface.Blit(bmpTopRightBorder.bitmap, size.w - bmpTopRightBorder.bitmap.width, 0, 0, 0, bmpTopRightBorder.bitmap.width, bmpTopRightBorder.bitmap.height);
 
@@ -616,7 +616,7 @@ public class MySkin_Window : Window
          surface.Stretch(bmpRightBorder.bitmap, size.w-9, 27, 0, 0, bmpRightBorder.bitmap.width, size.h - 27 - 9, bmpLeftBorder.bitmap.width, bmpLeftBorder.bitmap.height);
 
          surface.Blit(bmpBottomLeftBorder.bitmap, 0, size.h - 9, 0, 0, bmpBottomLeftBorder.bitmap.width, bmpBottomLeftBorder.bitmap.height);
-         surface.Stretch(bmpBottomBorder.bitmap, bmpBottomLeftBorder.bitmap.width, size.h - 9, 0, 0, size.w - 2 * bmpBottomLeftBorder.bitmap.width, bmpBottomBorder.bitmap.height, 
+         surface.Stretch(bmpBottomBorder.bitmap, bmpBottomLeftBorder.bitmap.width, size.h - 9, 0, 0, size.w - 2 * bmpBottomLeftBorder.bitmap.width, bmpBottomBorder.bitmap.height,
             bmpBottomBorder.bitmap.width, bmpBottomBorder.bitmap.height);
          surface.Blit(bmpBottomRightBorder.bitmap, size.w - bmpBottomRightBorder.bitmap.width, size.h - 9, 0, 0, bmpBottomRightBorder.bitmap.width, bmpBottomRightBorder.bitmap.height);
          //surface.alphaWrite = DontWrite;
@@ -635,7 +635,7 @@ public class MySkin_Window : Window
          {
             int buttonsSize = border +
                ((hasMaximize || hasMinimize) ? 60 : 26);
-            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET, 
+            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET,
                size.w - (buttonsSize + border + NAME_OFFSETX /*4*/), name, strlen(name));
          }
       }
index a86d7cf..fb90a18 100644 (file)
@@ -77,7 +77,7 @@ class SimSkin_Window : Window
             deepBottom = (((BorderBits)borderStyle).sizable && isNormal) ? bottom : border;
          }
 
-         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop, 
+         surface.Bevel(((BorderBits)borderStyle).bevel ? false : true, deepBorder, deepTop,
             size.w - deepBorder - deepBorder, size.h - deepBottom - deepTop);
       }
 
@@ -91,7 +91,7 @@ class SimSkin_Window : Window
             surface.SetForeground(activeBorder);
             surface.Rectangle(2, 2, size.w-3, size.h-3);
 
-            // Resizeable frame is 1 pixel thicker 
+            // Resizeable frame is 1 pixel thicker
             if(((BorderBits)borderStyle).sizable && isNormal)
                surface.Rectangle(3, 3, size.w - 4, size.h - 4);
          }
@@ -101,7 +101,7 @@ class SimSkin_Window : Window
             surface.Gradient(gradient, sizeof(gradient) / sizeof(ColorKey), GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
          else
-            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey), 
+            surface.Gradient(gradientInactive, sizeof(gradientInactive) / sizeof(ColorKey),
             GRADIENT_SMOOTHNESS, GRADIENT_DIRECTION,
                border, top, size.w - border - 1, top + CAPTION - 2);
 
@@ -127,7 +127,7 @@ class SimSkin_Window : Window
          {
             int buttonsSize = border +
                ((hasMaximize || hasMinimize) ? 52 : 18);
-            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET, 
+            surface.WriteTextDots(left, border + NAME_OFFSETX, top + NAME_OFFSET,
                size.w - (buttonsSize + border + 4), name, strlen(name));
          }
       }
@@ -513,12 +513,12 @@ class SimSkin_Button : Button
             surface.SetForeground(Color { Min((int)c.r * 16/10, 255), Min((int)c.g * 16/10, 255), Min((int)c.b * 16/10,255) });
             surface.HLine(0 + isDefault, clientSize.w-2 - isDefault,  isDefault);
             surface.VLine(1 + isDefault, clientSize.h-2 - isDefault,  isDefault);
-            
-            
+
+
             surface.SetForeground(skinMainColor);
             surface.HLine(1 + isDefault, clientSize.w-2 - isDefault, clientSize.h-2 - isDefault);
             surface.VLine(1 + isDefault, clientSize.h-3 - isDefault, clientSize.w-2 - isDefault);
-            
+
             if(bevel)
             {
                //surface.SetForeground(skinForeground);
@@ -683,13 +683,13 @@ class SimSkin_Button : Button
                   x, y,
                   0,0,buttonBitmap.width,buttonBitmap.height);
             }
-            else 
+            else
             {
                // Push Buttons
                if(scaleBitmap)
                {
                   if(bevel || offset)
-                     surface.Stretch(buttonBitmap, 
+                     surface.Stretch(buttonBitmap,
                         1 + offset, 1 + offset,0,0,
                         clientSize.w-3,clientSize.h-3,buttonBitmap.width,buttonBitmap.height);
                   else
@@ -752,12 +752,12 @@ class SimSkin_Button : Button
             surface.TextExtent(text, strlen(text),&tw, &th);
 
             if((isRadio || isCheckbox) && !bevelOver)
-               WriteCaption(surface, /*clientSize.h +*/ CAPTION_DISTANCE + 3, 
+               WriteCaption(surface, /*clientSize.h +*/ CAPTION_DISTANCE + 3,
                   (clientSize.h - th - 4)/2);
-            else 
+            else
             {
                int x, y = (clientSize.h - th - 1)/2 + offset;
-               
+
                if(ellipsis)
                {
                   int width = clientSize.w - 2*6;
@@ -850,7 +850,7 @@ class SimSkin_ScrollBar : ScrollBar
       downBtn.background = Color {  70 * 6/10, 130* 6/10, 180* 6/10 }; //skinBackground;
       downBtn.bitmap = { (direction == vertical) ? "<:ecere>elements/arrowDown.png" : "<:ecere>elements/arrowRight.png", monochrome = true };
       thumb.background = Color {  70 * 6/10, 130* 6/10, 180* 6/10 }; //skinBackground;*/
-   }   
+   }
 }
 
 /*class SimSkin_DropBox : DropBox
@@ -862,7 +862,7 @@ class SimSkin_ScrollBar : ScrollBar
       background = skinBackground;
       foreground = skinForeground;
       selectionColor = skinMainColor;
-   }   
+   }
 }*/
 
 /*class SimSkin_ListBox : ListBox
@@ -873,7 +873,7 @@ class SimSkin_ScrollBar : ScrollBar
       background = skinBackground;
       foreground = skinForeground;
       selectionColor = skinMainColor;
-   }   
+   }
 }*/
 
 public class SimSkin : Skin
index 521c7fb..ab23b2a 100644 (file)
@@ -29,7 +29,7 @@ class SlideShow : Window
 
    background = black;
    anchor = Anchor { 0, 0, 0, 0 };
-   
+
    void NextImage(int direction)
    {
       timer.Stop();
@@ -39,8 +39,8 @@ class SlideShow : Window
       {
          PictureFile oldFileName = fileName;
          int oldDirID = fileName.dirID;
-         while(fileName.dirID == oldDirID || 
-            (direction == -2 && 
+         while(fileName.dirID == oldDirID ||
+            (direction == -2 &&
                (fileName.prev ? fileName.prev : (PictureFile)fileNames.last).dirID == fileName.dirID))
          {
             if(Sgn(direction) == 1)
@@ -54,7 +54,7 @@ class SlideShow : Window
                if(!fileName) fileName = fileNames.last;
             }
             if(Abs(direction) == 1) break;
-            
+
             if(fileName == oldFileName) break;
          }
       }
@@ -80,7 +80,7 @@ class SlideShow : Window
    {
       FileListing listing { directory, "pcx, jpg, bmp, png" };
       OldList list { };
-   
+
       PictureFile fileName;
       int thisDirID = dirID++;
 
@@ -97,7 +97,7 @@ class SlideShow : Window
       for(;(fileName = list.first);)
       {
          list.Remove(fileName);
-         
+
          if(fileName.dir)
          {
             AddDirectory(files, fileName.name);
index 3ecd42e..0f1b12d 100644 (file)
@@ -57,14 +57,14 @@ class Snowing : Window
          surface.background = backgroundColor;
          surface.Area(0,0, w-1, h-1);
          surface.WriteText((clientSize.w - tw)/2, (clientSize.h - th)/2, textString, len);
-         
+
          #ifndef __WIN32__
          XSync(IS_XGetDisplay());   // TODO: Need an API for this...
          #endif
 
          memcpy(buffer.picture, bitmap.picture, buffer.sizeBytes);
       }
-           
+
       if(screenBuffer)
       {
          int x,y;
@@ -109,7 +109,7 @@ class Snowing : Window
          bool atRight = (offset % stride) >= w - 1;
          switch(GetRandom(0, 2))
          {
-            case 0: 
+            case 0:
                if(!SnowTo(offset, stride))
                {
                   if(GetRandom(0, 4) == 0)
index 12c42fc..93b4a02 100644 (file)
@@ -15,7 +15,7 @@ class Form1 : Window
       this, anchor = { 5,5,5,5 };
       clickThrough = true;
    };
-   
+
    Label prompt { column, font = { "Arial", 14, bold = true }, anchor = { horz = 0, top = 10 }, text = "testing" };
    EditBox query
    {
index f798aa5..67df865 100644 (file)
@@ -53,7 +53,7 @@ public class TextScroller : Window
       delete linesText;
       delete contents;
    }
-   
+
    property String contents
    {
       set
@@ -68,7 +68,7 @@ public class TextScroller : Window
       }
       get { return contents; }
    };
-   
+
    bool OnLoadGraphics()
    {
       int c;
index 1dc470f..a084d66 100644 (file)
@@ -25,7 +25,7 @@ class ToolTipsDemo : Window
       button2, tip = "You can change fonts and colors!";
       alphaBlend = true, opacity = 0.75;
       font = { "Comic Sans MS", 12 };
-      background = lightSkyBlue, foreground = darkSlateBlue;      
+      background = lightSkyBlue, foreground = darkSlateBlue;
    };
 }
 
index 5a8b915..29df8ad 100644 (file)
@@ -46,8 +46,8 @@ class Form1 : Window
          return true;
       }
    };
-   Button btnHost 
-   {      
+   Button btnHost
+   {
       this, text = "Host", position = { 32, 16 };
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -57,8 +57,8 @@ class Form1 : Window
       }
    };
    EditBox message { this, size = { 510, 43 }, position = { 16, 400 } };
-   Button btnSend 
-   {      
+   Button btnSend
+   {
       this, text = "Send", isDefault = true, size = { 60, 37 }, position = { 552, 400 };
       disabled = true;
 
index 5dab67c..b3efe57 100644 (file)
@@ -8,7 +8,7 @@ struct SamplePacket
 {
    int stringLen;
    // stringLen + 1 bytes are actually used (variable size depending on string)
-   char string[1];   
+   char string[1];
 };
 
 class SampleService : Service
index 48945f1..c5040d8 100644 (file)
@@ -8,7 +8,7 @@ struct SamplePacket
 {
    int stringLen;
    // stringLen + 1 bytes are actually used (variable size depending on string)
-   char string[1];   
+   char string[1];
 };
 
 class SampleService : Service
@@ -40,7 +40,7 @@ class SampleSocket : Socket
       else if(servingSocket == this)
          servingSocket = null;
 
-      form.UpdateButtonStates();      
+      form.UpdateButtonStates();
    }
 
    unsigned int OnReceive(unsigned char * buffer, unsigned int count)
@@ -93,9 +93,9 @@ class SocketSample : Window
       // The Listen button is disabled if we're already listening
       btnListen.disabled = listening;
    }
-   
-   Button btnSend 
-   {      
+
+   Button btnSend
+   {
       this, text = "Send", position = { 344, 64 }, disabled = true;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -116,8 +116,8 @@ class SocketSample : Window
    };
    EditBox serverAddress { this, text = "Server Address", size = { 174, 19 }, position = { 8, 40 }, contents = "localhost" };
    Label lblServerAddress { this, position = { 8, 16 }, labeledWindow = serverAddress };
-   Button btnListen 
-   {      
+   Button btnListen
+   {
       this, text = "Listen", position = { 144, 104 };
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -135,8 +135,8 @@ class SocketSample : Window
    Label lblSentString { this, position = { 224, 16 }, labeledWindow = sentString };
    EditBox recvString { this, text = "Received String", size = { 166, 19 }, position = { 224, 104 } };
    Label label1 { this, position = { 224, 80 }, labeledWindow = recvString };
-   Button btnConnect 
-   {      
+   Button btnConnect
+   {
       this, text = "Connect", position = { 8, 72 };
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
index f25d323..f7efda0 100644 (file)
@@ -8,7 +8,7 @@ struct SamplePacket
 {
    int stringLen;
    // stringLen + 1 bytes are actually used (variable size depending on string)
-   char string[1];   
+   char string[1];
 };
 
 // We don't really need anything special in this class here, we could simply use Socket directly
index 49688c8..4df4cc1 100644 (file)
@@ -6,7 +6,7 @@ class MySocket : Socket
    {
       printf("Connected!\n");
    }
-   
+
 }
 
 MySocket socket { };
index 4484a8a..7dd00f4 100644 (file)
@@ -1,6 +1,6 @@
 /********************************************************
-   This sample demonstrates how to use the XMLParser 
-   class to parse an XML communication protocol and 
+   This sample demonstrates how to use the XMLParser
+   class to parse an XML communication protocol and
    update model objects accordingly.
 ********************************************************/
 
@@ -66,7 +66,7 @@ class TrackXMLParser : XMLParser
          if(object)
          {
             object.type = type;
-            object.description = desc;            
+            object.description = desc;
          }
          else
          {
index bcbf383..4e0b3ca 100644 (file)
@@ -151,7 +151,7 @@ class Explorer : Window
          {
             File f = FileOpen(htmlView.location, read);
             if(f)
-            {               
+            {
                if(!f.CopyTo(saveFileDialog.filePath))
                {
                   String e = PrintString("Error saving to ", saveFileDialog.filePath);
@@ -165,7 +165,7 @@ class Explorer : Window
    };
    MenuDivider { fileMenu };
    MenuItem exitItem { fileMenu, "Exit\tAlt+F4", x, NotifySelect = MenuFileExit };
-   
+
    bool PageOpened()
    {
       char caption[MAX_LOCATION];
@@ -180,7 +180,7 @@ class Explorer : Window
    }
 
    bool OnPostCreate()
-   {  
+   {
       addressBar.MakeActive();
       return true;
    }
index 0138c5c..c953949 100644 (file)
@@ -54,13 +54,13 @@ class Connection : Window
    borderStyle = sizable, hasClose = true, hasMinimize = true, showInTaskBar = true, size = Size { 580, 600 },
    minClientSize = Size { 300, 440 }, tabCycle = true, background = activeBorder;
 
-   Button close 
-   { 
+   Button close
+   {
       this, text = "Close", size = Size { 80, 0 }, anchor = Anchor { right = 10, bottom = 5 }, hotKey = altC;
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          Destroy(0);
-         return true;         
+         return true;
       }
    };
    Label { this, text = "[=== UPLOAD ===]", position = Point { 10, 10 } };
@@ -74,27 +74,27 @@ class Connection : Window
       }
 
    };
-   Button sendBrowse 
-   { 
+   Button sendBrowse
+   {
       this, text = "Browse", size = Size { 80,20 }, anchor = Anchor { right = 100, top = 40 }, hotKey = altB;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          if(fileList.Modal() == ok)
          {
-            sendFile.Clear(); 
+            sendFile.Clear();
             sendFile.PutS(fileList.filePath);
          }
          return true;
       }
    };
-   Button send 
-   { 
+   Button send
+   {
       this, text = "Send", size = Size { 80, 20 }, anchor = Anchor { right = 10, top = 40 }, hotKey = altS, disabled = true;
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
          char * fileName = sendFile.line.text;
-      
+
          fileSend = FileOpen(fileName, read);
          if(fileSend)
          {
@@ -119,7 +119,7 @@ class Connection : Window
 
                delete packet;
             }
-         
+
             sending.Clear();
             sending.Printf("Sending %s at", outputFile);
          }
@@ -132,7 +132,7 @@ class Connection : Window
    EditBox sending { this, textHorzScroll = true, readOnly = true, borderStyle = deep, inactive = true, size.h = 20, anchor = Anchor { left = 10, top = 70, right = 190 }, opacity = 0 };
    Label sendSpeed { this, borderStyle = deep, anchor = Anchor { right = 100, top = 70 }, size = Size { 80, 20 } };
    Button sendCancel
-   { 
+   {
       this, text = "Cancel", anchor = Anchor { right = 10, top = 70 }, size = Size { 80,20 }, disabled = true;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -158,13 +158,13 @@ class Connection : Window
       }
    };
    ProgressBar recvProgress { this, borderStyle = deep, inactive = true, anchor = Anchor { left = 10, top = 200, right = 10 }, size.h = 20 };
-   EditBox log 
+   EditBox log
    {
       this, readOnly = true, multiLine = true, autoEmpty = true, text = "Conversation", inactive = true, size = Size { 560, 226 }, anchor = Anchor { left = 10, top = 270, right = 10, bottom = 100 }, hasHorzScroll = true, hasVertScroll = true
    };
    Label { this, position = Point { 10, 250 }, labeledWindow = log };
-   Button clear 
-   { 
+   Button clear
+   {
       this, text = "Clear", anchor = Anchor { left = 10, bottom = 5 }, size = Size { 80, 0 }, hotKey = altR;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -174,7 +174,7 @@ class Connection : Window
       }
    };
    Button backButton
-   { 
+   {
       this, text = "Background...", anchor = Anchor { bottom = 5 }, size = Size { 100, 0 }, hotKey = altK;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -185,7 +185,7 @@ class Connection : Window
          return true;
       }
    };
-   EditBox message 
+   EditBox message
    {
       this, multiLine = true, text = "Message", size = Size { 0, 50 }, anchor = Anchor { left = 10, right = 10, bottom = 32 }, disabled = true, hasHorzScroll = true, hasVertScroll = true, size.h = 50;
 
@@ -194,7 +194,7 @@ class Connection : Window
          if((SmartKey)key == ctrlEnter)
          {
             EditLine line;
-         
+
             log.End();
             log.AddS("\n");
             log.AddS("<");
@@ -285,7 +285,7 @@ class Connection : Window
       {
          namePacket->type = Name;
          namePacket->dataSize = strlen(name);
-      
+
          CopyBytes(namePacket + 1, name, namePacket->dataSize);
 
          socket.Send(namePacket, sizeof(eComPacket) + namePacket->dataSize);
@@ -361,7 +361,7 @@ class ConnectionSocket : Socket
 
                      CopyBytes(fileName, data, packet.dataSize);
                      fileName[packet.dataSize] = '\0';
-               
+
                      if(FileExists(fileName))
                      {
                         FileGetSize(fileName, &resumePosition);
@@ -418,7 +418,7 @@ class ConnectionSocket : Socket
                      connection.incomingMessage = renew connection.incomingMessage char[connection.incomingMsgLen + packet.dataSize + 1];
                      CopyBytes(connection.incomingMessage + connection.incomingMsgLen, data, packet.dataSize);
                      connection.incomingMessage[connection.incomingMsgLen + packet.dataSize] = '\0';
-               
+
                      connection.incomingMsgLen += packet.dataSize;
 
                      if(packet.msg.over)
@@ -454,7 +454,7 @@ class ConnectionSocket : Socket
                   {
                      eComPacket ackPacket { DataAck };
                      Seconds diffTime;
-              
+
                      if(connection.abortRecv)
                         ackPacket.data.status = Abort;
                      else if(packet.dataSize)
@@ -466,7 +466,7 @@ class ConnectionSocket : Socket
                         ackPacket.data.status = packet.data.status;
 
                      connection.recvProgress.progress += packet.dataSize;
-               
+
                      diffTime = GetTime() - connection.recvTime;
                      if(diffTime)
                      {
@@ -475,7 +475,7 @@ class ConnectionSocket : Socket
                         strcat(string, "/s");
                         connection.recvSpeed.text = string;
                      }
-               
+
                      if(ackPacket.data.status)
                      {
                         connection.log.End();
@@ -520,7 +520,7 @@ class ConnectionSocket : Socket
                               connection.log.Printf("\n* Remote ran out of disk space receiving %s.", connection.sendFileName);
                               break;
                         }
-                  
+
                         connection.sendProgress.range = 0;
                         delete connection.fileSend;
 
index d6c71d9..e9a5e79 100644 (file)
@@ -46,7 +46,7 @@ class MainPanel : Window
       }
    };
    Button localHost
-   { 
+   {
       this, text = "Local Host", position = Point { 320, 30 }, size = Size { 80, 0 }, hotKey = altL;
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
@@ -71,11 +71,11 @@ class MainPanel : Window
          return true;
        }
    };
-   
+
    EditBox log
    {
-      this, readOnly = true, multiLine = true, autoEmpty = true, hasVertScroll = true, hasHorzScroll = true, inactive = true, 
-      text = "Communication Log", 
+      this, readOnly = true, multiLine = true, autoEmpty = true, hasVertScroll = true, hasHorzScroll = true, inactive = true,
+      text = "Communication Log",
       anchor = Anchor { left = 10, top = 100, right = 10, bottom = 30 },
       contents = app.appName
    };
@@ -91,7 +91,7 @@ class MainPanel : Window
       {
          char * string = nameBox.contents;
          OldLink link;
-         for(link = connections.first; link; link = link.next) 
+         for(link = connections.first; link; link = link.next)
             ((Connection)link.data).SendName(string);
       }
    };
@@ -116,7 +116,7 @@ class MainPanel : Window
 
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
-         Destroy(0); 
+         Destroy(0);
          return true;
       }
    };
@@ -161,7 +161,7 @@ class eComApp : GuiApplication
 class eComService : Service
 {
    MainPanel mainPanel;
-   
+
    port = ECOMMUNICATOR_PORT;
 
    void OnAccept()
index 878d756..05ca1c3 100644 (file)
@@ -3,7 +3,7 @@
 
    Copyright (c) 2001-2008 Jerome Jacovella-St-Louis
    All Rights Reserved.
-   
+
    console.ec - Console Dialog
 ****************************************************************************/
 import "ecere"
@@ -170,7 +170,7 @@ class Console : Window
          if(version)
             surface.WriteTextf(
                clientSize.w - verLROffset.x * 768 / referenceHeight,
-               clientSize.h - verLROffset.y * 768 / referenceHeight, 
+               clientSize.h - verLROffset.y * 768 / referenceHeight,
                version);
       }
    }
index 1035700..b26ff79 100644 (file)
@@ -137,7 +137,7 @@ class IRCSocket : Socket
       // console.Log("\n");
       console.Log(buffer);
 
-      
+
    /*   // Auto connect login Script
       if(!strcmpi(buffer, "NOTICE AUTH :*** Got ident response"))
       {
@@ -166,7 +166,7 @@ class IRCSocket : Socket
    {
       ircSocket.Sendf("NICK %s\n", const_NickName );
       ircSocket.Sendf("USER %s %s %s %s\n", const_NickName, const_NickName, const_NickName , const_NickName );
-      
+
    }
 }
 
index bb8862d..2cc8542 100644 (file)
@@ -85,7 +85,7 @@ class HTTPClient : Socket
       {
          if(buffer[c] == '\r' && buffer[c+1] == '\n')
             break;
-      }   
+      }
       if(c<count)
       {
          char * string = (char *)buffer;
@@ -145,7 +145,7 @@ class HTTPClient : Socket
                      {
                         f = FileOpen(indexFile, read);
                         break;
-                     }               
+                     }
                   }
                   // List contents if we didn't find an index
                   if(i == NUM_INDEX)
@@ -214,7 +214,7 @@ class HTTPApplication : GuiApplication
 
             static byte buffer[PACKETSIZE];
             int read = client.f.Read(buffer, 1, PACKETSIZE);
-            
+
             if(read)
                client.Send(buffer, read);
             if(client.f.Eof())
index 51f7642..255ce3a 100644 (file)
@@ -15,11 +15,11 @@ class ClientApp : GuiApplication
             int newsize;
             uint * indexfs = null;
             int c;
-            
+
             f.Seek(0, end);
             newsize = f.Tell();
             f.Seek(0, 0);
-            
+
             indexfs = renew indexfs byte[newsize];
             c = f.Read(indexfs, newsize, 1);
             delete f;
@@ -29,7 +29,7 @@ class ClientApp : GuiApplication
             delete f;
 
             // while(true) Sleep(1);
-         }      
+         }
          delete connection;
       }
    }
index d49cdb1..90f7448 100644 (file)
@@ -117,7 +117,7 @@ class ClientConnection : Socket
                   OpenPacket packet = (OpenPacket) packetHeader;
                   byte reply[4] = XDWORD(MAXDWORD);
                   int c;
-                  
+
                   Log("Open\n");
                   for(c = 0; c < MAX_HANDLES; c++)
                   {
@@ -234,6 +234,6 @@ class ServerApp : GuiApplication
             WaitEvent();
             ProcessNetworkEvents();
          }
-      } 
+      }
    }
 }
index 79e870d..b4e52a6 100644 (file)
@@ -18,7 +18,7 @@ class SMTPSocket : Socket
    }
    void OnDisconnect(int code)
    {
-      replied = true;      
+      replied = true;
    }
    void WaitReply()
    {
@@ -41,15 +41,15 @@ void Send(char * host, char * to, char * from, File file)
       socket.WaitReply();
       socket.SendString("HELO localhost\n");
       socket.WaitReply();
-      socket.Sendf("MAIL from: %s\n", from); 
+      socket.Sendf("MAIL from: %s\n", from);
       socket.WaitReply();
-      socket.Sendf("RCPT To: %s\n", to); 
+      socket.Sendf("RCPT To: %s\n", to);
       socket.WaitReply();
-      socket.SendString("DATA\n"); 
+      socket.SendString("DATA\n");
       socket.WaitReply();
       socket.SendString("Subject: Email test\n");
       socket.SendString("Content-Type: text/html; charset=Windows-1252\n");
-     
+
       file.Seek(0, start);
       while(!file.Eof())
       {
@@ -75,5 +75,5 @@ class MyApp : GuiApplication
          Send("mail.mailserver.com", "destaddress@destdomain.com", "srcaddress@srcdomain.com", f);
       delete f;
       getch();
-   }   
+   }
 }
index 9f62da1..cca026c 100644 (file)
@@ -13,7 +13,7 @@ class ScanningTest : Window
    Bitmap scannedBitmap;
 
    WiaItem scanner;
-   
+
    ~ScanningTest()
    {
       delete scannedImage;
index ac0c12f..6a13f41 100644 (file)
@@ -46,7 +46,7 @@ class MySocket : Socket
 
       packet.size = size;
       packet.delay = delay;
-      CopyBytes(packet.string, string, len+1);     
+      CopyBytes(packet.string, string, len+1);
       SendPacket(packet);
 
       delete packet;
@@ -105,7 +105,7 @@ class Form1 : Window
          return true;
       }
    };
-   ListBox listBox1 
+   ListBox listBox1
    {
       this, alwaysHighLight = true, text = "listBox1", hasVertScroll = true, size = Size { 172, 268 }, position = Point { 56, 72 };
 
@@ -123,7 +123,7 @@ class Form1 : Window
    void AddString(char * string)
    {
       DataRow row = null;
-      
+
       /*for(row = listBox1.firstRow; row; row = row.next)
          if(!strcmp(row.string, string))
             break;*/