girara
input-history.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Zlib */
2 
3 #ifndef GIRARA_INPUT_HISTORY_H
4 #define GIRARA_INPUT_HISTORY_H
5 
6 #include <glib-object.h>
7 #include "macros.h"
8 #include "types.h"
9 
11  GTypeInterface parent_iface;
12 
13  /* interface methods */
14 
21  void (*append)(GiraraInputHistoryIO* io, const char* input);
22 
30 
31  /* reserved for further methods */
32  void (*reserved1)(void);
33  void (*reserved2)(void);
34  void (*reserved3)(void);
35  void (*reserved4)(void);
36 };
37 
38 #define GIRARA_TYPE_INPUT_HISTORY_IO \
39  (girara_input_history_io_get_type())
40 #define GIRARA_INPUT_HISTORY_IO(obj) \
41  (G_TYPE_CHECK_INSTANCE_CAST((obj), GIRARA_TYPE_INPUT_HISTORY_IO, GiraraInputHistoryIO))
42 #define GIRARA_IS_INPUT_HISTORY_IO(obj) \
43  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GIRARA_TYPE_INPUT_HISTORY_IO))
44 #define GIRARA_INPUT_HISTORY_IO_GET_INTERFACE(obj) \
45  (G_TYPE_INSTANCE_GET_INTERFACE((obj), GIRARA_TYPE_INPUT_HISTORY_IO, GiraraInputHistoryIOInterface))
46 
48 
50 
52 
53 
55  GObject parent;
56 };
57 
59  GObjectClass parent_class;
60 
61  /* methods */
62 
70  void (*append)(GiraraInputHistory* history, const char* input);
71 
78  girara_list_t* (*list)(GiraraInputHistory* history);
79 
87  const char* (*next)(GiraraInputHistory* history, const char* current_input);
88 
96  const char* (*previous)(GiraraInputHistory* history, const char* current_input);
97 
105  void (*reset)(GiraraInputHistory* history);
106 
107  /* reserved for further methods */
108  void (*reserved1)(void);
109  void (*reserved2)(void);
110  void (*reserved3)(void);
111  void (*reserved4)(void);
112 };
113 
114 #define GIRARA_TYPE_INPUT_HISTORY \
115  (girara_input_history_get_type())
116 #define GIRARA_INPUT_HISTORY(obj) \
117  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIRARA_TYPE_INPUT_HISTORY, GiraraInputHistory))
118 #define GIRARA_INPUT_HISTORY_CLASS(obj) \
119  (G_TYPE_CHECK_CLASS_CAST ((obj), GIRARA_TYPE_INPUT_HISTORY, GiraraInputHistoryClass))
120 #define GIRARA_IS_INPUT_HISTORY(obj) \
121  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIRARA_TYPE_INPUT_HISTORY))
122 #define GIRARA_IS_INPUT_HISTORY_CLASS(obj) \
123  (G_TYPE_CHECK_CLASS_TYPE ((obj), GIRARA_TYPE_INPUT_HISTORY))
124 #define GIRARA_INPUT_HISTORY_GET_CLASS(obj) \
125  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIRARA_TYPE_INPUT_HISTORY, GiraraInputHistoryClass))
126 
133 
141 
148 void girara_input_history_append(GiraraInputHistory* history, const char* input) GIRARA_VISIBLE;
149 
157 const char* girara_input_history_next(GiraraInputHistory* history,
158  const char* current_input) GIRARA_VISIBLE;
159 
167 const char* girara_input_history_previous(GiraraInputHistory* history,
168  const char* current_input) GIRARA_VISIBLE;
169 
175 void girara_input_history_reset(GiraraInputHistory* history) GIRARA_VISIBLE;
176 
184 
185 #endif
girara_input_history_io_interface_s::reserved4
void(* reserved4)(void)
Definition: input-history.h:35
girara_input_history_reset
void girara_input_history_reset(GiraraInputHistory *history) GIRARA_VISIBLE
girara_input_history_io_interface_s::parent_iface
GTypeInterface parent_iface
Definition: input-history.h:11
girara_input_history_io_read
girara_list_t * girara_input_history_io_read(GiraraInputHistoryIO *io) GIRARA_VISIBLE
girara_input_history_class_s::reserved1
void(* reserved1)(void)
Definition: input-history.h:108
GIRARA_VISIBLE
#define GIRARA_VISIBLE
Definition: macros.h:54
types.h
girara_input_history_class_s
Definition: input-history.h:58
girara_input_history_next
const char * girara_input_history_next(GiraraInputHistory *history, const char *current_input) GIRARA_VISIBLE
girara_input_history_get_type
GType girara_input_history_get_type(void) G_GNUC_CONST GIRARA_VISIBLE
macros.h
girara_input_history_io_interface_s::reserved3
void(* reserved3)(void)
Definition: input-history.h:34
girara_input_history_s::parent
GObject parent
Definition: input-history.h:55
girara_input_history_previous
const char * girara_input_history_previous(GiraraInputHistory *history, const char *current_input) GIRARA_VISIBLE
girara_input_history_io_interface_s
Definition: input-history.h:10
girara_input_history_io_append
void girara_input_history_io_append(GiraraInputHistoryIO *io, const char *input) GIRARA_VISIBLE
girara_input_history_class_s::reserved4
void(* reserved4)(void)
Definition: input-history.h:111
girara_input_history_list
girara_list_t * girara_input_history_list(GiraraInputHistory *history) GIRARA_VISIBLE
girara_input_history_s
Definition: input-history.h:54
girara_input_history_class_s::parent_class
GObjectClass parent_class
Definition: input-history.h:59
girara_input_history_append
void girara_input_history_append(GiraraInputHistory *history, const char *input) GIRARA_VISIBLE
girara_input_history_new
GiraraInputHistory * girara_input_history_new(GiraraInputHistoryIO *io) GIRARA_VISIBLE
girara_input_history_io_interface_s::append
void(* append)(GiraraInputHistoryIO *io, const char *input)
Definition: input-history.h:21
girara_input_history_class_s::reserved2
void(* reserved2)(void)
Definition: input-history.h:109
girara_input_history_io_get_type
GType girara_input_history_io_get_type(void) G_GNUC_CONST GIRARA_VISIBLE
girara_list_t
struct girara_list_s girara_list_t
Definition: types.h:10
girara_input_history_io_interface_s::reserved1
void(* reserved1)(void)
Definition: input-history.h:32
GiraraInputHistoryIO
struct girara_input_history_io_s GiraraInputHistoryIO
Definition: types.h:208
girara_input_history_class_s::reset
void(* reset)(GiraraInputHistory *history)
Definition: input-history.h:105
girara_input_history_class_s::append
void(* append)(GiraraInputHistory *history, const char *input)
Definition: input-history.h:70
girara_input_history_io_interface_s::reserved2
void(* reserved2)(void)
Definition: input-history.h:33
girara_input_history_class_s::reserved3
void(* reserved3)(void)
Definition: input-history.h:110