summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobb <robb@ubuntu.hsd1.va.comcast.net>2007-03-18 12:39:37 -0400
committerrobb <robb@ubuntu.hsd1.va.comcast.net>2007-03-18 12:39:37 -0400
commit6f6a3a38f034bf3b85cd1ff5f283c46dacb677ea (patch)
tree6b72d98cd74026c11d785c93ae9b144b8b6c77aa
parent1c727b9e938e8911d968c64f72210ba0edff2e00 (diff)
downloadberyl-plugins-python.tar.gz
beryl-plugins-python.tar.bz2
-rw-r--r--pythonloader/Makefile75
-rw-r--r--pythonloader/README51
-rw-r--r--pythonloader/beryl.py1879
-rw-r--r--pythonloader/berylplugin.py290
-rw-r--r--pythonloader/berylpython.c543
-rw-r--r--pythonloader/berylpython.h13
-rw-r--r--pythonloader/berylpython.pyx155
-rw-r--r--pythonloader/python_init.h40
-rw-r--r--pythonloader/script.py176
9 files changed, 3222 insertions, 0 deletions
diff --git a/pythonloader/Makefile b/pythonloader/Makefile
new file mode 100644
index 0000000..6003230
--- /dev/null
+++ b/pythonloader/Makefile
@@ -0,0 +1,75 @@
+DESTDIR = $(HOME)/.beryl/plugins
+PLUGIN = berylpython
+SHADER = no
+
+BUILDDIR = build
+
+CC = gcc
+LIBTOOL = libtool
+INSTALL = install
+PYTHON = python2.4
+
+CGC = /usr/bin/cgc
+
+CFLAGS = -Wall -ggdb3 `pkg-config --cflags x11 beryl` -I/usr/include/$(PYTHON) -DIMAGEDIR=\"/usr/share/beryl\"
+LDFLAGS = `pkg-config --libs x11` -ldl -lpthread -lm -l$(PYTHON) -lutil
+
+headers := $(shell find -name '$(PLUGIN)*.h' 2> /dev/null | sed -e 's/^.\///')
+headers := $(filter-out $(PLUGIN)_shader.h,$(headers))
+
+color := $(shell if [ $$TERM = "dumb" ]; then echo "no"; else echo "yes"; fi)
+
+.PHONY:
+
+all: $(BUILDDIR) $(shader_header) $(BUILDDIR)/lib$(PLUGIN).la
+
+$(PLUGIN).c: berylpython.pyx
+ pyrexc berylpython.pyx
+
+fromscratch:
+ h2xml.py `pkg-config --cflags x11 beryl` /usr/include/beryl/beryl.h -o beryl.xml
+ xml2py.py -r "^(?"\!"PFNG)Comp.*" beryl.xml -o beryl.py
+
+$(BUILDDIR) :
+ @mkdir $(BUILDDIR)
+
+$(BUILDDIR)/lib$(PLUGIN).lo: $(PLUGIN).c $(headers) $(shader_header)
+ @if [ '$(color)' != 'no' ]; then \
+ echo -e "\033[0;1;5mcompiling \033[0;1;37m: \033[0;32m$< \033[0;1;37m-> \033[0;31m$@\033[0m"; \
+ else \
+ echo "compiling : $< -> $@"; \
+ fi
+ $(LIBTOOL) --quiet --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
+ @if [ '$(color)' != 'no' ]; then \
+ echo -e "\r\033[0mcompiling : \033[34m$< -> $@\033[0m"; \
+ fi
+
+$(BUILDDIR)/lib$(PLUGIN).la: $(BUILDDIR)/lib$(PLUGIN).lo
+ @if [ '$(color)' != 'no' ]; then \
+ echo -e "\033[0;1;5mlinking \033[0;1;37m: \033[0;32m$< \033[0;1;37m-> \033[0;31m$@\033[0m"; \
+ else \
+ echo "linking : $< -> $@"; \
+ fi
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -rpath $(DESTDIR) -o $@ $<
+ @if [ '$(color)' != 'no' ]; then \
+ echo -e "\r\033[0mlinking : \033[34m$< -> $@\033[0m"; \
+ fi
+
+install: all
+ @if [ '$(color)' != 'no' ]; then \
+ echo -e "\033[0;1;5minstall \033[0;1;37m: \033[0;31m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \
+ else \
+ echo "install : $(DESTDIR)/lib$(PLUGIN).so"; \
+ fi
+ @mkdir -p $(DESTDIR)
+ $(INSTALL) $(BUILDDIR)/.libs/lib$(PLUGIN).so $(DESTDIR)/lib$(PLUGIN).so
+ @if [ '$(color)' != 'no' ]; then \
+ echo -e "\r\033[0minstall : \033[34m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \
+ fi
+
+clean:
+ rm -rf $(BUILDDIR)
+
+uninstall:
+ rm -f $(DESTDIR)/lib$(PLUGIN).so
+
diff --git a/pythonloader/README b/pythonloader/README
new file mode 100644
index 0000000..b5e6805
--- /dev/null
+++ b/pythonloader/README
@@ -0,0 +1,51 @@
+This is an extremely experimental plugin that has a long way to go.
+You should not attempt to run it without first looking at the source
+and at least having a vague concept of what it does.
+
+- irid, 11/04/07
+
+Things you will need to build from scratch (needed if you're running a
+revision much greater than 4284 and the interface [beryl.py] goes out of date):
+
+ * ctypes
+ * ctypeslib code generator (can be found at
+ http://svn.python.org/projects/ctypes/trunk/ctypeslib/)
+ * gccxml ( http://www.gccxml.org/ )
+
+ Run make fromscratch to rebuild beryl.py, otherwise make install.
+
+ 27/02/2007:
+ Basic functionality in place. Rotating black square bounces from left to
+ right in script.py
+ - Beware that you need to change the 3rd line of berylpython.pyx to make
+ it work for you (should point to the directory that contains script.py)
+
+ Problems that need to be overcome:
+ - Calling C functions from python
+ Currently a bit difficult because we may need access to functions
+ from random libraries, or from beryl or elsewhere. For example, the
+ [ bad example here, but imagine some beryl function ]
+ XStringToKeysym function can be got at by doing ctypes.CDLL(None).XStringToKeysym
+ however firstly, we need to tell ctypes what argument and return
+ type conversions to do. Secondly, that doesn't work when
+ beryl-settings loads up the module to check what our module provides
+ because beryl-settings doesn't load libX11.so.
+ Currently any for beryl functions you want to call from python you
+ need to tell ctypes what the argument types are.
+
+ - A neat way of specifying options.
+ Some sort of dictionary form would probably be nice.
+
+ - Complex callback return types.
+ ctypes doesn't like us trying to make a callback that returns a non-
+ fundamental type. Why this is I cannot fathom. It can be got around by
+ making thet return type an int and using the 'addressof' function
+ cleverly, but this is really hacky and requires manual editing of the
+ bindings file (beryl.py) - another annoyance.
+
+ Todo:
+ - Have better installation method. Put things in directories where they are
+ accessible.
+ - Good directory structure for build?
+ - Maybe dynamic loading of types and functions and such?
+ - Make plugin 'overload' plugin loader. \ No newline at end of file
diff --git a/pythonloader/beryl.py b/pythonloader/beryl.py
new file mode 100644
index 0000000..482040f
--- /dev/null
+++ b/pythonloader/beryl.py
@@ -0,0 +1,1879 @@
+from ctypes import *
+STRING = c_char_p
+
+
+CompPluginRuleAfterCategory = 2
+CompPluginRuleBefore = 0
+CompOptionTypeAction = 5
+CompOptionTypeBool = 0
+CompBindingTypeNone = 0
+CompBindingTypeButton = 2
+CompActionStateCancel = 1024
+CompActionStateTermEdgeDnd = 256
+CompActionStateInitBell = 16
+CompActionStateModifier = 2048
+CompActionStateInitButton = 4
+CompActionStateInitKey = 1
+CompPluginRuleRequire = 3
+CompPluginRuleAfter = 1
+CompActionStateTermEdge = 64
+CompOptionTypeList = 6
+CompOptionTypeString = 3
+CompOptionTypeInt = 1
+CompBindingTypeEdgeButton = 4
+CompBindingTypeKey = 1
+CompActionStateInitEdgeDnd = 128
+CompActionStateInitEdge = 32
+CompActionStateTermButton = 8
+CompActionStateTermKey = 2
+CompOptionTypeFloat = 2
+CompActionStateCommit = 512
+CompOptionTypeColor = 4
+CompPluginRuleEnd = 4
+class _CompPlugin(Structure):
+ pass
+CompPlugin = _CompPlugin
+class _CompDisplay(Structure):
+ pass
+CompDisplay = _CompDisplay
+class _CompScreen(Structure):
+ pass
+CompScreen = _CompScreen
+class _CompWindow(Structure):
+ pass
+CompWindow = _CompWindow
+class _CompTexture(Structure):
+ pass
+CompTexture = _CompTexture
+class _CompIcon(Structure):
+ pass
+CompIcon = _CompIcon
+class _CompWindowExtents(Structure):
+ pass
+CompWindowExtents = _CompWindowExtents
+class _CompProgram(Structure):
+ pass
+CompProgram = _CompProgram
+class _CompFunction(Structure):
+ pass
+CompFunction = _CompFunction
+class _CompFunctionData(Structure):
+ pass
+CompFunctionData = _CompFunctionData
+class _CompLibraryFunction(Structure):
+ pass
+CompLibraryFunction = _CompLibraryFunction
+class _CompPrivate(Union):
+ pass
+CompPrivate = _CompPrivate
+
+# values for enumeration 'CompOptionType'
+CompOptionType = c_int # enum
+
+# values for enumeration 'CompBindingType'
+CompBindingType = c_int # enum
+
+# values for enumeration 'CompActionState'
+CompActionState = c_int # enum
+class _CompKeyBinding(Structure):
+ pass
+CompKeyBinding = _CompKeyBinding
+class _CompButtonBinding(Structure):
+ pass
+CompButtonBinding = _CompButtonBinding
+class _CompOptionValue(Union):
+ pass
+CompOptionValue = _CompOptionValue
+class _CompOption(Structure):
+ pass
+CompOption = _CompOption
+class _CompAction(Structure):
+ pass
+CompAction = _CompAction
+CompActionCallBackProc = CFUNCTYPE(c_int, POINTER(CompDisplay), POINTER(CompAction), CompActionState, POINTER(CompOption), c_int)
+class CompListValue(Structure):
+ pass
+CompListValue._fields_ = [
+ ('type', CompOptionType),
+ ('value', POINTER(CompOptionValue)),
+ ('nValue', c_int),
+]
+class _CompOptionIntRestriction(Structure):
+ pass
+CompOptionIntRestriction = _CompOptionIntRestriction
+class _CompOptionFloatRestriction(Structure):
+ pass
+CompOptionFloatRestriction = _CompOptionFloatRestriction
+class _CompOptionStringRestriction(Structure):
+ pass
+CompOptionStringRestriction = _CompOptionStringRestriction
+class CompOptionRestriction(Union):
+ pass
+_CompOptionIntRestriction._fields_ = [
+ ('min', c_int),
+ ('max', c_int),
+]
+_CompOptionFloatRestriction._fields_ = [
+ ('min', c_float),
+ ('max', c_float),
+ ('precision', c_float),
+]
+_CompOptionStringRestriction._fields_ = [
+ ('string', POINTER(STRING)),
+ ('nString', c_int),
+]
+CompOptionRestriction._fields_ = [
+ ('i', CompOptionIntRestriction),
+ ('f', CompOptionFloatRestriction),
+ ('s', CompOptionStringRestriction),
+]
+CompTimeoutHandle = c_int
+CompWatchFdHandle = c_int
+
+# values for enumeration 'CompFocusOnCloseModes'
+FocusLastWindow = 0
+FocusPointer = 1
+CompFocusOnCloseModes = c_int # enum
+class _CompRequestFlag(Structure):
+ pass
+CompRequestFlag = _CompRequestFlag
+class _CompTransform(Structure):
+ pass
+CompTransform = _CompTransform
+class _CompMatrix(Structure):
+ pass
+CompMatrix = _CompMatrix
+
+# values for enumeration 'CompTextureFilter'
+COMP_TEXTURE_FILTER_FAST = 0
+COMP_TEXTURE_FILTER_GOOD = 1
+CompTextureFilter = c_int # enum
+class _CompKeyGrab(Structure):
+ pass
+CompKeyGrab = _CompKeyGrab
+class _CompButtonGrab(Structure):
+ pass
+CompButtonGrab = _CompButtonGrab
+class _CompGrab(Structure):
+ pass
+CompGrab = _CompGrab
+class _CompGroup(Structure):
+ pass
+CompGroup = _CompGroup
+class _CompStartupSequence(Structure):
+ pass
+CompStartupSequence = _CompStartupSequence
+class _CompFBConfig(Structure):
+ pass
+CompFBConfig = _CompFBConfig
+class _CompScreenEdge(Structure):
+ pass
+CompScreenEdge = _CompScreenEdge
+class _CompOutput(Structure):
+ pass
+CompOutput = _CompOutput
+
+# values for enumeration 'CompProjectionStyle'
+COMP_PERSPECTIVE_LOCAL = 0
+COMP_PERSPECTIVE_LOCAL_REAL = 1
+COMP_PERSPECTIVE_GLOBAL = 2
+COMP_PERSPECTIVE_GLOBAL_REAL = 3
+CompProjectionStyle = c_int # enum
+class _CompStruts(Structure):
+ pass
+CompStruts = _CompStruts
+
+# values for enumeration 'CompPluginRule'
+CompPluginRule = c_int # enum
+class _CompPluginDep(Structure):
+ pass
+CompPluginDep = _CompPluginDep
+class _CompPluginFeature(Structure):
+ pass
+CompPluginFeature = _CompPluginFeature
+class _CompPluginVTable(Structure):
+ pass
+CompPluginVTable = _CompPluginVTable
+_CompProgram._fields_ = [
+]
+_CompFunction._fields_ = [
+]
+_CompFunctionData._fields_ = [
+]
+_CompPrivate._fields_ = [
+ ('ptr', c_void_p),
+ ('val', c_long),
+ ('uval', c_ulong),
+ ('fptr', CFUNCTYPE(c_void_p)),
+]
+_CompKeyBinding._fields_ = [
+ ('keysym', c_int),
+ ('modifiers', c_uint),
+]
+_CompButtonBinding._fields_ = [
+ ('button', c_int),
+ ('modifiers', c_uint),
+]
+_CompAction._fields_ = [
+ ('initiate', CompActionCallBackProc),
+ ('terminate', CompActionCallBackProc),
+ ('state', CompActionState),
+ ('type', CompBindingType),
+ ('key', CompKeyBinding),
+ ('button', CompButtonBinding),
+ ('bell', c_int),
+ ('edgeMask', c_uint),
+ ('edgeButton', c_int),
+]
+_CompOptionValue._fields_ = [
+ ('b', c_int),
+ ('i', c_int),
+ ('f', c_float),
+ ('s', STRING),
+ ('c', c_ushort * 4),
+ ('action', CompAction),
+ ('list', CompListValue),
+]
+_CompOption._fields_ = [
+ ('name', STRING),
+ ('shortDesc', STRING),
+ ('longDesc', STRING),
+ ('group', STRING),
+ ('subGroup', STRING),
+ ('displayHints', STRING),
+ ('type', CompOptionType),
+ ('value', CompOptionValue),
+ ('rest', CompOptionRestriction),
+ ('advanced', c_int),
+]
+_CompRequestFlag._fields_ = [
+ ('data', c_ubyte * 8),
+ ('name', STRING),
+]
+class _XDisplay(Structure):
+ pass
+Display = _XDisplay
+class XineramaScreenInfo(Structure):
+ pass
+class SnDisplay(Structure):
+ pass
+Atom = c_ulong
+GLenum = c_uint
+XID = c_ulong
+Window = XID
+class XModifierKeymap(Structure):
+ pass
+KeyCode = c_ubyte
+SetDisplayOptionProc = CFUNCTYPE(c_int, POINTER(CompDisplay), STRING, POINTER(CompOptionValue))
+SetDisplayOptionForPluginProc = CFUNCTYPE(c_int, POINTER(CompDisplay), STRING, STRING, POINTER(CompOptionValue))
+InitPluginForDisplayProc = CFUNCTYPE(c_int, POINTER(CompPlugin), POINTER(CompDisplay))
+FiniPluginForDisplayProc = CFUNCTYPE(None, POINTER(CompPlugin), POINTER(CompDisplay))
+class _XEvent(Union):
+ pass
+XEvent = _XEvent
+HandleEventProc = CFUNCTYPE(None, POINTER(CompDisplay), POINTER(XEvent))
+HandleBerylEventProc = CFUNCTYPE(None, POINTER(CompDisplay), STRING, STRING, POINTER(CompOption), c_int)
+FileToImageProc = CFUNCTYPE(c_int, POINTER(CompDisplay), STRING, STRING, POINTER(c_int), POINTER(c_int), POINTER(c_int), POINTER(c_void_p))
+ImageToFileProc = CFUNCTYPE(c_int, POINTER(CompDisplay), STRING, STRING, STRING, c_int, c_int, c_int, c_void_p)
+LoadPluginProc = CFUNCTYPE(c_int, POINTER(CompPlugin), STRING, STRING)
+UnloadPluginProc = CFUNCTYPE(None, POINTER(CompPlugin))
+class XShmSegmentInfo(Structure):
+ pass
+ShmSeg = c_ulong
+XShmSegmentInfo._fields_ = [
+ ('shmseg', ShmSeg),
+ ('shmid', c_int),
+ ('shmaddr', STRING),
+ ('readOnly', c_int),
+]
+class _IPCS_Atom(Structure):
+ pass
+IPCS_Atom = _IPCS_Atom
+class _BerylSettingsContext(Structure):
+ pass
+_CompDisplay._fields_ = [
+ ('focusStealingLevel', c_int),
+ ('display', POINTER(Display)),
+ ('screens', POINTER(CompScreen)),
+ ('screenPrivateIndices', STRING),
+ ('screenPrivateLen', c_int),
+ ('compositeEvent', c_int),
+ ('compositeError', c_int),
+ ('compositeOpcode', c_int),
+ ('damageEvent', c_int),
+ ('damageError', c_int),
+ ('randrEvent', c_int),
+ ('randrError', c_int),
+ ('syncEvent', c_int),
+ ('syncError', c_int),
+ ('shapeExtension', c_int),
+ ('shapeEvent', c_int),
+ ('shapeError', c_int),
+ ('xkbExtension', c_int),
+ ('xkbEvent', c_int),
+ ('xkbError', c_int),
+ ('xineramaExtension', c_int),
+ ('xineramaEvent', c_int),
+ ('xineramaError', c_int),
+ ('screenInfo', POINTER(XineramaScreenInfo)),
+ ('nScreenInfo', c_int),
+ ('snDisplay', POINTER(SnDisplay)),
+ ('supportedAtom', Atom),
+ ('supportingWmCheckAtom', Atom),
+ ('utf8StringAtom', Atom),
+ ('wmNameAtom', Atom),
+ ('winTypeAtom', Atom),
+ ('winTypeDesktopAtom', Atom),
+ ('winTypeDockAtom', Atom),
+ ('winTypeToolbarAtom', Atom),
+ ('winTypeMenuAtom', Atom),
+ ('winTypeUtilAtom', Atom),
+ ('winTypeSplashAtom', Atom),
+ ('winTypeDialogAtom', Atom),
+ ('winTypeNormalAtom', Atom),
+ ('winTypeDropdownMenuAtom', Atom),
+ ('winTypePopupMenuAtom', Atom),
+ ('winTypeTooltipAtom', Atom),
+ ('winTypeNotificationAtom', Atom),
+ ('winTypeComboAtom', Atom),
+ ('winTypeDndAtom', Atom),
+ ('winOpacityAtom', Atom),
+ ('winBrightnessAtom', Atom),
+ ('winSaturationAtom', Atom),
+ ('winActiveAtom', Atom),
+ ('winDesktopAtom', Atom),
+ ('workareaAtom', Atom),
+ ('desktopViewportAtom', Atom),
+ ('desktopGeometryAtom', Atom),
+ ('currentDesktopAtom', Atom),
+ ('numberOfDesktopsAtom', Atom),
+ ('winStateAtom', Atom),
+ ('winStateModalAtom', Atom),
+ ('winStateStickyAtom', Atom),
+ ('winStateMaximizedVertAtom', Atom),
+ ('winStateMaximizedHorzAtom', Atom),
+ ('winStateShadedAtom', Atom),
+ ('winStateSkipTaskbarAtom', Atom),
+ ('winStateSkipPagerAtom', Atom),
+ ('winStateHiddenAtom', Atom),
+ ('winStateFullscreenAtom', Atom),
+ ('winStateAboveAtom', Atom),
+ ('winStateBelowAtom', Atom),
+ ('winStateDemandsAttentionAtom', Atom),
+ ('winStateDisplayModalAtom', Atom),
+ ('winStateNoFocusAtom', Atom),
+ ('winActionMoveAtom', Atom),
+ ('winActionResizeAtom', Atom),
+ ('winActionStickAtom', Atom),
+ ('winActionMinimizeAtom', Atom),
+ ('winActionMaximizeHorzAtom', Atom),
+ ('winActionMaximizeVertAtom', Atom),
+ ('winActionFullscreenAtom', Atom),
+ ('winActionCloseAtom', Atom),
+ ('winActionShadeAtom', Atom),
+ ('winActionChangeDesktopAtom', Atom),
+ ('wmAllowedActionsAtom', Atom),
+ ('wmStrutAtom', Atom),
+ ('wmStrutPartialAtom', Atom),
+ ('wmUserTimeAtom', Atom),
+ ('wmIconAtom', Atom),
+ ('clientListAtom', Atom),
+ ('clientListStackingAtom', Atom),
+ ('frameExtentsAtom', Atom),
+ ('frameWindowAtom', Atom),
+ ('wmStateAtom', Atom),
+ ('wmChangeStateAtom', Atom),
+ ('wmProtocolsAtom', Atom),
+ ('wmClientLeaderAtom', Atom),
+ ('wmDeleteWindowAtom', Atom),
+ ('wmTakeFocusAtom', Atom),
+ ('wmPingAtom', Atom),
+ ('wmSyncRequestAtom', Atom),
+ ('wmSyncRequestCounterAtom', Atom),
+ ('closeWindowAtom', Atom),
+ ('wmMoveResizeAtom', Atom),
+ ('moveResizeWindowAtom', Atom),
+ ('restackWindowAtom', Atom),
+ ('showingDesktopAtom', Atom),
+ ('xBackgroundAtom', Atom * 2),
+ ('toolkitActionAtom', Atom),
+ ('toolkitActionMainMenuAtom', Atom),
+ ('toolkitActionRunDialogAtom', Atom),
+ ('toolkitActionWindowMenuAtom', Atom),
+ ('toolkitActionForceQuitDialogAtom', Atom),
+ ('mwmHintsAtom', Atom),
+ ('xdndAwareAtom', Atom),
+ ('xdndEnterAtom', Atom),
+ ('xdndLeaveAtom', Atom),
+ ('xdndPositionAtom', Atom),
+ ('xdndStatusAtom', Atom),
+ ('xdndDropAtom', Atom),
+ ('managerAtom', Atom),
+ ('targetsAtom', Atom),
+ ('multipleAtom', Atom),
+ ('timestampAtom', Atom),
+ ('versionAtom', Atom),
+ ('atomPairAtom', Atom),
+ ('startupIdAtom', Atom),
+ ('berylNetWmUserCreationTime', Atom),
+ ('restoreGeometryAtom', Atom),
+ ('berylDesktopManaged', Atom),
+ ('lastPing', c_uint),
+ ('pingHandle', CompTimeoutHandle),
+ ('textureFilter', GLenum),
+ ('focusOnCloseMode', CompFocusOnCloseModes),
+ ('textureAnisotropic', c_int),
+ ('glIncludeInferiorsOwner', Window),
+ ('activeWindow', Window),
+ ('below', Window),
+ ('displayString', c_char * 256),
+ ('modMap', POINTER(XModifierKeymap)),
+ ('modMask', c_uint * 7),
+ ('ignoredModMask', c_uint),
+ ('escapeKeyCode', KeyCode),
+ ('returnKeyCode', KeyCode),
+ ('opt', CompOption * 67),
+ ('autoRaiseHandle', CompTimeoutHandle),
+ ('autoRaiseWindow', Window),
+ ('delayedEdgeHandle', CompTimeoutHandle),
+ ('delayedEdge', c_uint),
+ ('delayedEdgeState', CompActionState),
+ ('delayedEdgeNOption', c_int),
+ ('delayedEdgeOption', CompOption * 7),
+ ('plugin', CompOptionValue),
+ ('dirtyPluginList', c_int),
+ ('setDisplayOption', SetDisplayOptionProc),
+ ('setDisplayOptionForPlugin', SetDisplayOptionForPluginProc),
+ ('initPluginForDisplay', InitPluginForDisplayProc),
+ ('finiPluginForDisplay', FiniPluginForDisplayProc),
+ ('handleEvent', HandleEventProc),
+ ('handleBerylEvent', HandleBerylEventProc),
+ ('fileToImage', FileToImageProc),
+ ('imageToFile', ImageToFileProc),
+ ('loaderLoadPlugin', LoadPluginProc),
+ ('loaderUnloadPlugin', UnloadPluginProc),
+ ('libFunctions', POINTER(CompLibraryFunction)),
+ ('privates', POINTER(CompPrivate)),
+ ('lastPointerX', c_int),
+ ('lastPointerY', c_int),
+ ('pointerX', c_int),
+ ('pointerY', c_int),
+ ('shmInfo', XShmSegmentInfo),
+ ('ipcs_size', c_uint),
+ ('ipcs_data', POINTER(c_ubyte)),
+ ('ipcs_atom_count', c_uint),
+ ('ipcs_atoms', POINTER(IPCS_Atom)),
+ ('requestFlags', POINTER(CompRequestFlag)),
+ ('nRequestFlags', c_int),
+ ('context', POINTER(_BerylSettingsContext)),
+ ('reloadSettingsAtom', Atom),
+ ('on_shutdown', c_int),
+]
+_CompTransform._fields_ = [
+ ('m', c_float * 16),
+]
+_CompMatrix._fields_ = [
+ ('xx', c_float),
+ ('yx', c_float),
+ ('xy', c_float),
+ ('yy', c_float),
+ ('x0', c_float),
+ ('y0', c_float),
+]
+GLuint = c_uint
+GLfloat = c_float
+GLXPixmap = XID
+class _CopyModeData(Structure):
+ pass
+class Box(Structure):
+ pass
+Box._fields_ = [
+ ('x1', c_short),
+ ('x2', c_short),
+ ('y1', c_short),
+ ('y2', c_short),
+]
+BOX = Box
+_CopyModeData._fields_ = [
+ ('width', c_int),
+ ('height', c_int),
+ ('depth', c_int),
+ ('damaged', c_int),
+ ('damage', BOX),
+ ('fullDamage', c_int),
+]
+CopyModeData = _CopyModeData
+_CompTexture._fields_ = [
+ ('mode', c_int),
+ ('name', GLuint),
+ ('target', GLenum),
+ ('dx', GLfloat),
+ ('dy', GLfloat),
+ ('pixmap', GLXPixmap),
+ ('filter', GLenum),
+ ('wrap', GLenum),
+ ('matrix', CompMatrix),
+ ('oldMipmaps', c_int),
+ ('mipmap', c_int),
+ ('refCount', c_int),
+ ('cmd', CopyModeData),
+]
+_CompKeyGrab._fields_ = [
+ ('keycode', c_int),
+ ('modifiers', c_uint),
+ ('count', c_int),
+]
+_CompButtonGrab._fields_ = [
+ ('button', c_int),
+ ('modifiers', c_uint),
+ ('count', c_int),
+]
+Cursor = XID
+_CompGrab._fields_ = [
+ ('active', c_int),
+ ('cursor', Cursor),
+ ('name', STRING),
+]
+_CompGroup._fields_ = [
+ ('next', POINTER(_CompGroup)),
+ ('refCnt', c_uint),
+ ('id', Window),
+]
+class SnStartupSequence(Structure):
+ pass
+_CompStartupSequence._fields_ = [
+ ('next', POINTER(_CompStartupSequence)),
+ ('sequence', POINTER(SnStartupSequence)),
+ ('viewportX', c_uint),
+ ('viewportY', c_uint),
+]
+class __GLXFBConfigRec(Structure):
+ pass
+GLXFBConfig = POINTER(__GLXFBConfigRec)
+_CompFBConfig._fields_ = [
+ ('fbConfig', GLXFBConfig),
+ ('yInverted', c_int),
+ ('mipmap', c_int),
+ ('textureFormat', c_int),
+]
+_CompScreenEdge._fields_ = [
+ ('id', Window),
+ ('count', c_uint),
+]
+_CompIcon._fields_ = [
+ ('texture', CompTexture),
+ ('width', c_int),
+ ('height', c_int),
+]
+class _XRegion(Structure):
+ pass
+_XRegion._fields_ = [
+ ('size', c_long),
+ ('numRects', c_long),
+ ('rects', POINTER(BOX)),
+ ('extents', BOX),
+]
+REGION = _XRegion
+_CompOutput._fields_ = [
+ ('name', STRING),
+ ('region', REGION),
+ ('workRegion', REGION),
+ ('width', c_int),
+ ('height', c_int),
+]
+Colormap = XID
+Region = POINTER(_XRegion)
+class XWindowAttributes(Structure):
+ pass
+class Visual(Structure):
+ pass
+class Screen(Structure):
+ pass
+XWindowAttributes._fields_ = [
+ ('x', c_int),
+ ('y', c_int),
+ ('width', c_int),
+ ('height', c_int),
+ ('border_width', c_int),
+ ('depth', c_int),
+ ('visual', POINTER(Visual)),
+ ('root', Window),
+ ('c_class', c_int),
+ ('bit_gravity', c_int),
+ ('win_gravity', c_int),
+ ('backing_store', c_int),
+ ('backing_planes', c_ulong),
+ ('backing_pixel', c_ulong),
+ ('save_under', c_int),
+ ('colormap', Colormap),
+ ('map_installed', c_int),
+ ('map_state', c_int),
+ ('all_event_masks', c_long),
+ ('your_event_mask', c_long),
+ ('do_not_propagate_mask', c_long),
+ ('override_redirect', c_int),
+ ('screen', POINTER(Screen)),
+]
+class XVisualInfo(Structure):
+ pass
+GLint = c_int
+class XRectangle(Structure):
+ pass
+class SnMonitorContext(Structure):
+ pass
+Time = c_ulong
+class timeval(Structure):
+ pass
+__time_t = c_long
+__suseconds_t = c_long
+timeval._fields_ = [
+ ('tv_sec', __time_t),
+ ('tv_usec', __suseconds_t),
+]
+XRectangle._fields_ = [
+ ('x', c_short),
+ ('y', c_short),
+ ('width', c_ushort),
+ ('height', c_ushort),
+]
+FuncPtr = CFUNCTYPE(None)
+GLubyte = c_ubyte
+GLXGetProcAddressProc = CFUNCTYPE(FuncPtr, POINTER(GLubyte))
+GLXBindTexImageProc = CFUNCTYPE(None, POINTER(Display), c_ulong, c_int, POINTER(c_int))
+GLXReleaseTexImageProc = CFUNCTYPE(None, POINTER(Display), c_ulong, c_int)
+GLXQueryDrawableProc = CFUNCTYPE(None, POINTER(Display), c_ulong, c_int, POINTER(c_uint))
+GLXCopySubBufferProc = CFUNCTYPE(None, POINTER(Display), c_ulong, c_int, c_int, c_int, c_int)
+GLXGetVideoSyncProc = CFUNCTYPE(c_int, POINTER(c_uint))
+GLXWaitVideoSyncProc = CFUNCTYPE(c_int, c_int, c_int, POINTER(c_uint))
+GLXGetFBConfigsProc = CFUNCTYPE(POINTER(GLXFBConfig), POINTER(Display), c_int, POINTER(c_int))
+GLXGetFBConfigAttribProc = CFUNCTYPE(c_int, POINTER(Display), POINTER(__GLXFBConfigRec), c_int, POINTER(c_int))
+GLXCreatePixmapProc = CFUNCTYPE(GLXPixmap, POINTER(Display), POINTER(__GLXFBConfigRec), c_ulong, POINTER(c_int))
+GLActiveTextureProc = CFUNCTYPE(None, c_uint)
+GLClientActiveTextureProc = CFUNCTYPE(None, c_uint)
+GLGenProgramsProc = CFUNCTYPE(None, c_int, POINTER(GLuint))
+GLDeleteProgramsProc = CFUNCTYPE(None, c_int, POINTER(GLuint))
+GLBindProgramProc = CFUNCTYPE(None, c_uint, c_uint)
+GLvoid = None
+GLProgramStringProc = CFUNCTYPE(None, c_uint, c_uint, c_int, POINTER(GLvoid))
+GLProgramParameter4fProc = CFUNCTYPE(None, c_uint, c_uint, c_float, c_float, c_float, c_float)
+GLGenFramebuffersProc = CFUNCTYPE(None, c_int, POINTER(GLuint))
+GLDeleteFramebuffersProc = CFUNCTYPE(None, c_int, POINTER(GLuint))
+GLBindFramebufferProc = CFUNCTYPE(None, c_uint, c_uint)
+GLCheckFramebufferStatusProc = CFUNCTYPE(GLenum, c_uint)
+GLFramebufferTexture2DProc = CFUNCTYPE(None, c_uint, c_uint, c_uint, c_uint, c_int)
+GLGenerateMipmapProc = CFUNCTYPE(None, c_uint)
+GLGenRenderbuffersProc = CFUNCTYPE(None, c_int, POINTER(GLuint))
+GLDeleteRenderbuffersProc = CFUNCTYPE(None, c_int, POINTER(GLuint))
+GLBindRenderbufferProc = CFUNCTYPE(None, c_uint, c_uint)
+GLRenderbufferStorageProc = CFUNCTYPE(None, c_uint, c_uint, c_int, c_int)
+GLFramebufferRenderbufferProc = CFUNCTYPE(None, c_uint, c_uint, c_uint, c_uint)
+class __GLXcontextRec(Structure):
+ pass
+GLXContext = POINTER(__GLXcontextRec)
+SetScreenOptionProc = CFUNCTYPE(c_int, POINTER(CompScreen), STRING, POINTER(CompOptionValue))
+SetScreenOptionForPluginProc = CFUNCTYPE(c_int, POINTER(CompScreen), STRING, STRING, POINTER(CompOptionValue))
+InitPluginForScreenProc = CFUNCTYPE(c_int, POINTER(CompPlugin), POINTER(CompScreen))
+FiniPluginForScreenProc = CFUNCTYPE(None, POINTER(CompPlugin), POINTER(CompScreen))
+PreparePaintScreenProc = CFUNCTYPE(None, POINTER(CompScreen), c_int)
+DonePaintScreenProc = CFUNCTYPE(None, POINTER(CompScreen))
+class _ScreenPaintAttrib(Structure):
+ pass
+ScreenPaintAttrib = _ScreenPaintAttrib
+PaintScreenProc = CFUNCTYPE(c_int, POINTER(CompScreen), POINTER(ScreenPaintAttrib), POINTER(CompTransform), POINTER(_XRegion), c_int, c_uint)
+PaintTransformedScreenProc = CFUNCTYPE(None, POINTER(CompScreen), POINTER(ScreenPaintAttrib), POINTER(CompTransform), POINTER(_XRegion), c_int, c_uint)
+ApplyScreenTransformProc = CFUNCTYPE(None, POINTER(CompScreen), POINTER(ScreenPaintAttrib), c_int, POINTER(CompTransform))
+PaintBackgroundProc = CFUNCTYPE(None, POINTER(CompScreen), POINTER(_XRegion), c_uint)
+class _WindowPaintAttrib(Structure):
+ pass
+WindowPaintAttrib = _WindowPaintAttrib
+PaintWindowProc = CFUNCTYPE(c_int, POINTER(CompWindow), POINTER(WindowPaintAttrib), POINTER(CompTransform), POINTER(_XRegion), c_uint)
+class _FragmentAttrib(Structure):
+ pass
+FragmentAttrib = _FragmentAttrib
+DrawWindowProc = CFUNCTYPE(c_int, POINTER(CompWindow), POINTER(CompTransform), POINTER(FragmentAttrib), POINTER(_XRegion), c_uint)
+AddWindowGeometryProc = CFUNCTYPE(None, POINTER(CompWindow), POINTER(CompMatrix), c_int, POINTER(_XRegion), POINTER(_XRegion))
+DrawWindowGeometryProc = CFUNCTYPE(None, POINTER(CompWindow))
+DrawWindowTextureProc = CFUNCTYPE(None, POINTER(CompWindow), POINTER(CompTexture), POINTER(FragmentAttrib), c_uint)
+DamageWindowRectProc = CFUNCTYPE(c_int, POINTER(CompWindow), c_int, POINTER(Box))
+GetOutputExtentsForWindowProc = CFUNCTYPE(None, POINTER(CompWindow), POINTER(CompWindowExtents))
+FocusWindowProc = CFUNCTYPE(c_int, POINTER(CompWindow))
+SetClipPlanesProc = CFUNCTYPE(None, POINTER(CompScreen), c_int)
+WindowResizeNotifyProc = CFUNCTYPE(None, POINTER(CompWindow), c_int, c_int, c_int, c_int, c_int)
+WindowMoveNotifyProc = CFUNCTYPE(None, POINTER(CompWindow), c_int, c_int, c_int)
+WindowGrabNotifyProc = CFUNCTYPE(None, POINTER(CompWindow), c_int, c_int, c_uint, c_uint)
+WindowUngrabNotifyProc = CFUNCTYPE(None, POINTER(CompWindow))
+EnterShowDesktopNotifyProc = CFUNCTYPE(c_int, POINTER(CompScreen))
+LeaveShowDesktopNotifyProc = CFUNCTYPE(c_int, POINTER(CompScreen), POINTER(CompWindow))
+WindowStateChangeNotifyProc = CFUNCTYPE(None, POINTER(CompWindow))
+WindowRestackNotifyProc = CFUNCTYPE(None, POINTER(CompWindow))
+OutputChangeNotifyProc = CFUNCTYPE(None, POINTER(CompScreen))
+_CompScreen._fields_ = [
+ ('next', POINTER(CompScreen)),
+ ('display', POINTER(CompDisplay)),
+ ('windows', POINTER(CompWindow)),
+ ('reverseWindows', POINTER(CompWindow)),
+ ('windowPrivateIndices', STRING),
+ ('windowPrivateLen', c_int),
+ ('colormap', Colormap),
+ ('screenNum', c_int),
+ ('width', c_int),
+ ('height', c_int),
+ ('x', c_int),
+ ('y', c_int),
+ ('hsize', c_int),
+ ('vsize', c_int),
+ ('nDesktop', c_uint),
+ ('currentDesktop', c_uint),
+ ('region', REGION),
+ ('damage', Region),
+ ('damageMask', c_ulong),
+ ('root', Window),
+ ('attrib', XWindowAttributes),
+ ('grabWindow', Window),
+ ('useFBConfig', c_int),
+ ('glxPixmapFBConfigs', CompFBConfig * 33),
+ ('glxPixmapVisuals', POINTER(XVisualInfo) * 33),
+ ('textureRectangle', c_int),
+ ('textureNonPowerOfTwo', c_int),
+ ('textureEnvCombine', c_int),
+ ('textureEnvCrossbar', c_int),
+ ('textureBorderClamp', c_int),
+ ('maxTextureSize', GLint),
+ ('fbo', c_int),
+ ('fragmentProgram', c_int),
+ ('maxTextureUnits', c_int),
+ ('anisotropicFiltering', c_int),
+ ('maxAnisotropy', c_float),
+ ('invisibleCursor', Cursor),
+ ('exposeRects', POINTER(XRectangle)),
+ ('sizeExpose', c_int),
+ ('nExpose', c_int),
+ ('backgroundTexture', CompTexture),
+ ('pendingDestroys', c_uint),
+ ('desktopWindowCount', c_int),
+ ('mapNum', c_uint),
+ ('activeNum', c_uint),
+ ('outputDev', POINTER(CompOutput)),
+ ('nOutputDev', c_int),
+ ('currentOutputDev', c_int),
+ ('overlayWindowCount', c_int),
+ ('screenEdge', CompScreenEdge * 8),
+ ('snContext', POINTER(SnMonitorContext)),
+ ('startupSequences', POINTER(CompStartupSequence)),
+ ('startupSequenceTimeoutHandle', c_uint),
+ ('filter', c_int * 3),
+ ('groups', POINTER(CompGroup)),
+ ('defaultIcon', POINTER(CompIcon)),
+ ('canDoSaturated', c_int),
+ ('canDoSlightlySaturated', c_int),
+ ('wmSnSelectionWindow', Window),
+ ('wmSnAtom', Atom),
+ ('wmSnTimestamp', Time),
+ ('normalCursor', Cursor),
+ ('busyCursor', Cursor),
+ ('clientList', POINTER(POINTER(CompWindow))),
+ ('nClientList', c_int),
+ ('buttonGrab', POINTER(CompButtonGrab)),
+ ('nButtonGrab', c_int),
+ ('keyGrab', POINTER(CompKeyGrab)),
+ ('nKeyGrab', c_int),
+ ('grabs', POINTER(CompGrab)),
+ ('grabSize', c_int),
+ ('maxGrab', c_int),
+ ('rasterX', c_int),
+ ('rasterY', c_int),
+ ('lastRedraw', timeval),
+ ('nextRedraw', c_int),
+ ('redrawTime', c_int),
+ ('optimalRedrawTime', c_int),
+ ('frameStatus', c_int),
+ ('timeMult', c_int),
+ ('idle', c_int),
+ ('timeLeft', c_int),
+ ('pendingCommands', c_int),
+ ('lastFunctionId', c_int),
+ ('fragmentFunctions', POINTER(CompFunction)),
+ ('fragmentPrograms', POINTER(CompProgram)),
+ ('saturateFunction', c_int * 64 * 2),
+ ('projection', POINTER(GLfloat)),
+ ('cleared', c_int),
+ ('lighting', c_int),
+ ('slowAnimations', c_int),
+ ('workArea', XRectangle),
+ ('showingDesktopMask', c_uint),
+ ('desktopHintData', POINTER(c_ulong)),
+ ('desktopHintSize', c_int),
+ ('getProcAddress', GLXGetProcAddressProc),
+ ('bindTexImage', GLXBindTexImageProc),
+ ('releaseTexImage', GLXReleaseTexImageProc),
+ ('queryDrawable', GLXQueryDrawableProc),
+ ('copySubBuffer', GLXCopySubBufferProc),
+ ('getVideoSync', GLXGetVideoSyncProc),
+ ('waitVideoSync', GLXWaitVideoSyncProc),
+ ('getFBConfigs', GLXGetFBConfigsProc),
+ ('getFBConfigAttrib', GLXGetFBConfigAttribProc),
+ ('createPixmap', GLXCreatePixmapProc),
+ ('activeTexture', GLActiveTextureProc),
+ ('clientActiveTexture', GLClientActiveTextureProc),
+ ('genPrograms', GLGenProgramsProc),
+ ('deletePrograms', GLDeleteProgramsProc),
+ ('bindProgram', GLBindProgramProc),
+ ('programString', GLProgramStringProc),
+ ('programEnvParameter4f', GLProgramParameter4fProc),
+ ('programLocalParameter4f', GLProgramParameter4fProc),
+ ('genFramebuffers', GLGenFramebuffersProc),
+ ('deleteFramebuffers', GLDeleteFramebuffersProc),
+ ('bindFramebuffer', GLBindFramebufferProc),
+ ('checkFramebufferStatus', GLCheckFramebufferStatusProc),
+ ('framebufferTexture2D', GLFramebufferTexture2DProc),
+ ('generateMipmap', GLGenerateMipmapProc),
+ ('genRenderbuffers', GLGenRenderbuffersProc),
+ ('deleteRenderbuffers', GLDeleteRenderbuffersProc),
+ ('bindRenderbuffer', GLBindRenderbufferProc),
+ ('renderbufferStorage', GLRenderbufferStorageProc),
+ ('framebufferRenderbuffer', GLFramebufferRenderbufferProc),
+ ('ctx', GLXContext),
+ ('opt', CompOption * 13),
+ ('setScreenOption', SetScreenOptionProc),
+ ('setScreenOptionForPlugin', SetScreenOptionForPluginProc),
+ ('initPluginForScreen', InitPluginForScreenProc),
+ ('finiPluginForScreen', FiniPluginForScreenProc),
+ ('preparePaintScreen', PreparePaintScreenProc),
+ ('donePaintScreen', DonePaintScreenProc),
+ ('paintScreen', PaintScreenProc),
+ ('paintTransformedScreen', PaintTransformedScreenProc),
+ ('applyScreenTransform', ApplyScreenTransformProc),
+ ('paintBackground', PaintBackgroundProc),
+ ('paintWindow', PaintWindowProc),
+ ('drawWindow', DrawWindowProc),
+ ('addWindowGeometry', AddWindowGeometryProc),
+ ('drawWindowGeometry', DrawWindowGeometryProc),
+ ('drawWindowTexture', DrawWindowTextureProc),
+ ('damageWindowRect', DamageWindowRectProc),
+ ('getOutputExtentsForWindow', GetOutputExtentsForWindowProc),
+ ('focusWindow', FocusWindowProc),
+ ('setClipPlanes', SetClipPlanesProc),
+ ('windowResizeNotify', WindowResizeNotifyProc),
+ ('windowMoveNotify', WindowMoveNotifyProc),
+ ('windowGrabNotify', WindowGrabNotifyProc),
+ ('windowUngrabNotify', WindowUngrabNotifyProc),
+ ('enterShowDesktopNotify', EnterShowDesktopNotifyProc),
+ ('leaveShowDesktopNotify', LeaveShowDesktopNotifyProc),
+ ('windowStateChangeNotify', WindowStateChangeNotifyProc),
+ ('windowRestackNotify', WindowRestackNotifyProc),
+ ('outputChangeNotify', OutputChangeNotifyProc),
+ ('privates', POINTER(CompPrivate)),
+ ('overlay', Window),
+ ('output', Window),
+ ('ipcs_size', c_uint),
+ ('ipcs_data', POINTER(c_ubyte)),
+ ('ipcs_atom_count', c_uint),
+ ('ipcs_atoms', POINTER(IPCS_Atom)),
+ ('projectionStyle', CompProjectionStyle),
+ ('berylDesktopManaged', c_int),
+]
+_CompWindowExtents._fields_ = [
+ ('left', c_int),
+ ('right', c_int),
+ ('top', c_int),
+ ('bottom', c_int),
+]
+_CompStruts._fields_ = [
+ ('left', XRectangle),
+ ('right', XRectangle),
+ ('top', XRectangle),
+ ('bottom', XRectangle),
+]
+class XSizeHints(Structure):
+ pass
+class N10XSizeHints4DOT_98E(Structure):
+ pass
+N10XSizeHints4DOT_98E._fields_ = [
+ ('x', c_int),
+ ('y', c_int),
+]
+XSizeHints._fields_ = [
+ ('flags', c_long),
+ ('x', c_int),
+ ('y', c_int),
+ ('width', c_int),
+ ('height', c_int),
+ ('min_width', c_int),
+ ('min_height', c_int),
+ ('max_width', c_int),
+ ('max_height', c_int),
+ ('width_inc', c_int),
+ ('height_inc', c_int),
+ ('min_aspect', N10XSizeHints4DOT_98E),
+ ('max_aspect', N10XSizeHints4DOT_98E),
+ ('base_width', c_int),
+ ('base_height', c_int),
+ ('win_gravity', c_int),
+]
+Pixmap = XID
+Damage = XID
+GLushort = c_ushort
+class _PaintLock(Structure):
+ pass
+
+# values for enumeration '_PaintLockLevels'
+PL_NO_LOCK = 0
+PL_TEMP_HELLO = 1
+PL_PLUGIN_ONE = 2
+PL_PLUGIN_TWO = 3
+PL_PLUGIN_THREE = 4
+PL_PLUGIN_FOUR = 5
+PL_PLUGIN_FIVE = 6
+PL_PLUGIN_SIX = 7
+PL_PLUGIN_SEVEN = 8
+PL_PLUGIN_EIGHT = 9
+PL_PLUGIN_NINE = 10
+PL_PLUGIN_TEN = 11
+PL_SUPER = 12
+_PaintLockLevels = c_int # enum
+PaintLockLevels = _PaintLockLevels
+_PaintLock._fields_ = [
+ ('opacity', PaintLockLevels),
+ ('brightness', PaintLockLevels),
+ ('saturation', PaintLockLevels),
+]
+PaintLock = _PaintLock
+_WindowPaintAttrib._fields_ = [
+ ('opacity', GLushort),
+ ('brightness', GLushort),
+ ('saturation', GLushort),
+ ('xScale', GLfloat),
+ ('yScale', GLfloat),
+ ('xTranslate', GLfloat),
+ ('yTranslate', GLfloat),
+ ('lock', PaintLock),
+]
+class XWindowChanges(Structure):
+ pass
+XWindowChanges._fields_ = [
+ ('x', c_int),
+ ('y', c_int),
+ ('width', c_int),
+ ('height', c_int),
+ ('border_width', c_int),
+ ('sibling', Window),
+ ('stack_mode', c_int),
+]
+XSyncCounter = XID
+class _XSyncValue(Structure):
+ pass
+_XSyncValue._fields_ = [
+ ('hi', c_int),
+ ('lo', c_uint),
+]
+XSyncValue = _XSyncValue
+XSyncAlarm = XID
+_CompWindow._fields_ = [
+ ('screen', POINTER(CompScreen)),
+ ('next', POINTER(CompWindow)),
+ ('prev', POINTER(CompWindow)),
+ ('refcnt', c_int),
+ ('id', Window),
+ ('frame', Window),
+ ('mapNum', c_uint),
+ ('activeNum', c_uint),
+ ('attrib', XWindowAttributes),
+ ('serverX', c_int),
+ ('serverY', c_int),
+ ('serverWidth', c_int),
+ ('serverHeight', c_int),
+ ('serverBorderWidth', c_int),
+ ('transientFor', Window),
+ ('clientLeader', Window),
+ ('sizeHints', XSizeHints),
+ ('pixmap', Pixmap),
+ ('texture', POINTER(CompTexture)),
+ ('matrix', CompMatrix),
+ ('thumbPixmap', Pixmap),
+ ('thumbTexture', POINTER(CompTexture)),
+ ('thumbMatrix', CompMatrix),
+ ('damage', Damage),
+ ('inputHint', c_int),
+ ('alpha', c_int),
+ ('width', GLint),
+ ('height', GLint),
+ ('region', Region),
+ ('clip', Region),
+ ('wmType', c_uint),
+ ('type', c_uint),
+ ('state', c_uint),
+ ('lastState', c_uint),
+ ('actions', c_uint),
+ ('protocols', c_uint),
+ ('mwmDecor', c_uint),
+ ('mwmFunc', c_uint),
+ ('invisible', c_int),
+ ('destroyed', c_int),
+ ('damaged', c_int),
+ ('redirected', c_int),
+ ('managed', c_int),
+ ('destroyRefCnt', c_int),
+ ('unmapRefCnt', c_int),
+ ('initialViewportX', c_uint),
+ ('initialViewportY', c_uint),
+ ('initialTimestamp', Time),
+ ('initialTimestampSet', c_int),
+ ('placed', c_int),
+ ('minimized', c_int),
+ ('inShowDesktopMode', c_int),
+ ('shaded', c_int),
+ ('hidden', c_int),
+ ('grabbed', c_int),
+ ('texCoordSize', c_int),
+ ('indexCount', c_int),
+ ('desktop', c_uint),
+ ('pendingUnmaps', c_int),
+ ('pendingMaps', c_int),
+ ('startupId', STRING),
+ ('resName', STRING),
+ ('resClass', STRING),
+ ('group', POINTER(CompGroup)),
+ ('lastPong', c_uint),
+ ('alive', c_int),
+ ('opacity', GLushort),
+ ('brightness', GLushort),
+ ('saturation', GLushort),
+ ('defaultPaintLock', PaintLock),
+ ('paint', WindowPaintAttrib),
+ ('lastPaint', WindowPaintAttrib),
+ ('input', CompWindowExtents),
+ ('output', CompWindowExtents),
+ ('struts', POINTER(CompStruts)),
+ ('icon', POINTER(POINTER(CompIcon))),
+ ('nIcon', c_int),
+ ('saveWc', XWindowChanges),
+ ('saveMask', c_int),
+ ('syncCounter', XSyncCounter),
+ ('syncValue', XSyncValue),
+ ('syncAlarm', XSyncAlarm),
+ ('syncAlarmConnection', c_ulong),
+ ('syncWaitHandle', c_uint),
+ ('syncWait', c_int),
+ ('syncX', c_int),
+ ('syncY', c_int),
+ ('syncWidth', c_int),
+ ('syncHeight', c_int),
+ ('syncBorderWidth', c_int),
+ ('closeRequests', c_int),
+ ('lastCloseRequestTime', Time),
+ ('damageRects', POINTER(XRectangle)),
+ ('sizeDamage', c_int),
+ ('nDamage', c_int),
+ ('vertices', POINTER(GLfloat)),
+ ('vertexSize', c_int),
+ ('indices', POINTER(GLushort)),
+ ('indexSize', c_int),
+ ('vCount', c_int),
+ ('texUnits', c_int),
+ ('privates', POINTER(CompPrivate)),
+ ('ipcs_size', c_uint),
+ ('ipcs_data', POINTER(c_ubyte)),
+ ('ipcs_atom_count', c_uint),
+ ('ipcs_atoms', POINTER(IPCS_Atom)),
+]
+_CompLibraryFunction._fields_ = [
+ ('prev', POINTER(CompLibraryFunction)),
+ ('next', POINTER(CompLibraryFunction)),
+ ('name', STRING),
+ ('function', c_void_p),
+]
+_CompPluginDep._fields_ = [
+ ('rule', CompPluginRule),
+ ('name', STRING),
+]
+_CompPluginFeature._fields_ = [
+ ('name', STRING),
+]
+InitPluginProc = CFUNCTYPE(c_int, POINTER(CompPlugin))
+FiniPluginProc = CFUNCTYPE(None, POINTER(CompPlugin))
+InitPluginForWindowProc = CFUNCTYPE(c_int, POINTER(CompPlugin), POINTER(CompWindow))
+FiniPluginForWindowProc = CFUNCTYPE(None, POINTER(CompPlugin), POINTER(CompWindow))
+GetDisplayOptionsProc = CFUNCTYPE(POINTER(CompOption), POINTER(CompDisplay), POINTER(c_int))
+GetScreenOptionsProc = CFUNCTYPE(POINTER(CompOption), POINTER(CompScreen), POINTER(c_int))
+UpdateLibraryFunctionProc = CFUNCTYPE(None, POINTER(CompDisplay), POINTER(CompLibraryFunction))
+class _GroupDesc(Structure):
+ pass
+GroupDesc = _GroupDesc
+_CompPluginVTable._fields_ = [
+ ('name', STRING),
+ ('shortDesc', STRING),
+ ('longDesc', STRING),
+ ('init', InitPluginProc),
+ ('fini', FiniPluginProc),
+ ('initDisplay', InitPluginForDisplayProc),
+ ('finiDisplay', FiniPluginForDisplayProc),
+ ('initScreen', InitPluginForScreenProc),
+ ('finiScreen', FiniPluginForScreenProc),
+ ('initWindow', InitPluginForWindowProc),
+ ('finiWindow', FiniPluginForWindowProc),
+ ('getDisplayOptions', GetDisplayOptionsProc),
+ ('setDisplayOption', SetDisplayOptionProc),
+ ('getScreenOptions', GetScreenOptionsProc),
+ ('setScreenOption', SetScreenOptionProc),
+ ('updateLibrayFunction', UpdateLibraryFunctionProc),
+ ('deps', POINTER(CompPluginDep)),
+ ('nDeps', c_int),
+ ('features', POINTER(CompPluginFeature)),
+ ('nFeatures', c_int),
+ ('version', c_uint),
+ ('struct_plugin_size', c_uint),
+ ('struct_display_size', c_uint),
+ ('struct_screen_size', c_uint),
+ ('struct_window_size', c_uint),
+ ('struct_texture_size', c_uint),
+ ('struct_icon_size', c_uint),
+ ('gettext_domain', STRING),
+ ('category', STRING),
+ ('groupDescs', POINTER(GroupDesc)),
+ ('nGroupDescs', c_int),
+ ('defaultEnabled', c_int),
+]
+_CompPlugin._fields_ = [
+ ('next', POINTER(CompPlugin)),
+ ('devPrivate', CompPrivate),
+ ('devType', STRING),
+ ('vTable', POINTER(CompPluginVTable)),
+ ('state', c_int),
+ ('handle', c_int),
+]
+__GLXcontextRec._fields_ = [
+]
+__GLXFBConfigRec._fields_ = [
+]
+class _XExtData(Structure):
+ pass
+XExtData = _XExtData
+VisualID = c_ulong
+Visual._fields_ = [
+ ('ext_data', POINTER(XExtData)),
+ ('visualid', VisualID),
+ ('c_class', c_int),
+ ('red_mask', c_ulong),
+ ('green_mask', c_ulong),
+ ('blue_mask', c_ulong),
+ ('bits_per_rgb', c_int),
+ ('map_entries', c_int),
+]
+_XDisplay._fields_ = [
+]
+class Depth(Structure):
+ pass
+class _XGC(Structure):
+ pass
+GC = POINTER(_XGC)
+Screen._fields_ = [
+ ('ext_data', POINTER(XExtData)),
+ ('display', POINTER(_XDisplay)),
+ ('root', Window),
+ ('width', c_int),
+ ('height', c_int),
+ ('mwidth', c_int),
+ ('mheight', c_int),
+ ('ndepths', c_int),
+ ('depths', POINTER(Depth)),
+ ('root_depth', c_int),
+ ('root_visual', POINTER(Visual)),
+ ('default_gc', GC),
+ ('cmap', Colormap),
+ ('white_pixel', c_ulong),
+ ('black_pixel', c_ulong),
+ ('max_maps', c_int),
+ ('min_maps', c_int),
+ ('backing_store', c_int),
+ ('save_unders', c_int),
+ ('root_input_mask', c_long),
+]
+XModifierKeymap._fields_ = [
+ ('max_keypermod', c_int),
+ ('modifiermap', POINTER(KeyCode)),
+]
+class XAnyEvent(Structure):
+ pass
+XAnyEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+]
+class XKeyEvent(Structure):
+ pass
+XKeyEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('root', Window),
+ ('subwindow', Window),
+ ('time', Time),
+ ('x', c_int),
+ ('y', c_int),
+ ('x_root', c_int),
+ ('y_root', c_int),
+ ('state', c_uint),
+ ('keycode', c_uint),
+ ('same_screen', c_int),
+]
+class XButtonEvent(Structure):
+ pass
+XButtonEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('root', Window),
+ ('subwindow', Window),
+ ('time', Time),
+ ('x', c_int),
+ ('y', c_int),
+ ('x_root', c_int),
+ ('y_root', c_int),
+ ('state', c_uint),
+ ('button', c_uint),
+ ('same_screen', c_int),
+]
+class XMotionEvent(Structure):
+ pass
+XMotionEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('root', Window),
+ ('subwindow', Window),
+ ('time', Time),
+ ('x', c_int),
+ ('y', c_int),
+ ('x_root', c_int),
+ ('y_root', c_int),
+ ('state', c_uint),
+ ('is_hint', c_char),
+ ('same_screen', c_int),
+]
+class XCrossingEvent(Structure):
+ pass
+XCrossingEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('root', Window),
+ ('subwindow', Window),
+ ('time', Time),
+ ('x', c_int),
+ ('y', c_int),
+ ('x_root', c_int),
+ ('y_root', c_int),
+ ('mode', c_int),
+ ('detail', c_int),
+ ('same_screen', c_int),
+ ('focus', c_int),
+ ('state', c_uint),
+]
+class XFocusChangeEvent(Structure):
+ pass
+XFocusChangeEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('mode', c_int),
+ ('detail', c_int),
+]
+class XExposeEvent(Structure):
+ pass
+XExposeEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('x', c_int),
+ ('y', c_int),
+ ('width', c_int),
+ ('height', c_int),
+ ('count', c_int),
+]
+class XGraphicsExposeEvent(Structure):
+ pass
+Drawable = XID
+XGraphicsExposeEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('drawable', Drawable),
+ ('x', c_int),
+ ('y', c_int),
+ ('width', c_int),
+ ('height', c_int),
+ ('count', c_int),
+ ('major_code', c_int),
+ ('minor_code', c_int),
+]
+class XNoExposeEvent(Structure):
+ pass
+XNoExposeEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('drawable', Drawable),
+ ('major_code', c_int),
+ ('minor_code', c_int),
+]
+class XVisibilityEvent(Structure):
+ pass
+XVisibilityEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('state', c_int),
+]
+class XCreateWindowEvent(Structure):
+ pass
+XCreateWindowEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('parent', Window),
+ ('window', Window),
+ ('x', c_int),
+ ('y', c_int),
+ ('width', c_int),
+ ('height', c_int),
+ ('border_width', c_int),
+ ('override_redirect', c_int),
+]
+class XDestroyWindowEvent(Structure):
+ pass
+XDestroyWindowEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('event', Window),
+ ('window', Window),
+]
+class XUnmapEvent(Structure):
+ pass
+XUnmapEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('event', Window),
+ ('window', Window),
+ ('from_configure', c_int),
+]
+class XMapEvent(Structure):
+ pass
+XMapEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('event', Window),
+ ('window', Window),
+ ('override_redirect', c_int),
+]
+class XMapRequestEvent(Structure):
+ pass
+XMapRequestEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('parent', Window),
+ ('window', Window),
+]
+class XReparentEvent(Structure):
+ pass
+XReparentEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('event', Window),
+ ('window', Window),
+ ('parent', Window),
+ ('x', c_int),
+ ('y', c_int),
+ ('override_redirect', c_int),
+]
+class XConfigureEvent(Structure):
+ pass
+XConfigureEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('event', Window),
+ ('window', Window),
+ ('x', c_int),
+ ('y', c_int),
+ ('width', c_int),
+ ('height', c_int),
+ ('border_width', c_int),
+ ('above', Window),
+ ('override_redirect', c_int),
+]
+class XGravityEvent(Structure):
+ pass
+XGravityEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('event', Window),
+ ('window', Window),
+ ('x', c_int),
+ ('y', c_int),
+]
+class XResizeRequestEvent(Structure):
+ pass
+XResizeRequestEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('width', c_int),
+ ('height', c_int),
+]
+class XConfigureRequestEvent(Structure):
+ pass
+XConfigureRequestEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('parent', Window),
+ ('window', Window),
+ ('x', c_int),
+ ('y', c_int),
+ ('width', c_int),
+ ('height', c_int),
+ ('border_width', c_int),
+ ('above', Window),
+ ('detail', c_int),
+ ('value_mask', c_ulong),
+]
+class XCirculateEvent(Structure):
+ pass
+XCirculateEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('event', Window),
+ ('window', Window),
+ ('place', c_int),
+]
+class XCirculateRequestEvent(Structure):
+ pass
+XCirculateRequestEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('parent', Window),
+ ('window', Window),
+ ('place', c_int),
+]
+class XPropertyEvent(Structure):
+ pass
+XPropertyEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('atom', Atom),
+ ('time', Time),
+ ('state', c_int),
+]
+class XSelectionClearEvent(Structure):
+ pass
+XSelectionClearEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('selection', Atom),
+ ('time', Time),
+]
+class XSelectionRequestEvent(Structure):
+ pass
+XSelectionRequestEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('owner', Window),
+ ('requestor', Window),
+ ('selection', Atom),
+ ('target', Atom),
+ ('property', Atom),
+ ('time', Time),
+]
+class XSelectionEvent(Structure):
+ pass
+XSelectionEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('requestor', Window),
+ ('selection', Atom),
+ ('target', Atom),
+ ('property', Atom),
+ ('time', Time),
+]
+class XColormapEvent(Structure):
+ pass
+XColormapEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('colormap', Colormap),
+ ('c_new', c_int),
+ ('state', c_int),
+]
+class XClientMessageEvent(Structure):
+ pass
+class N19XClientMessageEvent4DOT_69E(Union):
+ pass
+N19XClientMessageEvent4DOT_69E._fields_ = [
+ ('b', c_char * 20),
+ ('s', c_short * 10),
+ ('l', c_long * 5),
+]
+XClientMessageEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('message_type', Atom),
+ ('format', c_int),
+ ('data', N19XClientMessageEvent4DOT_69E),
+]
+class XMappingEvent(Structure):
+ pass
+XMappingEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('request', c_int),
+ ('first_keycode', c_int),
+ ('count', c_int),
+]
+class XErrorEvent(Structure):
+ pass
+XErrorEvent._fields_ = [
+ ('type', c_int),
+ ('display', POINTER(Display)),
+ ('resourceid', XID),
+ ('serial', c_ulong),
+ ('error_code', c_ubyte),
+ ('request_code', c_ubyte),
+ ('minor_code', c_ubyte),
+]
+class XKeymapEvent(Structure):
+ pass
+XKeymapEvent._fields_ = [
+ ('type', c_int),
+ ('serial', c_ulong),
+ ('send_event', c_int),
+ ('display', POINTER(Display)),
+ ('window', Window),
+ ('key_vector', c_char * 32),
+]
+_XEvent._fields_ = [
+ ('type', c_int),
+ ('xany', XAnyEvent),
+ ('xkey', XKeyEvent),
+ ('xbutton', XButtonEvent),
+ ('xmotion', XMotionEvent),
+ ('xcrossing', XCrossingEvent),
+ ('xfocus', XFocusChangeEvent),
+ ('xexpose', XExposeEvent),
+ ('xgraphicsexpose', XGraphicsExposeEvent),
+ ('xnoexpose', XNoExposeEvent),
+ ('xvisibility', XVisibilityEvent),
+ ('xcreatewindow', XCreateWindowEvent),
+ ('xdestroywindow', XDestroyWindowEvent),
+ ('xunmap', XUnmapEvent),
+ ('xmap', XMapEvent),
+ ('xmaprequest', XMapRequestEvent),
+ ('xreparent', XReparentEvent),
+ ('xconfigure', XConfigureEvent),
+ ('xgravity', XGravityEvent),
+ ('xresizerequest', XResizeRequestEvent),
+ ('xconfigurerequest', XConfigureRequestEvent),
+ ('xcirculate', XCirculateEvent),
+ ('xcirculaterequest', XCirculateRequestEvent),
+ ('xproperty', XPropertyEvent),
+ ('xselectionclear', XSelectionClearEvent),
+ ('xselectionrequest', XSelectionRequestEvent),
+ ('xselection', XSelectionEvent),
+ ('xcolormap', XColormapEvent),
+ ('xclient', XClientMessageEvent),
+ ('xmapping', XMappingEvent),
+ ('xerror', XErrorEvent),
+ ('xkeymap', XKeymapEvent),
+ ('pad', c_long * 24),
+]
+XVisualInfo._fields_ = [
+ ('visual', POINTER(Visual)),
+ ('visualid', VisualID),
+ ('screen', c_int),
+ ('depth', c_int),
+ ('c_class', c_int),
+ ('red_mask', c_ulong),
+ ('green_mask', c_ulong),
+ ('blue_mask', c_ulong),
+ ('colormap_size', c_int),
+ ('bits_per_rgb', c_int),
+]
+XineramaScreenInfo._fields_ = [
+ ('screen_number', c_int),
+ ('x_org', c_short),
+ ('y_org', c_short),
+ ('width', c_short),
+ ('height', c_short),
+]
+_BerylSettingsContext._fields_ = [
+]
+_ScreenPaintAttrib._fields_ = [
+ ('xRotate', GLfloat),
+ ('yRotate', GLfloat),
+ ('vRotate', GLfloat),
+ ('xTranslate', GLfloat),
+ ('yTranslate', GLfloat),
+ ('zTranslate', GLfloat),
+ ('zCamera', GLfloat),
+]
+class _SubGroupDesc(Structure):
+ pass
+SubGroupDesc = _SubGroupDesc
+_GroupDesc._fields_ = [
+ ('name', STRING),
+ ('desc', STRING),
+ ('subGroupDescs', POINTER(SubGroupDesc)),
+ ('nSubGroupDescs', c_int),
+]
+_FragmentAttrib._fields_ = [
+ ('opacity', GLushort),
+ ('brightness', GLushort),
+ ('saturation', GLushort),
+ ('nTexture', c_int),
+ ('function', c_int * 16),
+ ('nFunction', c_int),
+ ('nParam', c_int),
+]
+_IPCS_Atom._fields_ = [
+ ('name', STRING),
+ ('pos', c_int),
+ ('type', c_int),
+]
+SnDisplay._fields_ = [
+]
+SnMonitorContext._fields_ = [
+]
+SnStartupSequence._fields_ = [
+]
+XPointer = STRING
+_XExtData._fields_ = [
+ ('number', c_int),
+ ('next', POINTER(_XExtData)),
+ ('free_private', CFUNCTYPE(c_int, POINTER(_XExtData))),
+ ('private_data', XPointer),
+]
+_XGC._fields_ = [
+]
+Depth._fields_ = [
+ ('depth', c_int),
+ ('nvisuals', c_int),
+ ('visuals', POINTER(Visual)),
+]
+_SubGroupDesc._fields_ = [
+ ('name', STRING),
+ ('desc', STRING),
+]
+__all__ = ['_CopyModeData', 'BOX', 'PreparePaintScreenProc',
+ 'CompOptionValue', 'CompKeyGrab', '_XSyncValue',
+ 'FiniPluginForScreenProc', 'CompPluginDep',
+ 'XMappingEvent', 'PL_PLUGIN_TWO', 'CompOptionTypeString',
+ 'CompPlugin', 'FocusPointer', 'PL_SUPER',
+ 'CompRequestFlag', 'CompOptionTypeFloat', '_CompPluginDep',
+ 'CompAction', 'CompPluginVTable', '__GLXcontextRec',
+ '_XEvent', 'XSelectionClearEvent', 'ShmSeg', 'KeyCode',
+ 'GLClientActiveTextureProc', 'GLenum', 'XColormapEvent',
+ 'Colormap', 'GLRenderbufferStorageProc',
+ 'CompPluginRuleAfterCategory', 'Visual',
+ 'COMP_TEXTURE_FILTER_FAST', 'GetScreenOptionsProc',
+ 'XKeyEvent', 'CompStartupSequence', '_XExtData', 'GLuint',
+ 'XUnmapEvent', 'CompIcon', '_CompOptionIntRestriction',
+ 'PL_PLUGIN_THREE', 'XSyncValue', '_CompFunction',
+ 'CompOptionFloatRestriction', 'GLXCopySubBufferProc',
+ 'XID', 'GLXGetVideoSyncProc', 'CompActionStateCancel',
+ 'Region', 'XPropertyEvent', 'AddWindowGeometryProc',
+ 'XConfigureEvent', '_CompStartupSequence', 'Damage',
+ 'SnStartupSequence', 'XVisualInfo', 'GC',
+ '_CompLibraryFunction', 'CompProgram', 'GLXContext',
+ 'CompGrab', '__time_t', 'CompFocusOnCloseModes',
+ '__suseconds_t', 'CompActionStateInitBell',
+ 'EnterShowDesktopNotifyProc', 'WindowGrabNotifyProc',
+ 'CompTextureFilter', 'CompOptionTypeBool',
+ 'CompActionStateInitButton', 'CompPluginRuleRequire',
+ 'PL_PLUGIN_FOUR', '_CompIcon', 'CompTimeoutHandle',
+ 'GLXFBConfig', 'GLXCreatePixmapProc',
+ 'InitPluginForScreenProc', 'CompActionStateInitEdgeDnd',
+ 'CompActionStateInitKey', 'GLDeleteProgramsProc',
+ '_CompOutput', 'XMotionEvent', 'CompKeyBinding',
+ 'XAnyEvent', 'CompOutput', '_PaintLock',
+ '_CompOptionFloatRestriction', 'GetDisplayOptionsProc',
+ 'GLBindFramebufferProc', 'CompBindingTypeButton',
+ 'COMP_PERSPECTIVE_LOCAL', 'GLubyte', '_FragmentAttrib',
+ 'WindowPaintAttrib', 'Display', 'PaintLockLevels',
+ 'CopyModeData', 'GLXWaitVideoSyncProc', 'CompWindow',
+ 'CompOptionTypeList', 'XPointer', 'PL_PLUGIN_TEN',
+ 'CompActionStateTermEdgeDnd', 'ScreenPaintAttrib',
+ 'DrawWindowProc', '_CompDisplay', '_CompKeyBinding',
+ 'XExposeEvent', 'XSizeHints', 'VisualID',
+ 'SetScreenOptionForPluginProc',
+ 'GLFramebufferRenderbufferProc',
+ '_CompOptionStringRestriction', '_CompFBConfig',
+ 'XShmSegmentInfo', 'FocusLastWindow', 'CompPluginRuleEnd',
+ 'WindowResizeNotifyProc', 'FileToImageProc', 'PaintLock',
+ 'CompPrivate', 'SnDisplay', 'Box', 'GLGenFramebuffersProc',
+ '_CompWindowExtents', 'CompWindowExtents', 'PL_NO_LOCK',
+ 'GLGenProgramsProc', 'COMP_PERSPECTIVE_GLOBAL_REAL',
+ 'DamageWindowRectProc', '_CompTransform',
+ 'GLGenRenderbuffersProc', '_CompScreenEdge',
+ 'GLXBindTexImageProc', 'CompOptionTypeInt',
+ 'SetDisplayOptionForPluginProc',
+ 'GLFramebufferTexture2DProc', '_CompGroup', 'GLXPixmap',
+ 'Cursor', 'GLBindProgramProc', 'XGravityEvent',
+ 'CompFunctionData', 'XGraphicsExposeEvent',
+ 'PL_PLUGIN_FIVE', 'GLint', 'CompPluginRuleBefore',
+ 'WindowMoveNotifyProc', 'WindowRestackNotifyProc',
+ 'GLBindRenderbufferProc', '__GLXFBConfigRec',
+ 'XConfigureRequestEvent', 'CompListValue', 'GLfloat',
+ '_CompOption', 'CompBindingTypeKey', 'CompButtonBinding',
+ 'CompActionStateTermEdge', 'CompDisplay',
+ 'CompPluginFeature', '_CompPluginFeature',
+ 'GLDeleteRenderbuffersProc', 'CompBindingTypeEdgeButton',
+ 'N10XSizeHints4DOT_98E', 'CompStruts',
+ 'WindowUngrabNotifyProc', 'PL_PLUGIN_SIX', '_GroupDesc',
+ 'CompProjectionStyle', 'GLXGetFBConfigAttribProc',
+ '_IPCS_Atom', 'DrawWindowTextureProc',
+ '_ScreenPaintAttrib', '_PaintLockLevels',
+ 'XWindowAttributes', 'XineramaScreenInfo', 'FuncPtr',
+ 'CompLibraryFunction', 'InitPluginProc', 'XKeymapEvent',
+ 'XCirculateEvent', 'CompOptionStringRestriction',
+ 'CompWatchFdHandle', 'UnloadPluginProc',
+ 'XCirculateRequestEvent', 'GLXGetProcAddressProc',
+ 'CompGroup', 'HandleBerylEventProc',
+ 'COMP_PERSPECTIVE_LOCAL_REAL', 'FragmentAttrib',
+ 'XMapEvent', 'Screen', 'CompActionStateCommit',
+ 'ImageToFileProc', 'XSelectionRequestEvent',
+ 'GLActiveTextureProc', 'InitPluginForDisplayProc',
+ 'CompButtonGrab', 'CompTexture', '_CompTexture',
+ 'GLCheckFramebufferStatusProc', 'XButtonEvent', 'GLvoid',
+ 'GetOutputExtentsForWindowProc',
+ 'WindowStateChangeNotifyProc', 'XModifierKeymap',
+ 'GLDeleteFramebuffersProc', 'XWindowChanges',
+ 'GLXQueryDrawableProc', 'InitPluginForWindowProc',
+ 'COMP_PERSPECTIVE_GLOBAL', 'Time', '_CompGrab',
+ '_SubGroupDesc', 'PL_PLUGIN_EIGHT', 'CompTransform',
+ '_XGC', 'XErrorEvent', 'PaintWindowProc', '_XDisplay',
+ 'CompBindingTypeNone', '_CompPrivate', '_CompProgram',
+ '_CompAction', 'CompScreenEdge', '_CompButtonBinding',
+ 'LeaveShowDesktopNotifyProc', 'CompActionStateTermButton',
+ 'PL_PLUGIN_SEVEN', '_CompStruts', 'XRectangle',
+ 'GLProgramParameter4fProc', '_CompButtonGrab',
+ '_CompPluginVTable', 'IPCS_Atom', 'CompPluginRuleAfter',
+ 'CompOption', 'PaintTransformedScreenProc',
+ 'PaintScreenProc', 'CompActionCallBackProc', 'Pixmap',
+ 'GroupDesc', 'CompActionStateInitEdge', '_CompKeyGrab',
+ 'CompPluginRule', 'CompBindingType', 'XSyncAlarm',
+ '_CompRequestFlag', 'OutputChangeNotifyProc',
+ 'GLXGetFBConfigsProc', 'Window', 'CompOptionTypeAction',
+ 'REGION', 'SetClipPlanesProc', 'XReparentEvent',
+ 'FiniPluginForWindowProc', 'XCreateWindowEvent',
+ 'XSyncCounter', 'XDestroyWindowEvent',
+ '_WindowPaintAttrib', 'FiniPluginForDisplayProc',
+ '_CompWindow', 'PaintBackgroundProc', 'CompActionState',
+ 'PL_TEMP_HELLO', 'LoadPluginProc', '_BerylSettingsContext',
+ 'timeval', 'ApplyScreenTransformProc', 'CompFunction',
+ 'PL_PLUGIN_ONE', 'XEvent', 'Atom', 'CompOptionTypeColor',
+ 'XResizeRequestEvent', 'FiniPluginProc',
+ 'DrawWindowGeometryProc', 'SetDisplayOptionProc',
+ 'XExtData', 'CompActionStateTermKey',
+ 'SetScreenOptionProc', 'CompMatrix',
+ 'UpdateLibraryFunctionProc', 'CompActionStateModifier',
+ 'XFocusChangeEvent', 'CompOptionType', 'SubGroupDesc',
+ 'GLGenerateMipmapProc', 'GLushort',
+ 'CompOptionIntRestriction', '_CompScreen', 'Depth',
+ 'DonePaintScreenProc', '_CompOptionValue',
+ 'HandleEventProc', 'XSelectionEvent',
+ 'CompOptionRestriction', 'Drawable', 'GLProgramStringProc',
+ 'GLXReleaseTexImageProc', 'FocusWindowProc',
+ 'SnMonitorContext', 'XNoExposeEvent', 'XCrossingEvent',
+ '_CompFunctionData', '_XRegion', 'XMapRequestEvent',
+ 'CompFBConfig', '_CompMatrix', 'PL_PLUGIN_NINE',
+ 'CompScreen', '_CompPlugin', 'XClientMessageEvent',
+ 'COMP_TEXTURE_FILTER_GOOD', 'XVisibilityEvent',
+ 'N19XClientMessageEvent4DOT_69E']
+ ('saturation', GLushort),
+ ('nTexture', c_int),
+ ('function', c_int * 16),
+ ('nFunction', c_int),
+ ('nParam', c_int),
+]
+_IPCS_Atom._fields_ = [
+ ('name', STRING),
+ ('pos', c_int),
+ ('type', c_int),
+]
+SnDisplay._fields_ = [
+]
+SnMonitorContext._fields_ = [
+]
+XPointer = STRING
+_XExtData._fields_ = [
+ ('number', c_int),
+ ('next', POINTER(_XExtData)),
+ ('free_private', CFUNCTYPE(c_int, POINTER(_XExtData))),
+ ('private_data', XPointer),
+]
+_XGC._fields_ = [
+]
+Depth._fields_ = [
+ ('depth', c_int),
+ ('nvisuals', c_int),
+ ('visuals', POINTER(Visual)),
+]
+SnStartupSequence._fields_ = [
+]
diff --git a/pythonloader/berylplugin.py b/pythonloader/berylplugin.py
new file mode 100644
index 0000000..97f0e00
--- /dev/null
+++ b/pythonloader/berylplugin.py
@@ -0,0 +1,290 @@
+from ctypes import *
+from beryl import *
+
+f = CDLL( "libX11.so" )
+#print "keysym = ", f.transformToScreenSpace
+
+f.XStringToKeysym.argtypes = [c_char_p]
+f.XStringToKeysym.restype = c_int
+
+def _S( st ):
+ return cast( create_string_buffer( st ), c_char_p )
+
+"""
+o = self.opts
+o[0].advanced = False;
+o[0].name = _S("initiate");
+o[0].group = _S("Main");
+o[0].subGroup = _S("");
+o[0].displayHints = _S("");
+o[0].shortDesc = _S("Initiate");
+o[0].longDesc = _S("Start benchmark");
+o[0].type = CompOptionTypeAction
+o[0].value = CompOptionValue()
+o[0].value.action.initiate = CompActionCallBackProc( self.MyActionTest )
+o[0].value.action.terminate = cast( c_void_p( 0 ), CompActionCallBackProc )
+o[0].value.action.bell = False
+o[0].value.action.edgeMask = 0
+o[0].value.action.type = CompBindingTypeKey
+o[0].value.action.state = CompActionStateInitKey
+o[0].value.action.key.modifiers = (1 << 18)
+f.XStringToKeysym.argtypes = [c_char_p]
+f.XStringToKeysym.restype = c_int
+o[0].value.action.key.keysym = f.XStringToKeysym("F2")
+#print "Options1 ", self.opts
+"""
+
+#self.MyActionTest, None, False, 0, CompBindingTypeKey, CompActionStateInitKey, (1 << 18), "F2"
+
+class berylAction( object ):
+ def __init__( self, init, term, bell, edgemask, actype, state, keymod, keysym ): #button, bell, edgemask, edgebutton ):
+ self.init = init
+ self.term = term
+ self.state = state
+ self.actype = actype
+ self.keymod = keymod
+ self.keysym = keysym
+ #self.button = button
+ self.bell = bell
+ #self.edgemask = edgemask
+ #self.edgebutton = edgebutton
+
+ def go( self, o ):
+ if self.init:
+ print "here...", self.init
+ o.value.action.initiate = CompActionCallBackProc( self.init )
+ print "..."
+ else:
+ o.value.action.initiate = cast( c_void_p( 0 ), CompActionCallBackProc )
+
+ if self.term:
+ print "I am here1.."
+ o.value.action.terminate = CompActionCallBackProc( self.term )
+ print "I am here.2.."
+ else:
+ print "Blah"
+ o.value.action.terminate = cast( c_void_p( 0 ), CompActionCallBackProc )
+ print "...bleuogh"
+
+ o.value.action.state = self.state
+ o.value.action.type = self.actype
+ o.value.action.key.keysym = f.XStringToKeysym(self.keysym)
+ o.value.action.key.modifiers = self.keymod
+ #o.value.action.button = self.button
+ o.value.action.bell = self.bell
+ o.value.action.edgemask = 0
+ #o.value.action.edgebutton = self.edgebutton
+
+ type = CompOptionTypeAction
+
+class berylInt( object ):
+ def __init__( self, val, minimum, maximum ):
+ self.val = val
+ self.minimum = minimum
+ self.maximum = maximum
+
+ def go( self, o ):
+ #o.value = CompOptionInt
+ print "--!!Setting up int"
+ o.value.i = self.val
+ o.rest.i.min = self.minimum
+ o.rest.i.max = self.maximum
+
+ type = CompOptionTypeInt
+
+class Plugin( object ):
+ def __init__( self ):
+ self.avalue = 0
+ self.optsInitialised = False
+ self.initOptions()
+ self.vtable = CompPluginVTable()
+ #print "I AM HERE.."
+ #GetDisplayOptionsProc.restype = c_int
+ #MyGetDisplayOptionsProc = CFUNCTYPE(c_void_p, POINTER(CompDisplay), POINTER(c_int))
+
+ #MyGetDisplayOptionsProc = GetDisplayOptionsProc
+ #MyGetDisplayOptionsProc._restype_ = c_int
+ #MyGetDisplayOptionsProc.restype = c_int
+ #print "blingbling"
+ #print MyGetDisplayOptionsProc( self.getOptions )
+ #print "GOT THIS FAR"
+ info = { "init" : InitPluginProc( self.initPlugin ),
+ "fini" : FiniPluginProc( self.finiPlugin ),
+ "initDisplay" : InitPluginForDisplayProc( self.initDisplay ),
+ "finiDisplay" : FiniPluginForDisplayProc( self.finiDisplay ),
+ "initScreen" : InitPluginForScreenProc( self.initScreen ),
+ "finiScreen" : FiniPluginForScreenProc( self.finiScreen ),
+ "getDisplayOptions" : GetDisplayOptionsProc( self.getOptions ),
+ "setDisplayOption" : SetDisplayOptionProc( self.setOptions ),
+ "struct_plugin_size" : sizeof( CompPlugin ),
+ "struct_display_size" : sizeof( CompDisplay ),
+ "struct_screen_size" : sizeof( CompScreen ),
+ "struct_window_size" : sizeof( CompWindow ),
+ "struct_texture_size" : sizeof( CompTexture ),
+ "struct_icon_size" : sizeof( CompIcon ),
+ }
+
+ info.update( self.info )
+
+ for k in info.keys():
+ self.vtable.__setattr__( k, info[k] )
+
+ def initScreen( self, p, s ):
+ print " ------ initScreen"
+ #addScreenAction(s, &bd->opt[BENCH_DISPLAY_OPTION_INITIATE].value.action);
+ return True
+
+ def finiScreen( self, p, s ):
+ print " ------ finiScreen"
+ #removeScreenAction(s, &bd->opt[BENCH_DISPLAY_OPTION_INITIATE].value.action);
+
+ def getOptions( self, display, count ):
+ #print "Number of options requested.."
+ count.contents.value = len( self.ropts )
+ return addressof( self.opts )
+
+ def fetchopt( self, name ):
+ for i in self.ropts:
+ if i["name"] == name:
+ return i
+ return None
+
+ def setOptions( self, display, name, value ):
+ #print "Setting option.."
+ if self.fetchopt( name )["value"].type == CompOptionTypeInt:
+ self.__setattr__( name, value.contents.i )
+ #print "Option is being set: ", name
+ #self.__setattr__( name,
+ #if name == "length":
+ #print "Got value: ", value.contents.i
+ #self.avalue = value.contents.i
+ #self.opts[0].value.action.key.keysym = f.XStringToKeysym("F5")
+ return True
+
+ def MyActionTest( self, d, ac, s, o, nO ):
+ print "SUCCESS!!!"
+ #reload( script )
+ return True
+
+ def initOptions( self ):
+ if not self.optsInitialised:
+ #"""
+ opts = self.ropts = [{
+ "advanced" : False,
+ "name" : "initiate",
+ "group" : "Main",
+ "subGroup" : "",
+ "displayHints" : "",
+ "shortDesc" : "HELLO THERE!",
+ "longDesc" : "Start timerthing",
+ "value" : berylAction( self.MyActionTest, None, False, 0, CompBindingTypeKey,
+ CompActionStateInitKey, (1 << 18), "F2" )
+ },
+ {
+ "advanced" : False,
+ "name" : "length",
+ "group" : "Main",
+ "subGroup" : "Dimensions",
+ "displayHints" : "Something here",
+ "shortDesc" : "Length",
+ "longDesc" : "Length of faces",
+ "value" : berylInt( 10, 1, 200 )
+ },
+ {
+ "advanced" : False,
+ "name" : "height",
+ "group" : "Main",
+ "subGroup" : "Dimensions",
+ "displayHints" : "Something here",
+ "shortDesc" : "Height",
+ "longDesc" : "Height of faces",
+ "value" : berylInt( 10, 1, 200 )
+ },
+ {
+ "advanced" : False,
+ "name" : "x",
+ "group" : "Main",
+ "subGroup" : "Position",
+ "displayHints" : "Position",
+ "shortDesc" : "Position X",
+ "longDesc" : "Position X",
+ "value" : berylInt( 10, 1, 50 )
+ },
+ {
+ "advanced" : False,
+ "name" : "y",
+ "group" : "Main",
+ "subGroup" : "Position",
+ "displayHints" : "Position",
+ "shortDesc" : "Position Y",
+ "longDesc" : "Position Y",
+ "value" : berylInt( 10, 1, 50 )
+ }
+ ]
+
+ self.opts = (CompOption * len( opts ))()
+
+ print "----!!<<", self.opts
+
+ for i,o in enumerate( opts ):
+ #print "Loading option ", o["name"]
+ for key,val in o.items():
+ #print "Bling", key, "bling - ", val
+ if type( val ) == str:
+ val = _S( val )
+ if key == "value":
+ self.opts[i].value = CompOptionValue()
+ self.opts[i].rest = CompOptionRestriction()
+ #print "Valtype = ", val.type
+ #print "Blah = ", CompOptionTypeAction
+ self.opts[i].type = val.type
+ val.go( self.opts[i] )
+ if self.opts[i].type == CompOptionTypeInt:
+ self.__setattr__( o["name"], val.val )
+ else:
+ #print "Setting option", key, "to", val
+ self.opts[i].__setattr__( key, val )
+ o = self.opts[1]
+ #print "My value=",o.value.i
+ #"""
+ print "Options initialised"
+ """
+ self.opts = (CompOption * 1)()
+
+ o = self.opts
+ o[0].advanced = False;
+ o[0].name = _S("initiate");
+ o[0].group = _S("Main");
+ o[0].subGroup = _S("");
+ o[0].displayHints = _S("");
+ o[0].shortDesc = _S("Initiateblahblah");
+ #o[0].__setattr__( "shortDesc", _S( "Initiate23345" ) )
+
+ o[0].longDesc = _S("Start benchmark");
+ o[0].type = CompOptionTypeAction
+ o[0].vCompOptionTypeActionalue = CompOptionValue()
+ o[0].value.action.initiate = CompActionCallBackProc( self.MyActionTest )
+ o[0].value.action.terminate = cast( c_void_p( 0 ), CompActionCallBackProc )
+ o[0].value.action.bell = False
+ o[0].value.action.edgeMask = 0
+ o[0].value.action.type = CompBindingTypeKey
+ o[0].value.action.state = CompActionStateInitKey
+ o[0].value.action.key.modifiers = (1 << 18)
+ f.XStringToKeysym.argtypes = [c_char_p]
+ f.XStringToKeysym.restype = c_int
+ o[0].value.action.key.keysym = f.XStringToKeysym("F2")
+ """
+ self.optsInitialised = True
+
+ optsInitialised = False
+
+ def initPlugin( self, p ):
+ print "Default init called.."
+ return False
+ def finiPlugin( self, p ):
+ print "Default fini called"
+ def initDisplay( self, p, d ):
+ print "default Display init called."
+ return True
+ def finiDisplay( self, p, d ):
+ print "default display fini called.." \ No newline at end of file
diff --git a/pythonloader/berylpython.c b/pythonloader/berylpython.c
new file mode 100644
index 0000000..f97dd53
--- /dev/null
+++ b/pythonloader/berylpython.c
@@ -0,0 +1,543 @@
+/* Generated by Pyrex 0.9.4.1 on Sun Mar 18 14:36:14 2007 */
+
+#include "Python.h"
+#include "structmember.h"
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+__PYX_EXTERN_C double pow(double, double);
+#include "string.h"
+#include "beryl.h"
+#include "python_init.h"
+
+
+typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
+typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
+static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
+static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
+static int __Pyx_PrintItem(PyObject *); /*proto*/
+static int __Pyx_PrintNewline(void); /*proto*/
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static void __Pyx_ReRaise(void); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+static PyObject *__Pyx_GetExcValue(void); /*proto*/
+static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
+static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
+static void __Pyx_WriteUnraisable(char *name); /*proto*/
+static void __Pyx_AddTraceback(char *funcname); /*proto*/
+static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
+static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
+static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
+static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_b;
+static int __pyx_lineno;
+static char *__pyx_filename;
+static char **__pyx_f;
+
+/* Declarations from berylpython */
+
+static LoadPluginProc __pyx_v_11berylpython_oldLoader;
+static CompDisplay (*__pyx_v_11berylpython_cd);
+DL_EXPORT(CompPluginVTable) vTable;
+__PYX_EXTERN_C Bool (pyInit(CompPlugin (*))); /*proto*/
+__PYX_EXTERN_C DL_EXPORT(void) (pyFini(CompPlugin (*))); /*proto*/
+__PYX_EXTERN_C Bool (pyPluginLoader(CompPlugin (*),char (*),char (*))); /*proto*/
+__PYX_EXTERN_C Bool (pyInitDisplay(CompPlugin (*),CompDisplay (*))); /*proto*/
+__PYX_EXTERN_C DL_EXPORT(void) (pyFiniDisplay(CompPlugin (*),CompDisplay (*))); /*proto*/
+__PYX_EXTERN_C DL_EXPORT(CompPluginVTable) (*(getCompPluginInfo(void))); /*proto*/
+
+/* Implementation of berylpython */
+
+
+static PyObject *__pyx_n_ctypes;
+static PyObject *__pyx_n_sys;
+
+static PyObject *__pyx_n_True;
+
+static PyObject *__pyx_k3p;
+
+static char (__pyx_k3[]) = " -> pyInit";
+
+__PYX_EXTERN_C Bool pyInit(CompPlugin (*__pyx_v_p)) {
+ Bool __pyx_r;
+ PyObject *__pyx_1 = 0;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":76 */
+ if (__Pyx_PrintItem(__pyx_k3p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}
+ if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":77 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
+ __pyx_r = ((PyObject *)__pyx_1);
+ __pyx_1 = 0;
+ goto __pyx_L0;
+
+ __pyx_r = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ __Pyx_AddTraceback("berylpython.pyInit");
+ __pyx_r = 0;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+static PyObject *__pyx_k4p;
+
+static char (__pyx_k4[]) = " <- pyFini";
+
+__PYX_EXTERN_C DL_EXPORT(void) pyFini(CompPlugin (*__pyx_v_p)) {
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":80 */
+ if (__Pyx_PrintItem(__pyx_k4p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
+ if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
+
+ goto __pyx_L0;
+ __pyx_L1:;
+ __Pyx_WriteUnraisable("berylpython.pyFini");
+ __pyx_L0:;
+}
+
+static PyObject *__pyx_k5p;
+static PyObject *__pyx_k6p;
+
+static char (__pyx_k5[]) = "In pyPluginLoader()";
+static char (__pyx_k6[]) = "Leaving pyPluginLoader()";
+
+__PYX_EXTERN_C Bool pyPluginLoader(CompPlugin (*__pyx_v_p),char (*__pyx_v_name),char (*__pyx_v_path)) {
+ LoadPluginProc __pyx_v_temp;
+ Bool __pyx_r;
+ PyObject *__pyx_1 = 0;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":89 */
+ if (__Pyx_PrintItem(__pyx_k5p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
+ __pyx_1 = PyString_FromString(__pyx_v_name); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
+ if (__Pyx_PrintItem(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_1 = PyString_FromString(__pyx_v_path); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
+ if (__Pyx_PrintItem(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":91 */
+ __pyx_v_temp = __pyx_v_11berylpython_cd->loaderLoadPlugin;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":92 */
+ __pyx_v_11berylpython_cd->loaderLoadPlugin = __pyx_v_11berylpython_oldLoader;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":93 */
+ __pyx_1 = ((PyObject *)__pyx_v_11berylpython_cd->loaderLoadPlugin(__pyx_v_p,__pyx_v_name,__pyx_v_path)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":94 */
+ __pyx_v_11berylpython_cd->loaderLoadPlugin = __pyx_v_temp;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":95 */
+ if (__Pyx_PrintItem(__pyx_k6p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
+ if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":96 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
+ __pyx_r = ((PyObject *)__pyx_1);
+ __pyx_1 = 0;
+ goto __pyx_L0;
+
+ __pyx_r = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ __Pyx_AddTraceback("berylpython.pyPluginLoader");
+ __pyx_r = 0;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+static PyObject *__pyx_k7p;
+static PyObject *__pyx_k8p;
+
+static char (__pyx_k7[]) = " -> pyInitDisplay";
+static char (__pyx_k8[]) = "Thingybob is set.";
+
+__PYX_EXTERN_C Bool pyInitDisplay(CompPlugin (*__pyx_v_p),CompDisplay (*__pyx_v_d)) {
+ Bool __pyx_r;
+ PyObject *__pyx_1 = 0;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":101 */
+ if (__Pyx_PrintItem(__pyx_k7p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
+ if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":102 */
+ __pyx_v_11berylpython_cd = __pyx_v_d;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":103 */
+ __pyx_v_11berylpython_oldLoader = __pyx_v_d->loaderLoadPlugin;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":104 */
+ __pyx_v_d->loaderLoadPlugin = (&pyPluginLoader);
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":105 */
+ if (__Pyx_PrintItem(__pyx_k8p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
+ if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":106 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; goto __pyx_L1;}
+ __pyx_r = ((PyObject *)__pyx_1);
+ __pyx_1 = 0;
+ goto __pyx_L0;
+
+ __pyx_r = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ __Pyx_AddTraceback("berylpython.pyInitDisplay");
+ __pyx_r = 0;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+static PyObject *__pyx_k9p;
+
+static char (__pyx_k9[]) = " <- pyFiniDisplay";
+
+__PYX_EXTERN_C DL_EXPORT(void) pyFiniDisplay(CompPlugin (*__pyx_v_p),CompDisplay (*__pyx_v_d)) {
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":109 */
+ if (__Pyx_PrintItem(__pyx_k9p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;}
+ if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;}
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":110 */
+ __pyx_v_d->loaderLoadPlugin = __pyx_v_11berylpython_oldLoader;
+
+ goto __pyx_L0;
+ __pyx_L1:;
+ __Pyx_WriteUnraisable("berylpython.pyFiniDisplay");
+ __pyx_L0:;
+}
+
+static PyObject *__pyx_k15p;
+
+static char (__pyx_k10[]) = "pythonloader";
+static char (__pyx_k11[]) = "Python module loader";
+static char (__pyx_k12[]) = "This plugin loads python modules placed in your ~/.beryl/plugins/ dir ending in .py";
+static char (__pyx_k13[]) = "devel";
+static char (__pyx_k14[]) = "beryl-plugins";
+static char (__pyx_k15[]) = "Returning vTable...";
+
+__PYX_EXTERN_C DL_EXPORT(CompPluginVTable) (*getCompPluginInfo(void)) {
+ CompPluginVTable (*__pyx_r);
+ PyObject *__pyx_1 = 0;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":116 */
+ __pyx_1 = PyInt_FromLong((sizeof(CompPluginVTable ))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
+ memset((&vTable),0,((PyObject *)__pyx_1));
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":118 */
+ vTable.init = (&pyInit);
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":119 */
+ vTable.fini = (&pyFini);
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":120 */
+ vTable.initDisplay = (&pyInitDisplay);
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":121 */
+ vTable.finiDisplay = (&pyFiniDisplay);
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":123 */
+ vTable.version = BERYL_VERSION;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":124 */
+ vTable.struct_plugin_size = (sizeof(CompPlugin ));
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":125 */
+ vTable.struct_display_size = (sizeof(CompDisplay ));
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":126 */
+ vTable.struct_screen_size = (sizeof(CompScreen ));
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":127 */
+ vTable.struct_window_size = (sizeof(CompWindow ));
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":128 */
+ vTable.struct_texture_size = (sizeof(CompTexture ));
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":129 */
+ vTable.struct_icon_size = (sizeof(CompIcon ));
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":130 */
+ vTable.name = __pyx_k10;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":131 */
+ vTable.shortDesc = __pyx_k11;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":132 */
+ vTable.longDesc = __pyx_k12;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":133 */
+ vTable.category = __pyx_k13;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":134 */
+ vTable.gettext_domain = __pyx_k14;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":153 */
+ if (__Pyx_PrintItem(__pyx_k15p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
+ if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":155 */
+ __pyx_r = (&vTable);
+ goto __pyx_L0;
+
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ __Pyx_WriteUnraisable("berylpython.getCompPluginInfo");
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+static __Pyx_InternTabEntry __pyx_intern_tab[] = {
+ {&__pyx_n_True, "True"},
+ {&__pyx_n_ctypes, "ctypes"},
+ {&__pyx_n_sys, "sys"},
+ {0, 0}
+};
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_k3p, __pyx_k3, sizeof(__pyx_k3)},
+ {&__pyx_k4p, __pyx_k4, sizeof(__pyx_k4)},
+ {&__pyx_k5p, __pyx_k5, sizeof(__pyx_k5)},
+ {&__pyx_k6p, __pyx_k6, sizeof(__pyx_k6)},
+ {&__pyx_k7p, __pyx_k7, sizeof(__pyx_k7)},
+ {&__pyx_k8p, __pyx_k8, sizeof(__pyx_k8)},
+ {&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9)},
+ {&__pyx_k15p, __pyx_k15, sizeof(__pyx_k15)},
+ {0, 0, 0}
+};
+
+static struct PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+static void __pyx_init_filenames(void); /*proto*/
+
+PyMODINIT_FUNC initberylpython(void); /*proto*/
+PyMODINIT_FUNC initberylpython(void) {
+ PyObject *__pyx_1 = 0;
+ __pyx_init_filenames();
+ __pyx_m = Py_InitModule4("berylpython", __pyx_methods, 0, 0, PYTHON_API_VERSION);
+ if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
+ __pyx_b = PyImport_AddModule("__builtin__");
+ if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
+ if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":1 */
+ __pyx_1 = __Pyx_Import(__pyx_n_ctypes, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_ctypes, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":1 */
+ __pyx_1 = __Pyx_Import(__pyx_n_sys, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+ /* "/home/pwaller/Projects/Beryl/branches/beryl-plugins/python/berylpython.pyx":114 */
+ return;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ __Pyx_AddTraceback("berylpython");
+}
+
+static char *__pyx_filenames[] = {
+ "berylpython.pyx",
+};
+
+/* Runtime support code */
+
+static void __pyx_init_filenames(void) {
+ __pyx_f = __pyx_filenames;
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
+ PyObject *__import__ = 0;
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
+ if (!__import__)
+ goto bad;
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ module = PyObject_CallFunction(__import__, "OOOO",
+ name, global_dict, empty_dict, list);
+bad:
+ Py_XDECREF(empty_list);
+ Py_XDECREF(__import__);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+static PyObject *__Pyx_GetStdout(void) {
+ PyObject *f = PySys_GetObject("stdout");
+ if (!f) {
+ PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
+ }
+ return f;
+}
+
+static int __Pyx_PrintItem(PyObject *v) {
+ PyObject *f;
+
+ if (!(f = __Pyx_GetStdout()))
+ return -1;
+ if (PyFile_SoftSpace(f, 1)) {
+ if (PyFile_WriteString(" ", f) < 0)
+ return -1;
+ }
+ if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
+ return -1;
+ if (PyString_Check(v)) {
+ char *s = PyString_AsString(v);
+ int len = PyString_Size(v);
+ if (len > 0 &&
+ isspace(Py_CHARMASK(s[len-1])) &&
+ s[len-1] != ' ')
+ PyFile_SoftSpace(f, 0);
+ }
+ return 0;
+}
+
+static int __Pyx_PrintNewline(void) {
+ PyObject *f;
+
+ if (!(f = __Pyx_GetStdout()))
+ return -1;
+ if (PyFile_WriteString("\n", f) < 0)
+ return -1;
+ PyFile_SoftSpace(f, 0);
+ return 0;
+}
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
+ PyObject *result;
+ result = PyObject_GetAttr(dict, name);
+ if (!result)
+ PyErr_SetObject(PyExc_NameError, name);
+ return result;
+}
+
+static void __Pyx_WriteUnraisable(char *name) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ PyErr_Fetch(&old_exc, &old_val, &old_tb);
+ ctx = PyString_FromString(name);
+ PyErr_Restore(old_exc, old_val, old_tb);
+ if (!ctx)
+ ctx = Py_None;
+ PyErr_WriteUnraisable(ctx);
+}
+
+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
+ while (t->p) {
+ *t->p = PyString_InternFromString(t->s);
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+
+static void __Pyx_AddTraceback(char *funcname) {
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ PyObject *py_globals = 0;
+ PyObject *empty_tuple = 0;
+ PyObject *empty_string = 0;
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+
+ py_srcfile = PyString_FromString(__pyx_filename);
+ if (!py_srcfile) goto bad;
+ py_funcname = PyString_FromString(funcname);
+ if (!py_funcname) goto bad;
+ py_globals = PyModule_GetDict(__pyx_m);
+ if (!py_globals) goto bad;
+ empty_tuple = PyTuple_New(0);
+ if (!empty_tuple) goto bad;
+ empty_string = PyString_FromString("");
+ if (!empty_string) goto bad;
+ py_code = PyCode_New(
+ 0, /*int argcount,*/
+ 0, /*int nlocals,*/
+ 0, /*int stacksize,*/
+ 0, /*int flags,*/
+ empty_string, /*PyObject *code,*/
+ empty_tuple, /*PyObject *consts,*/
+ empty_tuple, /*PyObject *names,*/
+ empty_tuple, /*PyObject *varnames,*/
+ empty_tuple, /*PyObject *freevars,*/
+ empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ __pyx_lineno, /*int firstlineno,*/
+ empty_string /*PyObject *lnotab*/
+ );
+ if (!py_code) goto bad;
+ py_frame = PyFrame_New(
+ PyThreadState_Get(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ py_globals, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = __pyx_lineno;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ Py_XDECREF(empty_tuple);
+ Py_XDECREF(empty_string);
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
diff --git a/pythonloader/berylpython.h b/pythonloader/berylpython.h
new file mode 100644
index 0000000..20259bc
--- /dev/null
+++ b/pythonloader/berylpython.h
@@ -0,0 +1,13 @@
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+__PYX_EXTERN_C DL_IMPORT(CompPluginVTable) vTable;
+__PYX_EXTERN_C Bool (pyInit(CompPlugin (*)));
+__PYX_EXTERN_C DL_IMPORT(void) (pyFini(CompPlugin (*)));
+__PYX_EXTERN_C Bool (pyPluginLoader(CompPlugin (*),char (*),char (*)));
+__PYX_EXTERN_C Bool (pyInitDisplay(CompPlugin (*),CompDisplay (*)));
+__PYX_EXTERN_C DL_IMPORT(void) (pyFiniDisplay(CompPlugin (*),CompDisplay (*)));
+__PYX_EXTERN_C DL_IMPORT(CompPluginVTable) (*(getCompPluginInfo(void)));
+PyMODINIT_FUNC initberylpython(void);
diff --git a/pythonloader/berylpython.pyx b/pythonloader/berylpython.pyx
new file mode 100644
index 0000000..b4f5bfe
--- /dev/null
+++ b/pythonloader/berylpython.pyx
@@ -0,0 +1,155 @@
+import ctypes, sys
+
+cdef extern from "string.h":
+ ctypedef size_t
+ void *memset(void *s, int c, size_t n)
+
+cdef extern from "beryl.h":
+ ctypedef Bool
+ ctypedef struct CompPlugin:
+ pass
+
+ ctypedef Bool (*LoadPluginProc)(CompPlugin *p, char *, char *)
+ ctypedef void (*UnloadPluginProc)(CompPlugin *p)
+
+ ctypedef struct CompDisplay:
+ LoadPluginProc loaderLoadPlugin
+ UnloadPluginProc loaderUnloadPlugin
+
+ ctypedef Bool (*InitPluginProc) (CompPlugin *)
+ ctypedef void (*FiniPluginProc) (CompPlugin *)
+ ctypedef Bool (*InitPluginForDisplayProc) (CompPlugin *, CompDisplay *)
+ ctypedef void (*FiniPluginForDisplayProc) (CompPlugin *, CompDisplay *)
+
+ ctypedef struct CompPluginVTable:
+ InitPluginProc init
+ FiniPluginProc fini
+ InitPluginForDisplayProc initDisplay
+ FiniPluginForDisplayProc finiDisplay
+ int version
+ int struct_plugin_size
+ int struct_display_size
+ int struct_screen_size
+ int struct_window_size
+ int struct_texture_size
+ int struct_icon_size
+ char * name
+ char * shortDesc
+ char * longDesc
+ char * gettext_domain
+ char * category
+
+ #lsint initScreen
+ #int finiScreen
+ #int initWindow
+ #int finiWindow
+ #int getDisplayOptions
+ #int setDisplayOption
+ #int getScreenOptions
+ #int setScreenOption
+ #int updateLibrayFunction
+ #int deps
+ #int nDeps
+ #int features
+ #int nFeatures
+
+ ctypedef struct CompScreen:
+ pass
+ ctypedef struct CompWindow:
+ pass
+ ctypedef struct CompIcon:
+ pass
+ ctypedef struct CompTexture:
+ pass
+
+ cdef int BERYL_VERSION
+
+
+cdef extern from "Python.h":
+ int PyInt_AsLong( object )
+
+# Python init in here because of funny function decorations
+cdef extern from "python_init.h":
+ pass
+
+cdef public Bool pyInit( CompPlugin *p ):
+ print " -> pyInit"
+ return True
+
+cdef public void pyFini( CompPlugin *p ):
+ print " <- pyFini"
+
+cdef LoadPluginProc oldLoader
+#cdef UnLoadPluginProc oldUnLoader
+cdef CompDisplay *cd
+
+cdef public Bool pyPluginLoader( CompPlugin *p, char *name, char *path ):
+ #print "Hello"
+ global cd, oldLoader
+ print "In pyPluginLoader()", name, path
+ cdef LoadPluginProc temp
+ temp = cd.loaderLoadPlugin
+ cd.loaderLoadPlugin = oldLoader
+ cd.loaderLoadPlugin( p, name, path )
+ cd.loaderLoadPlugin = temp
+ print "Leaving pyPluginLoader()"
+ return True
+
+
+cdef public Bool pyInitDisplay(CompPlugin * p, CompDisplay * d):
+ global cd, oldLoader
+ print " -> pyInitDisplay"
+ cd = d
+ oldLoader = d.loaderLoadPlugin
+ d.loaderLoadPlugin = &pyPluginLoader
+ print "Thingybob is set."
+ return True
+
+cdef public void pyFiniDisplay(CompPlugin * p, CompDisplay * d):
+ print " <- pyFiniDisplay"
+ d.loaderLoadPlugin = oldLoader
+
+cdef public CompPluginVTable vTable
+
+cdef public CompPluginVTable *getCompPluginInfo():
+
+ memset( &vTable, 0, sizeof( CompPluginVTable ) )
+
+ vTable.init = &pyInit
+ vTable.fini = &pyFini
+ vTable.initDisplay = &pyInitDisplay
+ vTable.finiDisplay = &pyFiniDisplay
+
+ vTable.version = BERYL_VERSION
+ vTable.struct_plugin_size = sizeof( CompPlugin )
+ vTable.struct_display_size = sizeof( CompDisplay )
+ vTable.struct_screen_size = sizeof( CompScreen )
+ vTable.struct_window_size = sizeof( CompWindow )
+ vTable.struct_texture_size = sizeof( CompTexture )
+ vTable.struct_icon_size = sizeof( CompIcon )
+ vTable.name = "pythonloader"
+ vTable.shortDesc = "Python module loader"
+ vTable.longDesc = "This plugin loads python modules placed in your ~/.beryl/plugins/ dir ending in .py"
+ vTable.category = "devel"
+ vTable.gettext_domain = "beryl-plugins"
+
+ #print "Loading Python pluginloader"
+ #print "vTable location = 0x%08x" % (<unsigned int>&vTable)
+
+ #vTable.initScreen = 0
+ #vTable.finiScreen = 0
+ #vTable.initWindow = 0
+ #vTable.finiWindow = 0
+ #vTable.getDisplayOptions = 0
+ #vTable.setDisplayOption = 0
+ #vTable.getScreenOptions = 0
+ #vTable.setScreenOption = 0
+ #vTable.updateLibrayFunction = 0
+ #vTable.deps = 0
+ #vTable.nDeps = 0
+ #vTable.features = 0
+ #vTable.nFeatures = 0
+
+ print "Returning vTable..."
+
+ return &vTable \ No newline at end of file
diff --git a/pythonloader/python_init.h b/pythonloader/python_init.h
new file mode 100644
index 0000000..146b830
--- /dev/null
+++ b/pythonloader/python_init.h
@@ -0,0 +1,40 @@
+__PYX_EXTERN_C DL_EXPORT(void) (initberylpython(void));
+
+void *pyHand = 0;
+int Py_PreviouslyInitialised = 0;
+
+#include <dlfcn.h>
+#include <stdio.h>
+
+// Initialiser called when this shared library is dlopen'ed
+// make python interpreter ready if necessary, make things ready
+void __attribute__((constructor))init()
+{
+ // Ensure python symbols available.
+ // Would be nice to have some better system here.
+ pyHand = dlopen( "/usr/lib/libpython2.4.so", RTLD_NOW | RTLD_GLOBAL );
+
+ Py_PreviouslyInitialised = Py_IsInitialized();
+
+ if ( !Py_PreviouslyInitialised )
+ {
+ //printf( "Before = %i\n", Py_IsInitialized() );
+ Py_Initialize();
+ //printf( "Python initialised.. %i\n", Py_IsInitialized() );
+ //PyRun_SimpleString( "print 'this is a test'" );
+ } else
+ 0; //printf( "Python already initialised\n" );
+
+
+ initberylpython();
+}
+
+void __attribute__((destructor))fini()
+{
+ //printf( "Python dlclose'd\n" );
+
+ if ( !Py_PreviouslyInitialised )
+ Py_Finalize();
+
+ dlclose( pyHand );
+}
diff --git a/pythonloader/script.py b/pythonloader/script.py
new file mode 100644
index 0000000..98783ae
--- /dev/null
+++ b/pythonloader/script.py
@@ -0,0 +1,176 @@
+import beryl
+import berylplugin
+import ctypes
+import math
+#import Numeric
+from Numeric import *
+import PIL.Image
+
+from OpenGL import GL
+#print "Importing numpy"
+#from numpy import *
+#import numpy
+#print "Numpy loaded..."
+
+_S = berylplugin._S
+
+f = ctypes.CDLL( None )
+
+# Todo: Need better methods for wrap/unwrap
+# Make options work
+
+
+class Plugin( berylplugin.Plugin ):
+ def __init__( self ):
+ self.px = 0
+ self.dir = 10.
+ self.info = { "name" : _S( "pythonplugin" ),
+ "shortDesc" : _S( "Python plugin experiment" ),
+ "longDesc" : _S( "This is an experiment in python plugins" ),
+ "gettext_domain" : _S( "beryl-plugins" ),
+ "category" : _S( "devel" ),
+ "initScreen" : beryl.InitPluginForScreenProc( self.initScreen ),
+ "finiScreen" : beryl.FiniPluginForScreenProc( self.finiScreen ),
+ }
+ self.options = [
+
+ ]
+ berylplugin.Plugin.__init__( self )
+
+ def initPlugin( self, p ):
+ print "-----!InitPlugin"
+ return True
+
+ def finiPlugin( self, p ):
+ print "-----!FiniPlugin"
+
+ def initDisplay( self, p, d ):
+ #print "-------!! initDisplay"
+ #print ctypes.CDLL( None ).XStringToKeysym( "F12" )
+ #self.initOptions()
+ return True
+
+ def finiDisplay( self, p, d ):
+ print "-------!! finiDisplay"
+
+ def initScreen( self, p, s ):
+ reals = s.contents
+ print " --- !! initScreen"
+ self.texes = GL.glGenTextures( 1 )
+
+ #print "Self.texes = ", self.texes
+
+ GL.glEnable( GL.GL_TEXTURE_2D )
+ GL.glBindTexture( GL.GL_TEXTURE_2D, self.texes )
+
+ GL.glTexParameteri( GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR )
+ GL.glTexParameteri( GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR )
+ GL.glTexParameteri( GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT )
+ GL.glTexParameteri( GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_REPEAT )
+ i = PIL.Image.open( "/home/pwaller/Downloads/Nuovo/Xtra/gaim/buttons/insert-smiley-small.png" )
+ GL.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, i.size[0], i.size[1], 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, i.tostring())
+
+ self.rememberPS = ctypes.cast( reals.paintScreen, ctypes.c_void_p )
+ self.rememberDPS = ctypes.cast( reals.donePaintScreen, ctypes.c_void_p )
+ self.myPS = beryl.PaintScreenProc( self.paintScreen )
+ self.myDPS = beryl.DonePaintScreenProc( self.donePaintScreen )
+ reals.paintScreen = self.myPS
+ reals.donePaintScreen = self.myDPS
+
+ f.addScreenAction.argtypes = [ ctypes.POINTER( beryl.CompScreen ), ctypes.c_int ]
+ f.addScreenAction.restype = None
+ f.removeScreenAction.argtypes = [ ctypes.POINTER( beryl.CompScreen ), ctypes.c_int ]
+ f.removeScreenAction.restype = None
+
+ f.addScreenAction( s, ctypes.addressof( self.opts[0].value.action ) ) #&bd->opt[BENCH_DISPLAY_OPTION_INITIATE].value.action);
+
+ return True
+
+ def finiScreen( self, p, s ):
+ reals = s.contents
+ reals.paintScreen = ctypes.cast( self.rememberPS, beryl.PaintScreenProc )
+ reals.donePaintScreen = ctypes.cast( self.rememberDPS, beryl.DonePaintScreenProc )
+
+ f.removeScreenAction( s, ctypes.addressof( self.opts[0].value.action ) )
+
+ def donePaintScreen( self, s ):
+ f.damageScreen( s )
+ reals = s.contents
+ f.glFlush()
+ f.XSync( reals.display.contents.display, False )
+
+ reals.donePaintScreen = ctypes.cast( self.rememberDPS, beryl.DonePaintScreenProc )
+ reals.donePaintScreen( s )
+ reals.donePaintScreen = self.myDPS
+
+ def paintScreen( self, s, sa, transform, region, output, mask ):
+ reals = s.contents
+
+ reals.paintScreen = ctypes.cast( self.rememberPS, beryl.PaintScreenProc )
+ ret = reals.paintScreen( s, sa, transform, region, output, mask )
+ reals.paintScreen = self.myPS
+
+ f.transformToScreenSpace.argtypes = [ ctypes.POINTER(beryl.CompScreen), ctypes.c_uint, ctypes.c_float, ctypes.POINTER(beryl.CompTransform) ]
+ f.glLoadMatrixf.argtypes = [ ctypes.c_float * 16 ]
+
+ tf = beryl.CompTransform()
+ ctypes.memmove( ctypes.byref( tf ), transform, ctypes.sizeof( tf ) )
+
+ f.transformToScreenSpace( s, output, -self.defaultZ, ctypes.byref( tf ) )
+
+
+ GL.glPushMatrix()
+ f.glLoadMatrixf( tf.m )
+ self.px += self.dir
+ if self.px >= 1280-25 or self.px <= 0: self.dir = -self.dir
+ #GL.glTranslatef( self.px+50, 500, 0 )
+ #GL.glRotatef( self.px/(1280-25)*180*0.5, 0, 0, 1 )
+ #GL.glScalef( 0.5+2*math.sin( self.px/1180.0*math.pi ), 1.5, 1 )
+ #GL.glTranslatef( 100, 100, 0 )
+ GL.glColor4f( 1, 1, 1, 0.75 ) #0, math.sin( self.px/1180.0*math.pi ) )
+
+ GL.glEnable( GL.GL_BLEND )
+ GL.glEnable(GL.GL_TEXTURE_2D);
+ #"""
+ GL.glBindTexture(GL.GL_TEXTURE_2D, self.texes)
+ GL.glBegin( GL.GL_QUADS )
+ psize = array( [self.length, self.height] )
+ ppos = array( [self.x, self.y] )*4
+ for i in xrange( 0, 10 ):
+ GL.glTexCoord2f(0, 0);
+ GL.glVertex2f( *ppos )
+ GL.glTexCoord2f(0, 1);
+ GL.glVertex2f( *(ppos+(0,psize[1])) )
+ GL.glTexCoord2f(1, 1);
+ GL.glVertex2f( *(ppos+psize) )
+ GL.glTexCoord2f(1, 0);
+ GL.glVertex2f( *(ppos+(psize[0],0)) )
+ ppos[0] += psize[0] + 5
+ GL.glEnd()
+ #"""
+ #GL.glBindTexture(GL.GL_TEXTURE_2D, self.texes)
+ """
+ GL.glBegin(GL.GL_QUADS)
+ GL.glTexCoord2f(0, 0);
+ GL.glVertex2f(0, 0)
+ GL.glTexCoord2f(0, 1);
+ G
+ L.glVertex2f(0, 50)
+ #GL.glColor4f( 0, 0, 1, 1 )
+ GL.glTexCoord2f(1, 1);
+ GL.glVertex2f(50, 50)
+ GL.glTexCoord2f(1, 0);
+ GL.glVertex2f(50, 0)
+ GL.glEnd()
+ """
+
+ GL.glDisable( GL.GL_BLEND )
+ GL.glDisable(GL.GL_TEXTURE_2D);
+ GL.glPopMatrix()
+
+ return ret
+
+ def __del__( self ):
+ print "Plugin deleted!!!!!!!!!!!!!!!!!"
+
+print "script.py loaded..."