avoid pulling in the dbus libraries for now

This commit is contained in:
Irmen de Jong 2020-03-14 14:40:39 +01:00
parent 3245a9b157
commit 91d9559f79
11 changed files with 74 additions and 78 deletions

View File

@ -34,7 +34,7 @@ dependencies {
implementation 'org.antlr:antlr4-runtime:4.8' implementation 'org.antlr:antlr4-runtime:4.8'
implementation 'org.jetbrains.kotlinx:kotlinx-cli-jvm:0.1.0-dev-5' implementation 'org.jetbrains.kotlinx:kotlinx-cli-jvm:0.1.0-dev-5'
// implementation 'net.razorvine:ksim65:1.6' // implementation 'net.razorvine:ksim65:1.6'
implementation("com.github.hypfvieh:dbus-java:3.2.0") // implementation "com.github.hypfvieh:dbus-java:3.2.0"
implementation project(':parser') implementation project(':parser')
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5" testImplementation "org.jetbrains.kotlin:kotlin-test-junit5"
@ -101,7 +101,7 @@ test {
// Show test results. // Show test results.
testLogging { testLogging {
events "passed", "skipped", "failed" events "skipped", "failed"
} }
} }

View File

@ -1,22 +1,22 @@
package prog8.server.dbus package prog8.server.dbus
import org.freedesktop.dbus.interfaces.DBusInterface //import org.freedesktop.dbus.interfaces.DBusInterface
//
//
interface IrmenDbusTest: DBusInterface //interface IrmenDbusTest: DBusInterface
{ //{
fun Status(address: String): Map<Int, String> // fun Status(address: String): Map<Int, String>
} //}
//
//
internal class TestService: IrmenDbusTest { //internal class TestService: IrmenDbusTest {
override fun Status(address: String): Map<Int, String> { // override fun Status(address: String): Map<Int, String> {
return mapOf( // return mapOf(
5 to "hello", // 5 to "hello",
42 to address // 42 to address
) // )
} // }
//
override fun isRemote() = true // override fun isRemote() = true
override fun getObjectPath() = "/razorvine/TestService" // override fun getObjectPath() = "/razorvine/TestService"
} //}

View File

@ -1,16 +1,17 @@
package prog8.server.dbus package prog8.server.dbus
import org.freedesktop.dbus.connections.impl.DBusConnection
fun main() {
DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use {
println(it.names.toList())
println(it.uniqueName)
println(it.address)
println(it.machineId)
val obj = it.getRemoteObject("local.net.razorvine.dbus.test", "/razorvine/TestService", IrmenDbusTest::class.java)
println(obj.Status("irmen"))
}
}
//import org.freedesktop.dbus.connections.impl.DBusConnection
//
//
//fun main() {
// DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use {
// println(it.names.toList())
// println(it.uniqueName)
// println(it.address)
// println(it.machineId)
// val obj = it.getRemoteObject("local.net.razorvine.dbus.test", "/razorvine/TestService", IrmenDbusTest::class.java)
// println(obj.Status("irmen"))
// }
//}
//

View File

@ -1,18 +1,18 @@
package prog8.server.dbus package prog8.server.dbus
import org.freedesktop.dbus.connections.impl.DBusConnection //import org.freedesktop.dbus.connections.impl.DBusConnection
//
//
fun main() { //fun main() {
DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use { // DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION).use {
it.requestBusName("local.net.razorvine.dbus.test") // it.requestBusName("local.net.razorvine.dbus.test")
println(it.names.toList()) // println(it.names.toList())
println(it.uniqueName) // println(it.uniqueName)
println(it.address) // println(it.address)
println(it.machineId) // println(it.machineId)
val service = TestService() // val service = TestService()
it.exportObject(service.objectPath, service) // it.exportObject(service.objectPath, service)
//
Thread.sleep(100000) // Thread.sleep(100000)
} // }
} //}

View File

@ -34,17 +34,18 @@ sub start() {
delay() delay()
} }
} }
}
sub delay() { sub delay() {
ubyte d ubyte d
for d in 0 to 12 { for d in 0 to 12 {
while(c64.RASTER!=0) { while(c64.RASTER!=0) {
; tempo delay synced to screen refresh ; tempo delay synced to screen refresh
} }
} }
} }
sub print_notes(ubyte n1, ubyte n2) { sub print_notes(ubyte n1, ubyte n2) {
c64.CHROUT('\n') c64.CHROUT('\n')
c64scr.plot(n1/2, 24) c64scr.plot(n1/2, 24)
c64.COLOR=7 c64.COLOR=7
@ -52,9 +53,9 @@ sub start() {
c64scr.plot(n2/2, 24) c64scr.plot(n2/2, 24)
c64.COLOR=4 c64.COLOR=4
c64.CHROUT('Q') c64.CHROUT('Q')
}
} }
; details about the boulderdash music can be found here: ; details about the boulderdash music can be found here:
; https://www.elmerproductions.com/sp/peterb/sounds.html#Theme%20tune ; https://www.elmerproductions.com/sp/peterb/sounds.html#Theme%20tune

View File

@ -55,7 +55,6 @@ main {
check_eval_stack() check_eval_stack()
return return
sub compare() { sub compare() {
c64scr.print(" == != < > <= >=\n") c64scr.print(" == != < > <= >=\n")

View File

@ -106,7 +106,6 @@ main {
} }
} }
sub check_eval_stack() { sub check_eval_stack() {

View File

@ -27,10 +27,6 @@ main {
c64scr.print("sp2:") c64scr.print("sp2:")
sub3() sub3()
sub blerp() {
;-- keep this!
}
sub3() sub3()
sub3() sub3()
sub3() sub3()