Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
44e81329
Commit
44e81329
authored
Feb 03, 2021
by
Igor Demin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AWT.kt, awt_jni.cc. Refactoring
parent
07d5e63f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
awt_jni.cc
skiko/src/jvmMain/cpp/common/awt_jni.cc
+3
-1
AWT.kt
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/AWT.kt
+12
-6
No files found.
skiko/src/jvmMain/cpp/common/awt_jni.cc
View file @
44e81329
...
...
@@ -14,7 +14,9 @@ extern "C"
if
(
result
==
JNI_FALSE
)
{
return
0
;
}
else
{
}
else
{
return
static_cast
<
jlong
>
(
reinterpret_cast
<
uintptr_t
>
(
awt
));
}
}
...
...
skiko/src/jvmMain/kotlin/org/jetbrains/skiko/AWT.kt
View file @
44e81329
...
...
@@ -25,9 +25,11 @@ internal fun Component.getDrawingSurface() = DrawingSurface(this)
internal
class
DrawingSurface
(
component
:
Component
)
:
AutoCloseable
{
val
ptr
=
getDrawingSurface
(
awt
,
component
).
also
{
check
(
it
!=
0L
)
}
var
ptr
=
getDrawingSurface
(
awt
,
component
).
also
{
check
(
it
!=
0L
)
}
private
set
fun
lock
()
=
lockDrawingSurface
(
ptr
)
...
...
@@ -46,20 +48,24 @@ internal class DrawingSurface(
override
fun
close
()
{
freeDrawingSurface
(
awt
,
ptr
)
ptr
=
0
}
}
internal
class
DrawingSurfaceInfo
(
private
val
drawingSurface
:
Long
)
:
AutoCloseable
{
val
ptr
=
getDrawingSurfaceInfo
(
drawingSurface
).
also
{
check
(
it
!=
0L
)
}
var
ptr
=
getDrawingSurfaceInfo
(
drawingSurface
).
also
{
check
(
it
!=
0L
)
}
private
set
val
platformInfo
:
Long
get
()
=
getPlatformInfo
(
ptr
)
override
fun
close
()
{
freeDrawingSurfaceInfo
(
drawingSurface
,
ptr
)
ptr
=
0
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment