1 /* 2 * quicklaunch: Quicklaunch box 3 * 4 * Copyright 2012-2020 Stephan Haller <nomad@froevel.de> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 * MA 02110-1301, USA. 20 * 21 * 22 */ 23 24 #ifndef __LIBXFDASHBOARD_QUICKLAUNCH__ 25 #define __LIBXFDASHBOARD_QUICKLAUNCH__ 26 27 #if !defined(__LIBXFDASHBOARD_H_INSIDE__) && !defined(LIBXFDASHBOARD_COMPILATION) 28 #error "Only <libxfdashboard/libxfdashboard.h> can be included directly." 29 #endif 30 31 #include <libxfdashboard/background.h> 32 #include <libxfdashboard/toggle-button.h> 33 #include <libxfdashboard/focusable.h> 34 35 G_BEGIN_DECLS 36 37 #define XFDASHBOARD_TYPE_QUICKLAUNCH (xfdashboard_quicklaunch_get_type()) 38 #define XFDASHBOARD_QUICKLAUNCH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XFDASHBOARD_TYPE_QUICKLAUNCH, XfdashboardQuicklaunch)) 39 #define XFDASHBOARD_IS_QUICKLAUNCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), XFDASHBOARD_TYPE_QUICKLAUNCH)) 40 #define XFDASHBOARD_QUICKLAUNCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), XFDASHBOARD_TYPE_QUICKLAUNCH, XfdashboardQuicklaunchClass)) 41 #define XFDASHBOARD_IS_QUICKLAUNCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), XFDASHBOARD_TYPE_QUICKLAUNCH)) 42 #define XFDASHBOARD_QUICKLAUNCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XFDASHBOARD_TYPE_QUICKLAUNCH, XfdashboardQuicklaunchClass)) 43 44 typedef struct _XfdashboardQuicklaunch XfdashboardQuicklaunch; 45 typedef struct _XfdashboardQuicklaunchClass XfdashboardQuicklaunchClass; 46 typedef struct _XfdashboardQuicklaunchPrivate XfdashboardQuicklaunchPrivate; 47 48 struct _XfdashboardQuicklaunch 49 { 50 /*< private >*/ 51 /* Parent instance */ 52 XfdashboardBackground parent_instance; 53 54 /* Private structure */ 55 XfdashboardQuicklaunchPrivate *priv; 56 }; 57 58 struct _XfdashboardQuicklaunchClass 59 { 60 /*< private >*/ 61 /* Parent class */ 62 XfdashboardBackgroundClass parent_class; 63 64 /*< public >*/ 65 /* Virtual functions */ 66 void (*favourite_added)(XfdashboardQuicklaunch *self, GAppInfo *inAppInfo); 67 void (*favourite_removed)(XfdashboardQuicklaunch *self, GAppInfo *inAppInfo); 68 69 /* Binding actions */ 70 gboolean (*selection_add_favourite)(XfdashboardQuicklaunch *self, 71 XfdashboardFocusable *inSource, 72 const gchar *inAction, 73 ClutterEvent *inEvent); 74 gboolean (*selection_remove_favourite)(XfdashboardQuicklaunch *self, 75 XfdashboardFocusable *inSource, 76 const gchar *inAction, 77 ClutterEvent *inEvent); 78 79 gboolean (*favourite_reorder_left)(XfdashboardQuicklaunch *self, 80 XfdashboardFocusable *inSource, 81 const gchar *inAction, 82 ClutterEvent *inEvent); 83 gboolean (*favourite_reorder_right)(XfdashboardQuicklaunch *self, 84 XfdashboardFocusable *inSource, 85 const gchar *inAction, 86 ClutterEvent *inEvent); 87 gboolean (*favourite_reorder_up)(XfdashboardQuicklaunch *self, 88 XfdashboardFocusable *inSource, 89 const gchar *inAction, 90 ClutterEvent *inEvent); 91 gboolean (*favourite_reorder_down)(XfdashboardQuicklaunch *self, 92 XfdashboardFocusable *inSource, 93 const gchar *inAction, 94 ClutterEvent *inEvent); 95 }; 96 97 /* Public API */ 98 GType xfdashboard_quicklaunch_get_type(void) G_GNUC_CONST; 99 100 ClutterActor* xfdashboard_quicklaunch_new(void); 101 ClutterActor* xfdashboard_quicklaunch_new_with_orientation(ClutterOrientation inOrientation); 102 103 gfloat xfdashboard_quicklaunch_get_normal_icon_size(XfdashboardQuicklaunch *self); 104 void xfdashboard_quicklaunch_set_normal_icon_size(XfdashboardQuicklaunch *self, const gfloat inIconSize); 105 106 gfloat xfdashboard_quicklaunch_get_spacing(XfdashboardQuicklaunch *self); 107 void xfdashboard_quicklaunch_set_spacing(XfdashboardQuicklaunch *self, const gfloat inSpacing); 108 109 ClutterOrientation xfdashboard_quicklaunch_get_orientation(XfdashboardQuicklaunch *self); 110 void xfdashboard_quicklaunch_set_orientation(XfdashboardQuicklaunch *self, ClutterOrientation inOrientation); 111 112 XfdashboardToggleButton* xfdashboard_quicklaunch_get_apps_button(XfdashboardQuicklaunch *self); 113 114 G_END_DECLS 115 116 #endif /* __LIBXFDASHBOARD_QUICKLAUNCH__ */ 117