rofi  1.7.0
widget-internal.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2017 Qball Cow <qball@gmpclient.org>
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining
8  * a copy of this software and associated documentation files (the
9  * "Software"), to deal in the Software without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Software, and to
12  * permit persons to whom the Software is furnished to do so, subject to
13  * the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25  *
26  */
27 
28 #ifndef WIDGET_INTERNAL_H
29 #define WIDGET_INTERNAL_H
30 
31 #include "theme.h"
35 struct _widget {
39  short x;
41  short y;
43  short w;
45  short h;
55 
58 
60  gboolean enabled;
62  gboolean expand;
64  gboolean end;
66  struct _widget *parent;
68  gboolean need_redraw;
70  int (*get_width)(struct _widget *);
72  int (*get_height)(struct _widget *);
74  void (*draw)(struct _widget *widget, cairo_t *draw);
76  void (*resize)(struct _widget *, short, short);
78  void (*update)(struct _widget *);
79 
81  gboolean (*motion_notify)(struct _widget *, gint x, gint y);
82 
83  int (*get_desired_height)(struct _widget *);
84  int (*get_desired_width)(struct _widget *);
85 
86  void (*set_state)(struct _widget *, const char *);
87 
94 
96  void (*free)(struct _widget *widget);
97 
99  char *name;
100  const char *state;
101 };
102 
113  const char *name);
114 
121 void widget_set_state(widget *widget, const char *state);
122 
130 int widget_padding_get_left(const widget *wid);
131 
139 int widget_padding_get_right(const widget *wid);
140 
148 int widget_padding_get_top(const widget *wid);
149 
157 int widget_padding_get_bottom(const widget *wid);
158 
191 #endif // WIDGET_INTERNAL_H
_widget::end
gboolean end
Definition: widget-internal.h:64
widget_padding_get_left
int widget_padding_get_left(const widget *wid)
Definition: widget.c:581
_widget::draw
void(* draw)(struct _widget *widget, cairo_t *draw)
Definition: widget-internal.h:74
widget_padding_get_bottom
int widget_padding_get_bottom(const widget *wid)
Definition: widget.c:613
_widget::get_desired_width
int(* get_desired_width)(struct _widget *)
Definition: widget-internal.h:84
widget_padding_get_padding_width
int widget_padding_get_padding_width(const widget *wid)
Definition: widget.c:642
_widget::free
void(* free)(struct _widget *widget)
Definition: widget-internal.h:96
WidgetType
WidgetType
Definition: widget.h:56
_widget::enabled
gboolean enabled
Definition: widget-internal.h:60
_widget::trigger_action_cb_data
void * trigger_action_cb_data
Definition: widget-internal.h:93
widget
struct _widget widget
Definition: widget.h:51
widget_padding_get_remaining_width
int widget_padding_get_remaining_width(const widget *wid)
Definition: widget.c:624
_widget::expand
gboolean expand
Definition: widget-internal.h:62
_widget::resize
void(* resize)(struct _widget *, short, short)
Definition: widget-internal.h:76
_widget::margin
RofiPadding margin
Definition: widget-internal.h:51
_widget::update
void(* update)(struct _widget *)
Definition: widget-internal.h:78
_widget::def_border_radius
RofiPadding def_border_radius
Definition: widget-internal.h:50
_widget::def_margin
RofiPadding def_margin
Definition: widget-internal.h:47
_widget::state
const char * state
Definition: widget-internal.h:100
_widget::get_width
int(* get_width)(struct _widget *)
Definition: widget-internal.h:70
_widget::get_desired_height
int(* get_desired_height)(struct _widget *)
Definition: widget-internal.h:83
_widget::get_height
int(* get_height)(struct _widget *)
Definition: widget-internal.h:72
widget_padding_get_right
int widget_padding_get_right(const widget *wid)
Definition: widget.c:591
widget_padding_get_top
int widget_padding_get_top(const widget *wid)
Definition: widget.c:603
_widget::name
char * name
Definition: widget-internal.h:99
_widget::def_border
RofiPadding def_border
Definition: widget-internal.h:49
theme.h
_widget::motion_notify
gboolean(* motion_notify)(struct _widget *, gint x, gint y)
Definition: widget-internal.h:81
_widget::set_state
void(* set_state)(struct _widget *, const char *)
Definition: widget-internal.h:86
_widget::trigger_action
widget_trigger_action_cb trigger_action
Definition: widget-internal.h:91
_widget::y
short y
Definition: widget-internal.h:41
widget_trigger_action_cb
WidgetTriggerActionResult(* widget_trigger_action_cb)(widget *widget, guint action, gint x, gint y, void *user_data)
Definition: widget.h:113
_widget::x
short x
Definition: widget-internal.h:39
RofiPadding
Definition: rofi-types.h:202
widget_set_state
void widget_set_state(widget *widget, const char *state)
Definition: widget.c:72
_widget::parent
struct _widget * parent
Definition: widget-internal.h:66
widget_padding_get_padding_height
int widget_padding_get_padding_height(const widget *wid)
Definition: widget.c:636
_widget::h
short h
Definition: widget-internal.h:45
_widget::w
short w
Definition: widget-internal.h:43
_widget::border
RofiPadding border
Definition: widget-internal.h:53
_widget::def_padding
RofiPadding def_padding
Definition: widget-internal.h:48
RofiCursorType
RofiCursorType
Definition: rofi-types.h:142
_widget::border_radius
RofiPadding border_radius
Definition: widget-internal.h:54
_widget::find_mouse_target
widget_find_mouse_target_cb find_mouse_target
Definition: widget-internal.h:89
widget_init
void widget_init(widget *wid, widget *parent, WidgetType type, const char *name)
Definition: widget.c:44
widget_padding_get_remaining_height
int widget_padding_get_remaining_height(const widget *wid)
Definition: widget.c:630
_widget::padding
RofiPadding padding
Definition: widget-internal.h:52
widget_find_mouse_target_cb
widget *(* widget_find_mouse_target_cb)(widget *widget, WidgetType type, gint x, gint y)
Definition: widget.h:98
_widget::need_redraw
gboolean need_redraw
Definition: widget-internal.h:68
_widget::cursor_type
RofiCursorType cursor_type
Definition: widget-internal.h:57
_widget
Definition: widget-internal.h:35
_widget::type
WidgetType type
Definition: widget-internal.h:37