Hello

This is what I want to do (from Lua archive). In short, if the one can
enumerate all windows in Windows, using neko program only (of course, it can
use some general purpose dll to allow it for dynamic calls and callbacks,
but this shouldn't depend on particular API function):

We want to reviwe DM2 project witch is desktop manager for Win.

The idea is to abandon current application and rewrite everything
particulary to abandon current plugin concept as to write plugins U have to
know C++, have IDE, know native API etc... so chance that sombody will write
plugin is small (empiricaly proven). We want to make this chance bigger by
providing easy to learn language that requries no IDE and special pre
knowledge. The other thing is that you would be able to change behavior of
default plugins to suite your needs as they will be provided as LUa code.

This is idea:

DM to be tiny shell that will encapsulate important windows events, like
OnTitleClick, OnWinMinimize, etc... and to integrate Lua as its plugin
writting language. You could be able to add number of different plugins to
the same handler. We would provide in that case set of classess (or Lua
equivalent) for basic things, but Lua should be capable of accessing Native
API for things we didn't do.

So the questions I hope you can answer are :

- How complex is mechanism to access Native API from lua, if possible
- How complex is interfering with APIs that use callbacks, if possible

I wish you could be also able to download DM2 and see what is it about (it
is ~100KB application) and tell me if it makes any sense or is it possible
at all to do all that using LUA as plugin SDK.

http://dm2.sourceforge.net/


So, the point is to allow Lua programmers to intereact with the system if
adequate wraapper is not provided by host.




On 12/15/06, Lee McColl Sylvester <[EMAIL PROTECTED]> wrote:

Callbacks aren't a problem with Neko. Generally, if a particular api
requires a C callback function pointer, you simply provide a C function
that passes the returned data into a C-> Neko function call, thus
proxying the callback to your Neko/haXe code.

As for the Windows API stuff, I'm not sure what it is you wish to do,
but Systools can handle some of your desktop API requirements, while
others still will need the use of OS specific coding.  I'm currently
wrapping IUP for Windows GUI functionality which provides a wealth of
Windows / Linux required desktop functionality needs. Maybe you should
look into that?

Regards,
Lee




majkinetor wrote:

>
> Hello there.
>
>
> I want to emebe Neko in desktop manager I write, for Windows, to use
> it as a plugin language.
>
> I don't want to wrapp everything out there in Windows needed for this
> job, so Neko must be able to dynamicaly call System API functions,
> something that is Lua done using this code:
>
>
>
---------------------------------------------------------------------------------------------------------------------
> if not USES( 'lib.dynacall', "try" ) then
>     print "Skipping DynaCall (module not compiled)"
>     return
> end
>
> local declare= ASSUME( lib.dynacall.declare )
>
> local MessageBox, err= declare( "user32", "MessageBox", "i=IAAI",
> "stdcall" )
> ASSUME(MessageBox)
>
> local answer = MessageBox( 0, "This is a test of the dynamic function
> binding library.\nDo you like it?", "Surprise!", 4 )
>
> if answer==6 then -- YES!
>      MessageBox( 0, ":-)", "Fine!", 0 )
> else -- NO?
>      ASSUME( answer==7 )
>     MessageBox( 0, ":-(", "you don't?", 0 )
> end
>
---------------------------------------------------------------------------------------------------------------------
>
>
> Can I achieve that in Neko ? Moreover, I didn't manage to solve
> following problem in Lua, and thats how I found Neko:
> Theproblematic scenario is the one with callbacks, like the one in for
> instance EnumWindows system API to get all windows. This function
> requires C
> callback so it can call its clients for every window in the system it
founds.
>
> Plugin writters must be able to use such functions from Neko direcltly
> if wrapper is not supplied (there are dozen of such functions in Win
SDK,
> and we can provide wrappers just for most common of them, not for all).
>
> I saw documentation about neko FFI & callbacks but still puzzled about
> this.
> So, is it possible for instance, for Neko programmer, to dynamicaly
> call EnumWindows witch has C function pointer as an argument, and
> supply Neko function
> as a callback instead C function (not directly ofcourse, but any
> mechanism will be enough).
>
>
> Any idea, tip or tip is highly appreciated
>
> Thanx.
>
> PS: EnumWindows docs:
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/enumwindows.asp
>
> --
> www.r-moth.com <http://www.r-moth.com>
> http://r-moth.deviantart.com




--
Neko : One VM to run them all
(http://nekovm.org)




--
www.r-moth.com
http://r-moth.deviantart.com
-- 
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to