diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:23:48 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:23:48 +0200 |
commit | ee1c8c5c25d25dfa42120125a8a45dc9831ee412 (patch) | |
tree | 67aa287157db954e0cadeee05b4aad331eb2ecf2 /lib/osx_file_icon.h | |
parent | 5.13 (diff) | |
download | FreeFileSync-ee1c8c5c25d25dfa42120125a8a45dc9831ee412.tar.gz FreeFileSync-ee1c8c5c25d25dfa42120125a8a45dc9831ee412.tar.bz2 FreeFileSync-ee1c8c5c25d25dfa42120125a8a45dc9831ee412.zip |
5.14
Diffstat (limited to 'lib/osx_file_icon.h')
-rw-r--r-- | lib/osx_file_icon.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/osx_file_icon.h b/lib/osx_file_icon.h new file mode 100644 index 00000000..1d57a00e --- /dev/null +++ b/lib/osx_file_icon.h @@ -0,0 +1,36 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * +// ************************************************************************** + +#ifndef OSX_FILE_ICON_8427508422345342 +#define OSX_FILE_ICON_8427508422345342 + +#include <vector> +#include <zen/osx_error.h> + +namespace osx +{ +struct ImageData +{ + ImageData(int w, int h) : width(w), height(h), rgb(w * h * 3), alpha(w * h) {} + ImageData(ImageData&& tmp) : width(tmp.width), height(tmp.height) { rgb.swap(tmp.rgb); alpha.swap(tmp.alpha); } + + const int width; + const int height; + std::vector<unsigned char> rgb; //rgb-byte order for use with wxImage + std::vector<unsigned char> alpha; + +private: + ImageData(const ImageData&); + ImageData& operator=(const ImageData&); +}; + +ImageData getThumbnail(const char* filename, int requestedSize); //throw OsxError +ImageData getFileIcon (const char* filename, int requestedSize); //throw OsxError +ImageData getDefaultFileIcon (int requestedSize); //throw OsxError +ImageData getDefaultFolderIcon(int requestedSize); //throw OsxError +} + +#endif //OSX_FILE_ICON_8427508422345342 |