-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the Evince DBus connection to use the java-dbus bindings ins…
…tead of spawning commands
- Loading branch information
Showing
6 changed files
with
126 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.gnome.evince | ||
|
||
import org.freedesktop.dbus.Struct | ||
import org.freedesktop.dbus.annotations.Position | ||
|
||
/** | ||
* Nested Object in DBus communication with evince, this specifies the position in the document | ||
* | ||
* @author Tim Klocke | ||
*/ | ||
class SyncViewSourcePointStruct( | ||
@field:Position(0) val line: Int, | ||
@field:Position(1) val column: Int | ||
) : Struct() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.gnome.evince | ||
|
||
import org.freedesktop.dbus.annotations.DBusInterfaceName | ||
import org.freedesktop.dbus.interfaces.DBusInterface | ||
import org.freedesktop.dbus.messages.DBusSignal | ||
import org.freedesktop.dbus.types.UInt32 | ||
|
||
/** | ||
* Interface to communicate with an Evince Window over DBus, such as syncing in both directions | ||
* | ||
* @author Tim Klocke | ||
*/ | ||
@Suppress("FunctionName") | ||
@DBusInterfaceName("org.gnome.evince.Window") | ||
interface Window : DBusInterface { | ||
|
||
/** | ||
* Sync the position of Evince to the corresponding position. | ||
* | ||
* @param sourceFile Path to the tex file, prepended with file:// | ||
* @param sourcePoint Position in the document to jump to. | ||
* @param timestamp Timestamp | ||
* @return | ||
*/ | ||
fun SyncView(sourceFile: String?, sourcePoint: SyncViewSourcePointStruct?, timestamp: UInt32?) | ||
|
||
/** | ||
* Signal to sync the position of the editor to the specified position. | ||
* | ||
* @param path Path to the DBusObject | ||
* @param sourceFile Path to the tex file, prepended with file:// | ||
* @param sourcePoint Position in the document to jump to. | ||
* @param timestamp Timestamp | ||
* @return | ||
*/ | ||
class SyncSource( | ||
path: String?, | ||
val sourceFile: String, | ||
val sourcePoint: SyncViewSourcePointStruct, | ||
timestamp: UInt32 | ||
) : DBusSignal(path, sourceFile, sourcePoint, timestamp) | ||
} |