2012-05-30 14:23:27 +04:00
|
|
|
/*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Sanel Zukan
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2009-10-03 11:33:08 +04:00
|
|
|
#ifndef __PANEL_H__
|
|
|
|
#define __PANEL_H__
|
|
|
|
|
|
|
|
#include <edelib/Window.h>
|
|
|
|
#include "AppletManager.h"
|
|
|
|
|
2011-10-26 20:04:37 +04:00
|
|
|
#define EDE_PANEL_CAST_TO_PANEL(obj) ((Panel*)(obj))
|
|
|
|
#define EDE_PANEL_GET_PANEL_OBJECT(w) (EDE_PANEL_CAST_TO_PANEL(w->parent()))
|
2009-10-03 11:33:08 +04:00
|
|
|
|
|
|
|
EDELIB_NS_USING_AS(Window, PanelWindow)
|
|
|
|
|
2009-11-18 15:24:58 +03:00
|
|
|
enum {
|
|
|
|
PANEL_POSITION_TOP,
|
|
|
|
PANEL_POSITION_BOTTOM
|
|
|
|
};
|
|
|
|
|
2013-03-05 03:18:17 +04:00
|
|
|
/* combination of what to do with strut data */
|
|
|
|
enum {
|
|
|
|
PANEL_STRUT_REMOVE = (1 << 1),
|
|
|
|
PANEL_STRUT_BOTTOM = (1 << 2),
|
|
|
|
PANEL_STRUT_TOP = (1 << 3)
|
|
|
|
};
|
|
|
|
|
2013-01-04 18:36:40 +04:00
|
|
|
class Hider;
|
|
|
|
|
2009-10-03 11:33:08 +04:00
|
|
|
class Panel : public PanelWindow {
|
|
|
|
private:
|
|
|
|
Fl_Widget *clicked;
|
2013-01-04 18:36:40 +04:00
|
|
|
Hider *hider;
|
|
|
|
|
2009-11-18 15:24:58 +03:00
|
|
|
int vpos;
|
2009-10-03 11:33:08 +04:00
|
|
|
int sx, sy;
|
|
|
|
int screen_x, screen_y, screen_w, screen_h, screen_h_half;
|
2012-04-04 13:58:23 +04:00
|
|
|
int width_perc; /* user specified panel width */
|
2012-04-11 20:15:01 +04:00
|
|
|
bool can_move_widgets, can_drag;
|
2009-10-03 11:33:08 +04:00
|
|
|
|
|
|
|
AppletManager mgr;
|
|
|
|
|
2009-11-18 15:24:58 +03:00
|
|
|
void read_config(void);
|
|
|
|
void save_config(void);
|
2009-10-03 11:33:08 +04:00
|
|
|
void do_layout(void);
|
2013-03-05 03:18:17 +04:00
|
|
|
void set_strut(short state);
|
2009-10-03 11:33:08 +04:00
|
|
|
public:
|
2009-11-18 15:24:58 +03:00
|
|
|
Panel();
|
2009-10-03 11:33:08 +04:00
|
|
|
|
|
|
|
void show(void);
|
2009-11-18 15:24:58 +03:00
|
|
|
void hide(void);
|
2012-06-07 13:32:27 +04:00
|
|
|
void update_size_and_pos(bool create_xid, bool update_strut);
|
|
|
|
void update_size_and_pos(bool create_xid, bool update_strut, int X, int Y, int W, int H);
|
2009-11-18 15:24:58 +03:00
|
|
|
int handle(int e);
|
2009-10-03 11:33:08 +04:00
|
|
|
void load_applets(void);
|
|
|
|
|
|
|
|
int panel_w(void) { return w(); }
|
|
|
|
int panel_h(void) { return h(); }
|
2011-10-26 20:04:37 +04:00
|
|
|
|
2012-04-11 20:15:01 +04:00
|
|
|
void screen_size(int &x, int &y, int &w, int &h) {
|
|
|
|
x = screen_x;
|
|
|
|
y = screen_y;
|
|
|
|
w = screen_w;
|
|
|
|
h = screen_h;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* so applets can do something */
|
|
|
|
void apply_struts(bool apply);
|
|
|
|
void allow_drag(bool d) { can_drag = d; }
|
|
|
|
|
2011-10-26 20:04:37 +04:00
|
|
|
void relayout(void) { do_layout(); }
|
2009-10-03 11:33:08 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|