[Dda-cvs] ntdda/src/win32gui arcdialog.c, NONE, 1.1 jointdialog.c, NONE, 1.1 tunneldialog.c, NONE,
Status: Beta
Brought to you by:
doolin
From: David M. D. <do...@us...> - 2006-08-01 06:16:31
|
Update of /cvsroot/dda/ntdda/src/win32gui In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv5641/src/win32gui Modified Files: drawdialog.c Added Files: arcdialog.c jointdialog.c tunneldialog.c Log Message: Added some dialog files. Added some code to clean up xml output. --- NEW FILE: jointdialog.c --- /** * Refactor joint dialog code here. */ --- NEW FILE: tunneldialog.c --- /** * Refactor tunnel dialog code here. */ --- NEW FILE: arcdialog.c --- /** * * Add arc dialog code, like message handling, here. */ Index: drawdialog.c =================================================================== RCS file: /cvsroot/dda/ntdda/src/win32gui/drawdialog.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** drawdialog.c 1 Aug 2006 05:26:10 -0000 1.8 --- drawdialog.c 1 Aug 2006 06:16:28 -0000 1.9 *************** *** 919,923 **** OPENFILENAME ofn; OFSTRUCT of; ! //FILE *fp; HFILE hFile; Geometrydata *geomstruct; --- 919,923 ---- OPENFILENAME ofn; OFSTRUCT of; ! FILE *fp; HFILE hFile; Geometrydata *geomstruct; *************** *** 939,945 **** */ return FALSE; ! } else { /* Open file and save data. ! * If it exists already, delete it. ! */ if (-1 != OpenFile (filepath.gpath, &of, OF_WRITE)) hFile = OpenFile (filepath.gpath, &of, OF_DELETE); --- 939,953 ---- */ return FALSE; ! } else { ! ! // The following is some ugly shit that shot ! // through the DDA code. Leave it alone for ! // now, handle it later. ! /* Open file and save data. ! * If it exists already, delete it. ! */ ! // FIXME: OpenFile is 16 bit win32. This code needs to ! // be changed to use either CreateFile, or better yet, ! // find a way to use fopen. if (-1 != OpenFile (filepath.gpath, &of, OF_WRITE)) hFile = OpenFile (filepath.gpath, &of, OF_DELETE); *************** *** 949,953 **** MB_OK | MB_ICONINFORMATION); return 0; ! } //////////////////////////////////////////////// --- 957,965 ---- MB_OK | MB_ICONINFORMATION); return 0; ! } ! // We are going to close this here because we want to ! // fopen instead, because it is posix compliant and ! // CreateFile and OpenFile are MS Windows specific. ! _lclose (hFile); //////////////////////////////////////////////// *************** *** 955,977 **** /// it afterwards, we can do cooler stuff here. geomstruct = gdata_new (); - - transferJointlistToGeomStruct (geomstruct, jointlist); - transferPointlistToGeomStruct (geomstruct, pointlist); transferBoltlistToGeomStruct (geomstruct, boltlist); - //fp = fopen(filepath.gpath, "w+"); //Disabled by Roozbeh - //geomstruct->dumptofile(geomstruct, fprintf, fp); //Disabled by Roozbeh - geomstruct->dumptofile (geomstruct, fprintf, filepath.gpath); - //fclose(fp); //Disabled by Roozbeh gdata_delete (geomstruct); ! /* FIXME: These functions are segfaulting. */ //freeJointList(); //freePointList(); //freeBoltList(); ! _lclose (hFile); SetClassLong (hDlg, GCL_HCURSOR, (long) LoadCursor (NULL, IDC_ARROW)); ReleaseDC (hDlg, hdc); --- 967,993 ---- /// it afterwards, we can do cooler stuff here. geomstruct = gdata_new (); + + // These are all going to go away soon. + transferJointlistToGeomStruct (geomstruct, jointlist); + transferPointlistToGeomStruct (geomstruct, pointlist); transferBoltlistToGeomStruct (geomstruct, boltlist); + + // We use fopen for posix compliance and the file pointer + // for convenience. + fp = fopen(filepath.gpath, "w+"); + // This call will be replaced shortly. + geomstruct->dumptofile(geomstruct, fprintf, fp); + fclose(fp); gdata_delete (geomstruct); ! /* FIXME: These functions are segfaulting. Fix them. */ //freeJointList(); //freePointList(); //freeBoltList(); ! //_lclose (hFile); SetClassLong (hDlg, GCL_HCURSOR, (long) LoadCursor (NULL, IDC_ARROW)); ReleaseDC (hDlg, hdc); |