author | unc0rr |
Wed, 01 Oct 2014 01:20:05 +0400 | |
branch | qmlfrontend |
changeset 10436 | 084e046f6bd5 |
parent 10434 | 1614b13ad35e |
child 10438 | 50ed968e4fee |
permissions | -rw-r--r-- |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
1 |
unit uFLData; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
2 |
interface |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
3 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
4 |
function getThemesList: PPChar; cdecl; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
5 |
procedure freeThemesList(list: PPChar); cdecl; |
10436 | 6 |
function getThemeIcon(themeName: PChar; buffer: PChar; buflen: Longword): Longword; cdecl; |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
7 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
8 |
implementation |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
9 |
uses uPhysFSLayer; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
10 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
11 |
function getThemesList: PPChar; cdecl; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
12 |
begin |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
13 |
getThemesList:= pfsEnumerateFiles('Themes') |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
14 |
end; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
15 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
16 |
procedure freeThemesList(list: PPChar); cdecl; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
17 |
begin |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
18 |
pfsFreeList(list) |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
19 |
end; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
20 |
|
10436 | 21 |
function getThemeIcon(themeName: PChar; buffer: PChar; buflen: Longword): Longword; cdecl; |
22 |
var s: shortstring; |
|
23 |
f: PFSFile; |
|
24 |
begin |
|
25 |
s:= '/Themes/' + shortstring(themeName) + '/icon@2x.png'; |
|
26 |
||
27 |
f:= pfsOpenRead(s); |
|
28 |
||
29 |
if f = nil then |
|
30 |
getThemeIcon:= 0 |
|
31 |
else |
|
32 |
begin |
|
33 |
getThemeIcon:= pfsBlockRead(f, buffer, buflen); |
|
34 |
pfsClose(f) |
|
35 |
end; |
|
36 |
end; |
|
37 |
||
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
38 |
end. |