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"
|
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-01-30 21:13:04 +00:00
|
|
|
extern int mouse_left;
|
2009-02-07 23:28:13 +00:00
|
|
|
extern int mouse_middle;
|
|
|
|
extern int mouse_right;
|
|
|
|
extern int mouse_scroll_up;
|
|
|
|
extern int mouse_scroll_down;
|
2009-08-28 23:14:53 +00:00
|
|
|
extern int mouse_tilt_left;
|
|
|
|
extern int mouse_tilt_right;
|
2009-02-07 23:28:13 +00:00
|
|
|
|
2008-10-02 18:47:02 +00:00
|
|
|
//panel mode
|
2009-06-08 16:50:14 +00:00
|
|
|
enum { SINGLE_DESKTOP=0, MULTI_DESKTOP };
|
2015-02-01 12:31:15 +00:00
|
|
|
enum { BOTTOM_LAYER, NORMAL_LAYER, TOP_LAYER };
|
2009-02-07 23:28:13 +00:00
|
|
|
extern int panel_mode;
|
2009-10-16 18:46:09 +00:00
|
|
|
extern int wm_menu;
|
2009-09-10 17:19:08 +00:00
|
|
|
extern int panel_dock;
|
2009-12-30 23:27:31 +00:00
|
|
|
extern int panel_layer;
|
2015-02-08 12:13:32 +00:00
|
|
|
extern char *panel_window_name;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-02-07 23:28:13 +00:00
|
|
|
//panel position
|
2008-10-02 18:47:02 +00:00
|
|
|
enum { LEFT=0x01, RIGHT=0x02, CENTER=0X04, TOP=0X08, BOTTOM=0x10 };
|
2009-02-07 23:28:13 +00:00
|
|
|
extern int panel_position;
|
2009-06-21 22:01:31 +00:00
|
|
|
extern int panel_horizontal;
|
2009-02-07 23:28:13 +00:00
|
|
|
|
|
|
|
extern int panel_refresh;
|
2010-02-08 22:44:56 +00:00
|
|
|
extern int task_dragged;
|
2009-02-07 23:28:13 +00:00
|
|
|
|
2010-01-05 20:38:49 +00:00
|
|
|
//panel autohide
|
2010-02-20 10:08:56 +00:00
|
|
|
enum { STRUT_MINIMUM, STRUT_FOLLOW_SIZE, STRUT_NONE };
|
2010-01-05 20:38:49 +00:00
|
|
|
extern int panel_autohide;
|
|
|
|
extern int panel_autohide_show_timeout;
|
|
|
|
extern int panel_autohide_hide_timeout;
|
|
|
|
extern int panel_autohide_height; // for vertical panels this is of course the width
|
|
|
|
extern int panel_strut_policy;
|
2010-09-18 12:36:11 +00:00
|
|
|
extern char *panel_items_order;
|
2010-01-05 20:38:49 +00:00
|
|
|
|
2009-06-20 14:41:06 +00:00
|
|
|
extern int max_tick_urgent;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2010-01-09 00:11:01 +00:00
|
|
|
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
|
|
|
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-09-25 21:40:06 +00:00
|
|
|
// tint2 use one panel per monitor and one taskbar per desktop.
|
2008-10-02 18:47:02 +00:00
|
|
|
typedef struct {
|
2009-09-20 20:48:00 +00:00
|
|
|
// always start with area
|
|
|
|
// area.list own all objects of the panel according to config file
|
|
|
|
Area area;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-09-20 20:48:00 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// panel
|
|
|
|
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;
|
|
|
|
int pourcentx, pourcenty;
|
|
|
|
// location of the panel (monitor number)
|
|
|
|
int monitor;
|
2015-04-18 13:22:07 +00:00
|
|
|
int font_shadow;
|
2009-09-20 20:48:00 +00:00
|
|
|
|
|
|
|
// --------------------------------------------------
|
|
|
|
// task and taskbar parameter per panel
|
2010-01-09 00:11:01 +00:00
|
|
|
Global_taskbar g_taskbar;
|
2009-02-07 23:28:13 +00:00
|
|
|
Global_task g_task;
|
|
|
|
|
2009-09-20 20:48:00 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// taskbar point to the first taskbar in panel.area.list.
|
2009-09-26 11:04:02 +00:00
|
|
|
// number of tasbar == nb_desktop. taskbar[i] is for desktop(i).
|
2009-09-10 21:00:50 +00:00
|
|
|
// taskbar[i] is used to loop over taskbar,
|
|
|
|
// while panel->area.list is used to loop over all panel's objects
|
2009-09-20 20:48:00 +00:00
|
|
|
Taskbar *taskbar;
|
|
|
|
int nb_desktop;
|
2009-01-20 21:16:54 +00:00
|
|
|
|
2009-09-20 20:48:00 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// clock
|
|
|
|
Clock clock;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2009-05-15 20:44:42 +00:00
|
|
|
// --------------------------------------------------
|
|
|
|
// battery
|
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;
|
|
|
|
|
2010-01-09 00:11:01 +00:00
|
|
|
// autohide
|
2010-01-05 20:38:49 +00:00
|
|
|
int is_hidden;
|
|
|
|
int hidden_width, hidden_height;
|
|
|
|
Pixmap hidden_pixmap;
|
2010-01-09 00:11:01 +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;
|
2009-02-07 23:28:13 +00:00
|
|
|
extern Panel *panel1;
|
|
|
|
extern int nb_panel;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
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);
|
2010-09-24 19:16:55 +00:00
|
|
|
int resize_panel(void *obj);
|
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
|
|
|
|
2009-11-16 17:17:53 +00:00
|
|
|
Taskbar *click_taskbar (Panel *panel, int x, int y);
|
|
|
|
Task *click_task (Panel *panel, int x, int y);
|
2010-08-02 17:12:07 +00:00
|
|
|
Launcher *click_launcher (Panel *panel, int x, int y);
|
|
|
|
LauncherIcon *click_launcher_icon (Panel *panel, int x, int y);
|
2009-11-16 17:17:53 +00:00
|
|
|
int click_padding(Panel *panel, int x, int y);
|
|
|
|
int click_clock(Panel *panel, int x, int y);
|
|
|
|
Area* click_area(Panel *panel, int x, int y);
|
2009-02-07 23:28:13 +00:00
|
|
|
|
2010-06-20 15:56:04 +00:00
|
|
|
void autohide_show(void* p);
|
2010-06-26 12:35:35 +00:00
|
|
|
void autohide_hide(void* p);
|
2010-06-20 15:56:04 +00:00
|
|
|
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
|