lua macro plugin 0.3.2-
Posted by: mark307
Date: September 03, 2006 02:05PM

I'm surprised that previous topic is closed.

This is only for 1.0-.

rapidshare.de/files/31804356/luamacro-0.3.2.zip.html

* Fix: Incompatible manner of OnActivateWindow. It wasn't called when layer changed.
* Add: OnCloseTab (CloseTabHook), OnCreateTab (CreateTabHook), OnSwitchTab (SwitchTabHook)
* Add: domaincomp.lua encoding.lua privacy.lua

@Hao
I knew your requests. But I thought they are difficult in a design. Please wait unhurriedly. And some of them may possibly be impossible for me.

regards.

Re: lua macro plugin 0.3.2-
Posted by: Hao Jiang
Date: September 03, 2006 04:03PM

@mark307,

Thank you very much. I understand my request is very hard. So don't worry about it for now. Thanks.

Regards,

Hao

Re: lua macro plugin 0.3.2-
Posted by: Hao Jiang
Date: September 05, 2006 03:18PM

Bug report:

Not very sure about this... But some people report very slow tab closing when calling OnCloseTab()


Hao

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: September 08, 2006 02:47PM

I made sure. I thought reason of the issue is move function in undo.lua. When the function was commented out, then tabs closed instantly.

