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
girara
Commits
e59fb731
Commit
e59fb731
authored
Dec 19, 2017
by
Sebastian Ramacher
Browse files
Merge branch 'release/0.2.8'
parents
fe7e9194
d235f5fe
Changes
42
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
e59fb731
...
...
@@ -8,7 +8,7 @@ tests/girara_test-gtk*
.depend
*.pc
version.h
css-definitions.
c
css-definitions.
*
*.info
*.gcno
*.gcda
...
...
Makefile
View file @
e59fb731
...
...
@@ -88,17 +88,12 @@ ${PROJECTNV}/version.h: ${PROJECTNV}/version.h.in config.mk
${PROJECTNV}
/version.h.in
>
${PROJECTNV}
/version.h.tmp
$(QUIET)
mv
${PROJECTNV}
/version.h.tmp
${PROJECTNV}
/version.h
${PROJECTNV}/css-definitions.
c
:
data/girara-
pre-3.20.css_t data/girara-post-3.20.css_t
${PROJECTNV}/css-definitions.
%
:
data/girara-
css.gresource.xml config.mk
$(
call
colorecho,GEN,
$@
)
$(QUIET)
echo
'#include "css-definitions.h"'
>
$@
.tmp
$(QUIET)
echo
'const char* CSS_TEMPLATE_PRE_3_20 ='
>>
$@
.tmp
$(QUIET)
sed
's/^\(.*\)$$/"\1\\n"/'
data/girara-pre-3.20.css_t
>>
$@
.tmp
$(QUIET)
echo
';'
>>
$@
.tmp
$(QUIET)
echo
'const char* CSS_TEMPLATE_POST_3_20 ='
>>
$@
.tmp
$(QUIET)
sed
's/^\(.*\)$$/"\1\\n"/'
data/girara-post-3.20.css_t
>>
$@
.tmp
$(QUIET)
echo
';'
>>
$@
.tmp
$(QUIET)mv
$@.tmp
$@
@
mkdir
-p
${DEPENDDIR}
/
$(
dir
$@
)
$(QUIET)$(GLIB_COMPILE_RESOURCES)
--generate
--c-name
=
girara_css
--internal
\
--dependency-file
=
$(DEPENDDIR)
/
$@
.dep
\
--sourcedir
=
data
--target
=
$@
data/girara-css.gresource.xml
${BUILDDIR}/${PROJECT}.pc
:
${PROJECTNV}.pc.in config.mk
$(
call
colorecho,GEN,
$(
shell
basename
$@
))
...
...
@@ -117,7 +112,8 @@ ${BUILDDIR}/${PROJECT}.pc: ${PROJECTNV}.pc.in config.mk
${OBJECTS}
:
config.mk
\
${PROJECTNV}/version.h
\
.version-checks/GTK
\
.version-checks/GLIB
.version-checks/GLIB
\
${PROJECTNV}/css-definitions.h
${BUILDDIR_RELEASE}/%.o
:
%.c
$(
call
colorecho,CC,
$<
)
...
...
@@ -148,7 +144,8 @@ release: ${PROJECT}
${OBJECT_DEBUG}
:
config.mk
\
${PROJECTNV}/version.h
\
.version-checks/GTK
\
.version-checks/GLIB
.version-checks/GLIB
\
${PROJECTNV}/css-definitions.h
${BUILDDIR_DEBUG}/%.o
:
%.c
$(
call
colorecho,CC,
$<
)
...
...
@@ -176,6 +173,7 @@ debug: ${PROJECT}-debug
${OBJECTS_GCOV}
:
config.mk
\
${PROJECTNV}/version.h
\
${PROJECTNV}/css-definitions.h
\
.version-checks/GLIB
\
.version-checks/GTK
...
...
@@ -222,7 +220,7 @@ clean:
${PROJECTNV}
/version.h
\
${PROJECTNV}
/version.h.tmp
\
${PROJECTNV}
/css-definitions.c
\
${PROJECTNV}
/css-definitions.
c.tmp
${PROJECTNV}
/css-definitions.
h
$(QUIET)$(MAKE)
-C
tests clean
$(QUIET)$(MAKE)
-C
po clean
$(QUIET)$(MAKE)
-C
doc clean
...
...
@@ -303,7 +301,7 @@ uninstall-headers:
format
:
clang-tidy
-fix
-checks
=
readability-braces-around-statements
\
$(SOURCE)
--
$(CPPFLAGS)
$(CFLAGS)
clang-format
-3.8
-i
$(SOURCE)
$(HEADERS)
clang-format
-i
$(SOURCE)
$(HEADERS)
tidy
:
clang-tidy
$(SOURCE)
--
$(CPPFLAGS)
$(CFLAGS)
...
...
README
View file @
e59fb731
...
...
@@ -5,12 +5,12 @@ and minimalism. It consists of three main components: The view is a widget that
represents the actual application (e.g.: a web site or a document). The input
bar is used to execute commands of the application, while the status bar
notifies the user with current information. It is designed to replace and the
enhance the user interface that is used by zathura
and jumanji
.
enhance the user interface that is used by zathura.
Requirements
------------
glib (>= 2.
36
)
gtk3 (>= 3.
4
)
glib (>= 2.
50
)
gtk3 (>= 3.
20
)
intltool
libnotify (optional, for notification support)
jscon-c (optional, for configuration dumping support)
...
...
config.mk
View file @
e59fb731
...
...
@@ -2,23 +2,26 @@
GIRARA_VERSION_MAJOR
=
0
GIRARA_VERSION_MINOR
=
2
GIRARA_VERSION_REV
=
7
GIRARA_VERSION_REV
=
8
VERSION
=
${GIRARA_VERSION_MAJOR}
.
${GIRARA_VERSION_MINOR}
.
${GIRARA_VERSION_REV}
# Rules for the SOMAJOR and SOMINOR.
# Before a release
check
perform the following checks against the last release:
# Before a release perform the following checks against the last release:
# * If a function has been removed or the paramaters of a function have changed
# bump SOMAJOR and set SOMINOR to 0.
# * If any of the exported datastructures have changed in a incompatible way
# bump SOMAJOR and set SOMINOR to 0.
# * If a function has been added bump SOMINOR.
SOMAJOR
=
2
SOMAJOR
=
3
SOMINOR
=
0
SOVERSION
=
${SOMAJOR}
.
${SOMINOR}
# pkg-config binary
PKG_CONFIG
?=
pkg-config
# glib-compile-resource binary
GLIB_COMPILE_RESOURCES
?=
glib-compile-resources
# libnotify
WITH_LIBNOTIFY
?=
$(
shell
(
${PKG_CONFIG}
libnotify
--atleast-version
=
0.7.0
&&
echo
1
)
||
echo
0
)
...
...
@@ -46,29 +49,44 @@ BINDIR ?= bin
# GTK+
GTK_VERSION_CHECK
?=
1
GTK_MIN_VERSION
=
3.
4
GTK_MIN_VERSION
=
3.
20
GTK_PKG_CONFIG_NAME
=
gtk+-3.0
# glib
GLIB_VERSION_CHECK
?=
1
GLIB_MIN_VERSION
=
2.
36
GLIB_MIN_VERSION
=
2.
50
GLIB_PKG_CONFIG_NAME
=
glib-2.0
# libs
GTK_INC
?=
$(
shell
${PKG_CONFIG}
--cflags
gtk+-3.0
)
GTK_LIB
?=
$(
shell
${PKG_CONFIG}
--libs
gtk+-3.0
)
ifeq
(${GTK_INC}-${GTK_LIB},-)
PKG_CONFIG_LIBS
+=
gtk+-3.0
else
INCS
+=
${GTK_INC}
LIBS
+=
${GTK_LIB}
endif
ifneq
(${WITH_LIBNOTIFY},0)
LIBNOTIFY_INC
?=
$(
shell
${PKG_CONFIG}
--cflags
libnotify
)
LIBNOTIFY_LIB
?=
$(
shell
${PKG_CONFIG}
--libs
libnotify
)
ifeq
(${LIBNOTIFY_INC}-${LIBNOTIFY_LIB},-)
PKG_CONFIG_LIBS
+=
libnotify
else
INCS
+=
${LIBNOTIFY_INC}
LIBS
+=
${LIBNOTIFY_LIB}
endif
endif
ifneq
(${WITH_JSON},0)
JSON_INC
?=
$(
shell
${PKG_CONFIG}
--cflags
json-c
)
JSON_LIB
?=
$(
shell
${PKG_CONFIG}
--libs
json-c
)
ifeq
(${JSON_INC}-${JSON_LIB},-)
PKG_CONFIG_LIBS
+=
json-c
else
INCS
+=
${JSON_INC}
LIBS
+=
${JSON_LIB}
endif
endif
INCS
=
${GTK_INC}
${LIBNOTIFY_INC}
${JSON_INC}
LIBS
=
${GTK_LIB}
${LIBNOTIFY_LIB}
${JSON_LIB}
-lm
ifneq
(${PKG_CONFIG_LIBS},)
INCS
+=
$(
shell
${PKG_CONFIG}
--cflags
${PKG_CONFIG_LIBS}
)
LIBS
+=
$(
shell
${PKG_CONFIG}
--libs
${PKG_CONFIG_LIBS}
)
endif
LIBS
+=
-lm
# pre-processor flags
CPPFLAGS
+=
-D_FILE_OFFSET_BITS
=
64
...
...
data/girara-css.gresource.xml
0 → 100644
View file @
e59fb731
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource
prefix=
"/org/pwmt/girara/CSS"
>
<file
compressed=
"true"
>
girara.css_t
</file>
</gresource>
</gresources>
data/girara-pre-3.20.css_t
deleted
100644 → 0
View file @
fe7e9194
/* No resize grip */
#@session@ {
-GtkWindow-resize-grip-height: 0;
-GtkWindow-resize-grip-width: 0;
}
/* Hide scrollbars from GtkScrolledWindow */
#@session@ GtkScrolledWindow GtkScrollbar:insensitive {
-GtkRange-slider-width: 0;
-GtkRange-trough-border: 0;
}
#@session@ GtkScrolledWindow GtkScrollbar {
background-color: @scrollbar-bg@;
}
#@session@ GtkScrolledWindow GtkScrollbar.slider {
background-color: @scrollbar-fg@;
}
#@session@ * {
color: @default-fg@;
background-color: @default-bg@;
background-image: none;
font: @font@;
}
/* Inputbar */
#@session@ GtkEntry.inputbar {
background-color: @inputbar-bg@;
}
#@session@ .inputbar {
color: @inputbar-fg@;
background-color: @inputbar-bg@;
}
/* Completion entries and groups */
#@session@ .completion, .completion-box {
color: @completion-fg@;
background-color: @completion-bg@;
}
#@session@ .completion {
padding: 1px;
}
#@session@ .completion:selected {
color: @completion-highlight-fg@;
background-color: @completion-highlight-bg@;
}
#@session@ .completion-group {
color: @completion-group-fg@;
background-color: @completion-group-bg@;
padding: 2px 4px;
}
/* Statusbar */
#@session@ .statusbar {
color: @statusbar-fg@;
background-color: @statusbar-bg@;
}
/* Tabbar */
#@session@ .tab {
color: @tabbar-fg@;
background-color: @tabbar-bg@;
}
#@session@ GtkLabel.tab {
padding: 4px;
}
#@session@ .tab:selected {
color: @tabbar-focus-fg@;
background-color: @tabbar-focus-bg@;
}
/* Notification area */
#@session@ .notification {
color: @notification-fg@;
background-color: @notification-bg@;
}
#@session@ .notification-error {
color: @notification-error-fg@;
background-color: @notification-error-bg@;
}
#@session@ .notification-warning {
color: @notification-warning-fg@;
background-color: @notification-warning-bg@;
}
/* Padding of the bottom box */
#@session@ .bottom_box {
border-style: none;
margin: 0px;
padding: @bottombox-padding1@px @bottombox-padding2@px @bottombox-padding3@px
@bottombox-padding4@px;
}
#@session@ GtkScrolledWindow .undershoot.top,
#@session@ GtkScrolledWindow .undershoot.top:backdrop,
#@session@ GtkScrolledWindow .undershoot.bottom,
#@session@ GtkScrolledWindow .undershoot.bottom:backdrop,
#@session@ GtkScrolledWindow .undershoot.left,
#@session@ GtkScrolledWindow .undershoot.left:backdrop,
#@session@ GtkScrolledWindow .undershoot.right,
#@session@ GtkScrolledWindow .undershoot.right:backdrop {
background-color: transparent;
}
data/girara
-post-3.20
.css_t
→
data/girara.css_t
View file @
e59fb731
#@session@
*
{
#@session@ {
color: @default-fg@;
background-color: @default-bg@;
background-image: none;
...
...
@@ -58,22 +58,6 @@
background-color: @statusbar-bg@;
}
/* Tabbar */
#@session@ .tab {
color: @tabbar-fg@;
background-color: @tabbar-bg@;
}
#@session@ label.tab {
padding: 4px;
}
#@session@ .tab:selected {
color: @tabbar-focus-fg@;
background-color: @tabbar-focus-bg@;
}
/* Notification area */
#@session@ .notification {
...
...
@@ -115,6 +99,5 @@
#@session@ scrolledwindow overshoot.left:backdrop,
#@session@ scrolledwindow overshoot.right,
#@session@ scrolledwindow overshoot.right:backdrop {
background-color: transparent;
background-image: none;
}
girara/callbacks.c
View file @
e59fb731
/* See LICENSE file for license and copyright information */
#include "callbacks.h"
#include "datastructures.h"
#include "session.h"
#include "shortcuts.h"
#include "input-history.h"
#include "internal.h"
#include "session.h"
#include "shortcuts.h"
#include "utils.h"
#include <string.h>
#include <glib/gi18n-lib.h>
#include <string.h>
static
const
guint
ALL_ACCELS_MASK
=
GDK_CONTROL_MASK
|
GDK_SHIFT_MASK
|
GDK_MOD1_MASK
;
static
const
guint
MOUSE_MASK
=
GDK_CONTROL_MASK
|
GDK_SHIFT_MASK
|
GDK_MOD1_MASK
|
...
...
@@ -86,9 +87,11 @@ girara_callback_view_key_press_event(GtkWidget* UNUSED(widget),
return
false
;
}
girara_session_private_t
*
session_private
=
session
->
private_data
;
/* prepare event */
GIRARA_LIST_FOREACH
(
session
->
bindings
.
shortcuts
,
girara_shortcut_t
*
,
iter
,
shortcut
)
if
(
session
->
buffer
.
command
!=
NULL
)
{
if
(
session
_private
->
buffer
.
command
!=
NULL
)
{
break
;
}
...
...
@@ -99,9 +102,9 @@ girara_callback_view_key_press_event(GtkWidget* UNUSED(widget),
&&
shortcut
->
function
!=
NULL
)
{
int
t
=
(
session
->
buffer
.
n
>
0
)
?
session
->
buffer
.
n
:
1
;
const
int
t
=
(
session
_private
->
buffer
.
n
>
0
)
?
session
_private
->
buffer
.
n
:
1
;
for
(
int
i
=
0
;
i
<
t
;
i
++
)
{
if
(
shortcut
->
function
(
session
,
&
(
shortcut
->
argument
),
NULL
,
session
->
buffer
.
n
)
==
false
)
{
if
(
shortcut
->
function
(
session
,
&
(
shortcut
->
argument
),
NULL
,
session
_private
->
buffer
.
n
)
==
false
)
{
break
;
}
}
...
...
@@ -111,7 +114,7 @@ girara_callback_view_key_press_event(GtkWidget* UNUSED(widget),
session
->
global
.
buffer
=
NULL
;
}
session
->
buffer
.
n
=
0
;
session
_private
->
buffer
.
n
=
0
;
if
(
session
->
events
.
buffer_changed
!=
NULL
)
{
session
->
events
.
buffer_changed
(
session
);
...
...
@@ -131,16 +134,16 @@ girara_callback_view_key_press_event(GtkWidget* UNUSED(widget),
session
->
global
.
buffer
=
g_string_append_c
(
session
->
global
.
buffer
,
keyval
);
if
(
session
->
buffer
.
command
==
NULL
&&
keyval
>=
0x30
&&
keyval
<=
0x39
)
{
if
(((
session
->
buffer
.
n
*
10
)
+
(
keyval
-
'0'
))
<
INT_MAX
)
{
session
->
buffer
.
n
=
(
session
->
buffer
.
n
*
10
)
+
(
keyval
-
'0'
);
if
(
session
_private
->
buffer
.
command
==
NULL
&&
keyval
>=
0x30
&&
keyval
<=
0x39
)
{
if
(((
session
_private
->
buffer
.
n
*
10
)
+
(
keyval
-
'0'
))
<
INT_MAX
)
{
session
_private
->
buffer
.
n
=
(
session
_private
->
buffer
.
n
*
10
)
+
(
keyval
-
'0'
);
}
}
else
{
if
(
session
->
buffer
.
command
==
NULL
)
{
session
->
buffer
.
command
=
g_string_new
(
""
);
if
(
session
_private
->
buffer
.
command
==
NULL
)
{
session
_private
->
buffer
.
command
=
g_string_new
(
""
);
}
session
->
buffer
.
command
=
g_string_append_c
(
session
->
buffer
.
command
,
keyval
);
session
_private
->
buffer
.
command
=
g_string_append_c
(
session
_private
->
buffer
.
command
,
keyval
);
}
if
(
session
->
events
.
buffer_changed
!=
NULL
)
{
...
...
@@ -149,33 +152,33 @@ girara_callback_view_key_press_event(GtkWidget* UNUSED(widget),
}
/* check for buffer command */
if
(
session
->
buffer
.
command
!=
NULL
)
{
if
(
session
_private
->
buffer
.
command
!=
NULL
)
{
bool
matching_command
=
FALSE
;
GIRARA_LIST_FOREACH
(
session
->
bindings
.
shortcuts
,
girara_shortcut_t
*
,
iter
,
shortcut
)
if
(
shortcut
->
buffered_command
!=
NULL
)
{
/* buffer could match a command */
if
(
!
strncmp
(
session
->
buffer
.
command
->
str
,
shortcut
->
buffered_command
,
session
->
buffer
.
command
->
len
))
{
if
(
!
strncmp
(
session
_private
->
buffer
.
command
->
str
,
shortcut
->
buffered_command
,
session
_private
->
buffer
.
command
->
len
))
{
/* command matches buffer exactly */
if
(
!
strcmp
(
session
->
buffer
.
command
->
str
,
shortcut
->
buffered_command
)
if
(
!
strcmp
(
session
_private
->
buffer
.
command
->
str
,
shortcut
->
buffered_command
)
&&
(
session
->
modes
.
current_mode
==
shortcut
->
mode
||
shortcut
->
mode
==
0
))
{
g_string_free
(
session
->
buffer
.
command
,
TRUE
);
g_string_free
(
session
_private
->
buffer
.
command
,
TRUE
);
g_string_free
(
session
->
global
.
buffer
,
TRUE
);
session
->
buffer
.
command
=
NULL
;
session
_private
->
buffer
.
command
=
NULL
;
session
->
global
.
buffer
=
NULL
;
if
(
session
->
events
.
buffer_changed
!=
NULL
)
{
session
->
events
.
buffer_changed
(
session
);
}
int
t
=
(
session
->
buffer
.
n
>
0
)
?
session
->
buffer
.
n
:
1
;
int
t
=
(
session
_private
->
buffer
.
n
>
0
)
?
session
_private
->
buffer
.
n
:
1
;
for
(
int
i
=
0
;
i
<
t
;
i
++
)
{
if
(
shortcut
->
function
(
session
,
&
(
shortcut
->
argument
),
NULL
,
session
->
buffer
.
n
)
==
false
)
{
if
(
shortcut
->
function
(
session
,
&
(
shortcut
->
argument
),
NULL
,
session
_private
->
buffer
.
n
)
==
false
)
{
break
;
}
}
session
->
buffer
.
n
=
0
;
session
_private
->
buffer
.
n
=
0
;
girara_list_iterator_free
(
iter
);
return
TRUE
;
}
...
...
@@ -187,11 +190,11 @@ girara_callback_view_key_press_event(GtkWidget* UNUSED(widget),
/* free buffer if buffer will never match a command */
if
(
matching_command
==
false
)
{
g_string_free
(
session
->
buffer
.
command
,
TRUE
);
g_string_free
(
session
_private
->
buffer
.
command
,
TRUE
);
g_string_free
(
session
->
global
.
buffer
,
TRUE
);
session
->
buffer
.
command
=
NULL
;
session
_private
->
buffer
.
command
=
NULL
;
session
->
global
.
buffer
=
NULL
;
session
->
buffer
.
n
=
0
;
session
_private
->
buffer
.
n
=
0
;
if
(
session
->
events
.
buffer_changed
!=
NULL
)
{
session
->
events
.
buffer_changed
(
session
);
...
...
@@ -210,7 +213,10 @@ girara_callback_view_button_press_event(GtkWidget* UNUSED(widget),
g_return_val_if_fail
(
button
!=
NULL
,
false
);
/* prepare girara event */
girara_event_t
event
;
girara_event_t
event
=
{
.
x
=
button
->
x
,
.
y
=
button
->
y
};
switch
(
button
->
type
)
{
case
GDK_BUTTON_PRESS
:
...
...
@@ -227,10 +233,8 @@ girara_callback_view_button_press_event(GtkWidget* UNUSED(widget),
break
;
}
event
.
x
=
button
->
x
;
event
.
y
=
button
->
y
;
const
guint
state
=
button
->
state
&
MOUSE_MASK
;
girara_session_private_t
*
session_private
=
session
->
private_data
;
/* search registered mouse events */
GIRARA_LIST_FOREACH
(
session
->
bindings
.
mouse_events
,
girara_mouse_event_t
*
,
iter
,
mouse_event
)
...
...
@@ -240,7 +244,7 @@ girara_callback_view_button_press_event(GtkWidget* UNUSED(widget),
&&
mouse_event
->
event_type
==
event
.
type
&&
(
session
->
modes
.
current_mode
==
mouse_event
->
mode
||
mouse_event
->
mode
==
0
)
)
{
mouse_event
->
function
(
session
,
&
(
mouse_event
->
argument
),
&
event
,
session
->
buffer
.
n
);
mouse_event
->
function
(
session
,
&
(
mouse_event
->
argument
),
&
event
,
session
_private
->
buffer
.
n
);
girara_list_iterator_free
(
iter
);
return
true
;
}
...
...
@@ -256,12 +260,14 @@ girara_callback_view_button_release_event(GtkWidget* UNUSED(widget), GdkEventBut
g_return_val_if_fail
(
button
!=
NULL
,
false
);
/* prepare girara event */
girara_event_t
event
;
event
.
type
=
GIRARA_EVENT_BUTTON_RELEASE
;
event
.
x
=
button
->
x
;
event
.
y
=
button
->
y
;
girara_event_t
event
=
{
.
type
=
GIRARA_EVENT_BUTTON_RELEASE
,
.
x
=
button
->
x
,
.
y
=
button
->
y
};
const
guint
state
=
button
->
state
&
MOUSE_MASK
;
girara_session_private_t
*
session_private
=
session
->
private_data
;
/* search registered mouse events */
GIRARA_LIST_FOREACH
(
session
->
bindings
.
mouse_events
,
girara_mouse_event_t
*
,
iter
,
mouse_event
)
...
...
@@ -271,7 +277,7 @@ girara_callback_view_button_release_event(GtkWidget* UNUSED(widget), GdkEventBut
&&
mouse_event
->
event_type
==
GIRARA_EVENT_BUTTON_RELEASE
&&
(
session
->
modes
.
current_mode
==
mouse_event
->
mode
||
mouse_event
->
mode
==
0
)
)
{
mouse_event
->
function
(
session
,
&
(
mouse_event
->
argument
),
&
event
,
session
->
buffer
.
n
);
mouse_event
->
function
(
session
,
&
(
mouse_event
->
argument
),
&
event
,
session
_private
->
buffer
.
n
);
girara_list_iterator_free
(
iter
);
return
true
;
}
...
...
@@ -294,6 +300,7 @@ girara_callback_view_button_motion_notify_event(GtkWidget* UNUSED(widget), GdkEv
};
const
guint
state
=
button
->
state
&
MOUSE_MASK
;
girara_session_private_t
*
session_private
=
session
->
private_data
;
/* search registered mouse events */
GIRARA_LIST_FOREACH
(
session
->
bindings
.
mouse_events
,
girara_mouse_event_t
*
,
iter
,
mouse_event
)
...
...
@@ -302,7 +309,7 @@ girara_callback_view_button_motion_notify_event(GtkWidget* UNUSED(widget), GdkEv
&&
mouse_event
->
event_type
==
event
.
type
&&
(
session
->
modes
.
current_mode
==
mouse_event
->
mode
||
mouse_event
->
mode
==
0
)
)
{
mouse_event
->
function
(
session
,
&
(
mouse_event
->
argument
),
&
event
,
session
->
buffer
.
n
);
mouse_event
->
function
(
session
,
&
(
mouse_event
->
argument
),
&
event
,
session
_private
->
buffer
.
n
);
girara_list_iterator_free
(
iter
);
return
true
;
}
...
...
@@ -318,9 +325,10 @@ girara_callback_view_scroll_event(GtkWidget* UNUSED(widget), GdkEventScroll* scr
g_return_val_if_fail
(
scroll
!=
NULL
,
false
);
/* prepare girara event */
girara_event_t
event
;
event
.
x
=
scroll
->
x
;
event
.
y
=
scroll
->
y
;
girara_event_t
event
=
{
.
x
=
scroll
->
x
,
.
y
=
scroll
->
y
};
switch
(
scroll
->
direction
)
{
case
GDK_SCROLL_UP
:
...
...
@@ -345,6 +353,7 @@ girara_callback_view_scroll_event(GtkWidget* UNUSED(widget), GdkEventScroll* scr
}
const
guint
state
=
scroll
->
state
&
MOUSE_MASK
;
girara_session_private_t
*
session_private
=
session
->
private_data
;
/* search registered mouse events */
/* TODO: Filter correct event */
...
...
@@ -354,7 +363,7 @@ girara_callback_view_scroll_event(GtkWidget* UNUSED(widget), GdkEventScroll* scr
&&
mouse_event
->
event_type
==
event
.
type
&&
(
session
->
modes
.
current_mode
==
mouse_event
->
mode
||
mouse_event
->
mode
==
0
)
)
{
mouse_event
->
function
(
session
,
&
(
mouse_event
->
argument
),
&
event
,
session
->
buffer
.
n
);
mouse_event
->
function
(
session
,
&
(
mouse_event
->
argument
),
&
event
,
session
_private
->
buffer
.
n
);
girara_list_iterator_free
(
iter
);
return
true
;
}
...
...
@@ -407,37 +416,23 @@ girara_callback_inputbar_activate(GtkEntry* entry, girara_session_t* session)
const
char
*
command
=
gtk_entry_get_text
(
entry
);
girara_input_history_append
(
session
->
command_history
,
command
);
/* parse input */
gchar
**
argv
=
NULL
;
gint
argc
=
0
;
if
(
g_shell_parse_argv
(
input
,
&
argc
,
&
argv
,
NULL
)
==
FALSE
)
{
g_free
(
input
);
return
false
;
}
gchar
*
cmd
=
argv
[
0
];
/* special commands */
char
*
identifier_s
=
gtk_editable_get_chars
(
GTK_EDITABLE
(
entry
),
0
,
1
);
if
(
identifier_s
==
NULL
)
{
g_free
(
input
);
g_strfreev
(
argv
);
return
false
;
}
char
identifier
=
identifier_s
[
0
];
const
char
identifier
=
identifier_s
[
0
];
g_free
(
identifier_s
);
girara_debug
(
"Processing special command with identifier '%c'."
,
identifier
);
GIRARA_LIST_FOREACH
(
session
->
bindings
.
special_commands
,
girara_special_command_t
*
,
iter
,
special_command
)
if
(
special_command
->
identifier
==
identifier
)
{
girara_debug
(
"Found special command."
);
if
(
special_command
->
always
!=
true
)
{
special_command
->
function
(
session
,
input
,
&
(
special_command
->
argument
));
}
g_free
(
input
);
g_strfreev
(
argv
);
girara_isc_abort
(
session
,
NULL
,
NULL
,
0
);
girara_list_iterator_free
(
iter
);
...
...
@@ -445,6 +440,18 @@ girara_callback_inputbar_activate(GtkEntry* entry, girara_session_t* session)
}
GIRARA_LIST_FOREACH_END
(
session
->
bindings
.
special_commands
,
girara_special_command_t
*
,
iter
,
special_command
);
/* parse input */
gchar
**
argv
=
NULL
;
gint
argc
=
0
;
if
(
g_shell_parse_argv
(
input
,
&
argc
,
&
argv
,
NULL
)
==
FALSE
)
{
girara_debug
(
"Failed to parse argument."
);
g_free
(
input
);
return
false
;
}
gchar
*
cmd
=
argv
[
0
];
/* search commands */
GIRARA_LIST_FOREACH
(
session
->
bindings
.
commands
,
girara_command_t
*
,
iter
,
command
)
if
((
g_strcmp0
(
cmd
,
command
->
command
)
==
0
)
||
...
...
@@ -514,6 +521,7 @@ girara_callback_inputbar_key_press_event(GtkWidget* entry, GdkEventKey* event, g