summaryrefslogtreecommitdiffstats
path: root/lib/widget/history.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:22:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:22:03 +0000
commitffccd5b2b05243e7976db80f90f453dccfae9886 (patch)
tree39a43152d27f7390d8f7a6fb276fa6887f87c6e8 /lib/widget/history.h
parentInitial commit. (diff)
downloadmc-0acba638a84ac029b0ce3ee33c0f8b7d9f3fa027.tar.xz
mc-0acba638a84ac029b0ce3ee33c0f8b7d9f3fa027.zip
Adding upstream version 3:4.8.30.upstream/3%4.8.30
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/widget/history.h')
-rw-r--r--lib/widget/history.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/widget/history.h b/lib/widget/history.h
new file mode 100644
index 0000000..03f764f
--- /dev/null
+++ b/lib/widget/history.h
@@ -0,0 +1,51 @@
+
+/** \file lib/widget/history.h
+ * \brief Header: show history
+ */
+
+#ifndef MC__WIDGET_HISTORY_H
+#define MC__WIDGET_HISTORY_H
+
+/*** typedefs(not structures) and defined constants **********************************************/
+
+/* forward declarations */
+struct history_descriptor_t;
+struct WLEntry;
+struct WListbox;
+
+typedef void (*history_create_item_func) (struct history_descriptor_t * hd, void *data);
+typedef void *(*history_release_item_func) (struct history_descriptor_t * hd, struct WLEntry * le);
+
+/*** enums ***************************************************************************************/
+
+/*** structures declarations (and typedefs of structures)*****************************************/
+
+typedef struct history_descriptor_t
+{
+ GList *list; /**< list with history items */
+ int y; /**< y-coordinate to place history window */
+ int x; /**< x-coordinate to place history window */
+ int current; /**< initially selected item in the history */
+ int action; /**< return action in the history */
+ char *text; /**< return text of selected item */
+
+ size_t max_width; /**< maximum width of string in history */
+ struct WListbox *listbox; /**< listbox widget to draw history */
+
+ history_create_item_func create; /**< function to create item of @list */
+ history_release_item_func release; /**< function to release item of @list */
+ GDestroyNotify free; /**< function to destroy element of @list */
+} history_descriptor_t;
+
+/*** global variables defined in .c file *********************************************************/
+
+/*** declarations of public functions ************************************************************/
+
+void history_descriptor_init (history_descriptor_t * hd, int y, int x, GList * history,
+ int current);
+
+void history_show (history_descriptor_t * hd);
+
+/*** inline functions ****************************************************************************/
+
+#endif /* MC__WIDGET_HISTORY_H */