summaryrefslogtreecommitdiff
path: root/mate-panel/drawer-private.h
blob: 4f300deafde4553e720ace44f420c872634f4442 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
 * MATE panel drawer module.
 * Copyright (C) 2012-2021 MATE Developers
 *
 * List static function prototypes separate
 * to prevent errors when compiling panel.c
 *
 * Authors: info@cppsp.de
 */


#ifndef DRAWER_PRIVATE_H
#define DRAWER_PRIVATE_H

#ifdef __cplusplus
extern "C" {
#endif


/* Internal functions */
/* event handlers */

static void  drawer_click                       (GtkWidget        *widget,
                                                 Drawer           *drawer);

static void  drawer_focus_panel_widget          (Drawer           *drawer,
                                                 GtkDirectionType  direction);

static gboolean  key_press_drawer               (GtkWidget        *widget,
                                                 GdkEventKey      *event,
                                                 Drawer           *drawer);

static gboolean  key_press_drawer_widget        (GtkWidget        *widget,
                                                 GdkEventKey      *event,
                                                 Drawer           *drawer);

    /* drag and drop handlers */

static void  drag_data_get_cb                   (GtkWidget        *widget,
                                                 GdkDragContext   *context,
                                                 GtkSelectionData *selection_data,
                                                 guint             info,
                                                 guint             time,
                                                 Drawer           *drawer);

static gboolean  drag_motion_cb                 (GtkWidget        *widget,
                                                 GdkDragContext   *context,
                                                 int               x,
                                                 int               y,
                                                 guint             time_,
                                                 Drawer           *drawer);

static gboolean  drag_drop_cb                   (GtkWidget        *widget,
                                                 GdkDragContext   *context,
                                                 int               x,
                                                 int               y,
                                                 guint             time_,
                                                 Drawer           *drawer);

static void  drag_data_received_cb              (GtkWidget        *widget,
                                                 GdkDragContext   *context,
                                                 gint              x,
                                                 gint              y,
                                                 GtkSelectionData *selection_data,
                                                 guint             info,
                                                 guint             time_,
                                                 Drawer           *drawer);

static gboolean  close_drawer_in_idle           (gpointer          data);

static void  queue_drawer_close_for_drag        (Drawer           *drawer);

static void  drag_leave_cb                      (GtkWidget        *widget,
                                                 GdkDragContext   *context,
                                                 guint             time_,
                                                 Drawer           *drawer);

    /* load_drawer_applet handlers */

static void  drawer_button_size_allocated       (GtkWidget        *widget,
                                                 GtkAllocation    *alloc,
                                                 Drawer           *drawer);

static gboolean  drawer_changes_enabled         (void);

    /* gsettings handlers */

static void  panel_drawer_custom_icon_changed   (GSettings        *settings,
                                                 gchar            *key,
                                                 Drawer           *drawer);

static void  panel_drawer_tooltip_changed       (GSettings        *settings,
                                                 gchar            *key,
                                                 Drawer           *drawer);

    /* destroy handlers */

static void  toplevel_destroyed                 (GtkWidget        *widget,
                                                 Drawer           *drawer);

static void  destroy_drawer                     (GtkWidget        *widget,
                                                 Drawer           *drawer);

static void  drawer_deletion_response           (GtkWidget        *dialog,
                                                 int               response,
                                                 Drawer           *drawer);

/* end event handlers */

static PanelToplevel *create_drawer_toplevel    (const char       *drawer_id,
                                                 GSettings        *settings);

static void  set_tooltip_and_name               (Drawer           *drawer,
                                                 const char       *tooltip);

static Drawer *create_drawer_applet             (PanelToplevel    *toplevel,
                                                 PanelToplevel    *parent_toplevel,
                                                 const char       *tooltip,
                                                 const char       *custom_icon,
                                                 gboolean          use_custom_icon,
                                                 PanelOrientation  orientation);

static void  panel_drawer_connect_to_gsettings  (Drawer           *drawer);

static void  load_drawer_applet                 (char             *toplevel_id,
                                                 GSettings        *settings,
                                                 const char       *custom_icon,
                                                 gboolean          use_custom_icon,
                                                 const char       *tooltip,
                                                 PanelToplevel    *parent_toplevel,
                                                 gboolean          locked,
                                                 int               pos,
                                                 gboolean          exactpos,
                                                 const char       *id);

static void  panel_drawer_prepare               (const char       *drawer_id,
                                                 GIcon            *custom_icon,
                                                 gboolean          use_custom_icon,
                                                 const char       *tooltip,
                                                 char            **attached_toplevel_id);


#ifdef __cplusplus
}
#endif

#endif /* DRAWER_PRIVATE_H */