libxputty 0.1
Loading...
Searching...
No Matches
xlistview.h
Go to the documentation of this file.
1/*
2 * 0BSD
3 *
4 * BSD Zero Clause License
5 *
6 * Copyright (c) 2019 Hermann Meyer
7 *
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted.
10
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 *
19 */
20
21#pragma once
22
23#ifndef XLISTVIEW_H_
24#define XLISTVIEW_H_
25
26#include "xputty.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
42typedef struct {
43 char **list_names;
45 cairo_surface_t *folder;
46 cairo_surface_t *file;
54 char pad[4];
56
63void listview_set_active_entry(Widget_t *w, int active);
64
71
81Widget_t* create_listview_viewport(Widget_t *parent, int elem, int width, int height);
82
91Widget_t* add_listview(Widget_t *parent, const char * label,
92 int x, int y, int width, int height);
93
100void listview_mem_free(void *w_, void* user_data);
101
107void listview_remove_list(Widget_t *listview);
108
116void listview_set_list(Widget_t *listview, char **list, int list_size);
117
124void listview_set_check_dir(Widget_t *listview, int set);
125
126#ifdef __cplusplus
127}
128#endif
129
130#endif //XLISTVIEW_H_
ViewList_t - struct to hold information for the listview.
Definition xlistview.h:42
int active_item
Definition xlistview.h:48
char ** list_names
Definition xlistview.h:43
int prev_prelight_item
Definition xlistview.h:49
int prelight_item
Definition xlistview.h:47
int prev_active_item
Definition xlistview.h:50
int list_size
Definition xlistview.h:52
int check_dir
Definition xlistview.h:53
Widget_t * slider
Definition xlistview.h:44
int show_items
Definition xlistview.h:51
cairo_surface_t * file
Definition xlistview.h:46
cairo_surface_t * folder
Definition xlistview.h:45
Widget_t - struct to hold the basic Widget_t info.
Definition xwidget.h:457
void listview_remove_list(Widget_t *listview)
listview_remove_list - remove the list from a listview Widget_t
Definition xlistview.c:109
Widget_t * add_listview(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_label - add a listview to a Widget_t
Definition xlistview.c:72
void listview_set_check_dir(Widget_t *listview, int set)
listview_set_check_dir - set optional check if list item is a directory
Definition xlistview.c:134
void listview_set_active_entry(Widget_t *w, int active)
listview_set_active_entry - set the active listview entry
Definition xlistview.c:28
void listview_mem_free(void *w_, void *user_data)
listview_mem_free - release additional used memory when destroy the Widget_t
Definition xlistview.c:101
Widget_t * create_listview_viewport(Widget_t *parent, int elem, int width, int height)
create_listview_viewport - create a viewport on a listview to a Widget_t
Definition xlistview.c:46
void listview_unset_active_entry(Widget_t *w)
listview_unset_active_entry - unset the active listview entry
Definition xlistview.c:39
void listview_set_list(Widget_t *listview, char **list, int list_size)
listview_set_list - set a list to a listview Widget_t
Definition xlistview.c:123
This file contains definitions and structs used on all platforms. Platform specific definitions are l...