5 years agoFill in design document.screen-scripting-soc
Rui Guo [Sat, 22 Aug 2009 17:02:41 +0000]
Fill in design document.

5 years agoSome tweak & fixes on interface definitions.
Rui Guo [Sat, 22 Aug 2009 16:58:25 +0000]
Some tweak & fixes on interface definitions.

Add readonly properties uid/esc/metaesc to user object
canvas property window is now reat/write. The showwin method is no longer
used.
Remove xs/ys field for canvas.
autosave property should be of integer type.

5 years agoCorrect the event description for activity/silient monitors.
Rui Guo [Sat, 22 Aug 2009 16:57:17 +0000]
Correct the event description for activity/silient monitors.

5 years agoUnhook the event handler if it causes error.
Rui Guo [Thu, 20 Aug 2009 17:09:20 +0000]
Unhook the event handler if it causes error.

This prevents crash on error caused by caption handler, which will cause stack
overflow.

5 years agoMake the result of screen.windows easier to use.
Rui Guo [Wed, 19 Aug 2009 15:10:22 +0000]
Make the result of screen.windows easier to use.

The resulting table does not have holes in index.

5 years agoFix problem caused by resourcing a script when an callback is in function.
Rui Guo [Wed, 19 Aug 2009 14:25:24 +0000]
Fix problem caused by resourcing a script when an callback is in function.

5 years agoSome more dead code & comments removed.
Rui Guo [Tue, 18 Aug 2009 17:48:22 +0000]
Some more dead code & comments removed.

5 years agoGet rid of some codes that no longer needed.
Rui Guo [Tue, 18 Aug 2009 17:27:58 +0000]
Get rid of some codes that no longer needed.

5 years agoGet rid of some legacy code.
Rui Guo [Tue, 18 Aug 2009 17:14:22 +0000]
Get rid of some legacy code.

5 years agoUse separate lua_State for different script files.
Rui Guo [Tue, 18 Aug 2009 17:10:51 +0000]
Use separate lua_State for different script files.

This totally solves issues with sourcing a script multiple times and make
anonymous hook functions work again.

5 years agoFix canvas.split on non-fore situation.
Rui Guo [Thu, 13 Aug 2009 15:00:25 +0000]
Fix canvas.split on non-fore situation.

5 years agoImplement get_lines & get_history for window object.
Rui Guo [Thu, 13 Aug 2009 14:59:49 +0000]
Implement get_lines & get_history for window object.

5 years agoSet title bas on the output found on the screen.
Rui Guo [Mon, 10 Aug 2009 16:37:52 +0000]
Set title bas on the output found on the screen.

5 years agoAdd two events
Rui Guo [Mon, 10 Aug 2009 16:36:45 +0000]
Add two events

Screen.oncreatewindow
window.onoutput

5 years agoAdd the window.viewing_canvases method
Rui Guo [Mon, 10 Aug 2009 13:08:49 +0000]
Add the window.viewing_canvases method

5 years agoDocument the onsilent/onactivity event.
Rui Guo [Tue, 4 Aug 2009 16:27:33 +0000]
Document the onsilent/onactivity event.

5 years agoFix a warning on no return value.
Rui Guo [Tue, 4 Aug 2009 16:26:55 +0000]
Fix a warning on no return value.

5 years agoPass the missing Display for triggering onsilent event.
Rui Guo [Tue, 4 Aug 2009 16:26:05 +0000]
Pass the missing Display for triggering onsilent event.

5 years agoImplement window event onslient & onactivity
Rui Guo [Tue, 4 Aug 2009 16:22:15 +0000]
Implement window event onslient & onactivity

5 years agoUpdate document on display interface.
Rui Guo [Mon, 3 Aug 2009 15:52:38 +0000]
Update document on display interface.

5 years agoUnplug broker from the hash on object invalidation.
Guo Rui [Mon, 27 Jul 2009 17:14:43 +0000]
Unplug broker from the hash on object invalidation.

This solve the problem comming along with reusing the same memory for an
irrelevant object. The new object will correctly have a separate broker now.

