libxputty 0.1
Loading...
Searching...
No Matches
xmenu.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 XMENU_H_
24#define XMENU_H_
25
26#include "xputty.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32
41void pop_menu_show(Widget_t *parent, Widget_t *menu, int elem, bool above);
42
51void pop_submenu_show(Widget_t *parent, Widget_t *menu, int elem, bool above);
52
61Widget_t* create_viewport(Widget_t *parent, int width, int height);
62
71Widget_t* add_menu(Widget_t *parent, const char * label,
72 int x, int y, int width, int height);
73
82Widget_t *add_menubar(Widget_t *parent, const char * label,
83 int x, int y, int width, int height);
84
92Widget_t *menubar_add_menu(Widget_t *parent, const char * label);
93
101Widget_t *menu_add_entry(Widget_t *wid, const char * label);
102
110Widget_t *menu_add_radio_entry(Widget_t *wid, const char * label);
111
119Widget_t *menu_add_check_entry(Widget_t *wid, const char * label);
120
128Widget_t *menu_add_accel_check_entry(Widget_t *wid, const char * label);
129
137Widget_t* menu_add_value_entry(Widget_t *wid,const char * label);
138
146Widget_t *menu_add_submenu(Widget_t *wid, const char * label);
147
155Widget_t *cmenu_add_submenu(Widget_t *wid, const char * label);
156
164Widget_t* create_menu(Widget_t *parent, int height);
165
173Widget_t* menu_add_item(Widget_t *menu, const char * label);
174
181void menu_remove_item(Widget_t *menu, Widget_t *item);
182
190Widget_t* menu_add_accel_item(Widget_t *menu, const char * label);
191
199Widget_t* menu_add_check_item(Widget_t *menu, const char * label);
200
208Widget_t* menu_add_value_item(Widget_t *menu,const char * label);
209
216
223void set_active_radio_entry_num(Widget_t *w, int active);
224
232Widget_t* menu_add_radio_item(Widget_t *menu, const char * label);
233
241void menu_add_numeric_items(Widget_t *menu, int *imin, int *imax);
242
243#ifdef __cplusplus
244}
245#endif
246
247#endif //XMENU_H_
Widget_t - struct to hold the basic Widget_t info.
Definition xwidget.h:457
Widget_t * menu_add_radio_item(Widget_t *menu, const char *label)
menu_add_radio_item - add a radio item to menu
Definition xmenu.c:342
Widget_t * add_menubar(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_menubar - add a menubar to a Widget_t
Definition xmenu.c:106
void radio_item_set_active(Widget_t *w)
radio_item_set_active - activate selected radio item
Definition xmenu.c:326
Widget_t * menubar_add_menu(Widget_t *parent, const char *label)
menubar_add_menu - add a menu to a menubar
Definition xmenu.c:114
Widget_t * menu_add_check_entry(Widget_t *wid, const char *label)
menu_add_check_entry- add a check entry to menu
Definition xmenu.c:150
Widget_t * add_menu(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_menu - add a menu to a Widget_t
Definition xmenu.c:86
void menu_remove_item(Widget_t *menu, Widget_t *item)
menu_remove_item - remove a item from menu
Definition xmenu.c:303
void pop_menu_show(Widget_t *parent, Widget_t *menu, int elem, bool above)
pop_menu_show - pop up a menu to a Widget_t
Definition xmenu.c:27
Widget_t * menu_add_accel_check_entry(Widget_t *wid, const char *label)
menu_add_accel_check_entry- add a check entry with accel to menu
Definition xmenu.c:159
Widget_t * menu_add_check_item(Widget_t *menu, const char *label)
menu_add_check_item - add a item to menu
Definition xmenu.c:317
Widget_t * menu_add_value_entry(Widget_t *wid, const char *label)
menu_add_value_entry- add a value entry to menu
Definition xmenu.c:169
Widget_t * create_viewport(Widget_t *parent, int width, int height)
create_viewport - create a viewport on a menu to a Widget_t
Definition xmenu.c:50
void menu_add_numeric_items(Widget_t *menu, int *imin, int *imax)
menu_add_numeric_items - add numeric items from imin to imax to menu
Definition xmenu.c:360
void pop_submenu_show(Widget_t *parent, Widget_t *menu, int elem, bool above)
pop_submenu_show - pop up a submenu to a Widget_t
Definition xmenu.c:41
Widget_t * menu_add_entry(Widget_t *wid, const char *label)
menu_add_entry - add a entry to menu
Definition xmenu.c:132
Widget_t * menu_add_accel_item(Widget_t *menu, const char *label)
menu_add_accel_item - add a accel item to menu
Definition xmenu.c:311
Widget_t * create_menu(Widget_t *parent, int height)
create_menu - create a menu to a Widget_t
Definition xmenu.c:256
Widget_t * menu_add_item(Widget_t *menu, const char *label)
menu_add_item - add a item to menu
Definition xmenu.c:283
Widget_t * cmenu_add_submenu(Widget_t *wid, const char *label)
cmenu_add_submenu - add a submenu to a cmenu
Definition xmenu.c:226
Widget_t * menu_add_radio_entry(Widget_t *wid, const char *label)
menu_add_radio_entry- add a radio entry to menu
Definition xmenu.c:141
void set_active_radio_entry_num(Widget_t *w, int active)
set_active_radio_item - activate selected radio item by number
Definition xmenu.c:78
Widget_t * menu_add_submenu(Widget_t *wid, const char *label)
menu_add_submenu - add a submenu to a Widget_t
Definition xmenu.c:194
Widget_t * menu_add_value_item(Widget_t *menu, const char *label)
menu_add_value_item - add a item to menu
Definition xmenu.c:351
This file contains definitions and structs used on all platforms. Platform specific definitions are l...