summaryrefslogtreecommitdiff
path: root/lib/osx_file_icon.h
blob: e9b179883404038397a285688b6e1b763af2cae6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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
bgstack15