Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1441554

Browse files
committed
Fix NodeMonitor, Add EntryList.cpp
1 parent3523aae commit1441554

File tree

6 files changed

+63
-33
lines changed

6 files changed

+63
-33
lines changed

‎Jamfile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ local sourceFiles =
188188
Statable.cpp
189189
Resources.cpp
190190
ResourceStrings.cpp
191+
EntryList.cpp
191192
Query.cpp
193+
NodeMonitor.cpp
192194
#FilePanel.cpp
193195
;
194196

‎bindings/__init__.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@
8989
from .Statableimport*
9090
from .Resourcesimport*
9191
from .ResourceStringsimport*
92+
from .EntryListimport*
9293
from .Queryimport*
94+
from .NodeMonitorimport*
95+
9396
#from .FilePanel import *
9497

9598
_BWindow=BWindow

‎bindings/storage/EntryList.cpp‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,33 @@
44
#include<pybind11/operators.h>
55

66
#include<EntryList.h>
7+
#include<Entry.h>
78

89
namespacepy= pybind11;
910

11+
classPyBEntryList :publicBEntryList {
12+
public:
13+
using BEntryList::BEntryList;
14+
status_tGetNextEntry(BEntry* entry,bool traverse =false)override {
15+
PYBIND11_OVERLOAD_PURE(status_t, BEntryList, GetNextEntry, entry, traverse);
16+
}
17+
status_tGetNextRef(entry_ref* ref)override {
18+
PYBIND11_OVERLOAD_PURE(status_t, BEntryList, GetNextRef, ref);
19+
}
20+
int32GetNextDirents(structdirent* direntBuffer,size_t bufferSize, int32 maxEntries = INT_MAX)override {
21+
PYBIND11_OVERLOAD_PURE(int32, BEntryList, GetNextDirents, direntBuffer, bufferSize, maxEntries);
22+
}
23+
status_tRewind()override {
24+
PYBIND11_OVERLOAD_PURE(status_t, BEntryList, Rewind);
25+
}
26+
int32CountEntries()override {
27+
PYBIND11_OVERLOAD_PURE(int32, BEntryList, CountEntries);
28+
}
29+
};
1030