5 years agoCorrect LuaRegEvent to use broker.
Guo Rui [Mon, 27 Jul 2009 17:13:44 +0000]
Correct LuaRegEvent to use broker.

5 years agoInvalidate broker on object destruction.
Guo Rui [Mon, 27 Jul 2009 17:13:01 +0000]
Invalidate broker on object destruction.

5 years agoImplement GC handler to release broker reference properly.
Guo Rui [Mon, 27 Jul 2009 16:18:06 +0000]
Implement GC handler to release broker reference properly.

5 years agoImplement window.onclose event, which happens just before window close.
Guo Rui [Sun, 26 Jul 2009 15:43:33 +0000]
Implement window.onclose event, which happens just before window close.

5 years agoImproved caption demo script a bit.
Guo Rui [Tue, 21 Jul 2009 16:30:57 +0000]
Improved caption demo script a bit.

Issues remain:
1. hard to iterate through windows
2. Error in caption handler causes stack-overflow.

5 years agoCorrectly pad the caption output.
Guo Rui [Tue, 21 Jul 2009 16:29:47 +0000]
Correctly pad the caption output.

5 years agoPush broker to lua script, instead of the pointer itself.
Guo Rui [Tue, 21 Jul 2009 16:27:55 +0000]
Push broker to lua script, instead of the pointer itself.

5 years agoClear invalid reference in get_broker_obj().
Guo Rui [Tue, 21 Jul 2009 16:25:41 +0000]
Clear invalid reference in get_broker_obj().

5 years agoFix freeing broker.
Guo Rui [Mon, 20 Jul 2009 16:22:12 +0000]
Fix freeing broker.

5 years agoImplement object broker mechanism.
Guo Rui [Thu, 16 Jul 2009 16:14:50 +0000]
Implement object broker mechanism.

5 years agoAdd display.top_canvas & bottom_canvas interface.
Guo Rui [Thu, 16 Jul 2009 15:01:39 +0000]
Add display.top_canvas & bottom_canvas interface.

5 years agoDemonstrate the idle event & attach event.
Guo Rui [Tue, 14 Jul 2009 15:56:04 +0000]
Demonstrate the idle event & attach event.

5 years agoImplement global display attach event.
Guo Rui [Tue, 14 Jul 2009 15:50:51 +0000]
Implement global display attach event.

5 years agoImplement display.idle_timeout interface, currently write-only
Guo Rui [Mon, 13 Jul 2009 16:08:07 +0000]
Implement display.idle_timeout interface, currently write-only

5 years agoRename idle event to onidle event.
Guo Rui [Mon, 13 Jul 2009 16:07:34 +0000]
Rename idle event to onidle event.

5 years agoReliably trigger onidle event.
Guo Rui [Mon, 13 Jul 2009 16:05:38 +0000]
Reliably trigger onidle event.

By pass internal processing on successful triggering.

5 years agoFix a crash in screen_schedule()
Guo Rui [Mon, 13 Jul 2009 16:03:32 +0000]
Fix a crash in screen_schedule()

5 years agoImplement screen.schedule interface.
Guo Rui [Sun, 12 Jul 2009 16:21:11 +0000]
Implement screen.schedule interface.

This is used to run a function at specified time.

Also fix a compile error in the previous commit.

5 years agoImplement display.onidle event.
Guo Rui [Sun, 12 Jul 2009 15:51:32 +0000]
Implement display.onidle event.

5 years agoFirst (hopefully) working version of caption processing.
Guo Rui [Fri, 10 Jul 2009 17:04:36 +0000]
First (hopefully) working version of caption processing.

5 years agoAdd canvas.display to access display from canvas.
Guo Rui [Fri, 10 Jul 2009 15:49:03 +0000]
Add canvas.display to access display from canvas.

5 years agoTrigger Processcaption event only for caption & hstatus handling.
Guo Rui [Wed, 8 Jul 2009 14:51:46 +0000]
Trigger Processcaption event only for caption & hstatus handling.

5 years agoImplement canvas.split
Guo Rui [Wed, 8 Jul 2009 14:26:12 +0000]
Implement canvas.split

