summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2010-02-25 23:29:42 +0000
committerMatthias Melcher <fltk@matthiasm.com>2010-02-25 23:29:42 +0000
commit60c1ccd33e0e87bacb45d87a9fc3e58b7a9e0723 (patch)
tree25338fedbec8221c232340eaa1b29462050fc3b8 /fluid
parent7f395e6e4410e376ff95c914506d1599083afce7 (diff)
Working VisualC suport in IDE's (dll's are still missing). Fixed a few warnings.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7147 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid')
-rw-r--r--fluid/Fl_Function_Type.cxx2
-rw-r--r--fluid/fluid.cxx16
-rw-r--r--fluid/ide_support.cxx2
-rw-r--r--fluid/ide_visualc.cxx67
4 files changed, 46 insertions, 41 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx
index 30a3b725e..0c33a50be 100644
--- a/fluid/Fl_Function_Type.cxx
+++ b/fluid/Fl_Function_Type.cxx
@@ -869,7 +869,7 @@ void Fl_Data_Type::write_code1() {
if (!c) return;
const char *fn = filename_;
char *data = 0;
- size_t nData = -1;
+ int nData = -1;
// path should be set correctly already
if (filename_ && !write_sourceview) {
FILE *f = fopen(filename_, "rb");
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index 92786fe10..49f8b50cd 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -1598,6 +1598,19 @@ void dbxcode_cb(Fl_Widget*, void*)
}
}
+void dbvisualc_cb(Fl_Widget*, void*)
+{
+ int i;
+ Fl_Plugin_Manager pm("commandline");
+ for (i=0; i<pm.plugins(); i++) {
+ Fl_Commandline_Plugin *pi = (Fl_Commandline_Plugin*)pm.plugin(i);
+ if (strcmp(pi->name(), "ideVisualC.fluid.fltk.org")==0) {
+ pi->test("/Users/matt/dev/fltk-1.3.0/fltk.db", "/Users/matt/dev/fltk-1.3.0");
+ break;
+ }
+ }
+}
+
////////////////////////////////////////////////////////////////
extern Fl_Menu_Item New_Menu[];
@@ -1693,7 +1706,8 @@ Fl_Menu_Item Main_Menu[] = {
{"Execute &Command...",FL_ALT+'x',(Fl_Callback *)show_shell_window},
{"Execute &Again...",FL_ALT+'g',(Fl_Callback *)do_shell_command},
{"--fltkdb",0,(Fl_Callback *)fltkdb_cb,0,FL_MENU_INVISIBLE},
- {"--dbxcode",0,(Fl_Callback *)dbxcode_cb,0,FL_MENU_INVISIBLE},
+ {"--dbxcode3",0,(Fl_Callback *)dbxcode_cb,0,FL_MENU_INVISIBLE},
+ {"--dbvisualc6",0,(Fl_Callback *)dbvisualc_cb,0,FL_MENU_INVISIBLE},
{0},
{"&Help",0,0,0,FL_SUBMENU},
{"&About FLUID...",0,about_cb},
diff --git a/fluid/ide_support.cxx b/fluid/ide_support.cxx
index e639f829a..5110bf202 100644
--- a/fluid/ide_support.cxx
+++ b/fluid/ide_support.cxx
@@ -680,6 +680,7 @@ int create_new_database(const char *filename)
db.add_source(files_db, "test/blocks.cxx");
db.add_lib(fltk_lib);
xcode_only(db.add_external_lib(files_db, "/System/Library/Frameworks/CoreAudio.framework"));
+ visualc_only(db.add_external_lib(files_db, "winmm.lib"));
demo_db.depends_on(db);
}
@@ -1058,6 +1059,7 @@ int create_new_database(const char *filename)
db.add_lib(fltk_jpeg_lib);
db.add_lib(fltk_png_lib);
xcode_only(db.add_external_lib(files_db, "/System/Library/Frameworks/CoreAudio.framework"));
+ visualc_only(db.add_external_lib(files_db, "winmm.lib"));
demo_db.depends_on(db);
}
diff --git a/fluid/ide_visualc.cxx b/fluid/ide_visualc.cxx
index 3126a0bca..ccc5e83fa 100644
--- a/fluid/ide_visualc.cxx
+++ b/fluid/ide_visualc.cxx
@@ -76,43 +76,22 @@ class VisualC6_IDE {
Fl_Preferences filesDB;
int nFiles;
Fl_Preferences ideDB;
- /*
- XCID xcRootNodeID;
- XCID xcBuildConfigurationListID;
- XCID xcMainGroupID;
- XCID xcProductsGroupID;
- XCID xcAppsGroupID;
- XCID xcLibsGroupID;
- XCID xcTestsGroupID;
- XCID xcBuildConfigurationDebugID;
- XCID xcBuildConfigurationReleaseID;
- */
public:
VisualC6_IDE(Fl_Preferences &db, const char *rootDirA)
: rootDir(strdup(rootDirA)),
- tgtAppsDB(db, "targets/apps"),
- tgtLibsDB(db, "targets/libs"),
- tgtTestsDB(db, "targets/tests"),
- filesDB(db, "files"),
- ideDB(db, "ide/VisualC")
+ tgtAppsDB(db, "targets/apps"),
+ tgtLibsDB(db, "targets/libs"),
+ tgtTestsDB(db, "targets/tests"),
+ filesDB(db, "files"),
+ ideDB(db, "ide/VisualC")
{
db.get("projectName", projectName, "Unnamed", 80);
nTgtApps = tgtAppsDB.groups();
nTgtLibs = tgtLibsDB.groups();
nTgtTests = tgtTestsDB.groups();
nFiles = filesDB.groups();
- /*
- getXCID(ideDB, "xcRootNodeID", xcRootNodeID);
- getXCID(ideDB, "xcBuildConfigurationListID", xcBuildConfigurationListID);
- getXCID(ideDB, "xcMainGroupID", xcMainGroupID);
- getXCID(ideDB, "xcProductsGroupID", xcProductsGroupID);
- getXCID(ideDB, "xcAppsGroupID", xcAppsGroupID);
- getXCID(ideDB, "xcLibsGroupID", xcLibsGroupID);
- getXCID(ideDB, "xcTestsGroupID", xcTestsGroupID);
- getXCID(ideDB, "xcBuildConfigurationDebugID", xcBuildConfigurationDebugID);
- getXCID(ideDB, "xcBuildConfigurationReleaseID", xcBuildConfigurationReleaseID);
- */
}
+
~VisualC6_IDE() {
if (rootDir) free(rootDir);
}
@@ -179,7 +158,7 @@ public:
for (i=0; i<nTgtLibs; i++) {
Fl_Preferences targetDB(tgtLibsDB, i);
writeProjectSection(f, targetDB);
- writeProjectSection(f, targetDB, 1);
+ //writeProjectSection(f, targetDB, 1);
}
for (i=0; i<nTgtTests; i++) {
Fl_Preferences targetDB(tgtTestsDB, i);
@@ -4364,7 +4343,7 @@ public:
*/
int writeApplicationTarget(const char *filepath, Fl_Preferences &targetDB, const char *dir=0) {
char name[80]; targetDB.get("name", name, "DBERROR", 80);
- if (dir) dir = name;
+ if (!dir) dir = name;
char filename[2048];
fl_snprintf(filename, 2047, "%s/%s.dsp", filepath, name);
FILE *f = fopen(filename, "wb");
@@ -4491,10 +4470,12 @@ public:
n = extsDB.groups();
for (i=0; i<n; i++) {
Fl_Preferences extDB(extsDB, i);
- GET_UUID(refUUID, extDB);
- Fl_File_Prefs fileDB(filesDB, refUUID);
- char pathAndName[1024]; fileDB.get("pathAndName", pathAndName, "DBERROR/DBERROR.DBERR", 1024);
- fprintf(f, "%s ", pathAndName);
+ if (with_visualc(extDB.id())) {
+ GET_UUID(refUUID, extDB);
+ Fl_File_Prefs fileDB(filesDB, refUUID);
+ char pathAndName[1024]; fileDB.get("pathAndName", pathAndName, "DBERROR/DBERROR.DBERR", 1024);
+ fprintf(f, "%s ", pathAndName);
+ }
}
fprintf(f, "comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd\" /out:\"../../%s/%sd.exe\" /pdbtype:sept /libpath:\"..\\..\\lib\"\r\n", dir, name);
@@ -4531,8 +4512,12 @@ public:
char cxx_pathname[1024]; strcpy(cxx_pathname, pathAndName);
DOSPath(pathAndName);
fl_filename_setext(cxx_pathname, 1024, ".cxx");
+ DOSPath(cxx_pathname);
const char *path_fl = fileDB.filePath();
- // FIXME: fill in variables
+ fprintf(f, "# Begin Source File\r\n");
+ fprintf(f, "\r\n");
+ fprintf(f, "SOURCE=..\\..\\%s\r\n", cxx_pathname);
+ fprintf(f, "# End Source File\r\n");
fprintf(f, "# Begin Source File\r\n");
fprintf(f, "\r\n");
fprintf(f, "SOURCE=..\\..\\%s\r\n", pathAndName);
@@ -4579,7 +4564,7 @@ public:
*/
int writeStaticLibTarget(const char *filepath, Fl_Preferences &targetDB, const char *dir=0) {
char name[80]; targetDB.get("name", name, "DBERROR", 80);
- if (dir) dir = name;
+ if (!dir) dir = name;
char filename[2048];
fl_snprintf(filename, 2047, "%s/%s.dsp", filepath, name);
FILE *f = fopen(filename, "wb");
@@ -4696,8 +4681,12 @@ public:
char cxx_pathname[1024]; strcpy(cxx_pathname, pathAndName);
DOSPath(pathAndName);
fl_filename_setext(cxx_pathname, 1024, ".cxx");
+ DOSPath(cxx_pathname);
const char *path_fl = fileDB.filePath();
- // FIXME: fill in variables
+ fprintf(f, "# Begin Source File\r\n");
+ fprintf(f, "\r\n");
+ fprintf(f, "SOURCE=..\\..\\%s\r\n", cxx_pathname);
+ fprintf(f, "# End Source File\r\n");
fprintf(f, "# Begin Source File\r\n");
fprintf(f, "\r\n");
fprintf(f, "SOURCE=..\\..\\%s\r\n", pathAndName);
@@ -4738,7 +4727,7 @@ public:
}
/*
- * Write a .dsp target file
+ * TODO: Write a .dsp target file
*/
int writeDynamicLibTarget(const char *filepath, Fl_Preferences &targetDB, const char *dir=0) {
char name[80]; targetDB.get("name", name, "DBERROR", 80);
@@ -4749,7 +4738,7 @@ public:
fl_alert("Can't open file:\n%s", filename);
return -1;
}
- // TODO: fill this
+ // fill this
fclose(f);
return 0;
}
@@ -4766,7 +4755,7 @@ public:
for (i=0; i<nTgtLibs; i++) {
Fl_Preferences targetDB(tgtLibsDB, i);
writeStaticLibTarget(filepath, targetDB, "src");
- writeDynamicLibTarget(filepath, targetDB, "src");
+ // TODO: writeDynamicLibTarget(filepath, targetDB, "src");
}
for (i=0; i<nTgtTests; i++) {
Fl_Preferences targetDB(tgtTestsDB, i);