libxputty  0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
xtooltip.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 XTOOLTIP_H_
24 #define XTOOLTIP_H_
25 
26 #include "xputty.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
33 /**
34  * @brief tooltip_set_text - set a (new) text to a tooltip for Widget_t
35  * @param *w - pointer to the Widget_t request the tooltip
36  * @param *label - the tooltip text
37  * @return void
38  */
39 
40 void tooltip_set_text(Widget_t *w, const char* label);
41 
42 /**
43  * @brief add_tooltip - add a tooltip to Widget_t
44  * @param *w - pointer to the Widget_t request the tooltip
45  * @param *label - the tooltip text
46  * @return void
47  */
48 
49 void add_tooltip(Widget_t *w, const char* label);
50 
51 /**
52  * @brief create_tooltip - create a tooltip for a Widget_t
53  * @param *parent - pointer to the Widget_t the tooltip should pop over
54  * @param width - define the width of the tooltip
55  * @param height - define the height of the tooltip
56  * @return Widget_t* - pointer to the Widget_t button struct
57  */
58 
59 Widget_t* create_tooltip(Widget_t *parent, int width, int height);
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif //XTOOLTIP_H_
xputty.h
Widget_t
Widget_t - struct to hold the basic Widget_t info.
Definition: xwidget.h:298
tooltip_set_text
void tooltip_set_text(Widget_t *w, const char *label)
tooltip_set_text - set a (new) text to a tooltip for Widget_t
Definition: xtooltip.c:25
add_tooltip
void add_tooltip(Widget_t *w, const char *label)
add_tooltip - add a tooltip to Widget_t
Definition: xtooltip.c:41
create_tooltip
Widget_t * create_tooltip(Widget_t *parent, int width, int height)
create_tooltip - create a tooltip for a Widget_t
Definition: xtooltip.c:47