Author: matt
Date: 2011-08-07 16:01:03 -0700 (Sun, 07 Aug 2011)
New Revision: 8927
Log:
Fluid3: adding Xcode workspace support

Modified:
   branches/branch-3.0/fltk.flw
   branches/branch-3.0/fluid/Fl_Type.cxx
   branches/branch-3.0/fluid/Fl_Type.h
   branches/branch-3.0/fluid/file_xcode.cxx
   branches/branch-3.0/fluid/workspace_panel.cxx
   branches/branch-3.0/fluid/workspace_panel.fl
   branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj
   branches/branch-3.0/ide/templates/Xcode4.tmpl

Modified: branches/branch-3.0/fltk.flw
===================================================================
--- branches/branch-3.0/fltk.flw        2011-08-07 08:51:21 UTC (rev 8926)
+++ branches/branch-3.0/fltk.flw        2011-08-07 23:01:03 UTC (rev 8927)
@@ -3,7 +3,7 @@
 header_name {.h} 
 code_name {.cxx} 
 wks_name FLTK 
-wks_env 1
+wks_env 64
 folder Applications {open
 } {
   app_target Fluid {
@@ -215,6 +215,7 @@
     uuid_Xcode4_SourcesBuildPhase {ABBF042C-9682-43C8-A51D-9D39F354B9DB}
     uuid_Xcode4_ProductReference {FEB0F8FE-0000-6383-0000-384180570D94}
     uuid_Xcode4_Target {A57FDE87-0000-1C99-0000-A52BEEDEE68C}
+    uuid_Xcode4_FrameworksBuildPhase {B5140FAA-6B8D-4D78-814B-695B78247541}
   } {
     folder Headers {open
     } {
@@ -225,7 +226,7 @@
         list_env 92
         filename_and_path {fltk3/Adjuster.h}
       }
-      file_ref {ask.h} {
+      file_ref {ask.h} {selected
         uuid_Xcode4_PBXBuildFile {AEDF2A15-B44B-4BD8-B754-2E54A44DB5B5}
         uuid_Xcode4_PBXFileRef {D31DE8AC-9AC3-4E54-98FE-200462A57910}
         build_env 64
@@ -239,7 +240,7 @@
         list_env 92
         filename_and_path {fltk3/Bitmap.h}
       }
-      file_ref {BMPImage.h} {selected
+      file_ref {BMPImage.h} {
         uuid_Xcode4_PBXBuildFile {B02F1ACA-8C63-4C41-A0FA-429D42B66E10}
         uuid_Xcode4_PBXFileRef {5B9A35BB-8AE6-4627-BE89-BB6BF86DBDA1}
         build_env 64
@@ -2313,6 +2314,17 @@
         filename_and_path {src/xutf8/utf8Wrap.c}
       }
     }
+    folder Libraries {open
+    } {
+      file_ref {Cocoa.framework} {
+        uuid_Xcode4_PBXBuildFile {C96290C2-0000-1274-0000-D0CF007D3CFE}
+        uuid_Xcode4_PBXFileRef {14F66311-AC34-4543-80C3-56AFE29024C3}
+        build_env 64
+        list_env 64
+        filename_and_path 
{SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Cocoa.framework}
+        location 2
+      }
+    }
   }
   lib_target fltk_gl {} {
     folder Sources {} {

Modified: branches/branch-3.0/fluid/Fl_Type.cxx
===================================================================
--- branches/branch-3.0/fluid/Fl_Type.cxx       2011-08-07 08:51:21 UTC (rev 
8926)
+++ branches/branch-3.0/fluid/Fl_Type.cxx       2011-08-07 23:01:03 UTC (rev 
8927)
@@ -1381,6 +1381,8 @@
         filetype(FL_FILE_C_HEADER);
       } else if (strcmp(ext, ".mm")==0) {
         filetype(FL_FILE_OBJC_SOURCE);
+      } else if (strcmp(ext, ".framework")==0) {
+        filetype(FL_FILE_FRAMEWORK);
       }
     }
   }
@@ -1473,6 +1475,10 @@
   return (pFileType==FL_FILE_OBJC_HEADER);
 }
 
+char Fl_File_Type::file_is_framework() {
+  return (pFileType==FL_FILE_FRAMEWORK);
+}
+
 char Fl_File_Type::file_is_code() {
   return 
(pFileType==FL_FILE_CPP_SOURCE)||(pFileType==FL_FILE_C_SOURCE)||(pFileType==FL_FILE_OBJC_SOURCE);
 }

