mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Code cleanup.
Removing usage of EDE_PANEL_APPLET_CLASS since there is no much usage of it. Also, marked all applet widgets as EDE_PANEL_WIDGET_TYPE so panel knows it is widget. Added license info in some code, but whole ede2 tree needs to be revised for that.
This commit is contained in:
@ -26,6 +26,9 @@ class Fl_Widget;
|
|||||||
/* stored version in each applet shared library in case interface get changed */
|
/* stored version in each applet shared library in case interface get changed */
|
||||||
#define EDE_PANEL_APPLET_INTERFACE_VERSION 0x01
|
#define EDE_PANEL_APPLET_INTERFACE_VERSION 0x01
|
||||||
|
|
||||||
|
/* all panel widgets are marked with this type (make sure it is greater than FL_DOUBLE_WINDOW */
|
||||||
|
#define EDE_PANEL_WIDGET_TYPE 0xFA
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Options assigned to each applet: how it will be resizable (horizontally or vertically)
|
* Options assigned to each applet: how it will be resizable (horizontally or vertically)
|
||||||
* and how it will be aligned. Each applet is by default aligned left without resizing ability.
|
* and how it will be aligned. Each applet is by default aligned left without resizing ability.
|
||||||
@ -58,10 +61,11 @@ typedef float (*applet_version_t)(void);
|
|||||||
* The main macro each applet library must implement. It will assign apropriate values
|
* The main macro each applet library must implement. It will assign apropriate values
|
||||||
* so applet loader can use them to load applet class with some common metadata.
|
* so applet loader can use them to load applet class with some common metadata.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define EDE_PANEL_APPLET_EXPORT(klass, aoptions, aname, aversion, aicon, aauthor) \
|
#define EDE_PANEL_APPLET_EXPORT(klass, aoptions, aname, aversion, aicon, aauthor) \
|
||||||
extern "C" Fl_Widget *ede_panel_applet_create(void) { \
|
extern "C" Fl_Widget *ede_panel_applet_create(void) { \
|
||||||
return new klass; \
|
klass *k = new klass; \
|
||||||
|
k->type(EDE_PANEL_WIDGET_TYPE); \
|
||||||
|
return k; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
extern "C" void ede_panel_applet_destroy(Fl_Widget *w) { \
|
extern "C" void ede_panel_applet_destroy(Fl_Widget *w) { \
|
||||||
@ -88,8 +92,4 @@ extern "C" int ede_panel_applet_get_iface_version(void) {
|
|||||||
return EDE_PANEL_APPLET_INTERFACE_VERSION; \
|
return EDE_PANEL_APPLET_INTERFACE_VERSION; \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* each applet must use this so applets can be easily extended in the future */
|
|
||||||
|
|
||||||
#define EDE_PANEL_APPLET_CLASS(c, inherits) class c : public inherits
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,3 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* $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.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
#include <FL/fl_draw.H>
|
#include <FL/fl_draw.H>
|
||||||
|
@ -1,3 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* $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.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __PANEL_H__
|
#ifndef __PANEL_H__
|
||||||
#define __PANEL_H__
|
#define __PANEL_H__
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ EDELIB_NS_USING(run_async)
|
|||||||
|
|
||||||
static void clock_refresh(void *o);
|
static void clock_refresh(void *o);
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(Clock, Fl_Box) {
|
class Clock : public Fl_Box {
|
||||||
private:
|
private:
|
||||||
int hour;
|
int hour;
|
||||||
char buf[64], tbuf[128];
|
char buf[64], tbuf[128];
|
||||||
|
@ -19,7 +19,7 @@ enum {
|
|||||||
IWM_STATES
|
IWM_STATES
|
||||||
};
|
};
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(CPUMonitor, Fl_Box) {
|
class CPUMonitor : public Fl_Box {
|
||||||
private:
|
private:
|
||||||
bool m_draw_label;
|
bool m_draw_label;
|
||||||
int m_old_samples;
|
int m_old_samples;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(MyButton, Fl_Button) {
|
class MyButton : public Fl_Button {
|
||||||
public:
|
public:
|
||||||
MyButton() : Fl_Button(0, 0, 90, 25, "xxx") {
|
MyButton() : Fl_Button(0, 0, 90, 25, "xxx") {
|
||||||
color(FL_RED);
|
color(FL_RED);
|
||||||
|
@ -41,7 +41,7 @@ EDELIB_NS_USING(RES_SYS_ONLY)
|
|||||||
|
|
||||||
static Atom _XA_XKB_RF_NAMES_PROP_ATOM = 0;
|
static Atom _XA_XKB_RF_NAMES_PROP_ATOM = 0;
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(KeyLayout, Fl_Button) {
|
class KeyLayout : public Fl_Button {
|
||||||
private:
|
private:
|
||||||
bool should_show_flag;
|
bool should_show_flag;
|
||||||
String path, curr_layout;
|
String path, curr_layout;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <FL/Fl_Box.H>
|
#include <FL/Fl_Box.H>
|
||||||
#include "Applet.h"
|
#include "Applet.h"
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(MemMonitor, Fl_Box) {
|
class MemMonitor : public Fl_Box {
|
||||||
private:
|
private:
|
||||||
int mem_usedp, swap_usedp;
|
int mem_usedp, swap_usedp;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ EDELIB_NS_USING(netwm_callback_add)
|
|||||||
EDELIB_NS_USING(netwm_callback_remove)
|
EDELIB_NS_USING(netwm_callback_remove)
|
||||||
EDELIB_NS_USING(NETWM_CHANGED_CURRENT_WORKSPACE)
|
EDELIB_NS_USING(NETWM_CHANGED_CURRENT_WORKSPACE)
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(Pager, Fl_Group) {
|
class Pager : public Fl_Group {
|
||||||
public:
|
public:
|
||||||
Pager();
|
Pager();
|
||||||
~Pager();
|
~Pager();
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
EDELIB_NS_USING(run_async)
|
EDELIB_NS_USING(run_async)
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(QuickLaunch, Fl_Input) {
|
class QuickLaunch : public Fl_Input {
|
||||||
private:
|
private:
|
||||||
Fl_Image *img;
|
Fl_Image *img;
|
||||||
int img_x, img_y;
|
int img_x, img_y;
|
||||||
|
@ -13,7 +13,7 @@ EDELIB_NS_USING(MenuBase)
|
|||||||
|
|
||||||
/* some of this code was ripped from Fl_Menu_Button.cxx */
|
/* some of this code was ripped from Fl_Menu_Button.cxx */
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(StartMenu, MenuBase) {
|
class StartMenu : public MenuBase {
|
||||||
private:
|
private:
|
||||||
MenuItem *mcontent;
|
MenuItem *mcontent;
|
||||||
public:
|
public:
|
||||||
|
@ -16,7 +16,7 @@ struct WinInfo {
|
|||||||
typedef list<WinInfo> WinList;
|
typedef list<WinInfo> WinList;
|
||||||
typedef list<WinInfo>::iterator WinListIt;
|
typedef list<WinInfo>::iterator WinListIt;
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(Tray, Fl_Group) {
|
class Tray : public Fl_Group {
|
||||||
private:
|
private:
|
||||||
Atom opcode, message_data;
|
Atom opcode, message_data;
|
||||||
WinList win_list;
|
WinList win_list;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
class TaskButton;
|
class TaskButton;
|
||||||
class Panel;
|
class Panel;
|
||||||
|
|
||||||
EDE_PANEL_APPLET_CLASS(Taskbar, Fl_Group) {
|
class Taskbar : public Fl_Group {
|
||||||
public:
|
public:
|
||||||
TaskButton *curr_active, *prev_active;
|
TaskButton *curr_active, *prev_active;
|
||||||
Panel *panel;
|
Panel *panel;
|
||||||
|
Reference in New Issue
Block a user