Skip to content

Commit

Permalink
Drawer cleanup and fix arrow behavior
Browse files Browse the repository at this point in the history
*Drawer coding style cleanup
*Drawer code organized
*Rearranged and labeled code
*Drawer fix arrows
*Fixed hide code for drawer in toplevel.
*fix #528
*fix #704
  • Loading branch information
info-cppsp authored and lukefromdc committed Feb 15, 2018
1 parent 112c3e0 commit b08bc13
Show file tree
Hide file tree
Showing 4 changed files with 722 additions and 560 deletions.
146 changes: 146 additions & 0 deletions mate-panel/drawer-private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
/*
* MATE panel drawer module.
*
* 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,
const char *custom_icon,
gboolean use_custom_icon,
const char *tooltip,
char **attached_toplevel_id);


#ifdef __cplusplus
}
#endif

#endif /* DRAWER_PRIVATE_H */
Loading

0 comments on commit b08bc13

Please sign in to comment.