Commit 1cea27ca authored by Moritz Lipp's avatar Moritz Lipp

Merge branch 'develop'

parents 5fda98be 3f9d0a90
girara is written by:
Moritz Lipp <mlq@pwmt.org>
Sebastian Ramacher <s.ramacher@gmx.at>
Sebastian Ramacher <sebastian+dev@ramacher.at>
Other contributors are (in alphabetical order):
Other contributors are (in no particular order):
Pavel Borzenkov <pavel.borzenkov@gmail.com>
William Dealey <william.dealey@gmail.com>
Oliver Mader <dotb52@gmail.com>
Maxime de Roucy <maxime.deroucy@gmail.com>
Marwan Tanager <marwan.tngr@gmail.com>
Benoît Knecht <benoit.knecht@fsfe.org>
Copyright (c) 2010-2012 pwmt.org
Copyright (c) 2010-2013 pwmt.org
This software is provided 'as-is', without any express or implied warranty. In
no event will the authors be held liable for any damages arising from the use of
......
......@@ -4,6 +4,7 @@
#include "datastructures.h"
#include "session.h"
#include "shortcuts.h"
#include "input-history.h"
#include <string.h>
#include <glib/gi18n-lib.h>
......@@ -399,10 +400,8 @@ girara_callback_inputbar_activate(GtkEntry* entry, girara_session_t* session)
}
/* append to command history */
if (session->global.command_history != NULL) {
const char* command = gtk_entry_get_text(entry);
girara_list_append(session->global.command_history, g_strdup(command));
}
const char* command = gtk_entry_get_text(entry);
girara_input_history_append(session->command_history, command);
/* parse input */
gchar** argv = NULL;
......@@ -576,7 +575,7 @@ girara_callback_inputbar_changed_event(GtkEditable* entry, girara_session_t* ses
special_command->function(session, input, &(special_command->argument));
g_free(input);
girara_list_iterator_free(iter);
return false;
return true;
}
GIRARA_LIST_FOREACH_END(session->bindings.special_commands, girara_special_command_t*, iter, special_command);
......
......@@ -105,12 +105,11 @@ girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list,
size_t number_of_arguments = girara_list_size(argument_list);
if (number_of_arguments < ((unmap == true) ? 1 : 2)) {
if (unmap == true) {
girara_notify(session, GIRARA_WARNING, _("Usage: unmap <binding>"));
} else {
girara_notify(session, GIRARA_WARNING, _("Usage: map <binding> <function>"));
}
unsigned int limit = (unmap == true) ? 1 : 2;
if (number_of_arguments < limit) {
girara_warning("Invalid number of arguments passed: %zu instead of at least %u", number_of_arguments, limit);
girara_notify(session, GIRARA_ERROR,
_("Invalid number of arguments passed: %zu instead of at least %u"), number_of_arguments, limit);
return false;
}
......@@ -151,14 +150,6 @@ girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list,
g_free(tmp_inner);
}
unsigned int limit = (unmap == true) ? 1 : 2;
if (number_of_arguments < limit) {
girara_warning("Invalid number of arguments passed: %zu instead of at least %u", number_of_arguments, limit);
girara_notify(session, GIRARA_ERROR,
_("Invalid number of arguments passed: %zu instead of at least %u"), number_of_arguments, limit);
return false;
}
if (is_mode == true) {
tmp = girara_list_nth(argument_list, ++current_command);
tmp_length = strlen(tmp);
......@@ -170,7 +161,7 @@ girara_cmd_map_unmap(girara_session_t* session, girara_list_t* argument_list,
tmp_length = strlen(tmp);
/* Multi key shortcut */
if (strchr(tmp, '-') != NULL && tmp_length > 2) {
if (strchr(tmp, '-') != NULL && tmp[1] == '-' && tmp_length > 2) {
switch (tmp[0]) {
case 'S':
shortcut_mask = GDK_SHIFT_MASK;
......
......@@ -498,7 +498,7 @@ girara_completion_row_create(girara_session_t* session, const char* command, con
GtkLabel *show_description = GTK_LABEL(gtk_label_new(NULL));
gtk_misc_set_alignment(GTK_MISC(show_command), 0.0, 0.0);
gtk_misc_set_alignment(GTK_MISC(show_description), 0.0, 0.0);
gtk_misc_set_alignment(GTK_MISC(show_description), 1.0, 0.0);
if (group == true) {
gtk_misc_set_padding(GTK_MISC(show_command), 2, 4);
......@@ -535,7 +535,7 @@ girara_completion_row_create(girara_session_t* session, const char* command, con
gtk_widget_override_font(GTK_WIDGET(show_description), session->style.font);
gtk_box_pack_start(GTK_BOX(col), GTK_WIDGET(show_command), TRUE, TRUE, 2);
gtk_box_pack_start(GTK_BOX(col), GTK_WIDGET(show_description), FALSE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(col), GTK_WIDGET(show_description), TRUE, TRUE, 2);
gtk_container_add(GTK_CONTAINER(row), GTK_WIDGET(col));
gtk_widget_show_all(GTK_WIDGET(row));
......
......@@ -56,6 +56,12 @@ cb_font(girara_session_t* session, const char* UNUSED(name),
if (session->gtk.notification_text != NULL) {
gtk_widget_override_font(GTK_WIDGET(session->gtk.notification_text), font);
}
GIRARA_LIST_FOREACH(session->elements.statusbar_items, girara_statusbar_item_t *, iter, item)
if (item != NULL){
gtk_widget_override_font(GTK_WIDGET(item->text), font);
}
GIRARA_LIST_FOREACH_END(session->elements.statusbar_items, girara_statusbar_item_t *, iter, item);
}
static void
......@@ -103,6 +109,21 @@ cb_guioptions(girara_session_t* session, const char* UNUSED(name),
}
}
static void
cb_scrollbars(girara_session_t* session, const char* UNUSED(name),
girara_setting_type_t UNUSED(type), void* value, void* UNUSED(data))
{
g_return_if_fail(session != NULL && value != NULL);
if (*(bool*) value == true) {
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(session->gtk.view),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
} else {
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(session->gtk.view),
GTK_POLICY_NEVER, GTK_POLICY_NEVER);
}
}
void
girara_config_load_default(girara_session_t* session)
{
......@@ -148,7 +169,7 @@ girara_config_load_default(girara_session_t* session)
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, "n-completion-items", &n_completion_items, INT, TRUE, _("Number of completion items"), NULL, NULL);
girara_setting_add(session, "show-scrollbars", &show_scrollbars, BOOLEAN, TRUE, _("Show scrollbars"), NULL, NULL);
girara_setting_add(session, "show-scrollbars", &show_scrollbars, BOOLEAN, FALSE, _("Show scrollbars"), cb_scrollbars, NULL);
girara_setting_add(session, "window-icon", "", STRING, FALSE, _("Window icon"), cb_window_icon, NULL);
girara_setting_add(session, "exec-command", "", STRING, FALSE, _("Command to execute in :exec"), NULL, NULL);
girara_setting_add(session, "guioptions", "s", STRING, FALSE, _("Show or hide certain GUI elements"), cb_guioptions, NULL);
......@@ -177,10 +198,14 @@ girara_config_load_default(girara_session_t* session)
girara_inputbar_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_w, girara_isc_string_manipulation, GIRARA_DELETE_LAST_WORD, NULL);
girara_inputbar_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_f, girara_isc_string_manipulation, GIRARA_NEXT_CHAR, NULL);
girara_inputbar_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_b, girara_isc_string_manipulation, GIRARA_PREVIOUS_CHAR, NULL);
girara_inputbar_shortcut_add(session, 0, GDK_KEY_Right, girara_isc_string_manipulation, GIRARA_NEXT_CHAR, NULL);
girara_inputbar_shortcut_add(session, 0, GDK_KEY_Left, girara_isc_string_manipulation, GIRARA_PREVIOUS_CHAR, NULL);
girara_inputbar_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_a, girara_isc_string_manipulation, GIRARA_GOTO_START, NULL);
girara_inputbar_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_e, girara_isc_string_manipulation, GIRARA_GOTO_END, NULL);
girara_inputbar_shortcut_add(session, 0, GDK_KEY_Up, girara_isc_command_history, GIRARA_PREVIOUS, NULL);
girara_inputbar_shortcut_add(session, 0, GDK_KEY_Down, girara_isc_command_history, GIRARA_NEXT, NULL);
girara_inputbar_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_p, girara_isc_command_history, GIRARA_PREVIOUS, NULL);
girara_inputbar_shortcut_add(session, GDK_CONTROL_MASK, GDK_KEY_n, girara_isc_command_history, GIRARA_NEXT, NULL);
/* commands */
girara_inputbar_command_add(session, "exec", NULL, girara_cmd_exec, NULL, _("Execute a command"));
......
......@@ -2,7 +2,7 @@
GIRARA_VERSION_MAJOR = 0
GIRARA_VERSION_MINOR = 1
GIRARA_VERSION_REV = 5
GIRARA_VERSION_REV = 6
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:
......@@ -12,7 +12,7 @@ VERSION = ${GIRARA_VERSION_MAJOR}.${GIRARA_VERSION_MINOR}.${GIRARA_VERSION_REV}
# bump SOMAJOR and set SOMINOR to 0.
# * If a function has been added bump SOMINOR.
SOMAJOR = 1
SOMINOR = 0
SOMINOR = 1
SOVERSION = ${SOMAJOR}.${SOMINOR}
# paths
......
......@@ -154,7 +154,7 @@ girara_list_iterator_t* girara_list_iterator(girara_list_t* list);
/**
* Create an iterator pointing to the same element as iter.
*
* @param list The girara list object
* @param iter The girara list iterator to be copied
* @return The list iterator or NULL if an error occured
*/
girara_list_iterator_t* girara_list_iterator_copy(girara_list_iterator_t* iter);
......@@ -245,7 +245,7 @@ void girara_list_foreach(girara_list_t* list, girara_list_callback_t callback,
do { \
girara_list_iterator_t* iter = girara_list_iterator(list); \
while (girara_list_iterator_is_valid(iter)) { \
type data = girara_list_iterator_data(iter);
type data = (type)girara_list_iterator_data(iter);
#define GIRARA_LIST_FOREACH_END(list, type, iter, data) \
girara_list_iterator_next(iter); \
......
......@@ -15,5 +15,6 @@
#include "shortcuts.h"
#include "commands.h"
#include "callbacks.h"
#include "input-history.h"
#endif
/* See LICENSE file for license and copyright information */
#include "input-history.h"
#include "macros.h"
G_DEFINE_INTERFACE(GiraraInputHistoryIO, girara_input_history_io, G_TYPE_OBJECT)
static void
girara_input_history_io_default_init(GiraraInputHistoryIOInterface* GIRARA_UNUSED(iface))
{
}
void
girara_input_history_io_append(GiraraInputHistoryIO* io, const char* input)
{
g_return_if_fail(GIRARA_IS_INPUT_HISTORY_IO(io) == true);
GIRARA_INPUT_HISTORY_IO_GET_INTERFACE(io)->append(io, input);
}
girara_list_t* girara_input_history_io_read(GiraraInputHistoryIO* io)
{
g_return_val_if_fail(GIRARA_IS_INPUT_HISTORY_IO(io) == true, NULL);
return GIRARA_INPUT_HISTORY_IO_GET_INTERFACE(io)->read(io);
}
/* See LICENSE file for license and copyright information */
#include "input-history.h"
#include "datastructures.h"
G_DEFINE_TYPE(GiraraInputHistory, girara_input_history, G_TYPE_OBJECT)
/**
* Private data of the settings manager
*/
typedef struct ih_private_s {
girara_list_t* history; /**< List of stored inputs */
bool reset; /**< Show history starting from the most recent command */
size_t current;
size_t current_match;
GiraraInputHistoryIO* io;
char* command_line;
} ih_private_t;
#define GIRARA_INPUT_HISTORY_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIRARA_TYPE_INPUT_HISTORY, \
ih_private_t))
/* Methods */
static void ih_finalize(GObject* object);
static void ih_set_property(GObject* object, guint prop_id,
const GValue* value, GParamSpec* pspec);
static void ih_get_property(GObject* object, guint prop_id, GValue* value,
GParamSpec* pspec);
static void ih_append(GiraraInputHistory* history, const char* input);
static girara_list_t* ih_list(GiraraInputHistory* history);
static const char* ih_next(GiraraInputHistory* history,
const char* current_input);
static const char* ih_previous(GiraraInputHistory* history,
const char* current_input);
static void ih_reset(GiraraInputHistory* history);
/* Properties */
enum {
PROP_0,
PROP_IO
};
/* Class init */
static void
girara_input_history_class_init(GiraraInputHistoryClass* class)
{
/* add private members */
g_type_class_add_private(class, sizeof(ih_private_t));
/* overwrite methods */
GObjectClass* object_class = G_OBJECT_CLASS(class);
object_class->finalize = ih_finalize;
object_class->set_property = ih_set_property;
object_class->get_property = ih_get_property;
class->append = ih_append;
class->list = ih_list;
class->next = ih_next;
class->previous = ih_previous;
class->reset = ih_reset;
/* properties */
g_object_class_install_property(object_class, PROP_IO,
g_param_spec_object("io", "history reader/writer",
"GiraraInputHistoryIO object used to read and write history",
girara_input_history_io_get_type(),
G_PARAM_WRITABLE | G_PARAM_READABLE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
}
/* Object init */
static void
girara_input_history_init(GiraraInputHistory* history)
{
ih_private_t* priv = GIRARA_INPUT_HISTORY_GET_PRIVATE(history);
priv->history = girara_list_new2((girara_free_function_t) g_free);
priv->reset = true;
priv->io = NULL;
}
/* GObject finalize */
static void
ih_finalize(GObject* object)
{
ih_private_t* priv = GIRARA_INPUT_HISTORY_GET_PRIVATE(object);
girara_list_free(priv->history);
g_free(priv->command_line);
if (priv->io != NULL) {
g_object_unref(priv->io);
}
G_OBJECT_CLASS(girara_input_history_parent_class)->finalize(object);
}
/* GObject set_property */
static void
ih_set_property(GObject* object, guint prop_id, const GValue* value,
GParamSpec* pspec)
{
ih_private_t* priv = GIRARA_INPUT_HISTORY_GET_PRIVATE(object);
switch (prop_id) {
case PROP_IO: {
if (priv->io != NULL) {
g_object_unref(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;
}
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
/* GObject get_property */
static void
ih_get_property(GObject* object, guint prop_id, GValue* value,
GParamSpec* pspec)
{
ih_private_t* priv = GIRARA_INPUT_HISTORY_GET_PRIVATE(object);
switch (prop_id) {
case PROP_IO:
g_value_set_object(value, priv->io);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
/* Object new */
GiraraInputHistory*
girara_input_history_new(GiraraInputHistoryIO* io)
{
return GIRARA_INPUT_HISTORY(g_object_new(GIRARA_TYPE_INPUT_HISTORY, "io",
io, NULL));
}
/* Method implementions */
static void
ih_append(GiraraInputHistory* history, const char* input)
{
if (input == NULL) {
return;
}
girara_list_t* list = girara_input_history_list(history);
if (list == NULL) {
return;
}
void* data = NULL;
while ((data = girara_list_find(list, (girara_compare_function_t) g_strcmp0, data)) != NULL) {
girara_list_remove(list, data);
}
girara_list_append(list, g_strdup(input));
ih_private_t* priv = GIRARA_INPUT_HISTORY_GET_PRIVATE(history);
if (priv->io != NULL) {
girara_input_history_io_append(priv->io, input);
}
/* begin from the last command when navigating through history */
girara_input_history_reset(history);
}
static girara_list_t*
ih_list(GiraraInputHistory* history)
{
ih_private_t* priv = GIRARA_INPUT_HISTORY_GET_PRIVATE(history);
return priv->history;
}
static const char*
find_next(GiraraInputHistory* history, const char* current_input, bool next)
{
ih_private_t* priv = GIRARA_INPUT_HISTORY_GET_PRIVATE(history);
girara_list_t* list = girara_input_history_list(history);
if (list == NULL) {
return NULL;
}
size_t length = girara_list_size(list);
if (length == 0) {
return NULL;
}
if (priv->reset == true) {
priv->current = length;
priv->current_match = priv->current;
}
/* Before moving into the history, save the current command-line. */
if (priv->current_match == length) {
g_free(priv->command_line);
priv->command_line = g_strdup(current_input);
}
size_t i = 0;
const char* command = NULL;
while (i < length) {
if (priv->reset == true || next == false) {
if (priv->current < 1) {
priv->reset = false;
priv->current = priv->current_match;
return NULL;
} else {
--priv->current;
}
} else if (next == true) {
if (priv->current + 1 >= length) {
/* At the bottom of the history, return what the command-line was. */
priv->current_match = length;
priv->current = priv->current_match;
return priv->command_line;
} else {
++priv->current;
}
} else {
return NULL;
}
command = girara_list_nth(list, priv->current);
if (command == NULL) {
return NULL;
}
/* Only match history items starting with what was on the command-line. */
if (g_str_has_prefix(command, priv->command_line)) {
priv->reset = false;
priv->current_match = priv->current;
break;
}
++i;
}
if (i == length) {
return NULL;
}
return command;
}
static const char*
ih_next(GiraraInputHistory* history, const char* current_input)
{
return find_next(history, current_input, true);
}
static const char*
ih_previous(GiraraInputHistory* history, const char* current_input)
{
return find_next(history, current_input, false);
}
static void
ih_reset(GiraraInputHistory* history)
{
ih_private_t* priv = GIRARA_INPUT_HISTORY_GET_PRIVATE(history);
priv->reset = true;
if (priv->io != NULL) {
girara_list_t* list = girara_input_history_list(history);
if (list == NULL) {
return;
}
girara_list_clear(list);
girara_list_t* newlist = girara_input_history_io_read(priv->io);
if (newlist != NULL) {
GIRARA_LIST_FOREACH(newlist, const char*, iter, data)
girara_list_append(list, g_strdup(data));
GIRARA_LIST_FOREACH_END(newlist, const char*, iter, data);
girara_list_free(newlist);
}
}
}
/* Wrapper functions for the members */
void
girara_input_history_append(GiraraInputHistory* history, const char* input)
{
g_return_if_fail(GIRARA_IS_INPUT_HISTORY(history) == true);
GIRARA_INPUT_HISTORY_GET_CLASS(history)->append(history, input);
}
girara_list_t*
girara_input_history_list(GiraraInputHistory* history)
{
g_return_val_if_fail(GIRARA_IS_INPUT_HISTORY(history) == true, NULL);
return GIRARA_INPUT_HISTORY_GET_CLASS(history)->list(history);
}
const char*
girara_input_history_next(GiraraInputHistory* history, const char* current_input)
{
g_return_val_if_fail(GIRARA_IS_INPUT_HISTORY(history) == true, NULL);
return GIRARA_INPUT_HISTORY_GET_CLASS(history)->next(history, current_input);
}
const char*
girara_input_history_previous(GiraraInputHistory* history, const char* current_input)
{
g_return_val_if_fail(GIRARA_IS_INPUT_HISTORY(history) == true, NULL);
return GIRARA_INPUT_HISTORY_GET_CLASS(history)->previous(history, current_input);
}
void
girara_input_history_reset(GiraraInputHistory* history)
{
g_return_if_fail(GIRARA_IS_INPUT_HISTORY(history) == true);
GIRARA_INPUT_HISTORY_GET_CLASS(history)->reset(history);
}
/* See LICENSE file for license and copyright information */
#ifndef GIRARA_INPUT_HISTORY_H
#define GIRARA_INPUT_HISTORY_H
#include <glib-object.h>
#include "types.h"
struct girara_input_history_io_interface_s {
GTypeInterface parent_iface;
/* interface methords */
/**
* Write a line of input to the input history storage.
*
* @param io a GiraraInputHistoryIO object
* @param input the input
*/
void (*append)(GiraraInputHistoryIO* io, const char* input);
/**
* Read all items from the input history storage.
*
* @param io a GiraraInputHistoryIO object
* @returns a list of inputs
*/
girara_list_t* (*read)(GiraraInputHistoryIO* io);
/* reserved for further methods */
void (*reserved1)(void);
void (*reserved2)(void);
void (*reserved3)(void);
void (*reserved4)(void);
};
#define GIRARA_TYPE_INPUT_HISTORY_IO \
(girara_input_history_io_get_type())
#define GIRARA_INPUT_HISTORY_IO(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), GIRARA_TYPE_INPUT_HISTORY_IO, GiraraInputHistoryIO))
#define GIRARA_IS_INPUT_HISTORY_IO(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GIRARA_TYPE_INPUT_HISTORY_IO))
#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);
void girara_input_history_io_append(GiraraInputHistoryIO* io, const char* input);
girara_list_t* girara_input_history_io_read(GiraraInputHistoryIO* io);
struct girara_input_history_s {
GObject parent;
};
struct girara_input_history_class_s {
GObjectClass parent_class;
/* methods */
/**
* Append a new line of input. If the io property is set, the input will
* be passed on to @ref girara_input_history_io_append.
*
* @param history an input history instance
* @param input the input
*/
void (*append)(GiraraInputHistory* history, const char* input);
/**
* Get a list of all the inputs stored.
*
* @param history an input history instance
* @returns a list containing all inputs
*/
girara_list_t* (*list)(GiraraInputHistory* history);
/**
* Get the "next" input from the history
*
* @param history an input history instance
* @param current_input input used to find the "next" input
* @returns "next" input
*/
const char* (*next)(GiraraInputHistory* history, const char* current_input);
/**
* Get the "previous" input from the history
*
* @param history an input history instance
* @param current_input input used to find the "next" input
* @returns "previous" input
*/
const char* (*previous)(GiraraInputHistory* history, const char* current_input);
/**
* Reset state of the input history, i.e reset any information used to
* determine the next input. If the io property is set, the history will be
* re-read with @ref girara_input_history_io_read.
*
* @param history an input history instance
*/
void (*reset)(GiraraInputHistory* history);
/* reserved for further methods */
void (*reserved1)(void);
void (*reserved2)(void);
void (*reserved3)(void);
void (*reserved4)(void);
};
#define GIRARA_TYPE_INPUT_HISTORY \
(girara_input_history_get_type ())
#define GIRARA_INPUT_HISTORY(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GIRARA_TYPE_INPUT_HISTORY, GiraraInputHistory))
#define GIRARA_INPUT_HISTORY_CLASS(obj) \
(G_TYPE_CHECK_CLASS_CAST ((obj), GIRARA_TYPE_INPUT_HISTORY, GiraraInputHistoryClass))
#define GIRARA_IS_INPUT_HISTORY(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIRARA_TYPE_INPUT_HISTORY))
#define GIRARA_IS_INPUT_HISTORY_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE ((obj), GIRARA_TYPE_INPUT_HISTORY))
#define GIRARA_INPUT_HISTORY_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GIRARA_TYPE_INPUT_HISTORY, GiraraInputHistoryClass))
/**
* Returns the type of the input history.
*
* @return the type
*/
GType girara_input_history_get_type(void);
/**
* Create new input history object.
*
* @param io a GiraraInputHistoryIO instance, may be NULL
* @returns an input history object
*/
GiraraInputHistory* girara_input_history_new(GiraraInputHistoryIO* io);
/**
* Append a new line of input.
*
* @param history an input history instance
* @param input the input
*/
void girara_input_history_append(GiraraInputHistory* history, const char* input);
/**
* Get the "next" input from the history
*
* @param history an input history instance
* @param current_input input used to find the "next" input
* @returns "next" input
*/
const char* girara_input_history_next(GiraraInputHistory* history,
const char* current_input);
/**
* Get the "previous" input from the history
*
* @param history an input history instance
* @param current_input input used to find the "next" input
* @returns "previous" input
*/
const char* girara_input_history_previous(GiraraInputHistory* history,
const char* current_input);
/**
* Reset state of the input history
*
* @param history an input history instance
*/