From MAILER-DAEMON Wed Jan 11 15:33:22 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Rl4rK-0003Mg-06 for mharc-libqtlua-list@gnu.org; Wed, 11 Jan 2012 15:33:22 -0500 Received: from eggs.gnu.org ([140.186.70.92]:47195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl4rG-0003M0-KU for libqtlua-list@nongnu.org; Wed, 11 Jan 2012 15:33:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rl4rF-0000SC-N5 for libqtlua-list@nongnu.org; Wed, 11 Jan 2012 15:33:18 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:49853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl4rF-0000Rn-7W for libqtlua-list@nongnu.org; Wed, 11 Jan 2012 15:33:17 -0500 Received: from ganymede.localnet (unknown [IPv6:2a01:e35:2e4f:5be0:230:48ff:fe64:86]) by smtp1-g21.free.fr (Postfix) with ESMTP id 89F27940572 for ; Wed, 11 Jan 2012 21:33:11 +0100 (CET) From: Alexandre Becoulet To: libqtlua-list@nongnu.org Date: Wed, 11 Jan 2012 21:33:09 +0100 Message-ID: <3635219.JzpjrJfGQP@ganymede> User-Agent: KMail/4.7.4 (Linux/3.1.5-1-ARCH; KDE/4.7.4; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 212.27.42.1 Subject: [Libqtlua-list] QtLua 1.4 released X-BeenThere: libqtlua-list@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 20:33:19 -0000 Hi list, A new release is available. Some new features have been added: * The new ArrayProxy class can be used to expose C arrays to lua script. * The UserObject class has been rewritten. * More constructors and cast operators are supported by the Value class, * conversion between Value and QVariant is supported. Many other improvments and minor fixes are included in this release. -- Alexandre From MAILER-DAEMON Sat Jan 21 11:05:28 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RodRY-0006tJ-5q for mharc-libqtlua-list@gnu.org; Sat, 21 Jan 2012 11:05:28 -0500 Received: from eggs.gnu.org ([140.186.70.92]:41826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RodRV-0006sf-4s for libqtlua-list@nongnu.org; Sat, 21 Jan 2012 11:05:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RodRU-00048Y-5K for libqtlua-list@nongnu.org; Sat, 21 Jan 2012 11:05:25 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:45217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RodRT-00048H-DE for libqtlua-list@nongnu.org; Sat, 21 Jan 2012 11:05:24 -0500 Received: from ganymede.localnet (unknown [IPv6:2a01:e35:2e4f:5be0:230:48ff:fe64:86]) by smtp1-g21.free.fr (Postfix) with ESMTP id DEB0C9403DC; Sat, 21 Jan 2012 17:05:15 +0100 (CET) From: Alexandre Becoulet To: Sven Oliver Moll Date: Sat, 21 Jan 2012 17:05:10 +0100 Message-ID: <2867923.kd5koKXfMJ@ganymede> User-Agent: KMail/4.7.4 (Linux/3.1.5-1-ARCH; KDE/4.7.4; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="ISO-8859-1" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 212.27.42.1 Cc: libqtlua-list@nongnu.org Subject: Re: [Libqtlua-list] Patch to enable #!/usr/local/bin/qtlua X-BeenThere: libqtlua-list@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 16:05:26 -0000 On Friday, January 20, 2012 06:14:14 PM you wrote: Hi, > The qtlua tool lacks a feature, imho: support for the shebang (#!). Here's > my suggestion on how it might be implemented. :) Thanks for your patch. It's now available from the svn repository. Best, -- Alexandre From MAILER-DAEMON Tue Jan 24 02:31:15 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RpaqZ-0000ma-BL for mharc-libqtlua-list@gnu.org; Tue, 24 Jan 2012 02:31:15 -0500 Received: from eggs.gnu.org ([140.186.70.92]:51556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpaqV-0000lv-PZ for libqtlua-list@nongnu.org; Tue, 24 Jan 2012 02:31:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpaqP-0007V2-On for libqtlua-list@nongnu.org; Tue, 24 Jan 2012 02:31:11 -0500 Received: from mail-vx0-f173.google.com ([209.85.220.173]:38767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpaqP-0007Uy-LT for libqtlua-list@nongnu.org; Tue, 24 Jan 2012 02:31:05 -0500 Received: by vcbfo14 with SMTP id fo14so2694294vcb.4 for ; Mon, 23 Jan 2012 23:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=Pc/vQbtZfx0PsidpalPa8BwEE3njEGXbCXgJqKL+umw=; b=pH4468JEAvlJj8b4f5kQFK2BfyHOAsOM4JzE7h2isthfCd/EkA7TSVTCJmmpD1MWjn 552j6WhjAdQHNZz67oTNNhvLB4fLUalv61AVyywpliWEOMJ1uCQKr/TU0U4qZqkFp91g 34dQY9D6d54Zu7R2J5hliA3Aq2GGgooJKbRzY= MIME-Version: 1.0 Received: by 10.220.106.207 with SMTP id y15mr6330951vco.69.1327390264003; Mon, 23 Jan 2012 23:31:04 -0800 (PST) Received: by 10.220.6.11 with HTTP; Mon, 23 Jan 2012 23:31:03 -0800 (PST) Date: Tue, 24 Jan 2012 01:31:03 -0600 Message-ID: From: Edwin Marshall To: libqtlua-list@nongnu.org Content-Type: multipart/alternative; boundary=f46d0434beee2a0bd804b741218b X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.220.173 Subject: [Libqtlua-list] Making a QObject instanciatable from Lua X-BeenThere: libqtlua-list@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 07:31:13 -0000 --f46d0434beee2a0bd804b741218b Content-Type: text/plain; charset=ISO-8859-1 First of all, I'm very new to lua, so if there is a more idiomatic way of accomplishing this, please let me know. Secondly, thank you for your efforts on such a great library. I'm evaluating it for use as a replacement for QtScript, and it seems to have a lot of features that QtScript doesn't, all while being quite compact. Anyways, I'm designing a program[1] that defines basic components, such as Action, Item, and Container. For the purpose of this email, I will focus on the Container component, which has the sole purpose of containing items and applying arbitrary restrictions to its contents. Specifically, given a Container named Hand, the following restrictions would apply: - contains cards of any type (club, diamond, spade, heart) - may contain no more than 5 cards - Is only view-able by the player (hidden from opponent's view) What I'd like to do is define a generic class in C++ named Container[2] which could then be accessed and instantiated in lua as a table. It seems as though UserData or UserObject is what I need. However, In addition to not seeing any example code of how to use such a defined object without first instantiating it (eg, passing an instance to lua), I'd like to find a way to do so that doesn't tightly couple QtLua to the Container class, should I decide to revert to a different binding language (Such as QtScript). My first instinct is to employee multiple inheritance, but I can't help but think this is sloppy, and that there is a cleaner way to do this. In short, my question is this: - How do I wrap a class and pass it to lua, rather than wrapping an instance of that class to pass to lua? [1] http://www.assembla.com/spaces/virtual-cardgame-engine/tab_tool [2] http://www.assembla.com/spaces/virtual-cardgame-engine/messages/1430883 -- Regards, Edwin O Marshall (aspidites) http://github.com/aspidites http://bitbucket.org/aspidites http://www.assembla.com/profile/aspidites?public=true --f46d0434beee2a0bd804b741218b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable First of all, I'm very new to lua, so if there is a more idiomatic way = of accomplishing this, please let me know. Secondly, thank you for your eff= orts on such a great library. I'm evaluating it for use as a replacemen= t for QtScript, and it seems to have a lot of features that QtScript doesn&= #39;t, all while being quite compact.

Anyways, I'm designing a program[1] that defines basic c= omponents, such as Action, Item, and Container. For the purpose of this ema= il, I will focus on the Container component, which has the sole purpose of = containing items and applying arbitrary restrictions to its contents. Speci= fically, given a Container named Hand, the following restrictions would app= ly:
  • contains cards of any type (club, diamond, spade, heart)
  • <= li>may contain no more than 5 cards
  • Is only=A0view-able=A0by the pl= ayer (hidden from opponent's view)
What I'd like to d= o is define a generic class in C++ named Container[2] which could then be a= ccessed and=A0instantiated=A0in lua as a table. It seems as though UserData= or UserObject is what I need. However, In addition to not seeing any examp= le code of how to use such a defined object without first instantiating it = (eg, passing an instance to lua), I'd like to find a way to do so that = doesn't tightly couple QtLua to the Container class, should I decide to= revert to a different binding language (Such as QtScript). My first=A0inst= inct=A0is to employee multiple=A0inheritance, but I can't help but thin= k this is sloppy, and that there is a cleaner way to do this.

In short, my question is this:
  • How do= I wrap a class and pass it to lua, rather than wrapping an instance of tha= t class to pass to lua?
--
Regards, --f46d0434beee2a0bd804b741218b-- From MAILER-DAEMON Wed Jan 25 17:21:51 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RqBDz-0005a5-F8 for mharc-libqtlua-list@gnu.org; Wed, 25 Jan 2012 17:21:51 -0500 Received: from eggs.gnu.org ([140.186.70.92]:47550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqBDw-0005YR-7X for libqtlua-list@nongnu.org; Wed, 25 Jan 2012 17:21:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqBDu-0003YI-UZ for libqtlua-list@nongnu.org; Wed, 25 Jan 2012 17:21:48 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:47473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqBDu-0003Xp-Ab for libqtlua-list@nongnu.org; Wed, 25 Jan 2012 17:21:46 -0500 Received: from ganymede.localnet (unknown [IPv6:2a01:e35:2e4f:5be0:230:48ff:fe64:86]) by smtp1-g21.free.fr (Postfix) with ESMTP id 02C0E94038D for ; Wed, 25 Jan 2012 23:21:39 +0100 (CET) From: Alexandre Becoulet To: libqtlua-list@nongnu.org Date: Wed, 25 Jan 2012 23:21:33 +0100 Message-ID: <33189735.z2YUMbYTQr@ganymede> User-Agent: KMail/4.7.4 (Linux/3.1.5-1-ARCH; KDE/4.7.4; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="ISO-8859-1" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 212.27.42.1 Subject: Re: [Libqtlua-list] Making a QObject instanciatable from Lua X-BeenThere: libqtlua-list@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 22:21:49 -0000 On Tuesday, January 24, 2012 01:31:03 AM Edwin Marshall wrote: Hi, > Anyways, I'm designing a program[1] that defines basic components, such as > Action, Item, and Container. For the purpose of this email, I will focus on > the Container component, which has the sole purpose of containing items and > applying arbitrary restrictions to its contents. Specifically, given a > Container named Hand, the following restrictions would apply: > > - contains cards of any type (club, diamond, spade, heart) > - may contain no more than 5 cards > - Is only view-able by the player (hidden from opponent's view) > > What I'd like to do is define a generic class in C++ named Container[2] > which could then be accessed and instantiated in lua as a table. It seems > as though UserData or UserObject is what I need. The proxy classes provided in QtLua allow to access Qt generic container classes from lua script. You may want to write such a class for your specific container class, this way you do not have to make your container class specific to lua or QtLua. > However, In addition to > not seeing any example code of how to use such a defined object without > first instantiating it (eg, passing an instance to lua), I'd like to find a > way to do so that doesn't tightly couple QtLua to the Container class, An other approach which would not make your class inherit from UserData is to write a QObject based class and use the Qt slots and properties to control your object from lua. > should I decide to revert to a different binding language (Such as > QtScript). My first instinct is to employee multiple inheritance, but I > can't help but think this is sloppy, and that there is a cleaner way to do > this. > > In short, my question is this: > > - How do I wrap a class and pass it to lua, rather than wrapping an > instance of that class to pass to lua? You can not pass C++ classes to lua. You would need some kind of binding to achieve something similar to this and QtLua is not a binding. The closer approach is to take advantages of the Qt meta object system to make QtLua aware of some members of your C++ class when it deals with an object of that type. This mechanism is the same as the one used in QtScript. You may have to provide a QtLua::Function which constructs a new object of that class if it needs to be instantiated from lua script. Best, -- Alexandre