5 years agoImplement screens.layouts.
Guo Rui [Wed, 8 Jul 2009 14:18:24 +0000]
Implement screens.layouts.

5 years agoImplement layout related interface.
Guo Rui [Mon, 6 Jul 2009 15:36:51 +0000]
Implement layout related interface.

Also restructure layout renumbering code to avoid duplication.

5 years agoMove ProcessCaption to current event dispatching system.
Guo Rui [Fri, 3 Jul 2009 15:15:47 +0000]
Move ProcessCaption to current event dispatching system.

Compile, but still could not work.
Currently the event will be triggered for both caption and hstatus, which does
not reflect the name.

5 years agoTrigger window.onresize event.
Guo Rui [Fri, 3 Jul 2009 14:18:33 +0000]
Trigger window.onresize event.

5 years agoIntroduce canvas.showwin() interface.
Rui Guo [Wed, 24 Jun 2009 14:29:09 +0000]
Introduce canvas.showwin() interface.

5 years agoDocument canvas.select method
Rui Guo [Wed, 24 Jun 2009 14:15:40 +0000]
Document canvas.select method

5 years agoIntroduce window.activate method.
Rui Guo [Wed, 24 Jun 2009 14:11:51 +0000]
Introduce window.activate method.

5 years agoExtract RC_FOCUS implementation to clean up duplicated code.
Rui Guo [Wed, 24 Jun 2009 14:09:50 +0000]
Extract RC_FOCUS implementation to clean up duplicated code.

5 years agoDocument the newly introduced window events.
Rui Guo [Wed, 24 Jun 2009 13:13:13 +0000]
Document the newly introduced window events.

5 years agoEnable stuffing a window.
Rui Guo [Mon, 22 Jun 2009 09:02:03 +0000]
Enable stuffing a window.

I would like to be able to stuff background windows without temporarily switch
the for layer.

5 years agoAdd a demo function.
Rui Guo [Mon, 22 Jun 2009 08:37:08 +0000]
Add a demo function.

Illustrates creating window immediately to the right of the current one.

5 years agoTrigger global forechange event on region change.
Rui Guo [Mon, 22 Jun 2009 08:12:11 +0000]
Trigger global forechange event on region change.

Also fix a special case of onfocus triggering: when the old canvas has no
window.

5 years agoTrigger onfocus onleave event when switch between regions.
Rui Guo [Mon, 22 Jun 2009 08:09:15 +0000]
Trigger onfocus onleave event when switch between regions.

5 years agoImplement onshow onhide events for window object.
Rui Guo [Mon, 22 Jun 2009 08:08:28 +0000]
Implement onshow onhide events for window object.

5 years agoAdd some window events.
Rui Guo [Fri, 19 Jun 2009 15:17:41 +0000]
Add some window events.

1. Define onfocus onleave onshow onhide events.
2. Implement onfocus & onleave event.

5 years agoWrap detached event trigger in compiler directives.
Rui Guo [Wed, 17 Jun 2009 15:11:37 +0000]
Wrap detached event trigger in compiler directives.

5 years agoMove the original forechanged event to the new hook/unhook scheme.
Rui Guo [Wed, 17 Jun 2009 15:07:10 +0000]
Move the original forechanged event to the new hook/unhook scheme.

5 years agoMake window.number writable.
Rui Guo [Wed, 17 Jun 2009 14:51:59 +0000]
Make window.number writable.

1. Abstract the RC_NUMBER logic to a ChangeWinNum function.
2. Implement setter to window.number using ChangeWinNum
3. Add a demo script to test it.
4. Update the document accordingly.

5. Also fix the title setter.

5 years agoUpdate the document about hook/unhook and input interface
Rui Guo [Wed, 17 Jun 2009 13:46:25 +0000]
Update the document about hook/unhook and input interface

5 years agoFree allocated memory before luaL_error() in screen_input()
Rui Guo [Wed, 17 Jun 2009 13:28:11 +0000]
Free allocated memory before luaL_error() in screen_input()

