• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

superkaramba

karamba.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 *  karamba_python.h  -  Functions for calling python scripts
00003 *
00004 *  Copyright (C) 2003 Hans Karlsson <karlsson.h@home.se>
00005 *  Copyright (C) 2003-2004 Adam Geitgey <adam@rootnode.org>
00006 *  Copyright (c) 2004 Petri Damst� <damu@iki.fi>
00007 *
00008 *  This file is part of SuperKaramba.
00009 *
00010 *  SuperKaramba is free software; you can redistribute it and/or modify
00011 *  it under the terms of the GNU General Public License as published by
00012 *  the Free Software Foundation; either version 2 of the License, or
00013 *  (at your option) any later version.
00014 *
00015 *  SuperKaramba is distributed in the hope that it will be useful,
00016 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 *  GNU General Public License for more details.
00019 *
00020 *  You should have received a copy of the GNU General Public License
00021 *  along with SuperKaramba; if not, write to the Free Software
00022 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023 ****************************************************************************/
00024 
00025 #ifndef KARAMBA_PYTHON_H
00026 #define KARAMBA_PYTHON_H
00027 
00028 class QString;
00029 class KMenu;
00030 class Task;
00031 class Startup;
00032 class Karamba;
00033 class Meter;
00034 struct _object;
00035 typedef struct _object PyObject;
00036 struct _ts;
00037 typedef struct _ts PyThreadState;
00038 class ThemeFile;
00039 
00040 class KarambaPython
00041 {
00042 protected:
00043     bool pythonThemeExtensionLoaded;
00044     PyObject *pName, *pModule;
00045     PyObject *pDict;
00046     static PyThreadState* mainThreadState;
00047 
00048     void getLock(PyThreadState** myThreadState);
00049     PyObject* getFunc(const char* function);
00050     void releaseLock(PyThreadState* myThreadState);
00051     bool callObject(const char* func, PyObject* pArgs, bool lock = true);
00052 
00053 public:
00054     KarambaPython(const ThemeFile& theme, bool reloading);
00055     ~KarambaPython();
00056 
00057     static void initPython();
00058     static void shutdownPython();
00059 
00060     bool isExtensionLoaded()
00061     {
00062         return pythonThemeExtensionLoaded;
00063     }
00064     bool initWidget(Karamba* k);
00065     bool widgetUpdated(Karamba* k);
00066     bool widgetClosed(Karamba* k);
00067     bool menuOptionChanged(Karamba* k, QString key, bool value);
00068     bool meterClicked(Karamba* k, Meter* meter, int button);
00069     bool meterClicked(Karamba* k, QString anchor, int button);
00070     bool widgetClicked(Karamba* k, int x, int y, int button);
00071     bool keyPressed(Karamba* k, const Meter* meter, const QString& text);
00072     bool widgetMouseMoved(Karamba* k, int x, int y, int button);
00073     bool menuItemClicked(Karamba* k, KMenu* menu, long id);
00074     bool activeTaskChanged(Karamba* k, Task* t);
00075     bool taskAdded(Karamba* k, Task* t);
00076     bool taskRemoved(Karamba* k, Task* t);
00077     bool startupAdded(Karamba* k, Startup* t);
00078     bool startupRemoved(Karamba* k, Startup* t);
00079     bool commandOutput(Karamba* k, int pid, char *buffer);
00080     bool commandFinished(Karamba* k, int pid);
00081     bool itemDropped(Karamba* k, QString text, int x, int y);
00082     bool themeNotify(Karamba* k, const char *from, const char *txt);
00083     bool systrayUpdated(Karamba* k);
00084     bool desktopChanged(Karamba* k, int desktop);
00085     bool wallpaperChanged(Karamba* k, int desktop);
00086 };
00087 
00088 PyObject* py_testInterface(PyObject *, PyObject *args);
00089 
00090 #endif // KARAMBA_PYTHON_H

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal