Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
c82bc2f0
Commit
c82bc2f0
authored
Aug 22, 2014
by
Sebastian Ramacher
Browse files
Add Edit signal
parent
fd13cf59
Changes
3
Hide whitespace changes
Inline
Side-by-side
data/org.pwmt.zathura.xml
View file @
c82bc2f0
...
...
@@ -28,5 +28,11 @@
<property
type=
's'
name=
'filename'
access=
'read'
/>
<property
type=
'u'
name=
'pagenumber'
access=
'read'
/>
<property
type=
'u'
name=
'numberofpages'
access=
'read'
/>
<!-- Open editor with given input file at line and column. -->
<signal
name=
'Edit'
>
<arg
type=
's'
name=
'input'
direction=
'out'
/>
<arg
type=
'u'
name=
'line'
direction=
'out'
/>
<arg
type=
'u'
name=
'column'
direction=
'out'
/>
</signal>
</interface>
</node>
dbus-interface.c
View file @
c82bc2f0
...
...
@@ -163,6 +163,33 @@ zathura_dbus_new(zathura_t* zathura)
return
dbus
;
}
void
zathura_dbus_edit
(
ZathuraDbus
*
edit
,
unsigned
int
page
,
unsigned
int
x
,
unsigned
int
y
)
{
private_t
*
priv
=
GET_PRIVATE
(
edit
);
const
char
*
filename
=
zathura_document_get_path
(
priv
->
zathura
->
document
);
char
*
input_file
=
NULL
;
unsigned
int
line
=
0
;
unsigned
int
column
=
0
;
if
(
synctex_get_input_line_column
(
filename
,
page
,
x
,
y
,
&
input_file
,
&
line
,
&
column
)
==
false
)
{
return
;
}
GError
*
error
=
NULL
;
g_dbus_connection_emit_signal
(
priv
->
connection
,
NULL
,
DBUS_OBJPATH
,
DBUS_INTERFACE
,
"Edit"
,
g_variant_new
(
"(suu)"
,
input_file
,
x
,
y
),
&
error
);
g_free
(
input_file
);
if
(
error
!=
NULL
)
{
girara_debug
(
"Failed to emit 'Edit' signal: %s"
,
error
->
message
);
g_error_free
(
error
);
}
}
/* D-Bus handler */
static
void
...
...
dbus-interface.h
View file @
c82bc2f0
...
...
@@ -41,6 +41,16 @@ GType zathura_dbus_get_type(void);
ZathuraDbus
*
zathura_dbus_new
(
zathura_t
*
zathura
);
/**
* Emit the 'Edit' signal on the D-Bus connection.
*
* @param dbus ZathuraDbus instance
* @param page page
* @param x x coordinate
* @param y y coordinate
*/
void
zathura_dbus_edit
(
ZathuraDbus
*
dbus
,
unsigned
int
page
,
unsigned
int
x
,
unsigned
int
y
);
/**
* Look for zathura instance having filename open and cause it to open give page
* and highlight rectangles on the given page
...
...
Write
Preview
Supports
Markdown
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