5 years agoinput() can now have an optional prefilled content.
Rui Guo [Wed, 17 Jun 2009 13:25:29 +0000]
input() can now have an optional prefilled content.

5 years agoDocument a known problem.
Rui Guo [Tue, 16 Jun 2009 15:12:51 +0000]
Document a known problem.

5 years agoCorrect garbage collecting the unhook ticket.
Rui Guo [Tue, 16 Jun 2009 15:08:44 +0000]
Correct garbage collecting the unhook ticket.

1. Also register unhook ticket for func registered with name.
2. We need two passes of GC collection after last commit.

5 years agoSeparate the weak table, since only the func part is weak.
Rui Guo [Tue, 16 Jun 2009 05:54:27 +0000]
Separate the weak table, since only the func part is weak.

5 years agoDo not produce duplicate hook on duplicate source.scripting-soc
Rui Guo [Mon, 15 Jun 2009 15:24:32 +0000]
Do not produce duplicate hook on duplicate source.

5 years agoDo not do refcount any more.
Rui Guo [Mon, 15 Jun 2009 14:37:32 +0000]
Do not do refcount any more.

5 years agoReally save func name -- may be lost during merge.
Rui Guo [Mon, 15 Jun 2009 14:25:34 +0000]
Really save func name -- may be lost during merge.

5 years agoChange function table name to ease removing refcnt.
Rui Guo [Mon, 15 Jun 2009 14:24:34 +0000]
Change function table name to ease removing refcnt.

5 years agoNo longer check for duplicate hook.
Rui Guo [Mon, 15 Jun 2009 13:54:34 +0000]
No longer check for duplicate hook.

5 years agoClean up of the callback unhook part.
Rui Guo [Mon, 15 Jun 2009 13:46:13 +0000]
Clean up of the callback unhook part.

5 years agoFix an memory leak on unhook ticket.
Rui Guo [Mon, 15 Jun 2009 13:10:08 +0000]
Fix an memory leak on unhook ticket.

5 years agoRemoved the LuaUnReg() func.
Rui Guo [Mon, 15 Jun 2009 12:17:15 +0000]
Removed the LuaUnReg() func.

5 years agoMake the merged unhooking code work again.
Rui Guo [Mon, 15 Jun 2009 12:15:27 +0000]
Make the merged unhooking code work again.

The ref counting is going to be removed as requested by Sadrul.

5 years agoMerge branch 'scripting-lua-unhook' (early part) into screen-scripting-soc
Rui Guo [Mon, 15 Jun 2009 11:20:36 +0000]
Merge branch 'scripting-lua-unhook' (early part) into screen-scripting-soc

Requires further modification.

Conflicts:
src/lua.c
src/scripts/cmdcallback.lua

5 years agoDo not crash on unhook.
Sadrul Habib Chowdhury [Sun, 14 Jun 2009 23:50:45 +0000]
Do not crash on unhook.

Use the handler to unhook event callbacks. The cmdcallback.lua
script has been updated to show the use.

5 years agoA simple asynchronous input interface.
Rui Guo [Fri, 12 Jun 2009 15:08:27 +0000]
A simple asynchronous input interface.

Where does it belongs? Canvas?

5 years agoImplement a robust ScriptCall and format the code.
Rui Guo [Fri, 12 Jun 2009 14:46:04 +0000]
Implement a robust ScriptCall and format the code.

5 years agoFix refcount logic & duplicate unhook checking.
Rui Guo [Fri, 12 Jun 2009 14:22:58 +0000]
Fix refcount logic & duplicate unhook checking.

1. LuaFuncKey() now increase the ref count when asked to, but never decrease
   the ref count. It may return LUA_UNREF if an entry is not found but asked
   not to add it.
2. LuaCheckHandler never decreases ref count and record function name only
   for mapped entry.
3. Require to provide the function name on unhook, if the function could not
   be resolved to key, do not proceed.

5 years agoDescription about the global detach event.
Rui Guo [Fri, 12 Jun 2009 13:20:52 +0000]
Description about the global detach event.

