Commit e59fb731 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Merge branch 'release/0.2.8'

parents fe7e9194 d235f5fe
......@@ -8,7 +8,7 @@ tests/girara_test-gtk*
.depend
*.pc
version.h
css-definitions.c
css-definitions.*
*.info
*.gcno
*.gcda
......
......@@ -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)
......
......@@ -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)
......
......@@ -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
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/pwmt/girara/CSS">
<file compressed="true">girara.css_t</file>
</gresource>
</gresources>
/* 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;
}
#@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;
}
/* 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
/* a custom handler has been installed (e.g. by girara_dialog) */
gboolean custom_ret = false;
if (session->signals.inputbar_custom_key_press_event != NULL) {
girara_debug("Running custom key press event handler.");
custom_ret = session->signals.inputbar_custom_key_press_event(entry, event, session->signals.inputbar_custom_data);
if (custom_ret == true) {
girara_isc_abort(session, NULL, NULL, 0);
......
/* See LICENSE file for license and copyright information */
#include <string.h>
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include "commands.h"
#include "datastructures.h"
#include "session.h"
#include "internal.h"
#include "utils.h"
#include "session.h"
#include "settings.h"
#include "shortcuts.h"
#include "utils.h"
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
/* default commands implementation */
bool
......@@ -316,16 +317,18 @@ girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list,
}
}
girara_session_private_t* session_private = session->private_data;
/* Check for passed shortcut command */
if (unmap == false) {
bool found_mapping = false;
GIRARA_LIST_FOREACH(session->config.shortcut_mappings, girara_shortcut_mapping_t*, iter, mapping)
GIRARA_LIST_FOREACH(session_private->config.shortcut_mappings, girara_shortcut_mapping_t*, iter, mapping)
if (!g_strcmp0(tmp, mapping->identifier)) {
shortcut_function = mapping->function;
found_mapping = true;
break;
}
GIRARA_LIST_FOREACH_END(session->config.shortcut_mappings, girara_shortcut_mapping_t*, iter, mapping);
GIRARA_LIST_FOREACH_END(session_private->config.shortcut_mappings, girara_shortcut_mapping_t*, iter, mapping);
if (found_mapping == false) {
girara_warning("Not a valid shortcut function: %s", tmp);
......@@ -342,12 +345,12 @@ girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list,
if (++current_command < number_of_arguments) {
tmp = (char*) girara_list_nth(argument_list, current_command);
GIRARA_LIST_FOREACH(session->config.argument_mappings, girara_argument_mapping_t*, iter, mapping)
GIRARA_LIST_FOREACH(session_private->config.argument_mappings, girara_argument_mapping_t*, iter, mapping)
if (!g_strcmp0(tmp, mapping->identifier)) {
shortcut_argument_n = mapping->value;
break;
}
GIRARA_LIST_FOREACH_END(session->config.argument_mappings, girara_argument_mapping_t*, iter, mapping);
GIRARA_LIST_FOREACH_END(session_private->config.argument_mappings, girara_argument_mapping_t*, iter, mapping);
/* If no known argument is passed we save it in the data field */
if (shortcut_argument_n == 0) {
......
/* See LICENSE file for license and copyright information */
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include "config.h"
#include "commands.h"
#include "datastructures.h"
#include "internal.h"
#include "session.h"
#include "settings.h"
#include "shortcuts.h"
#include "utils.h"
#include "template.h"
#include "utils.h"
#define COMMENT_PREFIX "\"#"
......@@ -204,10 +205,6 @@ girara_config_load_default(girara_session_t* session)
girara_setting_add(session, "notification-bg", "#FFFFFF", STRING, TRUE, _("Notification background color"), NULL, NULL);
girara_setting_add(session, "scrollbar-fg", "#DDDDDD", STRING, TRUE, _("Scrollbar foreground color"), NULL, NULL);
girara_setting_add(session, "scrollbar-bg", "#000000", STRING, TRUE, _("Scrollbar background color"), NULL, NULL);
girara_setting_add(session, "tabbar-fg", "#939393", STRING, TRUE, _("Tab bar foreground color"), NULL, NULL);
girara_setting_add(session, "tabbar-bg", "#000000", STRING, TRUE, _("Tab bar background color"), NULL, NULL);
girara_setting_add(session, "tabbar-focus-fg", "#9FBC00", STRING, TRUE, _("Tab bar foreground color (active)"), NULL, NULL);
girara_setting_add(session, "tabbar-focus-bg", "#000000", STRING, TRUE, _("Tab bar background color (active)"), NULL, NULL);
girara_setting_add(session, "word-separator", " /.-=&#?", STRING, TRUE, NULL, NULL, NULL);
girara_setting_add(session, "window-width", &window_width, INT, TRUE, _("Initial window width"), NULL, NULL);
girara_setting_add(session, "window-height", &window_height, INT, TRUE, _("Initial window height"), NULL, NULL);
......@@ -228,9 +225,6 @@ girara_config_load_default(girara_session_t* session)
girara_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_c, NULL, girara_sc_abort, normal_mode, 0, NULL);
girara_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_q, NULL, girara_sc_quit, normal_mode, 0, NULL);