synctex-dbus.h 1.79 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
/* See LICENSE file for license and copyright information */

#ifndef SYNCTEX_DBUS_H
#define SYNCTEX_DBUS_H

#include <stdbool.h>
#include <girara/types.h>
#include <glib-object.h>
#include "types.h"

typedef struct zathura_synctex_dbus_class_s ZathuraSynctexDbusClass;

struct zathura_synctex_dbus_s
{
  GObject parent;
};

struct zathura_synctex_dbus_class_s
{
  GObjectClass parent_class;
};

#define ZATHURA_TYPE_SYNCTEX_DBUS \
  (zathura_synctex_dbus_get_type())
#define ZATHURA_SYNCTEX_DBUS(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \
                              ZathuraSynctexDbus))
#define ZATHURA_SYNCTEX_DBUS_CLASS(obj) \
  (G_TYPE_CHECK_CLASS_CAST((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \
                           ZathuraSynctexDbus))
#define ZATHURA_IS_SYNCTEX_DBUS(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj), ZATHURA_TYPE_SYNCTEX_DBUS))
#define ZATHURA_IS_SYNCTEX_DBUS_CLASS(obj) \
  (G_TYPE_CHECK_CLASS_TYPE((obj), ZATHURA_TYPE_SYNCTEX_DBUS))
#define ZATHURA_SYNCTEX_DBUS_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS((obj), ZATHURA_TYPE_SYNCTEX_DBUS, \
                             ZathuraSynctexDbusClass))

GType zathura_synctex_dbus_get_type(void);

ZathuraSynctexDbus* zathura_synctex_dbus_new(zathura_t* zathura);

43
/**
44 45 46
 * Look for zathura instance having filename open and cause it to open give page
 * and move to the given position on that page.
 *
47
 * @param filename filename
48 49 50
 * @param page page number
 * @param position_x x coordinate on the page
 * @param position_y y coordinate on the page
51 52 53
 * @returns true if a instance was found that has the given filename open, false
 * otherwise
 */
54 55 56
bool zathura_dbus_goto_page_and_highlight(const char* filename, int page, girara_list_t* rectangles);

bool zathura_dbus_synctex_position(const char* filename, const char* position);
57 58

#endif