[go: up one dir, main page]

Menu

[12172e]: / src / ypaths.h  Maximize  Restore  History

Download this file

57 lines (43 with data), 1.5 kB

 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* IceWM - Definition for resource paths
* Copyright (C) 2001 The Authors of IceWM
*
* Release under terms of the GNU Library General Public License
*/
#ifndef __YRESOURCEPATH_H
#define __YRESOURCEPATH_H
#include <stddef.h>
#include "ypaint.h"
int findPath(char const *path, int mode, char const *name,
char **fullname, bool path_relative = false);
struct YPathElement {
char *joinPath(char const *base, char const *name = NULL) const;
char const **root;
char const *rdir;
char const **sub;
};
class YResourcePaths {
public:
YResourcePaths() : fPaths(NULL) {}
YResourcePaths(YResourcePaths const & other) :
fPaths(NULL) { operator= (other); }
YResourcePaths(char const *subdir, bool themeOnly = false) :
fPaths(NULL) { init(subdir, themeOnly); }
YResourcePaths(YResourcePaths const & other, char const *subdir,
bool themeOnly = false) :
fPaths(NULL) { operator= (other); init(subdir, themeOnly); }
~YResourcePaths() { delete[] fPaths; }
YResourcePaths const & operator= (YResourcePaths const & other);
void init (char const * subdir, bool themeOnly = false);
void init (YResourcePaths const & other, char const * subdir,
bool themeOnly = false) {
operator= (other); init(subdir, themeOnly);
}
YPixmap * loadPixmap(char const *base, char const *name);
operator YPathElement const * () { return fPaths; }
protected:
void verifyPaths(char const *base);
private:
YPathElement * fPaths;
};
#endif