commands.c 1.42 KB
Newer Older
Moritz Lipp's avatar
Moritz Lipp committed
1 2 3
/* See LICENSE file for license and copyright information */

#include "commands.h"
Moritz Lipp's avatar
Moritz Lipp committed
4
#include "zathura.h"
5
#include "print.h"
Moritz Lipp's avatar
Moritz Lipp committed
6 7

bool
Moritz Lipp's avatar
Moritz Lipp committed
8
cmd_bookmark_create(girara_session_t* session, girara_list_t* argument_list)
Moritz Lipp's avatar
Moritz Lipp committed
9 10 11 12 13
{
  return true;
}

bool
Moritz Lipp's avatar
Moritz Lipp committed
14
cmd_bookmark_delete(girara_session_t* session, girara_list_t* argument_list)
Moritz Lipp's avatar
Moritz Lipp committed
15 16 17 18 19
{
  return true;
}

bool
Moritz Lipp's avatar
Moritz Lipp committed
20
cmd_bookmark_open(girara_session_t* session, girara_list_t* argument_list)
Moritz Lipp's avatar
Moritz Lipp committed
21 22 23 24 25
{
  return true;
}

bool
Moritz Lipp's avatar
Moritz Lipp committed
26
cmd_close(girara_session_t* session, girara_list_t* argument_list)
Moritz Lipp's avatar
Moritz Lipp committed
27
{
28 29 30
  g_return_val_if_fail(session != NULL, false);
  g_return_val_if_fail(session->global.data != NULL, false);
  zathura_t* zathura = session->global.data;
31 32 33 34
  if (zathura->document == NULL) {
    // nothing needs to be done
    return true;
  }
35 36

  document_close(zathura);
Moritz Lipp's avatar
Moritz Lipp committed
37

Moritz Lipp's avatar
Moritz Lipp committed
38 39 40 41
  return true;
}

bool
Moritz Lipp's avatar
Moritz Lipp committed
42
cmd_info(girara_session_t* session, girara_list_t* argument_list)
Moritz Lipp's avatar
Moritz Lipp committed
43 44 45 46
{
  return true;
}

47 48 49 50 51 52
bool
cmd_open(girara_session_t* session, girara_list_t* argument_list)
{
  return true;
}

Moritz Lipp's avatar
Moritz Lipp committed
53
bool
Moritz Lipp's avatar
Moritz Lipp committed
54
cmd_print(girara_session_t* session, girara_list_t* argument_list)
Moritz Lipp's avatar
Moritz Lipp committed
55
{
56 57 58 59 60 61 62 63 64 65 66
  g_return_val_if_fail(session != NULL, false);
  g_return_val_if_fail(session->global.data != NULL, false);
  zathura_t* zathura = session->global.data;

	if (zathura->document == NULL) {
		girara_error("no document as been opened");
		return false;
	}

	print((zathura_t*) session->global.data);;

Moritz Lipp's avatar
Moritz Lipp committed
67 68 69 70
  return true;
}

bool
Moritz Lipp's avatar
Moritz Lipp committed
71
cmd_save(girara_session_t* session, girara_list_t* argument_list)
Moritz Lipp's avatar
Moritz Lipp committed
72 73 74
{
  return true;
}