5 years agoMerge branch 'scripting-python' (early part) into screen-scripting-soc
Rui Guo [Fri, 12 Jun 2009 08:57:12 +0000]
Merge branch 'scripting-python' (early part) into screen-scripting-soc

5 years agoFix lua stack balance in LuaHRef(). And get rid of an unused var.
Rui Guo [Fri, 12 Jun 2009 08:37:54 +0000]
Fix lua stack balance in LuaHRef(). And get rid of an unused var.

5 years agoFix duplicate check on event hooking.
Rui Guo [Fri, 12 Jun 2009 08:31:09 +0000]
Fix duplicate check on event hooking.

5 years agoCopyright update.
Sadrul Habib Chowdhury [Fri, 12 Jun 2009 05:30:52 +0000]
Copyright update.

5 years agoFill in the lost unref call. Thanks Sadrul.
Rui Guo [Fri, 12 Jun 2009 03:39:55 +0000]
Fill in the lost unref call. Thanks Sadrul.

5 years agoUse the key directly to refer to the lua callback handler.
Rui Guo [Fri, 12 Jun 2009 03:38:36 +0000]
Use the key directly to refer to the lua callback handler.

5 years agoParse the params to 'script source' correctly.
Sadrul Habib Chowdhury [Thu, 11 Jun 2009 17:35:02 +0000]
Parse the params to 'script source' correctly.

5 years agoTrigger detach events.
Sadrul Habib Chowdhury [Thu, 11 Jun 2009 16:33:06 +0000]
Trigger detach events.

For detach-events, it's not enough to just listen to 'detach'
command, since this command is not used for remote detaches. So
scripts looking to do something on a detach event need to hook to
this event, instead of hooking to 'cmdexecuted' event and looking
for 'detach' command.

5 years agoMerge branch 'master' into lua-scripting
Sadrul Habib Chowdhury [Thu, 11 Jun 2009 14:58:51 +0000]
Merge branch 'master' into lua-scripting

5 years agoFurther code clean up.
Rui Guo [Wed, 10 Jun 2009 14:32:24 +0000]
Further code clean up.

1. export (un)register_listener function to header.
2. Group Lua function managment function together.
3. Correctly print func name in message if we have it.

5 years agoRestructure the func register code.
Rui Guo [Wed, 10 Jun 2009 14:02:18 +0000]
Restructure the func register code.

Now we have a unified Lua function registration mechanism. User can register
with the function name, but the name is always resolved to the Lua function
itself. Typo is detected at this stage. The Lua function is then mapped to a
unique key, managed with reference counting.

5 years agoMake the merged code work again. Also fixs a SEGV.
Rui Guo [Wed, 10 Jun 2009 12:22:11 +0000]
Make the merged code work again. Also fixs a SEGV.

1. Properly push function according to the new lua_handler structure.
2. Never return without balancing the stack!

5 years agoMerge branch 'lua-scripting' into screen-scripting-soc
Rui Guo [Wed, 10 Jun 2009 07:42:55 +0000]
Merge branch 'lua-scripting' into screen-scripting-soc

With some local modifications. Still not work.

5 years agoMerge branch 'lua-scripting' (early part) into screen-scripting-soc
Rui Guo [Wed, 10 Jun 2009 06:48:34 +0000]
Merge branch 'lua-scripting' (early part) into screen-scripting-soc

5 years agoMerge branch 'lua-scripting' (early part) into screen-scripting-soc
Rui Guo [Wed, 10 Jun 2009 06:47:24 +0000]
Merge branch 'lua-scripting' (early part) into screen-scripting-soc

Add stackdump debug information.

5 years agoMerge branch 'lua-scripting' (early part) into screen-scripting-soc
Rui Guo [Wed, 10 Jun 2009 06:23:00 +0000]
Merge branch 'lua-scripting' (early part) into screen-scripting-soc

5 years agoDescript hook/unhook intf. Also a bit about input() (questionable)
Rui Guo [Wed, 10 Jun 2009 05:59:58 +0000]
Descript hook/unhook intf. Also a bit about input() (questionable)