2008-10-02 18:47:02 +00:00
|
|
|
/**************************************************************************
|
2009-01-20 21:16:54 +00:00
|
|
|
* Copyright (C) 2008 Pål Staurland (staura@gmail.com)
|
|
|
|
* Modified (C) 2008/2009 thierry lorthiois (lorthiois@bbsoft.fr)
|
|
|
|
*
|
|
|
|
* panel :
|
2008-10-02 18:47:02 +00:00
|
|
|
* - draw panel and all objects according to panel_layout
|
2009-01-20 21:16:54 +00:00
|
|
|
*
|
2008-10-02 18:47:02 +00:00
|
|
|
*
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#ifndef PANEL_H
|
|
|
|
#define PANEL_H
|
|
|
|
|
|
|
|
#include <pango/pangocairo.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "clock.h"
|
|
|
|
#include "task.h"
|
|
|
|
#include "taskbar.h"
|
2009-01-20 21:16:54 +00:00
|
|
|
#include "systraybar.h"
|
2010-08-02 17:12:07 +00:00
|
|
|
#include "launcher.h"
|
2015-06-11 23:42:00 +00:00
|
|
|
#include "freespace.h"
|
2015-12-05 09:05:42 +00:00
|
|
|
#include "execplugin.h"
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-06-18 20:26:40 +00:00
|
|
|
#ifdef ENABLE_BATTERY
|
|
|
|
#include "battery.h"
|
|
|
|
#endif
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-02-07 23:28:13 +00:00
|
|
|
extern int signal_pending;
|
|
|
|
// --------------------------------------------------
|
|
|
|
// mouse events
|
2015-11-20 22:28:37 +00:00
|
|
|
extern MouseAction mouse_left;
|
|
|
|
extern MouseAction mouse_middle;
|
|
|
|
extern MouseAction mouse_right;
|
|
|
|
extern MouseAction mouse_scroll_up;
|
|
|
|
extern MouseAction mouse_scroll_down;
|
|
|
|
extern MouseAction mouse_tilt_left;
|
|
|
|
extern MouseAction mouse_tilt_right;
|
|
|
|
|
|
|
|
// panel mode
|
|
|
|
typedef enum TaskbarMode {
|
|
|
|
SINGLE_DESKTOP = 0,
|
|
|
|
MULTI_DESKTOP,
|
|
|
|
} TaskbarMode;
|
|
|
|
|
|
|
|
typedef enum Layer {
|
|
|
|
BOTTOM_LAYER,
|
|
|
|
NORMAL_LAYER,
|
|
|
|
TOP_LAYER,
|
|
|
|
} Layer;
|
|
|
|
|
|
|
|
// panel position
|
|
|
|
typedef enum PanelPosition {
|
|
|
|
LEFT = 0x01,
|
|
|
|
RIGHT = 0x02,
|
|
|
|
CENTER = 0X04,
|
|
|
|
TOP = 0X08,
|
|
|
|
BOTTOM = 0x10,
|
|
|
|
} PanelPosition;
|
|
|
|
|
|
|
|
typedef enum Strut {
|
|
|
|
STRUT_MINIMUM,
|
|
|
|
STRUT_FOLLOW_SIZE,
|
|
|
|
STRUT_NONE,
|
|
|
|
} Strut;
|
|
|
|
|
|
|
|
extern TaskbarMode taskbar_mode;
|
|
|
|
extern gboolean wm_menu;
|
|
|
|
extern gboolean panel_dock;
|
|
|
|
extern Layer panel_layer;
|
2015-02-08 12:13:32 +00:00
|
|
|
extern char *panel_window_name;
|
2015-11-20 22:28:37 +00:00
|
|
|
extern PanelPosition panel_position;
|
|
|
|
extern gboolean panel_horizontal;
|
|
|
|
extern gboolean panel_refresh;
|
|
|
|
extern gboolean task_dragged;
|
|
|
|
extern gboolean panel_autohide;
|
2010-01-05 20:38:49 +00:00
|
|
|
extern int panel_autohide_show_timeout;
|
|
|
|
extern int panel_autohide_hide_timeout;
|
2015-11-20 22:28:37 +00:00
|
|
|
extern int panel_autohide_height; // for vertical panels this is of course the width
|
|
|
|
extern Strut panel_strut_policy;
|
2010-09-18 12:36:11 +00:00
|
|
|
extern char *panel_items_order;
|
2015-11-20 22:28:37 +00:00
|
|
|
extern int max_tick_urgent;
|
|
|
|
extern GArray *backgrounds;
|
2009-09-19 05:30:43 +00:00
|
|
|
extern Imlib_Image default_icon;
|
2015-04-11 09:51:10 +00:00
|
|
|
// TODO maybe this should be a config option
|
|
|
|
#define DEFAULT_FONT "sans 10"
|
2009-09-19 05:30:43 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
typedef struct Panel {
|
2009-09-20 20:48:00 +00:00
|
|
|
Area area;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-09-20 20:48:00 +00:00
|
|
|
Window main_win;
|
|
|
|
Pixmap temp_pmap;
|
2009-02-13 21:54:42 +00:00
|
|
|
|
2009-09-20 20:48:00 +00:00
|
|
|
// position relative to root window
|
2009-02-07 23:28:13 +00:00
|
|
|
int posx, posy;
|
2009-09-20 20:48:00 +00:00
|
|
|
int marginx, marginy;
|
2015-11-20 22:28:37 +00:00
|
|
|
int fractional_width, fractional_height;
|
2009-09-20 20:48:00 +00:00
|
|
|
int monitor;
|
2015-04-18 13:22:07 +00:00
|
|
|
int font_shadow;
|
2015-11-20 22:28:37 +00:00
|
|
|
gboolean mouse_effects;
|
2015-11-04 22:14:11 +00:00
|
|
|
// Mouse effects for icons
|
|
|
|
int mouse_over_alpha;
|
|
|
|
int mouse_over_saturation;
|
|
|
|
int mouse_over_brightness;
|
|
|
|
int mouse_pressed_alpha;
|
|
|
|
int mouse_pressed_saturation;
|
|
|
|
int mouse_pressed_brightness;
|
2009-09-20 20:48:00 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
// Per-panel parameters and states for Taskbar and Task
|
|
|
|
GlobalTaskbar g_taskbar;
|
|
|
|
GlobalTask g_task;
|
2009-02-07 23:28:13 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
// Array of Taskbar, with num_desktops items
|
2009-09-20 20:48:00 +00:00
|
|
|
Taskbar *taskbar;
|
2015-11-20 22:28:37 +00:00
|
|
|
int num_desktops;
|
2015-09-12 01:08:25 +00:00
|
|
|
PangoFontDescription *taskbarname_font_desc;
|
2009-01-20 21:16:54 +00:00
|
|
|
|
2009-09-20 20:48:00 +00:00
|
|
|
Clock clock;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-06-18 20:26:40 +00:00
|
|
|
#ifdef ENABLE_BATTERY
|
2009-05-15 20:44:42 +00:00
|
|
|
Battery battery;
|
2009-06-18 20:26:40 +00:00
|
|
|
#endif
|
2010-01-09 00:11:01 +00:00
|
|
|
|
2010-08-02 17:12:07 +00:00
|
|
|
Launcher launcher;
|
2015-06-11 23:42:00 +00:00
|
|
|
FreeSpace freespace;
|
2015-12-05 09:05:42 +00:00
|
|
|
GList *execp_list;
|
2015-06-11 23:42:00 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
// Autohide
|
|
|
|
gboolean is_hidden;
|
2010-01-05 20:38:49 +00:00
|
|
|
int hidden_width, hidden_height;
|
|
|
|
Pixmap hidden_pixmap;
|
2015-11-20 22:28:37 +00:00
|
|
|
timeout *autohide_timeout;
|
2008-10-02 18:47:02 +00:00
|
|
|
} Panel;
|
|
|
|
|
2009-10-17 16:53:16 +00:00
|
|
|
extern Panel panel_config;
|
2015-11-20 22:28:37 +00:00
|
|
|
extern Panel *panels;
|
|
|
|
extern int num_panels;
|
2010-04-18 14:28:45 +00:00
|
|
|
|
|
|
|
// default global data
|
|
|
|
void default_panel();
|
|
|
|
|
|
|
|
// freed memory
|
|
|
|
void cleanup_panel();
|
|
|
|
|
2009-10-18 17:54:09 +00:00
|
|
|
// realloc panels according to number of monitor
|
2009-10-22 20:31:53 +00:00
|
|
|
// use panel_config as default value
|
2009-02-07 23:28:13 +00:00
|
|
|
void init_panel();
|
2009-10-18 17:54:09 +00:00
|
|
|
|
2009-09-27 16:57:19 +00:00
|
|
|
void init_panel_size_and_position(Panel *panel);
|
2015-11-20 22:28:37 +00:00
|
|
|
gboolean resize_panel(void *obj);
|
2015-11-18 20:57:10 +00:00
|
|
|
void render_panel(Panel *panel);
|
2009-02-13 21:54:42 +00:00
|
|
|
|
2010-09-19 08:34:24 +00:00
|
|
|
void set_panel_items_order(Panel *p);
|
2009-02-07 23:28:13 +00:00
|
|
|
void set_panel_properties(Panel *p);
|
2009-02-03 20:40:46 +00:00
|
|
|
|
|
|
|
// draw background panel
|
2009-02-07 23:28:13 +00:00
|
|
|
void set_panel_background(Panel *p);
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-02-13 21:54:42 +00:00
|
|
|
// detect witch panel
|
2009-02-07 23:28:13 +00:00
|
|
|
Panel *get_panel(Window win);
|
2009-02-03 20:40:46 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
Taskbar *click_taskbar(Panel *panel, int x, int y);
|
|
|
|
Task *click_task(Panel *panel, int x, int y);
|
|
|
|
Launcher *click_launcher(Panel *panel, int x, int y);
|
|
|
|
LauncherIcon *click_launcher_icon(Panel *panel, int x, int y);
|
|
|
|
gboolean click_padding(Panel *panel, int x, int y);
|
|
|
|
gboolean click_clock(Panel *panel, int x, int y);
|
2015-07-13 03:16:02 +00:00
|
|
|
|
|
|
|
#ifdef ENABLE_BATTERY
|
2015-11-20 22:28:37 +00:00
|
|
|
gboolean click_battery(Panel *panel, int x, int y);
|
2015-07-13 03:16:02 +00:00
|
|
|
#endif
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
Area *click_area(Panel *panel, int x, int y);
|
2015-12-05 09:05:42 +00:00
|
|
|
Execp *click_execp(Panel *panel, int x, int y);
|
2009-02-07 23:28:13 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void autohide_show(void *p);
|
|
|
|
void autohide_hide(void *p);
|
|
|
|
void autohide_trigger_show(Panel *p);
|
|
|
|
void autohide_trigger_hide(Panel *p);
|
2010-01-05 20:38:49 +00:00
|
|
|
|
2009-11-16 17:17:53 +00:00
|
|
|
#endif
|