11-
voiddefine_EntryList(py::module_& m)
31+
PYBIND11_MODULE(EntryList, m)
1232
{
13-
py::class_<BEntryList>(m,"BEntryList")
33+
py::class_<BEntryList,PyBEntryList>(m,"BEntryList")
1434
.def(py::init(),"")
1535
.def("GetNextEntry", &BEntryList::GetNextEntry,"",py::arg("entry"),py::arg("traverse")=false)
1636
.def("GetNextRef", &BEntryList::GetNextRef,"",py::arg("ref"))

‎bindings/storage/NodeMonitor.cpp‎

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,46 @@
44
#include<pybind11/operators.h>
55

66
#include<NodeMonitor.h>
7+
#include<StorageDefs.h>
8+
#include<Handler.h>
9+
#include<Looper.h>
710

811
namespacepy= pybind11;
9-
usingnamespaceBPrivate;
10-
usingnamespaceBPrivate::Storage;
11-
usingnamespaceBPrivate::Storage::Mime;
12+
//using namespace BPrivate;
13+
//using namespace BPrivate::Storage;
14+
//using namespace BPrivate::Storage::Mime;
1215

13-
voiddefine_NodeMonitor(py::module_& m)
16+
PYBIND11_MODULE(NodeMonitor, m)
1417
{
15-
m.attr("B_STOP_WATCHING") =py::cast(B_STOP_WATCHING);
16-
m.attr("B_WATCH_NAME") =py::cast(B_WATCH_NAME);
17-
m.attr("B_WATCH_STAT") =py::cast(B_WATCH_STAT);
18-
m.attr("B_WATCH_ATTR") =py::cast(B_WATCH_ATTR);
19-
m.attr("B_WATCH_DIRECTORY") =py::cast(B_WATCH_DIRECTORY);
20-
m.attr("B_WATCH_ALL") =py::cast(B_WATCH_ALL);
21-
m.attr("B_WATCH_MOUNT") =py::cast(B_WATCH_MOUNT);
22-
m.attr("B_WATCH_INTERIM_STAT") =py::cast(B_WATCH_INTERIM_STAT);
23-
m.attr("B_WATCH_CHILDREN") =py::cast(B_WATCH_CHILDREN);
24-
25-
m.attr("B_STAT_MODE") =py::cast(B_STAT_MODE);
26-
m.attr("B_STAT_UID") =py::cast(B_STAT_UID);
27-
m.attr("B_STAT_GID") =py::cast(B_STAT_GID);
28-
m.attr("B_STAT_SIZE") =py::cast(B_STAT_SIZE);
29-
m.attr("B_STAT_ACCESS_TIME") =py::cast(B_STAT_ACCESS_TIME);
30-
m.attr("B_STAT_MODIFICATION_TIME") =py::cast(B_STAT_MODIFICATION_TIME);
31-
m.attr("B_STAT_CREATION_TIME") =py::cast(B_STAT_CREATION_TIME);
32-
m.attr("B_STAT_CHANGE_TIME") =py::cast(B_STAT_CHANGE_TIME);
33-
m.attr("B_STAT_INTERIM_UPDATE") =py::cast(B_STAT_INTERIM_UPDATE);
34-
35-
m.def("watch_volume", py::overload_cast<dev_t,unsignedint, BMessenger>(&watch_volume),"",py::arg("volume"),py::arg("flags"),py::arg("target"));
36-
37-
m.def("watch_volume", py::overload_cast<dev_t,unsignedint,const BHandler *,const BLooper *>(&watch_volume),"",py::arg("volume"),py::arg("flags"),py::arg("handler"),py::arg("looper")=NULL);
38-
39-
m.def("watch_node", py::overload_cast<const node_ref *,unsignedint, BMessenger>(&watch_node),"",py::arg("node"),py::arg("flags"),py::arg("target"));
40-
41-
m.def("watch_node", py::overload_cast<const node_ref *,unsignedint,const BHandler *,const BLooper *>(&watch_node),"",py::arg("node"),py::arg("flags"),py::arg("handler"),py::arg("looper")=NULL);
18+
m.def("watch_volume", py::overload_cast<dev_t, uint32, BMessenger>(&watch_volume),"",py::arg("volume"),py::arg("flags"),py::arg("target"));
19+
20+
m.def("watch_volume", py::overload_cast<dev_t, uint32,const BHandler *,const BLooper *>(&watch_volume),"",py::arg("volume"),py::arg("flags"),py::arg("handler"),py::arg("looper")=NULL);
21+
22+
m.def("watch_node", py::overload_cast<const node_ref *, uint32, BMessenger>(&watch_node),"",py::arg("node"),py::arg("flags"),py::arg("target"));
23+
24+
m.def("watch_node", py::overload_cast<const node_ref *, uint32,const BHandler *,const BLooper *>(&watch_node),"",py::arg("node"),py::arg("flags"),py::arg("handler"),py::arg("looper")=NULL);
4225

4326
m.def("stop_watching", py::overload_cast<BMessenger>(&stop_watching),"",py::arg("target"));
4427

4528
m.def("stop_watching", py::overload_cast<const BHandler *,const BLooper *>(&stop_watching),"",py::arg("handler"),py::arg("looper")=NULL);
4629

30+
m.attr("B_STOP_WATCHING") =0x0000;//these have been hardcoded due to fault on loading module
31+
m.attr("B_WATCH_NAME") =0x0001;
32+
m.attr("B_WATCH_STAT") =0x0002;
33+
m.attr("B_WATCH_ATTR") =0x0004;
34+
m.attr("B_WATCH_DIRECTORY") =0x0008;
35+
m.attr("B_WATCH_ALL") =0x000f;
36+
m.attr("B_WATCH_MOUNT") =0x0010;
37+
m.attr("B_WATCH_INTERIM_STAT") =0x0020;
38+
m.attr("B_WATCH_CHILDREN") =0x0040;
39+
40+
m.attr("B_STAT_MODE") =0x0001;
41+
m.attr("B_STAT_UID") =0x0002;
42+
m.attr("B_STAT_GID") =0x0004;
43+
m.attr("B_STAT_SIZE") =0x0008;
44+
m.attr("B_STAT_ACCESS_TIME") =0x0010;
45+
m.attr("B_STAT_MODIFICATION_TIME") =0x0020;
46+
m.attr("B_STAT_CREATION_TIME") =0x0040;
47+
m.attr("B_STAT_CHANGE_TIME") =0x0080;
48+
m.attr("B_STAT_INTERIM_UPDATE") =0x1000;
4749
}

‎bindings/storage/Query.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ using namespace BPrivate::Storage;
1313
//using namespace BPrivate::Storage::Mime;
1414
//using namespace BPackageKit;
1515

16+
//Add overrides
17+
1618
PYBIND11_MODULE(Query, m)
1719
{
1820
py::enum_<query_op>(m,"query_op","")

‎bindings/storage/Statable.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ using namespace BPrivate::Storage;
1313
using namespace BPrivate::Storage::Mime;
1414
using namespace BPackageKit;*/
1515

16+
// ADD GetStat overload_pure ?
1617
PYBIND11_MODULE(Statable, m)
1718
{
1819
py::class_<BStatable>(m,"BStatable")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp