21 #ifndef KARAMBAINTERFACE_H_
22 #define KARAMBAINTERFACE_H_
26 #include <kross/core/krossconfig.h>
27 #include <kross/core/manager.h>
28 #include <kross/core/action.h>
50 void startInterpreter();
51 bool initInterpreter();
54 void callInitWidget(
Karamba *k);
55 void callWidgetUpdated(
Karamba *k);
56 void callWidgetClosed(
Karamba *k);
57 void callMenuOptionChanged(
Karamba *k,
const QString &key,
bool value);
58 void callMenuItemClicked(
Karamba* k, KMenu* menu, QAction*
id);
64 void callCommandFinished(
Karamba *k,
int pid);
65 void callCommandOutput(
Karamba *k,
int pid,
char* buffer);
66 void callItemDropped(
Karamba *k,
const QString &text,
int x,
int y);
68 void callMeterClicked(
Karamba *k,
const QString &str,
int button);
69 void callWidgetClicked(
Karamba *k,
int x,
int y,
int button);
70 void callDesktopChanged(
Karamba *k,
int desktop);
71 void callWidgetMouseMoved(
Karamba *k,
int x,
int y,
int button);
72 void callKeyPressed(
Karamba *k,
Meter *meter,
const QString &key);
73 void callThemeNotify(
Karamba *k,
const QString &sender,
const QString &data);
74 void callWallpaperChanged(
Karamba *k,
int desktop);
81 void menuOptionChanged(
QObject*, QString,
bool);
87 void commandFinished(
QObject*,
int);
88 void commandOutput(
QObject*,
int, QString);
89 void itemDropped(
QObject*, QString,
int,
int);
91 void meterClicked(
QObject*, QString,
int);
92 void widgetClicked(
QObject*,
int,
int,
int);
93 void desktopChanged(
QObject*,
int);
94 void widgetMouseMoved(
QObject*,
int,
int,
int);
96 void themeNotify(
QObject*, QString, QString);
97 void wallpaperChanged(
QObject*,
int);
109 QVariantList getMeterMinMax(
const Karamba *k,
const Meter *m,
const QString &type)
const;
110 QVariantList getMeterSize(
const Karamba *k,
const Meter *m,
const QString &type)
const;
111 QVariantList getMeterPos(
const Karamba *k,
const Meter *m,
const QString &type)
const;
112 QString getMeterSensor(
const Karamba *k,
const Meter *m,
const QString &type)
const;
113 int getMeterValue(
const Karamba *k,
const Meter *m,
const QString &type)
const;
114 QObject* getThemeMeter(
const Karamba *k,
const QString &meter,
const QString &type)
const;
115 bool hideMeter(
const Karamba *k,
Meter *m,
const QString &type)
const;
116 bool moveMeter(
const Karamba *k,
Meter *m,
const QString &type,
int x,
int y)
const;
117 bool resizeMeter(
const Karamba *k,
Meter *m,
const QString &type,
int width,
int height)
const;
118 bool setMeterMinMax(
const Karamba *k,
Meter *m,
const QString &type,
int min,
int max)
const;
119 bool setMeterSensor(
Karamba *k,
Meter *m,
const QString &type,
const QString &sensor)
const;
121 bool showMeter(
const Karamba *k,
Meter *m,
const QString &type)
const;
122 bool setMeterColor(
const Karamba *k,
Meter *m,
const QString &type,
int red,
int green,
int
123 blue,
int alpha = 255)
const;
124 QVariantList getMeterColor(
const Karamba *k,
const Meter *m,
const QString &type)
const;
125 QString getMeterStringValue(
const Karamba *k,
const Meter *m,
const QString &type)
const;
126 QObject* setMeterStringValue(
const Karamba *k,
Meter *m,
const QString &type,
const QString
132 QObject* createBar(
Karamba *k,
int x,
int y,
int w,
int h,
const QString &path =
"")
const;
134 bool setBarMinMax(
const Karamba *k,
Bar *bar,
int min,
int max)
const;
135 QVariantList getBarMinMax(
const Karamba *k,
const Bar *bar)
const;
136 bool moveBar(
const Karamba *k,
Bar *bar,
int x,
int y)
const;
137 QVariantList getBarPos(
const Karamba *k,
const Bar *bar)
const;
138 bool setBarSensor(
Karamba *k,
Bar *bar,
const QString &sensor)
const;
139 QString getBarSensor(
const Karamba *k,
const Bar *bar)
const;
140 bool resizeBar(
const Karamba *k,
Bar *bar,
int width,
int height)
const;
141 QVariantList getBarSize(
const Karamba *k,
const Bar *bar)
const;
143 int getBarValue(
const Karamba *k,
const Bar *bar)
const;
144 QObject* getThemeBar(
const Karamba *k,
const QString &meter)
const;
145 bool hideBar(
const Karamba *k,
Bar *bar)
const;
146 bool showBar(
const Karamba *k,
Bar *bar)
const;
147 bool setBarVertical(
const Karamba *k,
Bar *bar,
bool vert)
const;
148 bool getBarVertical(
const Karamba *k,
const Bar *bar)
const;
149 bool setBarImage(
const Karamba *k,
Bar *bar,
const QString &image)
const;
150 QString getBarImage(
const Karamba *k,
const Bar *bar)
const;
161 QObject* createGraph(
Karamba* k,
int x,
int y,
int w,
int h,
int points)
const;
163 bool setGraphMinMax(
const Karamba *k,
Graph *bar,
int min,
int max)
const;
164 QVariantList getGraphMinMax(
const Karamba *k,
const Graph *graph)
const;
165 bool moveGraph(
const Karamba *k,
Graph *graph,
int x,
int y)
const;
166 QVariantList getGraphPos(
const Karamba *k,
const Graph *graph)
const;
167 bool setGraphSensor(
Karamba *k,
Graph *graph,
const QString &sensor)
const;
168 QString getGraphSensor(
const Karamba *k,
const Graph *graph)
const;
169 bool resizeGraph(
const Karamba *k,
Graph *graph,
int width,
int height)
const;
170 QVariantList getGraphSize(
const Karamba *k,
const Graph *graph)
const;
172 int getGraphValue(
const Karamba *k,
const Graph *graph)
const;
173 QObject* getThemeGraph(
const Karamba *k,
const QString &meter)
const;
176 bool setGraphColor(
const Karamba *k,
Graph *graph,
int red,
int green,
int blue,
int alpha=255)
const;
177 QVariantList getGraphColor(
const Karamba *k,
const Graph *graph)
const;
178 bool setGraphFillColor(
const Karamba *k,
Graph *graph,
int red,
int green,
int blue,
int alpha=255)
const;
179 QVariantList getGraphFillColor(
const Karamba *k,
const Graph *graph)
const;
180 QString getGraphScroll(
const Karamba *k,
const Graph *graph)
const;
181 bool setGraphScroll(
const Karamba *k,
Graph *graph,
const QString &scroll)
const;
182 QString getGraphPlot(
const Karamba *k,
const Graph *graph)
const;
183 bool setGraphPlot(
const Karamba *k,
Graph *graph,
const QString &plot)
const;
184 bool getGraphShouldFill(
const Karamba *k,
const Graph *graph)
const;
185 bool setGraphShouldFill(
const Karamba *k,
Graph *graph,
bool shouldFill)
const;
188 QObject* createImage(
Karamba* k,
int x,
int y,
const QString &image)
const;
189 QObject* createEmptyImage(
Karamba* k,
int x,
int y,
int w,
int h)
const;
195 bool resizeImage(
const Karamba *k,
ImageLabel *image,
int width,
int height)
const;
199 QObject* getThemeImage(
const Karamba *k,
const QString &meter)
const;
202 bool addImageTooltip(
const Karamba *k,
ImageLabel *image,
const QString &text)
const;
203 bool changeImageChannelIntensity(
const Karamba *k,
ImageLabel *image,
double ratio,
const
204 QString &channel,
int ms = 0)
const;
205 bool changeImageIntensity(
const Karamba *k,
ImageLabel *image,
double ratio,
int ms = 0)
const;
207 bool changeImageAlpha(
const Karamba *k,
ImageLabel *image,
int a,
int r=-1,
int g=-1,
int b=-1,
int ms = 0)
const;
208 QObject* createBackgroundImage(
Karamba *k,
int x,
int y,
const QString &imagePath)
const;
209 QObject* createTaskIcon(
Karamba *k,
int x,
int y,
int ctask)
const;
214 bool resizeImageSmooth(
Karamba *k,
ImageLabel *image,
int width,
int height)
const;
216 bool setPixel(
Karamba *k,
ImageLabel *image,
int x,
int y,
int r,
int g,
int b,
int a = 255);
219 bool setImageElement(
Karamba* k,
ImageLabel *image,
const QString &element)
const;
224 QObject* createInputBox(
Karamba* k,
int x,
int y,
int w,
int h,
const QString &text)
const;
226 bool moveInputBox(
Karamba *k,
Input *input,
int x,
int y)
const;
227 QVariantList getInputBoxPos(
const Karamba *k,
const Input *input)
const;
228 bool resizeInputBox(
const Karamba *k,
Input *input,
int width,
int height)
const;
229 QVariantList getInputBoxSize(
const Karamba *k,
const Input *input)
const;
231 QString getInputBoxValue(
const Karamba *k,
const Input *input)
const;
232 QObject* getThemeInputBox(
const Karamba *k,
const QString &meter)
const;
233 bool hideInputBox(
const Karamba *k,
Input *input)
const;
234 bool showInputBox(
const Karamba *k,
Input *input)
const;
235 bool changeInputBoxFont(
const Karamba *k,
Input *input,
const QString &font)
const;
236 bool changeInputBoxFontColor(
const Karamba *k,
Input *input,
int red,
int green,
int blue,
int alpha=255)
const;
237 QString getInputBoxFont(
const Karamba *k,
const Input *input)
const;
238 QVariantList getInputBoxFontColor(
const Karamba *k,
const Input *input)
const;
239 bool changeInputBoxSelectionColor(
const Karamba *k,
Input *input,
int red,
int green,
int blue,
int alpha=255)
241 QVariantList getInputBoxSelectionColor(
const Karamba *k,
const Input *input)
const;
242 bool changeInputBoxBackgroundColor(
const Karamba *k,
Input *input,
int red,
int green,
int blue,
int alpha=255)
244 QVariantList getInputBoxBackgroundColor(
const Karamba *k,
const Input *input)
const;
245 bool changeInputBoxFrameColor(
const Karamba *k,
Input *input,
int red,
int green,
int blue,
int alpha=255)
247 QVariantList getInputBoxFrameColor(
const Karamba *k,
const Input *input)
const;
248 bool changeInputBoxSelectedTextColor(
const Karamba *k,
Input *input,
int red,
int green,
int
249 blue,
int alpha=255)
const;
250 QVariantList getInputBoxSelectedTextColor(
const Karamba *k,
const Input *input)
const;
251 bool changeInputBoxFontSize(
const Karamba *k,
Input *input,
int size)
const;
252 int getInputBoxFontSize(
const Karamba *k,
const Input *input)
const;
253 bool setInputFocus(
const Karamba *k,
Input *input)
const;
254 bool clearInputFocus(
const Karamba *k,
Input *input)
const;
256 int getInputBoxTextWidth(
const Karamba *k,
Input *input)
const;
257 bool changeInputBoxSelection(
const Karamba *k,
Input *input,
int start,
int length)
const;
258 QVariantList getInputBoxSelection(
const Karamba *k,
Input *input)
const;
259 bool clearInputBoxSelection(
const Karamba *k,
Input *input)
const;
274 const QString &middleButton = QString(),
const QString &rightButton =
276 bool callTheme(
Karamba *k,
const QString &theme,
const QString &info)
const;
278 int execute(
const QString &command)
const;
280 const QString &onClick)
const;
282 const QString &name,
const QString &exec,
const QString &icon)
const;
283 int executeInteractive(
Karamba *k,
const QStringList &command);
284 QString
getIp(
const Karamba *k,
const QString &interface)
const;
286 QString getPrettyThemeName(
const Karamba *k)
const;
289 double getUpdateTime(
const Karamba *k)
const;
290 bool setUpdateTime(
Karamba *k,
double updateTime)
const;
293 QString language(
const Karamba *k)
const;
294 bool managementPopup(
const Karamba *k)
const;
296 bool startAsSubTheme)
const;
298 QString readThemeFile(
const Karamba *k,
const QString &file)
const;
299 bool reloadTheme(
Karamba *k)
const;
301 bool run(
const QString &appName,
const QString &command,
const QString &icon,
const QStringList
307 QString userLanguage(
const Karamba *k)
const;
308 QStringList userLanguages(
const Karamba *k)
const;
309 bool setWantRightButton(
Karamba *k,
bool enable)
const;
311 QVariantList desktopSize()
const;
312 QString getIconByName(
const QString &icon,
int size)
const;
313 QString getExecutingApplication()
const;
316 QObject* createRichText(
Karamba* k,
const QString &text,
bool underline =
false)
const;
325 QObject* getThemeRichText(
const Karamba *k,
const QString &meter)
const;
336 QObject* createSystray(
const Karamba *k,
int x,
int y,
int w,
int h)
const;
337 int getCurrentWindowCount(
const Karamba *k)
const;
338 bool hideSystray(
const Karamba *k)
const;
339 bool moveSystray(
const Karamba *k,
int x,
int y,
int w,
int h)
const;
340 bool showSystray(
const Karamba *k)
const;
341 bool updateSystrayLayout(
const Karamba *k)
const;
342 bool getSystraySize(
const Karamba *k)
const;
354 QObject* createText(
Karamba* k,
int x,
int y,
int width,
int height,
const QString &text =
"")
const;
358 bool setTextSensor(
Karamba *k,
TextLabel *text,
const QString &sensor)
const;
360 bool resizeText(
const Karamba *k,
TextLabel *text,
int width,
int height)
const;
362 QObject* getThemeText(
const Karamba *k,
const QString &meter)
const;
367 bool changeTextShadow(
const Karamba *k,
TextLabel *label,
int shadow)
const;
369 bool changeTextFont(
const Karamba *k,
TextLabel *text,
const QString &font)
const;
371 bool changeTextColor(
const Karamba *k,
TextLabel *text,
int red,
int green,
int blue,
int alpha = 255)
const;
376 bool setTextAlign(
const Karamba *k,
TextLabel *text,
const QString &alignment)
const;
377 bool setTextScroll(
const Karamba *k,
TextLabel *text,
const QString &type,
int x = 0,
int y = 0,
378 int gap = 0,
int pause = 0)
const;
382 bool createWidgetMask(
const Karamba *k,
const QString &mask)
const;
383 QVariantList getWidgetPosition(
const Karamba *k)
const;
386 bool redrawWidgetBackground(
const Karamba *k)
const;
388 bool toggleWidgetRedraw(
const Karamba *k,
bool enable)
const;
391 QObject* getPlasmaSensor(
Karamba *k,
const QString& engine,
const QString& source = QString());
395 bool moveCanvasWidget(
Karamba *k,
QObject* canvaswidget,
int x,
int y,
int w,
int h);
long writeConfigEntry(long widget, QString key, QString value)
static long callTheme(long widget, char *path, char *str)
int performTaskAction(long widget, long ctask, long action)
long createServiceClickArea(long widget, long x, long y, long w, long h, char *name, char *exec, char *icon)
Represents a task which is in the process of starting.
long openNamedTheme(char *path, char *name, bool is_sub_theme)
long createClickArea(long widget, long x, long y, long w, long h, char *text)
QString getIp(char *device_name)
long openTheme(char *path)
long readMenuConfigOption(long widget, QString key)
long setMenuConfigOption(long widget, QString key, bool value)
long toggleShowDesktop(long)
long acceptDrops(long widget)
QString readConfigEntry(long widget, QString key)
PyObject * getTaskInfo(long widget, long ctask)
const char * getThemePath(long widget)
static QString getIncomingData(long widget)
bool checkKaramba(long widget)
PyObject * getStartupInfo(long widget, long cstartup)
bool checkKarambaAndMeter(long widget, long meter, const char *type)
static void changeInterval(long widget, long interval)
long removeClickArea(long widget, long click)
long attachClickArea(long widget, long meter, QString LeftButton, QString MiddleButton, QString RightButton)
long addMenuConfigOption(long widget, QString key, QString name)
PyObject * getStartupList(long widget)
#define SUPERKARAMBA_EXPORT
static long setIncomingData(long widget, char *path, char *obj)
PyObject * getTaskNames(long widget)
int getNumberOfDesktops(long widget)
bool checkMeter(long widget, long meter, const char *type)
A dynamic interface to a task (main window).
int translateAll(long widget, int x, int y)
PyObject * getTaskList(long widget)
static PyObject * getServiceGroups(const char *rel_path)
static const char version[]