To access preference is slow (probably this isn't only lua). I suppose that undo data is holded in a table while browsing and is saved to the pref at exit. Furthermore I thought serialization of undo data isn't necessary, because k-meleon has history.

BTW. You should use hook instead of callbacks. Because using callbacks directly spoils modularity and makes mainteinance of scripts to difficult.

I'll post modified version.
Thank you.

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: September 08, 2006 02:49PM

-- Undo closed tab
-- for tab version only

-- Install
-- Put this on lua folder and add `require "undo"' to macros.lua.

require "compat"
require "hook"
require "setmenu" -- needs setmenu.modify
local max = km.getpref(TYPE_INT, "kmeleon.maximum.undo")
if max < 1 then max = 1; end
local data = {}
local function undo_menu(m)
local h,i={}
for i=1, #data do
h={data.title, "luamacros(undo("..i.."))"}
end
if m then
setmenu.modify("&Edit", 0, "Undo Closed Tabs...", h)
else
setmenu.append("&Edit", 0, "Undo Closed Tabs...", h)
end
end
hook.add(StartupHook, undo_menu)
local function OnCloseTab()
local title, url = GetDocInfo()
while #data >= max do
table.remove(data)
end
table.insert(data, 1, {url = url, title = title})
undo_menu(true)
end
hook.add(CloseTabHook, OnCloseTab)
function undo(arg)
local n = tonumber(arg)
if data[n] then
opennew(data[n].url)
end
end


Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: September 08, 2006 02:57PM

Sorry, "[ i ]" was interpreted as tag.

wrong: h={data.title, "luamacros(undo("..i.."))"}
correct: h[ i ]={data[ i ].title, "luamacros(undo("..i.."))"}

I should have posted to other site. I'll ship this script with next release.
regards.

Re: lua macro plugin 0.3.2-
Posted by: Hao Jiang
Date: September 08, 2006 08:24PM

@mark307,
Can you explain in detail what exactly hook does? I don't understand this right now. Thanks.

Regards,

Hao

Re: lua macro plugin 0.3.2-
Posted by: rmn
Date: September 09, 2006 03:22AM

I've updated my Lua plugin tutorial to cover this:

The Lua plugin exposes several K-Meleon events events through special functions, for example OnOpenWindow, OnCloseWindow, and so on (for the full list, see hook.lua).

A common mistake is to define these functions in your own code. The problem with that is, those functions will either override or be overridden by other extensions which also define them.

The Lua extensions plugin comes with a hook.lua file that should be used when you want to handle K-Meleon events.

require "hook"

if hook then
hook.add(OpenWindowHook, function()
-- Do something here.
end)
end

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: September 11, 2006 02:16PM

Please read hook.lua. It is simple and tiny so easier to understand than my bad english.

In implement, the hook consists of definition of reserved callback functions (On*) and tables (*Hook). When event is occured (ex. closing tab), the plugin calls callback function defined in hook.lua (ex. OnCloseTab), then the function calls functions that is in corresponding hook table (ex. CloseTabHook).

It is weakness that the hook doesn't resolve depandencies of scripts. You must line up "require" correctly.

In the fact, hook.lua is just example for luamacros, so you may write freely. But I think the hook is better way than managing individual callback functions.

Thank you.

Re: lua macro plugin 0.3.2-
Posted by: Hao Jiang
Date: September 13, 2006 07:19PM

@mark307 & rmn,
Sorry for the late reply. Thank you two very much for the explanations. I 'll try to use hook in my lua macros as you said. Thanks.

Regards,

Hao

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: September 17, 2006 01:08PM

I'm in a typhoon. It's very stormy X-(

kmplus lua addon

* Add: w32dlg; Property Sheet
* Add: w32mnu; setmenu.modify, undo.lua, undo_win.lua
* Fix: w32dlg; faked error check in dialog.lua

http://rapidshare.de/files/33438542/kmplus-0.0.4.zip.html

extra bonus.

utils plugin

* Add: strftime, mkdir

http://rapidshare.de/files/33438767/utils-0.0.7.zip.html

Thank you for your support.

Re: lua macro plugin 0.3.2-
Posted by: Hao Jiang
Date: September 19, 2006 04:11AM

@mark307,
Thank you very much for property page implementation! It's fantastic.

Re: lua macro plugin 0.3.2-
Posted by: CaptnBlack
Date: September 19, 2006 10:31AM

Thank you !

The strftime, and mkdir will be most welcome additions to the utils plugin.

Re: lua macro plugin 0.3.2-
Posted by: CaptnBlack
Date: September 19, 2006 01:09PM

@mark307,

Could you explain a little further on the use of strftime, and mkdir ?

I've not been able to get them to work.
Is this the proper use ? :

$time = pluginmsgex(utils, "strftime", %#x);

I get an error that says "Unmatched left parenthesis'('.".

The mkdir seems to add a ' \' in frount of the ' \' in variables if a variable is used instead of an actual path.
Using this:

$result = pluginmsgex(utils, "mkdir", $path, $time);

I get a path like this:
"C:\\Program Files\\k-meleon\\Profiles\\Profile\\"

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: September 19, 2006 02:33PM

@CaptnBlack

Sorry, I missed to explain on readme. Strftime is pluginmsgex type function, so you have to write like this;

$time = pluginmsgex(utils, "strftime", "%#x", STRING);

Mkdir is also;

$result = pluginmsgex(utils, "mkdir", $path . $time, STRING);

And variable $path has a backslash in last.

regards.

Re: lua macro plugin 0.3.2-
Posted by: CaptnBlack
Date: September 19, 2006 04:23PM

I see now.

Thanks for the info, and thanks again for the plugins.

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: October 09, 2006 09:03AM

Thank you for support. Here is lua macro plugin 0.3.3

* Add: BROWSERPATH variable

http://rapidshare.de/files/36058658/luamacro-0.3.3.zip.html

Search_dialog.lua is specially shiped with this archive. This adds new search dialog to k-meleon.

Thanks.

Re: lua macro plugin 0.3.2-
Posted by: Hao Jiang
Date: October 09, 2006 04:09PM

@mark307,

Thank you for the new version.

Hao

Re: lua macro plugin 0.3.2-
Posted by: mimas
Date: October 15, 2006 11:09AM

Hello,

Thanks for this plugin, mark307. Sure it will remplace the current macro language in future. Yeap, I'm a big fan of LUA smiling smiley.

Could you do something for the letter casing, e.g. there is an SetCheck() & an setpref() function ? So, why don't you use the same naming convention for all names ? Another exemple, script Search1.lua has now errors : it calls setcheck() but function is now called SetCheck().

Hope you will do something, this plugin is great. smiling smiley

Re: lua macro plugin 0.3.2-
Posted by: simpleinventor
Date: October 16, 2006 11:20PM

Let's get GUIs working in LUA: IUP - Portable User Interface.

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: October 18, 2006 02:26PM

@mimas

It is historical reason. I began to write this plugin for just wrapper of plugin API, and then I came to concern about compatibility with the macro. So the naming rule is little in confusion.

A function that has same interface with a plugin API is named same as API, others are named like macro statements.

Currehtly the solution for this problem is to use compat.lua.

The case of search1.lua is my mistake. Please replace "setcheck" by "SetCheck" in search.lua, or add "require 'compat'" on the top of search1.lua. Because I have used compat.lua, this fault had not been found. Thank you.

@simpleinventor

I'll check it. Well, how were Autoit and VC?

regards.

Re: lua macro plugin 0.3.2-
Posted by: simpleinventor
Date: October 18, 2006 06:28PM

I learned/worked on Autoit and love it, but it doesn't handle cropped bitmaps properly, resulting in a less-then desirable display. I have no experience with VC, so I didn't undertake the task of learning it (yet). It would be nice to simply import the SRC, since the code is sparesly commented and conversion to Autoit has been difficult (espesically when parsing the config files.) Do you know anyone who can comment and/or explain the code and possibly put together a *foolproof* tutorial for those who can code c/c++ but have never worked on anything like K-Meleon before? That would be awesome!

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: October 23, 2006 02:17PM

@simpleinventor
Sorry, I don't know who is suitable for doing it. And, in many cases, lua can't help to learn c++ codes.
Thank you.

Re: lua macro plugin 0.3.2-
Posted by: simpleinventor
Date: October 25, 2006 04:02AM

I have a good idea for a del.icio.us synchronizer using the del.icio.us API. Besides being able to manually add posts, a simple could could automatically synchronize your local bookmarks to your remote del.icio.us account! I was looking at the lua sample's in CCF and I see that even at 0.3.1 a solution can be done. The only tricky/annoying part is that it uses https, so authentication is a must. Can the new privacy.lua help out? Also, does 0.3.2 support regular expressions? The API return an XML file and would need to be correctly parsed. Thanks!

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: October 27, 2006 02:44PM

simpleinventor,

I found del.icio.us script in MacroLibrary (but little outdated). That may help you.

CCF's privacy.lua and mine are wrong. And I can't find a part related del.icio.us or https in both scripts.

Lua suports regular expressions with unique syntax and features. It is explained in Lua document.

This plugin can't use network except to open a page, and can't manupulate page contents except InjectJS and InjectCSS. I see using the API is impossible in ordinary way.

But there is unordinary way, luasocket and luaexpat. They are in luaforge. If you use them, I suppose to make the script in standalone script using with lua.exe.

Thank you.

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: October 30, 2006 01:44PM

I looked luasocket 2.0, and I saw luasocket can't connect by ssl. So it can't use del.icio.us API.
regards.

Re: lua macro plugin 0.3.2-
Posted by: simpleinventor
Date: October 30, 2006 04:19PM

A little outdated, but maybe this would work: LuaSLL

Re: lua macro plugin 0.3.2-
Date: November 10, 2006 09:18PM

Mark307, I made a lot of progress with IUP and LUA. Is there a way to message you?

Re: lua macro plugin 0.3.2-
Posted by: mark307
Date: November 12, 2006 02:32PM

simpleinventor,

I have interest about it. Would you tell me more?
I check this forum often. You can contact me by this forum.

Thanks.

Re: lua macro plugin 0.3.2-
Date: November 12, 2006 09:38PM

There is a WIN32 binary that works on NT systems available here: IUP Binaries. IUPLUA51.exe is made to work with the lua version 5.1. Here's a sample code for IUP:
img1 = iup.image
{
  {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
  {1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2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,2,2,2,2,2,2,2,2},
  {2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
  {3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
  colors =
  {
    "0 255 0", -- 1
    "BGCOLOR", -- 2
    "255 0 0", -- 3
    "0 0 0"    -- 4
  }
}

mnu = iup.menu
{
  iup.submenu
  {
    iup.menu
    {
      iup.item{title="IupItem 1 Checked",value="ON"},
      iup.separator{},
      iup.item{title="IupItem 2 Disabled",active="NO"}
    } 
    ;title="IupSubMenu 1"
  },
  iup.item{title="IupItem 3"},
  iup.item{title="IupItem 4"}
}

dlg = iup.dialog
{
  iup.vbox
  {
    iup.hbox
    {
      iup.frame
      {                   
        iup.vbox
        {
          iup.button{title="Button Text"},
          iup.button{title="",image=img1},
          iup.button{title="",image=img1,impress=img2}
        }
        ;title="IupButton"
      },
      iup.frame
      {                   
        iup.vbox
        {
          iup.label{title="Label Text"},
          iup.label{title="",separator="HORIZONTAL"},
          iup.label{title="",image=img1}
        }
        ;title="IupLabel"
      },
      iup.frame
      {                   
        iup.vbox
        {
          iup.toggle{title="Toggle Text", value="ON"},
          iup.toggle{title="",image=img1,impress=img2},
          iup.frame
          {                   
            iup.radio
            {
              iup.vbox
              {
               iup.toggle{title="Toggle Text"},
               iup.toggle{title="Toggle Text"}
              }
            }
            ;title="IupRadio"
          }
        }
        ;title="IupToggle"
      },
      iup.frame
      {                   
        iup.vbox
        {
          iup.text{size="80x",value="IupText Text"},
          iup.multiline{size="80x60",expand="YES",value="IupMultiline Text\nSecond Line\nThird Line"}
        }
        ;title="IupText/IupMultiline"
      },
      iup.frame
      {                   
        iup.vbox
        {
          iup.list{"Item 1 Text","Item 2 Text","Item 3 Text"; expand="YES",value="1"},
          iup.list{"Item 1 Text","Item 2 Text","Item 3 Text"; dropdown="YES",expand="YES",value="2"},
          iup.list{"Item 1 Text","Item 2 Text","Item 3 Text"; editbox="YES",expand="YES",value="3"}
        }     
        ;title="IupList"
      }
    },
    iup.canvas{bgcolor="128 255 0"}
    ;gap="5",alignment="ARIGHT",margin="5x5"
  }
  ;title="IupDialog Title", menu=mnu 
}

dlg:show()

iup.MainLoop()

Note that this is very similar to sample.lua found on the LUA website. The only difference is the last line, "iup.MainLoop()" which keeps the dialog looped & open. To run the above code, simply type "iuplua51.exe sample.lua" in the command-line. All the sample code should run in the same fashion, or at just need the last line. Now we can easily have dialogs w/ lua.

K-Meleon forum is powered by Phorum.