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;
}
This diff is collapsed.
/* 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);
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 */
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)
girara_config_handle_add(session, "unmap", girara_cmd_unmap);
/* shortcut mappings */
girara_shortcut_mapping_add(session, "focus_inputbar", girara_sc_focus_inputbar);
girara_shortcut_mapping_add(session, "quit", girara_sc_quit);
girara_shortcut_mapping_add(session, "set", girara_sc_set);
girara_shortcut_mapping_add(session, "feedkeys", girara_sc_feedkeys);
girara_shortcut_mapping_add(session, "tab_next", girara_sc_tab_navigate_next);
girara_shortcut_mapping_add(session, "tab_prev", girara_sc_tab_navigate_prev);
girara_shortcut_mapping_add(session, "exec", girara_sc_exec);
girara_shortcut_mapping_add(session, "feedkeys", girara_sc_feedkeys);
girara_shortcut_mapping_add(session, "focus_inputbar", girara_sc_focus_inputbar);
girara_shortcut_mapping_add(session, "quit", girara_sc_quit);
girara_shortcut_mapping_add(session, "set", girara_sc_set);
girara_shortcut_mapping_add(session, "toggle_inputbar", girara_sc_toggle_inputbar);
girara_shortcut_mapping_add(session, "toggle_statusbar", girara_sc_toggle_statusbar);
}
bool
......@@ -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(identifier != NULL, false);
girara_session_private_t* session_private = session->private_data;
/* 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) {
data->handle = handle;
girara_list_iterator_free(iter);
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 */
girara_config_handle_t* config_handle = g_slice_new(girara_config_handle_t);
config_handle->identifier = g_strdup(identifier);
config_handle->handle = handle;
girara_list_append(session->config.handles, config_handle);
girara_list_append(session_private->config.handles, config_handle);
return true;
}
......@@ -390,8 +386,9 @@ config_parse(girara_session_t* session, const char* path)
}
} else {
/* search for config handle */
girara_session_private_t* session_private = session->private_data;
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;
if (strcmp(handle->identifier, argv[0]) == 0) {
handle->handle(session, argument_list);
......@@ -399,7 +396,7 @@ config_parse(girara_session_t* session, const char* path)
} else {
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) {
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 @@
struct girara_tree_node_s
{
girara_free_function_t free; /**> The free function */
GNode* node; /* The node object */
girara_free_function_t free; /**> The free function */
};
typedef struct girara_tree_node_data_s
......@@ -20,9 +20,9 @@ typedef struct girara_tree_node_data_s
struct girara_list_s
{
GList* start; /**> List start */
girara_free_function_t free; /**> The free function */
girara_compare_function_t cmp; /**> The sort function */
GList* start; /**> List start */
};
struct girara_list_iterator_s
......@@ -34,18 +34,18 @@ struct girara_list_iterator_s
girara_list_t*
girara_list_new(void)
{
return g_try_malloc0(sizeof(girara_list_t));
return girara_list_new2(NULL);
}
girara_list_t*
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) {
return NULL;
}
girara_list_set_free_function(list, gfree);
list->free = gfree;
return list;
}
......@@ -76,7 +76,7 @@ girara_sorted_list_new2(girara_compare_function_t cmp, girara_free_function_t gf
void
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;
}
......@@ -334,7 +334,7 @@ girara_list_iterator_free(girara_list_iterator_t* iter)
size_t
girara_list_size(girara_list_t* list)
{
g_return_val_if_fail(list, 0);
g_return_val_if_fail(list != NULL, 0);
if (list->start == NULL) {
return 0;
......
......@@ -40,7 +40,7 @@ struct girara_entry_class_s
void (*paste_primary)(GiraraEntry*);
};
GType girara_entry_get_type(void) GIRARA_HIDDEN;
GType girara_entry_get_type(void) G_GNUC_CONST GIRARA_HIDDEN;
GiraraEntry* girara_entry_new(void) GIRARA_HIDDEN;
......
......@@ -111,15 +111,11 @@ ih_set_property(GObject* object, guint prop_id, const GValue* value,
switch (prop_id) {
case PROP_IO: {
if (priv->io != NULL) {
g_object_unref(priv->io);
}
g_clear_object(&priv->io);
gpointer* tmp = g_value_dup_object(value);
if (tmp != NULL) {
priv->io = GIRARA_INPUT_HISTORY_IO(tmp);
} else {
priv->io = NULL;
}
girara_input_history_reset(GIRARA_INPUT_HISTORY(object));
break;
......
......@@ -43,7 +43,7 @@ struct girara_input_history_io_interface_s {
#define GIRARA_INPUT_HISTORY_IO_GET_INTERFACE(obj) \
(G_TYPE_INSTANCE_GET_INTERFACE((obj), GIRARA_TYPE_INPUT_HISTORY_IO, GiraraInputHistoryIOInterface))
GType girara_input_history_io_get_type(void);
GType girara_input_history_io_get_type(void) G_GNUC_CONST;
void girara_input_history_io_append(GiraraInputHistoryIO* io, const char* input);
......@@ -128,7 +128,7 @@ struct girara_input_history_class_s {
*
* @return the type
*/
GType girara_input_history_get_type(void);
GType girara_input_history_get_type(void) G_GNUC_CONST;
/**
* Create new input history object.
......
......@@ -278,6 +278,24 @@ struct girara_session_private_s
GtkBox* bottom_box; /**< Box grouping input, status and notification */
GtkCssProvider* cssprovider;
} gtk;
struct
{
girara_list_t* statusbar_items; /**< List of statusbar items */
} elements;
struct
{
int n; /**< Numeric buffer */
GString *command; /**< Command in buffer */
} buffer;
struct
{
girara_list_t* handles;
girara_list_t* shortcut_mappings;
girara_list_t* argument_mappings;
} config;
};
#endif
......@@ -9,25 +9,23 @@
#include "types.h"
#include "macros.h"
#define GIRARA_INDIRECT(x) x
/**
* Prints a debug message. The arguments are passed to @ref _girara_log as
* Prints a debug message. The arguments are passed to @ref girara_log as
* last argument.
*/
#define girara_debug(...) girara_log(G_STRLOC, __func__, GIRARA_DEBUG, __VA_ARGS__)
/**
* Prints an info message. The arguments are passed to @ref _girara_log as
* Prints an info message. The arguments are passed to @ref girara_log as
* last argument.
*/
#define girara_info(...) girara_log(G_STRLOC, __func__, GIRARA_INFO, __VA_ARGS__)
/**
* Prints a warning message. The arguments are passed to @ref _girara_log as
* Prints a warning message. The arguments are passed to @ref girara_log as
* last argument.
*/
#define girara_warning(...) girara_log(G_STRLOC, __func__, GIRARA_WARNING, __VA_ARGS__)
/**
* Prints an error message. The arguments are passed to @ref _girara_log as
* Prints an error message. The arguments are passed to @ref girara_log as
* last argument.
*/
#define girara_error(...) girara_log(G_STRLOC, __func__, GIRARA_ERROR, __VA_ARGS__)
......
......@@ -3,6 +3,10 @@
#ifndef GIRARA_MACROS_H
#define GIRARA_MACROS_H
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef GIRARA_PRINTF
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) || defined(__clang__)
# define GIRARA_PRINTF(format_idx, arg_idx) \
......@@ -43,7 +47,8 @@
#endif
#ifndef GIRARA_ALLOC_SIZE
# if defined(__GNUC__)
# if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
(defined(__clang__) && __has_attribute(__alloc_size__))
# define GIRARA_ALLOC_SIZE(...) __attribute__((alloc_size(__VA_ARGS__)))
# else
# define GIRARA_ALLOC_SIZE(x)
......
This diff is collapsed.
......@@ -8,12 +8,10 @@
#include "callbacks.h"
#include <gtk/gtk.h>
#ifdef GDK_WINDOWING_X11
#include <gtk/gtkx.h>
#endif
#include <gdk/gdkkeysyms.h>
#ifndef GDK_WINDOWING_X11
#else
typedef int Window;
#endif
......@@ -29,12 +27,10 @@ struct girara_session_s
GtkBox *statusbar_entries; /**< Statusbar entry box */
GtkWidget *notification_area; /**< The notification area */
GtkWidget *notification_text; /**< The notification entry */
GtkWidget *tabbar; /**< The tabbar */
GtkBox *inputbar_box; /**< Inputbar box */
GtkWidget *inputbar; /**< Inputbar event box */
GtkLabel *inputbar_dialog; /**< Inputbar dialog */
GtkEntry *inputbar_entry; /**< Inputbar entry */
GtkNotebook *tabs; /**< The tabs notebook */
GtkBox *results; /**< Completion results */
Window embed; /**< Embedded window */
} gtk;
......@@ -48,11 +44,6 @@ struct girara_session_s
girara_list_t* inputbar_shortcuts; /**< List of inputbar shortcuts */
} bindings;
struct
{
girara_list_t* statusbar_items; /**< List of statusbar items */
} elements;
struct
{
int inputbar_activate; /**< Inputbar activation */
......@@ -90,19 +81,6 @@ struct girara_session_s
girara_mode_t inputbar; /**< The inputbar mode */
} modes;
struct
{
int n; /**< Numeric buffer */
GString *command; /**< Command in buffer */
} buffer;
struct
{
girara_list_t* handles;
girara_list_t* shortcut_mappings;
girara_list_t* argument_mappings;
} config;