Modified: branches/branch-3.0/fluid/Fl_Type.h
===================================================================
--- branches/branch-3.0/fluid/Fl_Type.h 2011-08-07 08:51:21 UTC (rev 8926)
+++ branches/branch-3.0/fluid/Fl_Type.h 2011-08-07 23:01:03 UTC (rev 8927)
@@ -67,12 +67,14 @@
   FL_FILE_C_SOURCE, FL_FILE_C_HEADER,
   FL_FILE_CPP_SOURCE, FL_FILE_CPP_HEADER,
   FL_FILE_OBJC_SOURCE, FL_FILE_OBJC_HEADER,
-  FL_FILE_TEXT, FL_FILE_TEXT_SCRIPT
+  FL_FILE_TEXT, FL_FILE_TEXT_SCRIPT,
+  FL_FILE_FRAMEWORK
 } FileType;
 
 typedef enum {
   FL_LOCATION_WORKSPACE = 0,
   FL_LOCATION_ABSOLUTE,
+  FL_LOCATION_IDE,
   FL_LOCATION_SDK
 } FileLocation;
 
@@ -322,6 +324,7 @@
   char file_is_c_header();
   char file_is_cplusplus_code();
   char file_is_cplusplus_header();
+  char file_is_framework();
   char file_is_code();
   char file_is_header();
 };

Modified: branches/branch-3.0/fluid/file_xcode.cxx
===================================================================
--- branches/branch-3.0/fluid/file_xcode.cxx    2011-08-07 08:51:21 UTC (rev 
8926)
+++ branches/branch-3.0/fluid/file_xcode.cxx    2011-08-07 23:01:03 UTC (rev 
8927)
@@ -90,6 +90,17 @@
 }
 
 
+static const char *xcode4_location(unsigned int fl) {
+  switch (fl) {
+    case FL_LOCATION_WORKSPACE: return "SOURCE_ROOT";
+    case FL_LOCATION_IDE:       return "DEVELOPER_DIR";
+    case FL_LOCATION_SDK:       return "SDKROOT";
+    case FL_LOCATION_ABSOLUTE:  return "<absolute>";
+  }
+  return "";
+}
+
+
 static int writeFileReferences(FILE *out, Fl_Target_Type *tgt) {
 
   char ProductReference[32]; strcpy(ProductReference, 
tgt->get_UUID_Xcode("Xcode4_ProductReference"));
@@ -171,6 +182,33 @@
 }
 
 
+static int writeFrameworksBuildPhase(FILE *out, Fl_Target_Type *tgt) {
+  
+  char FrameworksBuildPhase[32]; strcpy(FrameworksBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_FrameworksBuildPhase"));
+  
+  fprintf(out, "\t\t%s /* Frameworks */ = {\n", FrameworksBuildPhase);
+  fprintf(out, "\t\t\tisa = PBXFrameworksBuildPhase;\n");
+  fprintf(out, "\t\t\tbuildActionMask = 2147483647;\n");
+  fprintf(out, "\t\t\tfiles = (\n");
+  Fl_File_Type *f;
+  for (f = Fl_File_Type::first_file(tgt); f; f = f->next_file(tgt)) {
+    if (f->builds_in(FL_ENV_XC4) && f->file_is_framework()) {
+      char PBXBuildFile[32]; strcpy(PBXBuildFile, 
f->get_UUID_Xcode("Xcode4_PBXBuildFile"));
+      fprintf(out, "\t\t\t\t%s /* %s in %s */,\n", 
+              PBXBuildFile, 
+              f->filename_name(), 
+              "Frameworks");
+      // FIXME: C96290C21274D0CF007D3CFE /* Cocoa.framework in Frameworks */ = 
{isa = PBXBuildFile; fileRef = C9628FFD1274D0B3007D3CFE /* Cocoa.framework */; 
};
+      // FIXME: C9628FFD1274D0B3007D3CFE /* Cocoa.framework */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.framework; name = 
Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = 
SDKROOT; };
+    }
+  }
+  fprintf(out, "\t\t\t);\n");
+  fprintf(out, "\t\t\trunOnlyForDeploymentPostprocessing = 0;\n");
+  fprintf(out, "\t\t};\n");
+  return 0;
+}
+
+
 static int writeBuildConfigurations(FILE *out, const char *debugKey, const 
char *releaseKey, const char *productName) {
   // Write the Debug Build Configuration
   fprintf(out, "\t\t%s /* Debug */ = {\n", debugKey);
@@ -284,6 +322,7 @@
   char ResourcesBuildPhase[32]; strcpy(ResourcesBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_ResourcesBuildPhase"));
   char HeadersBuildPhase[32]; strcpy(HeadersBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_HeadersBuildPhase"));
   char SourcesBuildPhase[32]; strcpy(SourcesBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_SourcesBuildPhase"));
+  char FrameworksBuildPhase[32]; strcpy(FrameworksBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_FrameworksBuildPhase"));
   char FluidBuildRule[32]; strcpy(FluidBuildRule, 
tgt->get_UUID_Xcode("Xcode4_FluidBuildRule"));
   char ProductReference[32]; strcpy(ProductReference, 
tgt->get_UUID_Xcode("Xcode4_ProductReference"));
 
@@ -294,7 +333,11 @@
   fprintf(out, "\t\t\t\t%s /* Resources */,\n", ResourcesBuildPhase);
   fprintf(out, "\t\t\t\t%s /* Headers */,\n", HeadersBuildPhase);
   fprintf(out, "\t\t\t\t%s /* Sources */,\n", SourcesBuildPhase);
-  fprintf(out, "\t\t\t\tD2A1AD2D93B0EED43F624520 /* Frameworks */,\n");        
 // FIXME: use generated key
+  fprintf(out, "\t\t\t\t%s /* Frameworks */,\n", FrameworksBuildPhase);
+  // Relative to developer directory (the Xcode4 way):
+  // C933C2D913EEF82400E12C6E /* Cocoa.framework */ = {isa = PBXFileReference; 
lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = 
SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = 
DEVELOPER_DIR; };
+  // Relative to SDK (the Xcode3 way):
+  // C9628FFD1274D0B3007D3CFE /* Cocoa.framework */ = {isa = PBXFileReference; 
lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = 
System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
   fprintf(out, "\t\t\t);\n");
   fprintf(out, "\t\tbuildRules = (\n");
   fprintf(out, "\t\t\t\t%s /* PBXBuildRule */,\n", FluidBuildRule);
@@ -468,6 +511,10 @@
           char key[32]; strcpy(key, 
tgt->get_UUID_Xcode("Xcode4_ResourcesBuildPhase"));
           writeResourcesBuildPhase(out, key, tgt->name());
           hash = strchr(hash, ';')+1;
+        } else if (strncmp(hash, "#FrameworksBuildPhase(", 22)==0) {
+          Fl_Target_Type *tgt = Fl_Target_Type::find(hash+22, ')');
+          writeFrameworksBuildPhase(out, tgt);
+          hash = strchr(hash, ';')+1;
         } else if (strncmp(hash, "#NativeTarget(", 14)==0) {
           Fl_Target_Type *tgt = Fl_Target_Type::find(hash+14, ')');
           writeNativeTarget(out, tgt);

Modified: branches/branch-3.0/fluid/workspace_panel.cxx
===================================================================
--- branches/branch-3.0/fluid/workspace_panel.cxx       2011-08-07 08:51:21 UTC 
(rev 8926)
+++ branches/branch-3.0/fluid/workspace_panel.cxx       2011-08-07 23:01:03 UTC 
(rev 8927)
@@ -350,6 +350,7 @@
  {"ObjectiveC Header", 0,  0, (void*)(FL_FILE_OBJC_HEADER), 0, 
fltk3::NORMAL_LABEL, 0, 12, 0},
  {"Text", 0,  0, (void*)(FL_FILE_TEXT), 0, fltk3::NORMAL_LABEL, 0, 12, 0},
  {"Shell Script", 0,  0, (void*)(FL_FILE_TEXT_SCRIPT), 0, fltk3::NORMAL_LABEL, 
0, 12, 0},
+ {"OS X Framework", 0,  0, (void*)(FL_FILE_FRAMEWORK), 0, fltk3::NORMAL_LABEL, 
0, 12, 0},
  {"Unknown", 0,  0, (void*)(FL_FILE_UNKNOWN), 0, fltk3::NORMAL_LABEL, 0, 12, 
0},
  {0,0,0,0,0,0,0,0,0}
 };
@@ -385,6 +386,7 @@
 fltk3::MenuItem menu_Relative[] = {
  {"Relative to Workspace", 0,  0, (void*)(FL_LOCATION_WORKSPACE), 0, 
fltk3::NORMAL_LABEL, 0, 12, 0},
  {"Absolute Path", 0,  0, (void*)(FL_LOCATION_ABSOLUTE), 0, 
fltk3::NORMAL_LABEL, 0, 12, 0},
+ {"Relative to IDE", 0,  0, (void*)(FL_LOCATION_IDE), 0, fltk3::NORMAL_LABEL, 
0, 12, 0},
  {"Relative to SDK", 0,  0, (void*)(FL_LOCATION_SDK), 0, fltk3::NORMAL_LABEL, 
0, 12, 0},
  {0,0,0,0,0,0,0,0,0}
 };

Modified: branches/branch-3.0/fluid/workspace_panel.fl
===================================================================
--- branches/branch-3.0/fluid/workspace_panel.fl        2011-08-07 08:51:21 UTC 
(rev 8926)
+++ branches/branch-3.0/fluid/workspace_panel.fl        2011-08-07 23:01:03 UTC 
(rev 8927)
@@ -464,6 +464,11 @@
           xywh {70 70 31 20} labelsize 12
         }
         MenuItem {} {
+          label {OS X Framework}
+          user_data FL_FILE_FRAMEWORK user_data_type long selected
+          xywh {80 80 31 20} labelsize 12
+        }
+        MenuItem {} {
           label Unknown
           user_data FL_FILE_UNKNOWN user_data_type long
           xywh {80 80 31 20} labelsize 12
@@ -501,7 +506,7 @@
         o->label(mi->label());
         break;
       }
-    }} open selected
+    }} open
         xywh {75 130 170 20} labelsize 12
       } {
         MenuItem {} {
@@ -515,9 +520,14 @@
           xywh {10 10 31 20} labelsize 12
         }
         MenuItem {} {
+          label {Relative to IDE}
+          user_data FL_LOCATION_IDE user_data_type long
+          tooltip {Xcode: relative to Developer Directory, used for 
Frameworks} xywh {20 20 31 20} labelsize 12
+        }
+        MenuItem {} {
           label {Relative to SDK}
           user_data FL_LOCATION_SDK user_data_type long
-          xywh {20 20 31 20} labelsize 12
+          xywh {30 30 31 20} labelsize 12
         }
       }
     }

Modified: branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj
===================================================================
--- branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj       
2011-08-07 08:51:21 UTC (rev 8926)
+++ branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj       
2011-08-07 23:01:03 UTC (rev 8927)
@@ -5111,6 +5111,14 @@
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               B5140FAA26F5E81078247541 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               C96290C21274D0CF007D3CFE /* Cocoa.framework in 
Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                B6F3107B7FE73A3FEC52224A /* Frameworks */ = {
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
@@ -5260,14 +5268,6 @@
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
-               D2A1AD2D93B0EED43F624520 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               C96290C21274D0CF007D3CFE /* Cocoa.framework in 
Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
                D4E10D13391A30A63EF89A57 /* Frameworks */ = {
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
@@ -8196,7 +8196,7 @@
                                1DAA0C25D4F3735866428D29 /* Resources */,
                                0A872A2EDF7E71BE35FEFE8E /* Headers */,
                                ABBF042CD54A3824F354B9DB /* Sources */,
-                               D2A1AD2D93B0EED43F624520 /* Frameworks */,
+                               B5140FAA26F5E81078247541 /* Frameworks */,
                        );
                        buildRules = (
                                21280AFA5A5FFB0A93104B3F /* PBXBuildRule */,

Modified: branches/branch-3.0/ide/templates/Xcode4.tmpl
===================================================================
--- branches/branch-3.0/ide/templates/Xcode4.tmpl       2011-08-07 08:51:21 UTC 
(rev 8926)
+++ branches/branch-3.0/ide/templates/Xcode4.tmpl       2011-08-07 23:01:03 UTC 
(rev 8927)
@@ -4742,14 +4742,7 @@
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
-               D2A1AD2D93B0EED43F624520 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               C96290C21274D0CF007D3CFE /* Cocoa.framework in 
Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
+#FrameworksBuildPhase(fltk);
                D4E10D13391A30A63EF89A57 /* Frameworks */ = {
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to