Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
98d42ed3
Commit
98d42ed3
authored
Nov 12, 2010
by
Moritz Lipp
Browse files
Begin to test config structure
parent
6046fc71
Changes
6
Hide whitespace changes
Inline
Side-by-side
callbacks.c
View file @
98d42ed3
/* 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
;
}
callbacks.h
View file @
98d42ed3
...
@@ -3,4 +3,8 @@
...
@@ -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
config.c
View file @
98d42ed3
/* 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
);
}
config.h
View file @
98d42ed3
...
@@ -3,4 +3,6 @@
...
@@ -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
shortcuts.c
View file @
98d42ed3
/* 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)
...
@@ -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
...
...
zathura.c
View file @
98d42ed3
/* 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()
...
@@ -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
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment