Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2011-01-05 17:56:10 +0300
committerAndrea Weikert <elubie@gmx.net>2011-01-05 17:56:10 +0300
commita45183125a0ff6438b2b8a58374dcb6207064a8a (patch)
tree183f665e90dd79ddd644fd7533119fd6e57bc7e6 /intern
parent978bc0d8ace0ea10339afb25b50ef396e9cc1c8d (diff)
Patch: [#22524] Update Windows Recent Documents on Open/Save
Slightly modified to better fit in architecture (moved to related GHOST SystemPaths) Thanks to Harley Acheson for the research and for providing the original patch. Note: I added empty function for X11(Linux) and Mac (Carbon and Cocoa) to be implemented still.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/GHOST_ISystemPaths.h5
-rw-r--r--intern/ghost/GHOST_Path-api.h5
-rw-r--r--intern/ghost/intern/GHOST_Path-api.cpp8
-rw-r--r--intern/ghost/intern/GHOST_SystemPaths.h5
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsCarbon.cpp5
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsCarbon.h4
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsCocoa.h4
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsCocoa.mm5
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsWin32.cpp7
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsWin32.h4
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsX11.cpp4
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsX11.h4
12 files changed, 60 insertions, 0 deletions
diff --git a/intern/ghost/GHOST_ISystemPaths.h b/intern/ghost/GHOST_ISystemPaths.h
index a4bb94229e0..0d50e2b5982 100644
--- a/intern/ghost/GHOST_ISystemPaths.h
+++ b/intern/ghost/GHOST_ISystemPaths.h
@@ -85,6 +85,11 @@ public:
*/
virtual const GHOST_TUns8* getBinaryDir() const = 0;
+ /**
+ * Add the file to the operating system most recently used files
+ */
+ virtual void addToSystemRecentFiles(const char* filename) const = 0;
+
private:
/** The one and only system paths*/
static GHOST_ISystemPaths* m_systemPaths;
diff --git a/intern/ghost/GHOST_Path-api.h b/intern/ghost/GHOST_Path-api.h
index 23a50623fb7..f5117a0bd7a 100644
--- a/intern/ghost/GHOST_Path-api.h
+++ b/intern/ghost/GHOST_Path-api.h
@@ -70,6 +70,11 @@ extern const GHOST_TUns8* GHOST_getUserDir(void);
*/
extern const GHOST_TUns8* GHOST_getBinaryDir(void);
+/**
+* Add the file to the operating system most recently used files
+*/
+extern void GHOST_addToSystemRecentFiles(const char* filename);
+
#ifdef __cplusplus
}
#endif
diff --git a/intern/ghost/intern/GHOST_Path-api.cpp b/intern/ghost/intern/GHOST_Path-api.cpp
index adb8a7d0b97..387ca62889f 100644
--- a/intern/ghost/intern/GHOST_Path-api.cpp
+++ b/intern/ghost/intern/GHOST_Path-api.cpp
@@ -59,3 +59,11 @@ const GHOST_TUns8* GHOST_getBinaryDir()
GHOST_ISystemPaths* systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getBinaryDir() : 0; /* shouldn't be NULL */
}
+
+void GHOST_addToSystemRecentFiles(const char* filename)
+{
+ GHOST_ISystemPaths* systemPaths = GHOST_ISystemPaths::get();
+ if (systemPaths) {
+ systemPaths->addToSystemRecentFiles(filename);
+ }
+} \ No newline at end of file
diff --git a/intern/ghost/intern/GHOST_SystemPaths.h b/intern/ghost/intern/GHOST_SystemPaths.h
index 526a39e45f1..c197797dd55 100644
--- a/intern/ghost/intern/GHOST_SystemPaths.h
+++ b/intern/ghost/intern/GHOST_SystemPaths.h
@@ -67,6 +67,11 @@ public:
*/
virtual const GHOST_TUns8* getBinaryDir() const = 0;
+ /**
+ * Add the file to the operating system most recently used files
+ */
+ virtual void addToSystemRecentFiles(const char* filename) const = 0;
+
};
#endif
diff --git a/intern/ghost/intern/GHOST_SystemPathsCarbon.cpp b/intern/ghost/intern/GHOST_SystemPathsCarbon.cpp
index d35ab6e311f..9023d8f60d8 100644
--- a/intern/ghost/intern/GHOST_SystemPathsCarbon.cpp
+++ b/intern/ghost/intern/GHOST_SystemPathsCarbon.cpp
@@ -76,3 +76,8 @@ const GHOST_TUns8* GHOST_SystemPathsCarbon::getBinaryDir() const
return (GHOST_TUns8*)path;
}
+void GHOST_SystemPathsCarbon::addToSystemRecentFiles(const char* filename) const
+{
+ /* XXXXX TODO: Implementation for Carbon if possible */
+
+} \ No newline at end of file
diff --git a/intern/ghost/intern/GHOST_SystemPathsCarbon.h b/intern/ghost/intern/GHOST_SystemPathsCarbon.h
index f50e66a7f9e..4d61aea4b9f 100644
--- a/intern/ghost/intern/GHOST_SystemPathsCarbon.h
+++ b/intern/ghost/intern/GHOST_SystemPathsCarbon.h
@@ -75,6 +75,10 @@ public:
*/
virtual const GHOST_TUns8* getBinaryDir() const;
+ /**
+ * Add the file to the operating system most recently used files
+ */
+ void addToSystemRecentFiles(const char* filename) const;
};
#endif // _GHOST_SYSTEM_CARBON_H_
diff --git a/intern/ghost/intern/GHOST_SystemPathsCocoa.h b/intern/ghost/intern/GHOST_SystemPathsCocoa.h
index 59909d9fdd7..6b5715d89c8 100644
--- a/intern/ghost/intern/GHOST_SystemPathsCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemPathsCocoa.h
@@ -69,6 +69,10 @@ public:
*/
virtual const GHOST_TUns8* getBinaryDir() const;
+ /**
+ * Add the file to the operating system most recently used files
+ */
+ void addToSystemRecentFiles(const char* filename) const;
};
#endif // _GHOST_SYSTEM_COCOA_H_
diff --git a/intern/ghost/intern/GHOST_SystemPathsCocoa.mm b/intern/ghost/intern/GHOST_SystemPathsCocoa.mm
index d12ad6fb978..51763b42d17 100644
--- a/intern/ghost/intern/GHOST_SystemPathsCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemPathsCocoa.mm
@@ -114,3 +114,8 @@ const GHOST_TUns8* GHOST_SystemPathsCocoa::getBinaryDir() const
[pool drain];
return tempPath;
}
+
+void GHOST_SystemPathsCocoa::addToSystemRecentFiles(const char* filename) const
+{
+ /* XXXXX TODO: Implementation for X11 if possible */
+}
diff --git a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp b/intern/ghost/intern/GHOST_SystemPathsWin32.cpp
index 99467689a7a..843a4e6a460 100644
--- a/intern/ghost/intern/GHOST_SystemPathsWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemPathsWin32.cpp
@@ -79,3 +79,10 @@ const GHOST_TUns8* GHOST_SystemPathsWin32::getBinaryDir() const
return NULL;
}
+
+void GHOST_SystemPathsWin32::addToSystemRecentFiles(const char* filename) const
+{
+ /* SHARD_PATHA is for ansi strings, use SHARD_PATHW for wide */
+ SHAddToRecentDocs(SHARD_PATHA,filename);
+
+} \ No newline at end of file
diff --git a/intern/ghost/intern/GHOST_SystemPathsWin32.h b/intern/ghost/intern/GHOST_SystemPathsWin32.h
index c4abfbb235b..28e01745164 100644
--- a/intern/ghost/intern/GHOST_SystemPathsWin32.h
+++ b/intern/ghost/intern/GHOST_SystemPathsWin32.h
@@ -76,6 +76,10 @@ public:
*/
const GHOST_TUns8* getBinaryDir() const;
+ /**
+ * Add the file to the operating system most recently used files
+ */
+ void addToSystemRecentFiles(const char* filename) const;
};
#endif // _GHOST_SYSTEM_PATHS_WIN32_H_
diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.cpp b/intern/ghost/intern/GHOST_SystemPathsX11.cpp
index 0f0578f4ef5..70d4ea5df4a 100644
--- a/intern/ghost/intern/GHOST_SystemPathsX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemPathsX11.cpp
@@ -73,4 +73,8 @@ const GHOST_TUns8* GHOST_SystemPathsX11::getBinaryDir() const
return NULL;
}
+void GHOST_SystemPathsX11::addToSystemRecentFiles(const char* filename) const
+{
+ /* XXXXX TODO: Implementation for X11 if possible */
+}
diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.h b/intern/ghost/intern/GHOST_SystemPathsX11.h
index f4b7dda4e60..b95ed451ed3 100644
--- a/intern/ghost/intern/GHOST_SystemPathsX11.h
+++ b/intern/ghost/intern/GHOST_SystemPathsX11.h
@@ -67,6 +67,10 @@ public:
*/
const GHOST_TUns8* getBinaryDir() const;
+ /**
+ * Add the file to the operating system most recently used files
+ */
+ void addToSystemRecentFiles(const char* filename) const;
};
#endif