zathura/zathura.c

45 lines
826 B
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"
#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-10 19:18:01 +01:00
if(!(Zathura.UI.session = girara_session_create()))
return false;
2010-06-03 18:05:34 +02:00
2010-11-10 19:18:01 +01:00
if(!girara_session_init(Zathura.UI.session))
return false;
2010-06-03 18:05:34 +02:00
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);
/* 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-10 19:18:01 +01:00
if(!init_zathura()) {
printf("error: coult not initialize zathura\n");
return -1;
}
2010-01-01 13:54:21 +01:00
gdk_threads_enter();
2009-08-11 23:18:50 +02:00
gtk_main();
gdk_threads_leave();
2009-08-11 23:18:50 +02:00
return 0;
}