Commit e4da7cf8 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Merge branch 'release/0.2.9'

parents e59fb731 adfbdc13
......@@ -2,19 +2,8 @@
*.do
*.a
*.so*
examples/example_*-gtk*
examples/example_*-gtk*-debug
tests/girara_test-gtk*
.depend
*.pc
version.h
css-definitions.*
*.info
*.gcno
*.gcda
gcov/
*.swp
.version-checks/
doc/doxygen
build
tests/build
# See LICENSE file for license and copyright information
include config.mk
include colors.mk
include common.mk
PROJECTNV = girara
PROJECT = girara-gtk3
SOURCE = $(sort $(wildcard ${PROJECTNV}/*.c))
CSOURCE = $(filter-out ${PROJECTNV}/css-definitions.c, ${SOURCE})
OBJECTS = $(addprefix ${BUILDDIR_RELEASE}/,${CSOURCE:.c=.o}) \
${BUILDDIR_RELEASE}/${PROJECTNV}/css-definitions.o
OBJECTS_DEBUG = $(addprefix ${BUILDDIR_DEBUG}/,${CSOURCE:.c=.o}) \
${BUILDDIR_DEBUG}/${PROJECTNV}/css-definitions.o
OBJECTS_GCOV = $(addprefix ${BUILDDIR_GCOV}/,${CSOURCE:.c=.o}) \
${BUILDDIR_GCOV}/${PROJECTNV}/css-definitions.o
HEADERS = $(filter-out ${PROJECTNV}/internal.h, $(sort $(wildcard ${PROJECTNV}/*.h)))
ifneq (${WITH_LIBNOTIFY},0)
CPPFLAGS += -DWITH_LIBNOTIFY
LIBNOTIFY_PC_NAME = libnotify
else
LIBNOTIFY_PC_NAME =
endif
ifneq (${WITH_JSON},0)
CPPFLAGS += -DWITH_JSON
JSON_PC_NAME = json-c
else
JSON_PC_NAME =
endif
ifeq (,$(findstring -DGETTEXT_PACKAGE,${CPPFLAGS}))
CPPFLAGS += -DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"
endif
ifeq (,$(findstring -DLOCALEDIR,${CPPFLAGS}))
CPPFLAGS += -DLOCALEDIR=\"${LOCALEDIR}\"
endif
UNAME := $(shell uname -s)
ifeq ($(UNAME), Darwin)
SONAME_FLAG = -install_name
SHARED_FLAG = -dynamiclib
SOFILE = lib${PROJECT}.dylib
SOVERSIONFILE = lib${PROJECT}.${SOVERSION}.dylib
SOMAJORFILE = lib${PROJECT}.${SOMAJOR}.dylib
BUILDSOMAJORFILE = ${LIBDIR}/${SOMAJORFILE}
PLATFORMFLAGS = -current_version ${SOVERSION} -compatibility_version ${SOMAJOR}
else
SOFILE = lib${PROJECT}.so
SOVERSIONFILE = ${SOFILE}.${SOVERSION}
SOMAJORFILE = ${SOFILE}.${SOMAJOR}
BUILDSOMAJORFILE = ${SOMAJORFILE}
PLATFORMFLAGS =
endif
all: ${PROJECTNV} ${BUILDDIR}/${PROJECT}.pc po
# pkg-config based version checks
.version-checks/%: config.mk
$(QUIET)test $($(*)_VERSION_CHECK) -eq 0 || \
${PKG_CONFIG} --atleast-version $($(*)_MIN_VERSION) $($(*)_PKG_CONFIG_NAME) || ( \
echo "The minimum required version of $(*) is $($(*)_MIN_VERSION)" && \
false \
)
@mkdir -p .version-checks
$(QUIET)touch $@
options:
@echo ${PROJECTNV} build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "DFLAGS = ${DFLAGS}"
@echo "CC = ${CC}"
@echo "PLATFORMFLAGS = ${PLATFORMFLAGS}"
# generated files
${PROJECTNV}/version.h: ${PROJECTNV}/version.h.in config.mk
$(call colorecho,GEN,$@)
$(QUIET)sed \
-e 's,@GVMAJOR@,${GIRARA_VERSION_MAJOR},' \
-e 's,@GVMINOR@,${GIRARA_VERSION_MINOR},' \
-e 's,@GVREV@,${GIRARA_VERSION_REV},' \
${PROJECTNV}/version.h.in > ${PROJECTNV}/version.h.tmp
$(QUIET)mv ${PROJECTNV}/version.h.tmp ${PROJECTNV}/version.h
${PROJECTNV}/css-definitions.%: data/girara-css.gresource.xml config.mk
$(call colorecho,GEN,$@)
@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 $@))
@mkdir -p ${BUILDDIR}
$(QUIET)sed -e 's,@PROJECT@,${PROJECT},' \
-e 's,@VERSION@,${VERSION},' \
-e 's,@INCLUDEDIR@,${INCLUDEDIR},' \
-e 's,@LIBDIR@,${LIBDIR},' \
-e 's,@LIBNOTIFY_PC_NAME@,${LIBNOTIFY_PC_NAME},' \
-e 's,@JSON_PC_NAME@,${JSON_PC_NAME},' \
${PROJECTNV}.pc.in > $@.tmp
$(QUIET)mv $@.tmp $@
# release build
${OBJECTS}: config.mk \
${PROJECTNV}/version.h \
.version-checks/GTK \
.version-checks/GLIB \
${PROJECTNV}/css-definitions.h
${BUILDDIR_RELEASE}/%.o: %.c
$(call colorecho,CC,$<)
@mkdir -p ${DEPENDDIR}/$(dir $@)
@mkdir -p $(dir $(abspath $@))
$(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $< \
-MMD -MF ${DEPENDDIR}/$@.dep
${BUILDDIR_RELEASE}/${BINDIR}/lib${PROJECT}.a: ${OBJECTS}
$(call colorecho,AR,$@)
@mkdir -p ${BUILDDIR_RELEASE}/${BINDIR}
$(QUIET)${AR} rcs $@ ${OBJECTS}
${BUILDDIR_RELEASE}/${BINDIR}/${SOVERSIONFILE}: ${OBJECTS}
$(call colorecho,LD,$@)
@mkdir -p ${BUILDDIR_RELEASE}/${BINDIR}
$(QUIET)${CC} -Wl,${SONAME_FLAG},${BUILDSOMAJORFILE} \
${SHARED_FLAG} ${PLATFORMFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${LIBS}
${PROJECT}: static shared
${PROJECTNV}: ${PROJECT}
static: ${BUILDDIR_RELEASE}/${BINDIR}/lib${PROJECT}.a
shared: ${BUILDDIR_RELEASE}/${BINDIR}/${SOVERSIONFILE}
release: ${PROJECT}
# debug build
${OBJECT_DEBUG}: config.mk \
${PROJECTNV}/version.h \
.version-checks/GTK \
.version-checks/GLIB \
${PROJECTNV}/css-definitions.h
${BUILDDIR_DEBUG}/%.o: %.c
$(call colorecho,CC,$<)
@mkdir -p ${DEPENDDIR}/$(dir $@)
@mkdir -p $(dir $(abspath $@))
$(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${DFLAGS} -o $@ $< \
-MMD -MF ${DEPENDDIR}/$@.dep
${BUILDDIR_DEBUG}/${BINDIR}/lib${PROJECT}.a: ${OBJECTS_DEBUG}
$(call colorecho,AR,$@)
@mkdir -p ${BUILDDIR_DEBUG}/${BINDIR}
$(QUIET)${AR} rcs $@ ${OBJECTS_DEBUG}
${BUILDDIR_DEBUG}/${BINDIR}/${SOVERSIONFILE}: ${OBJECTS_DEBUG}
$(call colorecho,LD,$@)
@mkdir -p ${BUILDDIR_DEBUG}/${BINDIR}
$(QUIET)${CC} -Wl,${SONAME_FLAG},${BUILDSOMAJORFILE} ${SHARED_FLAG} ${PLATFORMFLAGS} ${LDFLAGS} -o $@ ${OBJECTS_DEBUG} ${LIBS}
${PROJECT}-debug: \
${BUILDDIR_DEBUG}/${BINDIR}/lib${PROJECT}.a \
${BUILDDIR_DEBUG}/${BINDIR}/${SOVERSIONFILE}
debug: ${PROJECT}-debug
# gcov build
${OBJECTS_GCOV}: config.mk \
${PROJECTNV}/version.h \
${PROJECTNV}/css-definitions.h \
.version-checks/GLIB \
.version-checks/GTK
${BUILDDIR_GCOV}/%.o: %.c
$(call colorecho,CC,$<)
@mkdir -p ${DEPENDDIR}/$(dir $@)
@mkdir -p $(dir $(abspath $@))
$(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${GCOV_CFLAGS} \
-o $@ $< -MMD -MF ${DEPENDDIR}/$@.dep
${BUILDDIR_GCOV}/${BINDIR}/lib${PROJECT}.a: ${OBJECTS_GCOV}
$(call colorecho,AR,$@)
@mkdir -p ${BUILDDIR_GCOV}/${BINDIR}
$(QUIET)${AR} rcs $@ ${OBJECTS_GCOV}
${BUILDDIR_GCOV}/${BINDIR}/${SOVERSIONFILE}: ${OBJECTS_GCOV}
$(call colorecho,LD,$@)
@mkdir -p ${BUILDDIR_GCOV}/${BINDIR}
$(QUIET)${CC} -Wl,${SONAME_FLAG},${BUILDSOMAJORFILE} ${SHARED_FLAG} \
${PLATFORMFLAGS} ${GCOV_LDFLAGS} -o $@ ${OBJECTS_GCOV} ${LIBS}
${PROJECT}-gcov: ${BUILDDIR_GCOV}/${BINDIR}/lib${PROJECT}.a
gcov: ${PROJECT}-gcov
run-gcov: options gcov
$(QUIET)${MAKE} -C tests run-gcov
$(call colorecho,LCOV,"Analyse data")
$(QUIET)${LCOV_EXEC} ${LCOV_FLAGS}
$(call colorecho,LCOV,"Generate report")
$(QUIET)${GENHTML_EXEC} ${GENHTML_FLAGS}
# clean
clean:
$(QUIET)rm -rf \
${BUILDDIR} \
${DEPENDDIR} \
${TARFILE} \
${GCDA} \
${GCNO} \
$(PROJECT).info \
gcov \
.version-checks \
${PROJECTNV}/version.h \
${PROJECTNV}/version.h.tmp \
${PROJECTNV}/css-definitions.c \
${PROJECTNV}/css-definitions.h
$(QUIET)$(MAKE) -C tests clean
$(QUIET)$(MAKE) -C po clean
$(QUIET)$(MAKE) -C doc clean
# translations
po:
$(QUIET)${MAKE} -C po
update-po:
$(QUIET)${MAKE} -C po update-po
# documentation
doc:
$(QUIET)$(MAKE) -C doc
# tests
test: ${PROJECT}
$(QUIET)$(MAKE) -C tests run
test-debug: ${PROJECT}-debug
$(QUIET)$(MAKE) -C tests run-debug
# create taball
dist:
$(QUIET)tar -czf $(TARFILE) --exclude=.gitignore \
--transform 's,^,$(PROJECTNV)-$(VERSION)/,' \
`git ls-files`
# install
install-static: static
$(call colorecho,INSTALL,"Install static library")
$(QUIET)mkdir -m 755 -p ${DESTDIR}${LIBDIR}
$(QUIET)install -m 644 ${BUILDDIR_RELEASE}/${BINDIR}/lib${PROJECT}.a ${DESTDIR}${LIBDIR}
install-shared: shared
$(call colorecho,INSTALL,"Install shared library")
$(QUIET)mkdir -m 755 -p ${DESTDIR}${LIBDIR}
$(QUIET)install -m 644 ${BUILDDIR_RELEASE}/${BINDIR}/${SOVERSIONFILE} ${DESTDIR}${LIBDIR}
$(QUIET)ln -sf ${SOVERSIONFILE} ${DESTDIR}${LIBDIR}/${SOMAJORFILE} || \
echo "Failed to create ${SOMAJORFILE}. Please check if it exists and points to the correct version of ${SOFILE}."
$(QUIET)ln -sf ${SOVERSIONFILE} ${DESTDIR}${LIBDIR}/${SOFILE} || \
echo "Failed to create ${SOFILE}. Please check if it exists and points to the correct version of ${SOFILE}."
install-headers: ${PROJECTNV}/version.h ${BUILDDIR}/${PROJECT}.pc
$(call colorecho,INSTALL,"Install pkg-config file")
$(QUIET)mkdir -m 755 -p ${DESTDIR}${LIBDIR}/pkgconfig
$(QUIET)install -m 644 ${BUILDDIR}/${PROJECT}.pc ${DESTDIR}${LIBDIR}/pkgconfig
$(call colorecho,INSTALL,"Install header files")
$(QUIET)mkdir -m 755 -p ${DESTDIR}${INCLUDEDIR}/girara
$(QUIET)install -m 644 ${HEADERS} ${DESTDIR}${INCLUDEDIR}/girara
install-po:
$(QUIET)${MAKE} -C po install
install: install-po install-static install-shared install-headers
# uninstall
uninstall: uninstall-headers
$(call colorecho,UNINSTALL,"Remove library files")
$(QUIET)rm -f ${LIBDIR}/lib${PROJECT}.a ${LIBDIR}/${SOVERSIONFILE} \
${LIBDIR}/${SOMAJORFILE} ${LIBDIR}/${SOFILE}
$(QUIET)${MAKE} -C po uninstall
uninstall-headers:
$(call colorecho,UNINSTALL,"Remove header files")
$(QUIET)rm -rf ${DESTDIR}${INCLUDEDIR}/girara
$(call colorecho,UNINSTALL,"Remove pkg-config file")
$(QUIET)rm -f ${DESTDIR}${LIBDIR}/pkgconfig/${PROJECT}.pc
# format and tidy
format:
clang-tidy -fix -checks=readability-braces-around-statements \
$(SOURCE) -- $(CPPFLAGS) $(CFLAGS)
clang-format -i $(SOURCE) $(HEADERS)
tidy:
clang-tidy $(SOURCE) -- $(CPPFLAGS) $(CFLAGS)
DEPENDS = ${DEPENDDIRS:^=${DEPENDDIR}/}$(addprefix ${DEPENDDIR}/,${OBJECTS:.o=.o.dep})
-include ${DEPENDS}
.PHONY: all options clean debug doc test dist install install-headers uninstall \
uninstall-headers ${PROJECT} ${PROJECT}-debug po update-po \
static shared install-static install-shared
girara - user interface library
===============================
girara is a library that implements a user interface that focuses on simplicity
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
......@@ -9,31 +10,33 @@ enhance the user interface that is used by zathura.
Requirements
------------
meson (>= 0.43)
glib (>= 2.50)
gtk3 (>= 3.20)
intltool
libnotify (optional, for notification support)
jscon-c (optional, for configuration dumping support)
json-c (optional, for configuration dumping support)
Please note that you need to have a working pkg-config installation
and that the Makefile is only compatible with GNU make.
If you don't have a working pkg-config installation, please set the GTK_INC and
GTK_LIB environment variables.
To disable the optional support for libnotify and json-c, configure the build
system with -Denable-notify=false or -Denable-json=false.
Installation
------------
Run the following command to build and install girara to your system:
make install
Run the following command to build and install girara to your system using
meson's ninja backend:
Uninstall
---------
To delete girara from your system, type:
meson build
cd build
ninja
ninja install
make uninstall
Note that the default backend for meson might vary based on the platform. Please
refer to the meson documentation for platform specific dependencies.
Bugs
----
Please report bugs at http://bugs.pwmt.org or contact us on our mailing list at
girara@lists.pwmt.org.
# See LICENSE file for license and copyright information
ifeq ($(COLOR),1)
# GCC diagnostics colors
DIAGNOSTICS_COLOR_AVAILABLE ?= $(shell ($(CC) -fdiagnostics-color=always -E - </dev/null >/dev/null 2>/dev/null && echo 1) || echo 0)
ifeq ($(DIAGNOSTICS_COLOR_AVAILABLE),1)
CPPFLAGS += -fdiagnostics-color=always
endif
# colorful output
TPUT ?= /usr/bin/tput
TPUT_AVAILABLE ?= $(shell ${TPUT} -V 2>/dev/null)
ifdef TPUT_AVAILABLE
COLOR_NORMAL = `$(TPUT) sgr0`
COLOR_ACTION = `$(TPUT) bold``$(TPUT) setaf 3`
COLOR_COMMENT = `$(TPUT) bold``$(TPUT) setaf 2`
COLOR_BRACKET = `$(TPUT) setaf 4`
define colorecho
@echo $(COLOR_BRACKET)" ["$(COLOR_ACTION)$1$(COLOR_BRACKET)"] "$(COLOR_COMMENT)$2$(COLOR_BRACKET) $(COLOR_NORMAL)
endef
else
define colorecho
@echo " [$1]" $2
endef
endif
else
define colorecho
@echo " [$1]" $2
endef
endif
# See LICENSE file for license and copyright information
ifeq "$(VERBOSE)" "0"
ECHO=@echo
QUIET=@
else
ECHO=@\#
QUIET=
endif
# See LICENSE file for license and copyright information
GIRARA_VERSION_MAJOR = 0
GIRARA_VERSION_MINOR = 2
GIRARA_VERSION_REV = 8
VERSION = ${GIRARA_VERSION_MAJOR}.${GIRARA_VERSION_MINOR}.${GIRARA_VERSION_REV}
# Rules for the SOMAJOR and SOMINOR.
# 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 = 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)
# libjson-c
WITH_JSON ?= $(shell (${PKG_CONFIG} json-c --exists && echo 1) || echo 0)
# paths
PREFIX ?= /usr
LIBDIR ?= ${PREFIX}/lib
INCLUDEDIR ?= ${PREFIX}/include
# locale directory
LOCALEDIR ?= ${PREFIX}/share/locale
# build directories
DEPENDDIR ?= .depend
BUILDDIR ?= build
BUILDDIR_RELEASE ?= ${BUILDDIR}/release
BUILDDIR_DEBUG ?= ${BUILDDIR}/debug
BUILDDIR_GCOV ?= ${BUILDDIR}/gcov
BINDIR ?= bin
# version checks
# If you want to disable any of the checks, set *_VERSION_CHECK to 0.
# GTK+
GTK_VERSION_CHECK ?= 1
GTK_MIN_VERSION = 3.20
GTK_PKG_CONFIG_NAME = gtk+-3.0
# glib
GLIB_VERSION_CHECK ?= 1
GLIB_MIN_VERSION = 2.50
GLIB_PKG_CONFIG_NAME = glib-2.0
# libs
ifeq (${GTK_INC}-${GTK_LIB},-)
PKG_CONFIG_LIBS += gtk+-3.0
else
INCS += ${GTK_INC}
LIBS += ${GTK_LIB}
endif
ifneq (${WITH_LIBNOTIFY},0)
ifeq (${LIBNOTIFY_INC}-${LIBNOTIFY_LIB},-)
PKG_CONFIG_LIBS += libnotify
else
INCS += ${LIBNOTIFY_INC}
LIBS += ${LIBNOTIFY_LIB}
endif
endif
ifneq (${WITH_JSON},0)
ifeq (${JSON_INC}-${JSON_LIB},-)
PKG_CONFIG_LIBS += json-c
else
INCS += ${JSON_INC}
LIBS += ${JSON_LIB}
endif
endif
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
# compiler flags
CFLAGS += -std=c11 -pedantic -Wall -Wextra -fPIC $(INCS)
# linker flags
LDFLAGS += -fPIC
# debug
DFLAGS = -O0 -g
# compiler
CC ?= gcc
# archiver
AR ?= ar
# strip
SFLAGS ?= -s
# soname
SONAME_FLAG ?= -soname
SHARED_FLAG ?= -shared
# set to something != 0 if you want verbose build output
VERBOSE ?= 0
# gettext package name
GETTEXT_PACKAGE ?= lib${PROJECT}-${SOMAJOR}
# msgfmt
MSGFMT ?= msgfmt
# gcov & lcov
GCOV_CFLAGS=-fprofile-arcs -ftest-coverage
GCOV_LDFLAGS=-fprofile-arcs
LCOV_OUTPUT=gcov
LCOV_EXEC=lcov
LCOV_FLAGS=--base-directory . --directory ${BUILDDIR_GCOV} --capture --rc \
lcov_branch_coverage=1 --output-file ${BUILDDIR_GCOV}/$(PROJECT).info
GENHTML_EXEC=genhtml
GENHTML_FLAGS=--rc lcov_branch_coverage=1 --output-directory ${LCOV_OUTPUT} ${BUILDDIR_GCOV}/$(PROJECT).info
# colors
COLOR ?= 1
# dist
TARFILE = ${PROJECTNV}-${VERSION}.tar.gz
gnome = import('gnome')
girara_css = gnome.compile_resources(
'css-definitions',
'girara-css.gresource.xml',
c_name: 'girara_css',
dependencies: files('girara.css_t')
)
......@@ -2,7 +2,7 @@
# General information
PROJECT_NAME = girara
OUTPUT_DIRECTORY = build
OUTPUT_DIRECTORY = @DOXYGEN_OUTPUT@
OUTPUT_LANGUAGE = English
TAB_SIZE = 2
EXTRACT_ALL = YES
......@@ -16,7 +16,7 @@ WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
# Input files
INPUT = ../
INPUT = @DOXYGEN_INPUT@
EXCLUDE = ../tests
FILE_PATTERNS = *.h
RECURSIVE = YES
......
# See LICENSE file for license and copyright information
include ../config.mk
include ../common.mk
include ../colors.mk
include config.mk
DOXYGEN_SOURCES=$(wildcard ../*.h) Doxyfile
all: html
html: ${DOXYGEN_BUILDDIR}/html/index.html
clean:
$(call colorecho,RM,doc/${DOXYGEN_BUILDDIR})
$(QUIET)rm -rf ${DOXYGEN_BUILDDIR}
${DOXYGEN_BUILDDIR}/html/index.html:
$(call colorecho,DOC,"Build HTML documentation")
$(QUIET)${DOXYGEN_BIN} Doxyfile
.PHONY: clean html all
# See LICENSE file for license and copyright information
DOXYGEN_BIN ?= doxygen
DOXYGEN_BUILDDIR ?= build
doxygen = find_program('doxygen', required: false)
if get_option('enable-docs') and doxygen.found()
conf_data = configuration_data()
conf_data.set('DOXYGEN_INPUT', meson.source_root())
conf_data.set('DOXYGEN_OUTPUT', meson.current_build_dir())
doxyfile = configure_file(
input: 'Doxyfile.in',
output: 'Doxyfile',
configuration: conf_data
)
custom_target('doc',
build_by_default: true,
command: [doxygen, doxyfile],
output: ['html']
)
endif
project=@PROJECT@
version=@VERSION@
includedir=@INCLUDEDIR@
libdir=@LIBDIR@
GTK_VERSION=3
Name: ${project}
Description: User interface libray
Version: ${version}
URL: http://pwmt.org/projects/girara
Cflags: -I${includedir}
Libs: -L${libdir} -l${project}
Requires.private: gtk+-3.0 @LIBNOTIFY_PC_NAME@ @JSON_PC_NAME@
This diff is collapsed.
......@@ -14,7 +14,7 @@
#include <string.h>
/* default commands implementation */
bool
static bool
girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list,
bool unmap)
{
......@@ -132,13 +132,13 @@ girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list,
if (tmp_length >= 3 && tmp[0] == '[' && tmp[tmp_length - 1] == ']') {
char* tmp_inner = g_strndup(tmp + 1, tmp_length - 2);
GIRARA_LIST_FOREACH(session->modes.identifiers, girara_mode_string_t*, iter, mode)
GIRARA_LIST_FOREACH_BODY(session->modes.identifiers, girara_mode_string_t*, mode,
if (!g_strcmp0(tmp_inner, mode->name)) {
shortcut_mode = mode->index;
is_mode = true;
break;
}
GIRARA_LIST_FOREACH_END(session->modes.identifiers, girara_mode_string_t*, iter, mode);
);
if (is_mode == false) {
girara_warning("Unregistered mode specified: %s", tmp_inner);
......@@ -322,13 +322,13 @@ girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list,
/* Check for passed shortcut command */
if (unmap == false) {
bool found_mapping = false;
GIRARA_LIST_FOREACH(session_private->config.shortcut_mappings, girara_shortcut_mapping_t*, iter, mapping)
GIRARA_LIST_FOREACH_BODY(session_private->config.shortcut_mappings, girara_shortcut_mapping_t*, mapping,
if (!g_strcmp0(tmp, mapping->identifier)) {
shortcut_function = mapping->function;
found_mapping = true;
break;
}
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);
......@@ -345,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_private->config.argument_mappings, girara_argument_mapping_t*, iter, mapping)
GIRARA_LIST_FOREACH_BODY(session_private->config.argument_mappings, girara_argument_mapping_t*, mapping,
if (!g_strcmp0(tmp, mapping->identifier)) {
shortcut_argument_n = mapping->value;
break;
}
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) {
......@@ -534,8 +534,9 @@ girara_inputbar_command_add(girara_session_t* session, const char* command,
g_return_val_if_fail(command != NULL, false);
g_return_val_if_fail(function != NULL, false);
bool found = false;
/* search for existing binding */
GIRARA_LIST_FOREACH(session->bindings.commands, girara_command_t*, iter, commands_it)
GIRARA_LIST_FOREACH_BODY(session->bindings.commands, girara_command_t*, commands_it,
if (g_strcmp0(commands_it->command, command) == 0) {
g_free(commands_it->abbr);
g_free(commands_it->description);
......@@ -545,20 +546,22 @@ girara_inputbar_command_add(girara_session_t* session, const char* command,
commands_it->completion = completion;
commands_it->description = description ? g_strdup(description) : NULL;
girara_list_iterator_free(iter);
return true;
found = true;
break;
}
GIRARA_LIST_FOREACH_END(session->bindings.commands, girara_command_t*, iter, commands_it);
/* add new inputbar command */
girara_command_t* new_command = g_slice_new(girara_command_t);
new_command->command = g_strdup(command);
new_command->abbr = abbreviation ? g_strdup(abbreviation) : NULL;
new_command->function = function;
new_command->completion = completion;
new_command->description = description ? g_strdup(description) : NULL;
girara_list_append(session->bindings.commands, new_command);