mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-16 08:35:50 +01:00
Begin to test config structure
This commit is contained in:
parent
6046fc71fb
commit
98d42ed3ce
6 changed files with 50 additions and 0 deletions
14
callbacks.c
14
callbacks.c
|
@ -1 +1,15 @@
|
||||||
/* See LICENSE file for license and copyright information */
|
/* See LICENSE file for license and copyright information */
|
||||||
|
|
||||||
|
#include <callbacks.h>
|
||||||
|
#include <girara.h>
|
||||||
|
|
||||||
|
#include "zathura.h"
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
cb_destroy(GtkWidget* widget, gpointer data)
|
||||||
|
{
|
||||||
|
if(Zathura.UI.session)
|
||||||
|
girara_session_destroy(Zathura.UI.session);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
|
@ -3,4 +3,8 @@
|
||||||
#ifndef CALLBACKS_H
|
#ifndef CALLBACKS_H
|
||||||
#define CALLBACKS_H
|
#define CALLBACKS_H
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
gboolean cb_destroy(GtkWidget* widget, gpointer data);
|
||||||
|
|
||||||
#endif // CALLBACKS_H
|
#endif // CALLBACKS_H
|
||||||
|
|
12
config.c
12
config.c
|
@ -1 +1,13 @@
|
||||||
/* See LICENSE file for license and copyright information */
|
/* See LICENSE file for license and copyright information */
|
||||||
|
|
||||||
|
#include "shortcuts.h"
|
||||||
|
#include "zathura.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
config_load_default()
|
||||||
|
{
|
||||||
|
if(!Zathura.UI.session)
|
||||||
|
return;
|
||||||
|
|
||||||
|
girara_shortcut_add(Zathura.UI.session, GDK_CONTROL_MASK, GDK_q, NULL, sc_quit, 0, 0, NULL);
|
||||||
|
}
|
||||||
|
|
2
config.h
2
config.h
|
@ -3,4 +3,6 @@
|
||||||
#ifndef CONFIG_H
|
#ifndef CONFIG_H
|
||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
|
void config_load_default();
|
||||||
|
|
||||||
#endif // CONFIG_H
|
#endif // CONFIG_H
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
/* See LICENSE file for license and copyright information */
|
/* See LICENSE file for license and copyright information */
|
||||||
|
|
||||||
|
#include <girara.h>
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "callbacks.h"
|
||||||
#include "shortcuts.h"
|
#include "shortcuts.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -113,7 +117,12 @@ sc_toggle_statusbar(girara_session_t* session, girara_argument_t* argument)
|
||||||
void
|
void
|
||||||
sc_quit(girara_session_t* session, girara_argument_t* argument)
|
sc_quit(girara_session_t* session, girara_argument_t* argument)
|
||||||
{
|
{
|
||||||
|
girara_argument_t arg = { GIRARA_HIDE, NULL };
|
||||||
|
girara_isc_completion(session, &arg);
|
||||||
|
|
||||||
|
cb_destroy(NULL, NULL);
|
||||||
|
|
||||||
|
gtk_main_quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
/* See LICENSE file for license and copyright information */
|
/* See LICENSE file for license and copyright information */
|
||||||
|
|
||||||
|
#include "callbacks.h"
|
||||||
|
#include "config.h"
|
||||||
|
#include "shortcuts.h"
|
||||||
#include "zathura.h"
|
#include "zathura.h"
|
||||||
|
|
||||||
/* function implementation */
|
/* function implementation */
|
||||||
|
@ -12,6 +15,12 @@ init_zathura()
|
||||||
if(!girara_session_init(Zathura.UI.session))
|
if(!girara_session_init(Zathura.UI.session))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* signals */
|
||||||
|
g_signal_connect(G_OBJECT(Zathura.UI.session->gtk.window), "destroy", G_CALLBACK(cb_destroy), NULL);
|
||||||
|
|
||||||
|
/* configuration */
|
||||||
|
config_load_default();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue