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* ...@@ -8,7 +8,7 @@ tests/girara_test-gtk*
.depend .depend
*.pc *.pc
version.h version.h
css-definitions.c css-definitions.*
*.info *.info
*.gcno *.gcno
*.gcda *.gcda
......
...@@ -88,17 +88,12 @@ ${PROJECTNV}/version.h: ${PROJECTNV}/version.h.in config.mk ...@@ -88,17 +88,12 @@ ${PROJECTNV}/version.h: ${PROJECTNV}/version.h.in config.mk
${PROJECTNV}/version.h.in > ${PROJECTNV}/version.h.tmp ${PROJECTNV}/version.h.in > ${PROJECTNV}/version.h.tmp
$(QUIET)mv ${PROJECTNV}/version.h.tmp ${PROJECTNV}/version.h $(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,$@) $(call colorecho,GEN,$@)
$(QUIET)echo '#include "css-definitions.h"' > $@.tmp @mkdir -p ${DEPENDDIR}/$(dir $@)
$(QUIET)echo 'const char* CSS_TEMPLATE_PRE_3_20 =' >> $@.tmp $(QUIET)$(GLIB_COMPILE_RESOURCES) --generate --c-name=girara_css --internal \
$(QUIET)sed 's/^\(.*\)$$/"\1\\n"/' data/girara-pre-3.20.css_t >> $@.tmp --dependency-file=$(DEPENDDIR)/$@.dep \
$(QUIET)echo ';' >> $@.tmp --sourcedir=data --target=$@ data/girara-css.gresource.xml
$(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 $@
${BUILDDIR}/${PROJECT}.pc: ${PROJECTNV}.pc.in config.mk ${BUILDDIR}/${PROJECT}.pc: ${PROJECTNV}.pc.in config.mk
$(call colorecho,GEN,$(shell basename $@)) $(call colorecho,GEN,$(shell basename $@))
...@@ -117,7 +112,8 @@ ${BUILDDIR}/${PROJECT}.pc: ${PROJECTNV}.pc.in config.mk ...@@ -117,7 +112,8 @@ ${BUILDDIR}/${PROJECT}.pc: ${PROJECTNV}.pc.in config.mk
${OBJECTS}: config.mk \ ${OBJECTS}: config.mk \
${PROJECTNV}/version.h \ ${PROJECTNV}/version.h \
.version-checks/GTK \ .version-checks/GTK \
.version-checks/GLIB .version-checks/GLIB \
${PROJECTNV}/css-definitions.h
${BUILDDIR_RELEASE}/%.o: %.c ${BUILDDIR_RELEASE}/%.o: %.c
$(call colorecho,CC,$<) $(call colorecho,CC,$<)
...@@ -148,7 +144,8 @@ release: ${PROJECT} ...@@ -148,7 +144,8 @@ release: ${PROJECT}
${OBJECT_DEBUG}: config.mk \ ${OBJECT_DEBUG}: config.mk \
${PROJECTNV}/version.h \ ${PROJECTNV}/version.h \
.version-checks/GTK \ .version-checks/GTK \
.version-checks/GLIB .version-checks/GLIB \
${PROJECTNV}/css-definitions.h
${BUILDDIR_DEBUG}/%.o: %.c ${BUILDDIR_DEBUG}/%.o: %.c
$(call colorecho,CC,$<) $(call colorecho,CC,$<)
...@@ -176,6 +173,7 @@ debug: ${PROJECT}-debug ...@@ -176,6 +173,7 @@ debug: ${PROJECT}-debug
${OBJECTS_GCOV}: config.mk \ ${OBJECTS_GCOV}: config.mk \
${PROJECTNV}/version.h \ ${PROJECTNV}/version.h \
${PROJECTNV}/css-definitions.h \
.version-checks/GLIB \ .version-checks/GLIB \
.version-checks/GTK .version-checks/GTK
...@@ -222,7 +220,7 @@ clean: ...@@ -222,7 +220,7 @@ clean:
${PROJECTNV}/version.h \ ${PROJECTNV}/version.h \
${PROJECTNV}/version.h.tmp \ ${PROJECTNV}/version.h.tmp \
${PROJECTNV}/css-definitions.c \ ${PROJECTNV}/css-definitions.c \
${PROJECTNV}/css-definitions.c.tmp ${PROJECTNV}/css-definitions.h
$(QUIET)$(MAKE) -C tests clean $(QUIET)$(MAKE) -C tests clean
$(QUIET)$(MAKE) -C po clean $(QUIET)$(MAKE) -C po clean
$(QUIET)$(MAKE) -C doc clean $(QUIET)$(MAKE) -C doc clean
...@@ -303,7 +301,7 @@ uninstall-headers: ...@@ -303,7 +301,7 @@ uninstall-headers:
format: format:
clang-tidy -fix -checks=readability-braces-around-statements \ clang-tidy -fix -checks=readability-braces-around-statements \
$(SOURCE) -- $(CPPFLAGS) $(CFLAGS) $(SOURCE) -- $(CPPFLAGS) $(CFLAGS)
clang-format-3.8 -i $(SOURCE) $(HEADERS) clang-format -i $(SOURCE) $(HEADERS)
tidy: tidy:
clang-tidy $(SOURCE) -- $(CPPFLAGS) $(CFLAGS) clang-tidy $(SOURCE) -- $(CPPFLAGS) $(CFLAGS)
......
...@@ -5,12 +5,12 @@ and minimalism. It consists of three main components: The view is a widget that ...@@ -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 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 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 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 Requirements
------------ ------------
glib (>= 2.36) glib (>= 2.50)
gtk3 (>= 3.4) gtk3 (>= 3.20)
intltool intltool
libnotify (optional, for notification support) libnotify (optional, for notification support)
jscon-c (optional, for configuration dumping support) jscon-c (optional, for configuration dumping support)
......
...@@ -2,23 +2,26 @@ ...@@ -2,23 +2,26 @@
GIRARA_VERSION_MAJOR = 0 GIRARA_VERSION_MAJOR = 0
GIRARA_VERSION_MINOR = 2 GIRARA_VERSION_MINOR = 2
GIRARA_VERSION_REV = 7 GIRARA_VERSION_REV = 8
VERSION = ${GIRARA_VERSION_MAJOR}.${GIRARA_VERSION_MINOR}.${GIRARA_VERSION_REV} VERSION = ${GIRARA_VERSION_MAJOR}.${GIRARA_VERSION_MINOR}.${GIRARA_VERSION_REV}
# Rules for the SOMAJOR and SOMINOR. # 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 # * If a function has been removed or the paramaters of a function have changed
# bump SOMAJOR and set SOMINOR to 0. # bump SOMAJOR and set SOMINOR to 0.
# * If any of the exported datastructures have changed in a incompatible way # * If any of the exported datastructures have changed in a incompatible way
# bump SOMAJOR and set SOMINOR to 0. # bump SOMAJOR and set SOMINOR to 0.
# * If a function has been added bump SOMINOR. # * If a function has been added bump SOMINOR.
SOMAJOR = 2 SOMAJOR = 3
SOMINOR = 0 SOMINOR = 0
SOVERSION = ${SOMAJOR}.${SOMINOR} SOVERSION = ${SOMAJOR}.${SOMINOR}
# pkg-config binary # pkg-config binary
PKG_CONFIG ?= pkg-config PKG_CONFIG ?= pkg-config
# glib-compile-resource binary
GLIB_COMPILE_RESOURCES ?= glib-compile-resources
# libnotify # libnotify
WITH_LIBNOTIFY ?= $(shell (${PKG_CONFIG} libnotify --atleast-version=0.7.0 && echo 1) || echo 0) WITH_LIBNOTIFY ?= $(shell (${PKG_CONFIG} libnotify --atleast-version=0.7.0 && echo 1) || echo 0)
...@@ -46,29 +49,44 @@ BINDIR ?= bin ...@@ -46,29 +49,44 @@ BINDIR ?= bin
# GTK+ # GTK+
GTK_VERSION_CHECK ?= 1 GTK_VERSION_CHECK ?= 1
GTK_MIN_VERSION = 3.4 GTK_MIN_VERSION = 3.20
GTK_PKG_CONFIG_NAME = gtk+-3.0 GTK_PKG_CONFIG_NAME = gtk+-3.0
# glib # glib
GLIB_VERSION_CHECK ?= 1 GLIB_VERSION_CHECK ?= 1
GLIB_MIN_VERSION = 2.36 GLIB_MIN_VERSION = 2.50
GLIB_PKG_CONFIG_NAME = glib-2.0 GLIB_PKG_CONFIG_NAME = glib-2.0
# libs # libs
GTK_INC ?= $(shell ${PKG_CONFIG} --cflags gtk+-3.0) ifeq (${GTK_INC}-${GTK_LIB},-)
GTK_LIB ?= $(shell ${PKG_CONFIG} --libs gtk+-3.0) PKG_CONFIG_LIBS += gtk+-3.0
else
INCS += ${GTK_INC}
LIBS += ${GTK_LIB}
endif
ifneq (${WITH_LIBNOTIFY},0) ifneq (${WITH_LIBNOTIFY},0)
LIBNOTIFY_INC ?= $(shell ${PKG_CONFIG} --cflags libnotify) ifeq (${LIBNOTIFY_INC}-${LIBNOTIFY_LIB},-)
LIBNOTIFY_LIB ?= $(shell ${PKG_CONFIG} --libs libnotify) PKG_CONFIG_LIBS += libnotify
else
INCS += ${LIBNOTIFY_INC}
LIBS += ${LIBNOTIFY_LIB}
endif
endif endif
ifneq (${WITH_JSON},0) ifneq (${WITH_JSON},0)
JSON_INC ?= $(shell ${PKG_CONFIG} --cflags json-c) ifeq (${JSON_INC}-${JSON_LIB},-)
JSON_LIB ?= $(shell ${PKG_CONFIG} --libs json-c) PKG_CONFIG_LIBS += json-c
else
INCS += ${JSON_INC}
LIBS += ${JSON_LIB}
endif
endif endif
INCS = ${GTK_INC} ${LIBNOTIFY_INC} ${JSON_INC} ifneq (${PKG_CONFIG_LIBS},)
LIBS = ${GTK_LIB} ${LIBNOTIFY_LIB} ${JSON_LIB} -lm INCS += $(shell ${PKG_CONFIG} --cflags ${PKG_CONFIG_LIBS})
LIBS += $(shell ${PKG_CONFIG} --libs ${PKG_CONFIG_LIBS})
endif
LIBS += -lm
# pre-processor flags # pre-processor flags
CPPFLAGS += -D_FILE_OFFSET_BITS=64 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@; color: @default-fg@;
background-color: @default-bg@; background-color: @default-bg@;
background-image: none; background-image: none;
...@@ -58,22 +58,6 @@ ...@@ -58,22 +58,6 @@
background-color: @statusbar-bg@; 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 */ /* Notification area */
#@session@ .notification { #@session@ .notification {
...@@ -115,6 +99,5 @@ ...@@ -115,6 +99,5 @@
#@session@ scrolledwindow overshoot.left:backdrop, #@session@ scrolledwindow overshoot.left:backdrop,
#@session@ scrolledwindow overshoot.right, #@session@ scrolledwindow overshoot.right,
#@session@ scrolledwindow overshoot.right:backdrop { #@session@ scrolledwindow overshoot.right:backdrop {
background-color: transparent;
background-image: none; background-image: none;
} }
This diff is collapsed.
/* See LICENSE file for license and copyright information */ /* See LICENSE file for license and copyright information */
#include <string.h>
#include <stdlib.h>
#include <glib/gi18n-lib.h>
#include "commands.h" #include "commands.h"
#include "datastructures.h" #include "datastructures.h"
#include "session.h"
#include "internal.h" #include "internal.h"
#include "utils.h" #include "session.h"
#include "settings.h" #include "settings.h"
#include "shortcuts.h" #include "shortcuts.h"
#include "utils.h"
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
/* default commands implementation */ /* default commands implementation */
bool bool
...@@ -316,16 +317,18 @@ girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list, ...@@ -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 */ /* Check for passed shortcut command */
if (unmap == false) { if (unmap == false) {
bool found_mapping = 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)) { if (!g_strcmp0(tmp, mapping->identifier)) {
shortcut_function = mapping->function; shortcut_function = mapping->function;
found_mapping = true; found_mapping = true;
break; 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) { if (found_mapping == false) {
girara_warning("Not a valid shortcut function: %s", tmp); 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, ...@@ -342,12 +345,12 @@ girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list,
if (++current_command < number_of_arguments) { if (++current_command < number_of_arguments) {
tmp = (char*) girara_list_nth(argument_list, current_command); 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)) { if (!g_strcmp0(tmp, mapping->identifier)) {
shortcut_argument_n = mapping->value; shortcut_argument_n = mapping->value;
break; 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 no known argument is passed we save it in the data field */
if (shortcut_argument_n == 0) { if (shortcut_argument_n == 0) {
......
/* See LICENSE file for license and copyright information */ /* See LICENSE file for license and copyright information */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include "config.h"
#include "commands.h" #include "commands.h"
#include "datastructures.h" #include "datastructures.h"
#include "internal.h" #include "internal.h"
#include "session.h" #include "session.h"
#include "settings.h" #include "settings.h"
#include "shortcuts.h" #include "shortcuts.h"
#include "utils.h"
#include "template.h" #include "template.h"
#include "utils.h"
#define COMMENT_PREFIX "\"#" #define COMMENT_PREFIX "\"#"
...@@ -204,10 +205,6 @@ girara_config_load_default(girara_session_t* session) ...@@ -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, "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-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, "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, "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-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); 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) ...@@ -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_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); girara_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_q, NULL, girara_sc_quit, normal_mode, 0, NULL);
girara_shortcut_add(session, 0, GDK_KEY_colon, NULL, girara_sc_focus_inputbar, normal_mode, 0, ":"); girara_shortcut_add(session, 0, GDK_KEY_colon, NULL, girara_sc_focus_inputbar, normal_mode, 0, ":");
girara_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_w, NULL, girara_sc_tab_close, normal_mode, 0, NULL);
girara_shortcut_add(session, 0, 0, "gt", girara_sc_tab_navigate, normal_mode, GIRARA_NEXT, NULL);
girara_shortcut_add(session, 0, 0, "gT", girara_sc_tab_navigate, normal_mode, GIRARA_PREVIOUS, NULL);
/* inputbar shortcuts */ /* inputbar shortcuts */
girara_inputbar_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_j, girara_isc_activate, 0, NULL); girara_inputbar_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_j, girara_isc_activate, 0, NULL);
...@@ -274,12 +268,13 @@ girara_config_load_default(girara_session_t* session) ...@@ -274,12 +268,13 @@ girara_config_load_default(girara_session_t* session)
girara_config_handle_add(session, "unmap", girara_cmd_unmap); girara_config_handle_add(session, "unmap", girara_cmd_unmap);
/* shortcut mappings */ /* shortcut mappings */
girara_shortcut_mapping_add(session, "focus_inputbar", girara_sc_focus_inputbar); girara_shortcut_mapping_add(session, "exec", girara_sc_exec);
girara_shortcut_mapping_add(session, "quit", girara_sc_quit); girara_shortcut_mapping_add(session, "feedkeys", girara_sc_feedkeys);
girara_shortcut_mapping_add(session, "set", girara_sc_set); girara_shortcut_mapping_add(session, "focus_inputbar", girara_sc_focus_inputbar);
girara_shortcut_mapping_add(session, "feedkeys", girara_sc_feedkeys); girara_shortcut_mapping_add(session, "quit", girara_sc_quit);
girara_shortcut_mapping_add(session, "tab_next", girara_sc_tab_navigate_next); girara_shortcut_mapping_add(session, "set", girara_sc_set);
girara_shortcut_mapping_add(session, "tab_prev", girara_sc_tab_navigate_prev); girara_shortcut_mapping_add(session, "toggle_inputbar", girara_sc_toggle_inputbar);
girara_shortcut_mapping_add(session, "toggle_statusbar", girara_sc_toggle_statusbar);
} }
bool bool
...@@ -288,21 +283,22 @@ girara_config_handle_add(girara_session_t* session, const char* identifier, gira ...@@ -288,21 +283,22 @@ girara_config_handle_add(girara_session_t* session, const char* identifier, gira
g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session != NULL, false);
g_return_val_if_fail(identifier != NULL, false); g_return_val_if_fail(identifier != NULL, false);
girara_session_private_t* session_private = session->private_data;
/* search for existing config handle */ /* search for existing config handle */
GIRARA_LIST_FOREACH(session->config.handles, girara_config_handle_t*, iter, data) GIRARA_LIST_FOREACH(session_private->config.handles, girara_config_handle_t*, iter, data)
if (strcmp(data->identifier, identifier) == 0) { if (strcmp(data->identifier, identifier) == 0) {
data->handle = handle; data->handle = handle;
girara_list_iterator_free(iter); girara_list_iterator_free(iter);
return true; return true;
} }
GIRARA_LIST_FOREACH_END(session->config.handles, girara_config_handle_t*, iter, data); GIRARA_LIST_FOREACH_END(session_private->config.handles, girara_config_handle_t*, iter, data);
/* add new config handle */ /* add new config handle */
girara_config_handle_t* config_handle = g_slice_new(girara_config_handle_t); girara_config_handle_t* config_handle = g_slice_new(girara_config_handle_t);
config_handle->identifier = g_strdup(identifier); config_handle->identifier = g_strdup(identifier);
config_handle->handle = handle; config_handle->handle = handle;
girara_list_append(session->config.handles, config_handle); girara_list_append(session_private->config.handles, config_handle);
return true; return true;
} }
...@@ -390,8 +386,9 @@ config_parse(girara_session_t* session, const char* path) ...@@ -390,8 +386,9 @@ config_parse(girara_session_t* session, const char* path)
} }
} else { } else {
/* search for config handle */ /* search for config handle */
girara_session_private_t* session_private = session->private_data;
girara_config_handle_t* handle = NULL; girara_config_handle_t* handle = NULL;
GIRARA_LIST_FOREACH(session->config.handles, girara_config_handle_t*, iter, tmp) GIRARA_LIST_FOREACH(session_private->config.handles, girara_config_handle_t*, iter, tmp)
handle = tmp; handle = tmp;
if (strcmp(handle->identifier, argv[0]) == 0) { if (strcmp(handle->identifier, argv[0]) == 0) {
handle->handle(session, argument_list); handle->handle(session, argument_list);
...@@ -399,7 +396,7 @@ config_parse(girara_session_t* session, const char* path) ...@@ -399,7 +396,7 @@ config_parse(girara_session_t* session, const char* path)
} else { } else {
handle = NULL; handle = NULL;
} }
GIRARA_LIST_FOREACH_END(session->config.handles, girara_config_handle_t*, iter, tmp); GIRARA_LIST_FOREACH_END(session_private->config.handles, girara_config_handle_t*, iter, tmp);
if (handle == NULL) { if (handle == NULL) {
girara_warning("Could not process line %d in '%s': Unknown handle '%s'", line_number, path, argv[0]); girara_warning("Could not process line %d in '%s': Unknown handle '%s'", line_number, path, argv[0]);
......
/* See LICENSE file for license and copyright information */
#ifndef GIRARA_CSS_DEFINITIONS_H
#define GIRARA_CSS_DEFINITIONS_H
#include "macros.h"
extern const char* CSS_TEMPLATE_PRE_3_20 GIRARA_HIDDEN;
extern const char* CSS_TEMPLATE_POST_3_20 GIRARA_HIDDEN;
#endif
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
struct girara_tree_node_s struct girara_tree_node_s
{ {
girara_free_function_t free; /**> The free function */
GNode* node; /* The node object */ GNode* node; /* The node object */
girara_free_function_t free; /**> The free function */
}; };
typedef struct girara_tree_node_data_s typedef struct girara_tree_node_data_s
...@@ -20,9 +20,9 @@ typedef struct girara_tree_node_data_s ...@@ -20,9 +20,9 @@ typedef struct girara_tree_node_data_s
struct girara_list_s struct girara_list_s
{ {
GList* start; /**> List start */
girara_free_function_t free; /**> The free function */ girara_free_function_t free; /**> The free function */
girara_compare_function_t cmp; /**> The sort function */ girara_compare_function_t cmp; /**> The sort function */
GList* start; /**> List start */
}; };
struct girara_list_iterator_s struct girara_list_iterator_s
...@@ -34,18 +34,18 @@ struct girara_list_iterator_s ...@@ -34,18 +34,18 @@ struct girara_list_iterator_s
girara_list_t* girara_list_t*
girara_list_new(void) girara_list_new(void)
{ {
return g_try_malloc0(sizeof(girara_list_t)); return girara_list_new2(NULL);
} }
girara_list_t* girara_list_t*
girara_list_new2(girara_free_function_t gfree) girara_list_new2(girara_free_function_t gfree)
{ {
girara_list_t* list = girara_list_new(); girara_list_t* list = g_try_malloc0(sizeof(girara_list_t));
if (list == NULL) { if (list == NULL) {
return NULL; return NULL;
} }
girara_list_set_free_function(list, gfree); list->free = gfree;
return list; return list;
} }
...@@ -76,7 +76,7 @@ girara_sorted_list_new2(girara_compare_function_t cmp, girara_free_function_t gf ...@@ -76,7 +76,7 @@ girara_sorted_list_new2(girara_compare_function_t cmp, girara_free_function_t gf
void void
girara_list_set_free_function(girara_list_t* list, girara_free_function_t gfree) girara_list_set_free_function(girara_list_t* list, girara_free_function_t gfree)
{ {
g_return_if_fail(list); g_return_if_fail(list != NULL);
list->free = gfree; list->free = gfree;
} }
...@@ -334,7 +334,7 @@ girara_list_iterator_free(girara_list_iterator_t* iter) ...@@ -334,7 +334,7 @@ girara_list_iterator_free(girara_list_iterator_t* iter)