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

Commitdd5e082

Browse files
bind TextView
1 parent7182921 commitdd5e082

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

‎Jamfile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ local sourceFiles =
115115
TextControl.cpp
116116
View.cpp
117117
Window.cpp
118-
Font.cpp ;
118+
Font.cpp
119+
TextView.cpp ;
119120

120121
# The shared library Be.so can be built from the sourceFiles
121122
SharedLibrary Be.so : $(sourceFiles) ;

‎bindings/interface/TextView.cpp‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#include<stdint.h>
88
#include<Locker.h>
99
#include<View.h>
10+
#include<File.h>
11+
#include<Clipboard.h>
12+
#include<Region.h>
1013

1114
namespacepy= pybind11;
1215
usingnamespaceBPrivate;
@@ -22,7 +25,7 @@ py::enum_<undo_state>(m, "undo_state", "")
2225
.value("B_UNDO_DROP", undo_state::B_UNDO_DROP,"")
2326
.export_values();
2427

25-
m.attr("TextGapBuffer") = TextGapBuffer;
28+
//m.attr("TextGapBuffer") = TextGapBuffer;
2629

2730
py::class_<text_run>(m,"text_run")
2831
.def_readwrite("offset", &text_run::offset,"")
@@ -32,7 +35,7 @@ py::class_<text_run>(m, "text_run")
3235

3336
py::class_<text_run_array>(m,"text_run_array")
3437
.def_readwrite("count", &text_run_array::count,"")
35-
.def_readwrite("runs", &text_run_array::runs,"")
38+
.def_readonly("runs", &text_run_array::runs,"")
3639
;
3740

3841
py::class_<BTextView, BView>(m,"BTextView")
@@ -82,17 +85,17 @@ py::class_<BTextView, BView>(m, "BTextView")
8285
.def("Select", &BTextView::Select,"",py::arg("startOffset"),py::arg("endOffset"))
8386
.def("SelectAll", &BTextView::SelectAll,"")
8487
.def("GetSelection", &BTextView::GetSelection,"",py::arg("_start"),py::arg("_end"))
85-
.def("SetFontAndColor", py::overload_cast<const BFont *,unsignedint,const rgb_color *>(&BTextView::SetFontAndColor),"",py::arg("font"),py::arg("mode")=B_FONT_ALL,py::arg("color")=NULL)
86-
.def("SetFontAndColor", py::overload_cast<int,int,const BFont *,unsignedint,const rgb_color *>(&BTextView::SetFontAndColor),"",py::arg("startOffset"),py::arg("endOffset"),py::arg("font"),py::arg("mode")=B_FONT_ALL,py::arg("color")=NULL)
87-
.def("GetFontAndColor", py::overload_cast<int, BFont *, rgb_color *>(&BTextView::GetFontAndColor),"",py::arg("offset"),py::arg("_font"),py::arg("_color")=NULL)
88-
.def("GetFontAndColor", py::overload_cast<BFont *,unsignedint, rgb_color *,bool *>(&BTextView::GetFontAndColor),"",py::arg("_font"),py::arg("_mode"),py::arg("_color")=NULL,py::arg("_sameColor")=NULL)
88+
//.def("SetFontAndColor", py::overload_cast<const BFont *, unsigned int, const rgb_color *>(&BTextView::SetFontAndColor,py::const_), "", py::arg("font"), py::arg("mode")=B_FONT_ALL, py::arg("color")=NULL)
89+
//.def("SetFontAndColor", py::overload_cast<int, int, const BFont *, unsigned int, const rgb_color *>(&BTextView::SetFontAndColor,py::const_), "", py::arg("startOffset"), py::arg("endOffset"), py::arg("font"), py::arg("mode")=B_FONT_ALL, py::arg("color")=NULL)
90+
//.def("GetFontAndColor", py::overload_cast<int, BFont *, rgb_color *>(&BTextView::GetFontAndColor,py::const_), "", py::arg("offset"), py::arg("_font"), py::arg("_color")=NULL)
91+
//.def("GetFontAndColor", py::overload_cast<BFont *, unsigned int, rgb_color *, bool *>(&BTextView::GetFontAndColor,py::const_), "", py::arg("_font"), py::arg("_mode"), py::arg("_color")=NULL, py::arg("_sameColor")=NULL)
8992
.def("SetRunArray", &BTextView::SetRunArray,"",py::arg("startOffset"),py::arg("endOffset"),py::arg("runs"))
9093
.def("RunArray", &BTextView::RunArray,"",py::arg("startOffset"),py::arg("endOffset"),py::arg("_size")=NULL)
91-
.def("LineAt", py::overload_cast<int>(&BTextView::LineAt),"",py::arg("offset"))
92-
.def("LineAt", py::overload_cast<BPoint>(&BTextView::LineAt),"",py::arg("point"))
94+
.def("LineAt", py::overload_cast<int>(&BTextView::LineAt,py::const_),"",py::arg("offset"))
95+
.def("LineAt", py::overload_cast<BPoint>(&BTextView::LineAt,py::const_),"",py::arg("point"))
9396
.def("PointAt", &BTextView::PointAt,"",py::arg("offset"),py::arg("_height")=NULL)
94-
.def("OffsetAt", py::overload_cast<BPoint>(&BTextView::OffsetAt),"",py::arg("point"))
95-
.def("OffsetAt", py::overload_cast<int>(&BTextView::OffsetAt),"",py::arg("line"))
97+
.def("OffsetAt", py::overload_cast<BPoint>(&BTextView::OffsetAt,py::const_),"",py::arg("point"))
98+
.def("OffsetAt", py::overload_cast<int>(&BTextView::OffsetAt,py::const_),"",py::arg("line"))
9699
.def("FindWord", &BTextView::FindWord,"",py::arg("offset"),py::arg("_fromOffset"),py::arg("_toOffset"))
97100
.def("CanEndLine", &BTextView::CanEndLine,"",py::arg("offset"))
98101
.def("LineWidth", &BTextView::LineWidth,"",py::arg("lineNumber")=0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp