OSDN Git Service

Change Progress.h to SysProgress.h because there are two progress.h file.
[tortoisegit/TortoiseGitJp.git] / src / Git / GitStatus.h
index 9e16536..a6d61e5 100644 (file)
@@ -15,7 +15,6 @@ typedef std::basic_string<wchar_t> wide_string;
 #pragma warning (pop)\r
 \r
 #include "TGitPath.h"\r
-#include "../../ext/wingit/wingit.h"\r
 \r
 typedef enum type_git_wc_status_kind\r
 {\r
@@ -51,6 +50,15 @@ typedef enum
 typedef CString git_revnum_t;\r
 typedef int git_error_t;\r
 \r
+typedef struct git_wc_entry_t\r
+{\r
+       // url in repository\r
+       const char *url;\r
+\r
+       TCHAR cmt_rev[41];\r
+} git_wc_entry_t;\r
+\r
+\r
 typedef struct git_wc_status2_t\r
 { \r
   /** The status of the entries text. */\r
@@ -58,11 +66,66 @@ typedef struct git_wc_status2_t
 \r
   /** The status of the entries properties. */\r
   git_wc_status_kind prop_status;\r
+\r
+  //git_wc_entry_t *entry;\r
 }git_wc_status2;\r
 \r
 #define MAX_STATUS_STRING_LENGTH               256\r
 \r
 \r
+/////////////////////////////////////////////////////////////////////\r
+// WINGIT API (replaced by commandline tool, but defs and data types kept so old code still works)\r
+\r
+// Flags for wgEnumFiles\r
+enum WGENUMFILEFLAGS\r
+{\r
+       WGEFF_NoRecurse         = (1<<0),       // only enumerate files directly in the specified path\r
+       WGEFF_FullPath          = (1<<1),       // enumerated filenames are specified with full path (instead of relative to proj root)\r
+       WGEFF_DirStatusDelta= (1<<2),   // include directories, in enumeration, that have a recursive status != WGFS_Normal (may have a slightly better performance than WGEFF_DirStatusAll)\r
+       WGEFF_DirStatusAll      = (1<<3),       // include directories, in enumeration, with recursive status\r
+       WGEFF_EmptyAsNormal     = (1<<4),       // report sub-directories, with no versioned files, as WGFS_Normal instead of WGFS_Empty\r
+       WGEFF_SingleFile        = (1<<5)        // indicates that the status of a single file or dir, specified by pszSubPath, is wanted\r
+};\r
+\r
+// File status\r
+enum WGFILESTATUS\r
+{\r
+       WGFS_Normal,\r
+       WGFS_Modified,\r
+       WGFS_Staged,\r
+       WGFS_Added,\r
+       WGFS_Conflicted,\r
+       WGFS_Deleted,\r
+\r
+       WGFS_Ignored = -1,\r
+       WGFS_Unversioned = -2,\r
+       WGFS_Empty = -3,\r
+       WGFS_Unknown = -4\r
+};\r
+\r
+// File flags\r
+enum WGFILEFLAGS\r
+{\r
+       WGFF_Directory          = (1<<0)        // enumerated file is a directory\r
+};\r
+\r
+struct wgFile_s\r
+{\r
+       LPCTSTR sFileName;                              // filename or directory relative to project root (using forward slashes)\r
+       int nStatus;                                    // the WGFILESTATUS of the file\r
+       int nFlags;                                             // a combination of WGFILEFLAGS\r
+\r
+       const BYTE* sha1;                               // points to the BYTE[20] sha1 (NULL for directories, WGFF_Directory)\r
+};\r
+\r
+// Application-defined callback function for wgEnumFiles, returns TRUE to abort enumeration\r
+// NOTE: do NOT store the pFile pointer or any pointers in wgFile_s for later use, the data is only valid for a single callback call\r
+typedef BOOL (__cdecl WGENUMFILECB)(const struct wgFile_s *pFile, void *pUserData);\r
+\r
+//\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+\r
 // convert wingit.dll status to git_wc_status_kind\r
 inline static git_wc_status_kind GitStatusFromWingit(int nStatus)\r
 {\r
@@ -70,11 +133,13 @@ inline static git_wc_status_kind GitStatusFromWingit(int nStatus)
        {\r
        case WGFS_Normal: return git_wc_status_normal;\r
        case WGFS_Modified: return git_wc_status_modified;\r
-       //case WGFS_Staged: return git_wc_status_modified;\r
-       //case WGFS_Added: return git_wc_status_added;\r
+       case WGFS_Staged: return git_wc_status_modified;\r
+       case WGFS_Added: return git_wc_status_added;\r
        case WGFS_Conflicted: return git_wc_status_conflicted;\r
        case WGFS_Deleted: return git_wc_status_deleted;\r
 \r
+       case WGFS_Ignored: return git_wc_status_ignored;\r
+       case WGFS_Unversioned: return git_wc_status_unversioned;\r
        case WGFS_Empty: return git_wc_status_unversioned;\r
        }\r
 \r