zathura/zathura.c

66 lines
1.3 KiB
C
Raw Normal View History

/* See LICENSE file for license and copyright information */
2010-11-12 13:48:18 +01:00
#include "callbacks.h"
#include "config.h"
2010-11-18 02:35:33 +01:00
#include "ft/document.h"
2010-11-12 13:48:18 +01:00
#include "shortcuts.h"
2010-11-10 19:18:01 +01:00
#include "zathura.h"
2009-12-26 17:57:46 +01:00
2010-11-10 19:18:01 +01:00
/* function implementation */
bool
init_zathura()
2010-06-03 18:05:34 +02:00
{
2010-11-17 22:51:15 +01:00
if(!(Zathura.UI.session = girara_session_create())) {
2010-11-10 19:18:01 +01:00
return false;
2010-11-17 22:51:15 +01:00
}
2010-06-03 18:05:34 +02:00
2010-11-17 22:51:15 +01:00
if(!girara_session_init(Zathura.UI.session)) {
2010-11-10 19:18:01 +01:00
return false;
2010-11-17 22:51:15 +01:00
}
2010-06-03 18:05:34 +02:00
2010-11-13 12:40:48 +01:00
/* UI */
Zathura.UI.buffer = girara_statusbar_item_add(Zathura.UI.session, FALSE, FALSE, FALSE, NULL);
if(!Zathura.UI.buffer) {
girara_session_destroy(Zathura.UI.session);
return false;
}
2010-11-12 13:48:18 +01:00
/* signals */
g_signal_connect(G_OBJECT(Zathura.UI.session->gtk.window), "destroy", G_CALLBACK(cb_destroy), NULL);
2010-11-13 12:40:48 +01:00
/* girara events */
Zathura.UI.session->events.buffer_changed = buffer_changed;
2010-11-12 13:48:18 +01:00
/* configuration */
config_load_default();
2010-11-10 19:18:01 +01:00
return true;
2010-06-03 18:05:34 +02:00
}
2009-08-11 23:18:50 +02:00
/* main function */
int main(int argc, char* argv[])
2009-08-11 23:18:50 +02:00
{
g_thread_init(NULL);
gdk_threads_init();
2009-08-11 23:18:50 +02:00
gtk_init(&argc, &argv);
2010-11-18 02:35:33 +01:00
/*if(!init_zathura()) {*/
/*printf("error: coult not initialize zathura\n");*/
/*return -1;*/
/*}*/
if(argc > 1) {
zathura_document_t* document = zathura_document_open(argv[1], NULL);
if(!document) {
return -1;
}
zathura_document_free(document);
}
2010-01-01 13:54:21 +01:00
2010-11-18 02:35:33 +01:00
/*gdk_threads_enter();*/
/*gtk_main();*/
/*gdk_threads_leave();*/
2009-08-11 23:18:50 +02:00
return 0;
}