From 853b5227d00b97e662f745f69ad622ef27ddfb69 Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Sat, 4 Sep 2010 14:16:52 +0200 Subject: [PATCH] First code documentation using LazDoc. It also added the os_linux unit to Simba.lpr, I guess it needs to do this for the FPDoc to work properly. --- LazDoc/os_linux.xml | 86 ++++++++++++++++++++++++++++++++++++++++ Projects/Simba/Simba.lpi | 10 ++++- Projects/Simba/Simba.lpr | 2 +- 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 LazDoc/os_linux.xml diff --git a/LazDoc/os_linux.xml b/LazDoc/os_linux.xml new file mode 100644 index 0000000..02d737a --- /dev/null +++ b/LazDoc/os_linux.xml @@ -0,0 +1,86 @@ + + + + + + Returns the dimension of the TWindow + Uses XGetWindowAttributes to retrieve the dimensions of the stored TWindow. + + + Uses TKeyInput class from lazarus to fake a keydown event. + + + Uses TKeyInput class from lazarus to fake a keyup event. + + + Should return true if the given key is held down. NOT YET IMPLEMENTED ON LINUX + + + Uses XGetWindowAttributes to check if the currently selected window is valid. If we have not recieved an error, the window is valid. + + + Selects the current client as input focus for the X11 windowing system + + + Uses XGetImage to get the pixel data of the currently stored TWindow. The image data is passed as result. + + + Frees the XImage object called buffer if it is set. This should be called once the ReturnData result is no longer required. + + + Uses XQueryPointer to query the current mouse position relative to the stored TWindow. + + + Uses XWarpPointer to move the mouse to the specific position relative to the stored TWindow. + + + Uses XTest to fake a mouse button press. + + + Uses XTest to fake a mouse button release. + + + Uses XQueryPointer to return if the given mouse button is held. + + + Linux/X11 implementation of the TIOManager + + + Set the stored TWindow to the passed TNativeWindow. + + + Set the desktop as stored TWindow. + + + Open the X11 connection + + + Close the X11 connection. + + + X Error Handler. + This is extremely hacky, but also very useful. + We have to install a X error handler, because otherwise X + will terminate out entire app on error. + + Since we want the right thread to recieve the right error, we have to + fiddle a bit with threadvars, mutexes / semaphores. + + Another problem is that the script thread is initialised on the main thread. + This means that all (threadvar!) semaphores initialised on the mainthread + are NOT initialised on the script thread, which has yet to be started. + Therefore, we check if it hasn't been created yet. + + ** Horrible solution, but WFM ** + + This is the Handler function. + + + Returns true if we have received an error + + + Returns the stored TWindow + + + + diff --git a/Projects/Simba/Simba.lpi b/Projects/Simba/Simba.lpi index ea95487..5b6f5ab 100644 --- a/Projects/Simba/Simba.lpi +++ b/Projects/Simba/Simba.lpi @@ -12,6 +12,7 @@ + @@ -38,7 +39,7 @@ - + @@ -203,7 +204,7 @@ - + @@ -293,6 +294,11 @@ + + + + + diff --git a/Projects/Simba/Simba.lpr b/Projects/Simba/Simba.lpr index d497819..abae30f 100644 --- a/Projects/Simba/Simba.lpr +++ b/Projects/Simba/Simba.lpr @@ -33,7 +33,7 @@ uses {$ENDIF}{$ENDIF} Interfaces, Forms, SimbaUnit, colourhistory, About, internets, debugimage, framefunctionlist, simpleanalyzer, updater, updateform, Simbasettings, - libloader, mufasabase, v_ideCodeInsight, PSDump, v_ideCodeParser, + libloader, mufasabase, os_linux, v_ideCodeInsight, PSDump, v_ideCodeParser, v_AutoCompleteForm, CastaliaPasLex, CastaliaPasLexTypes, CastaliaSimplePasPar, CastaliaSimplePasParTypes, dcpbase64, mPasLex, v_Constants, v_MiscFunctions, extensionmanagergui, mmisc, bitmapconv;