Author Topic: Scripting/macro language to automate tasks & prototype new features  (Read 5426 times)

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
I have been considering creating a pluggin that would add scripting capabilities to codeblocks.  The idea would be able to do things like highlight a member function name and then create standard header comments with a script to produce a result like:

/******************************
FUNCTION: void MyClass::MyFunction()
PURPOSE: {cursor left here to type the purpose}
******************************/
void MyClass::MyFunction() {
//code here
};

   I have decided on two possible languages Ruby and/or Python.  Ruby because it's supposed to be easy to learn and use.  Python because IBM is throwing its weight behind it.

jmccay
« Last Edit: July 25, 2005, 02:20:13 am by jmccay »
OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Scripting/macro language to automate tasks & prototype new features
« Reply #1 on: July 25, 2005, 08:43:30 am »
I haven't seen Ruby so I don't know about it. (wxRuby)
I haven't used Python but I know it's powerful enough. (wxPython)
You might also want to add Lua as a poll option which is really lightweight and has bindings to wxWidgets (wxLua).

Yiannis.
« Last Edit: July 25, 2005, 10:44:46 am by mandrav »
Be patient!
This bug will be fixed soon...

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Scripting/macro language to automate tasks & prototype new features
« Reply #2 on: July 25, 2005, 10:21:48 am »
You might also want to add Lua as a poll option which is really lightweight and has bindings to wxWidgets (wxLua).
I'd like to mention that wxRuby and wxPython are also available, just to clarify.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Scripting/macro language to automate tasks & prototype new features
« Reply #3 on: July 25, 2005, 10:44:17 am »
I'd like to mention that wxRuby and wxPython are also available, just to clarify.

Yes, sorry for not mentioning it above. Edited.

Yiannis.
Be patient!
This bug will be fixed soon...

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
Re: Scripting/macro language to automate tasks & prototype new features
« Reply #4 on: July 26, 2005, 03:59:19 am »
I will look into Lua, but I have books on Ruby & Python.  This would definitely be a long term project.  I was thinking of using SWIG, and hiding the details of GUI environment.  I am still working on the idea and details, but here is what I was thinking.  It very basic at the moment.

   A Workspace class (say cbWorkspace) would be the main control of the projects.  You'd be able to open/create Workspaces to process.  Once a Workspace is established you can add and remove projects from the Workspace.  You can set the working project, and traverse a list (or container) of the projects.

   Once a working project is set, you can add & remove files from the project, and you can also traverse a list (container) of the files in the project.  Then you can open a file from the project into the editor.

   Here is where things are murky.  I am not sure how this will work out.

   At any time you can traverse a list (container) of the open files in the workspace.  In the current file at the top (I'm tired and can't remember the right word), you can manipulate the cursor to move it, select text, cut text, copy text, and paste text.

   That's what I am starting with at the moment.  My goal is to make it so that what ever scripting language chosen, one doesn't need to know wx{Whatever} to write a script to accomplish a task.  My goal is to make it so that the person can focus on the task they want done thinking in terms of what they want to accomplish.

   Personally, I like the idea of ruby, but I haven't been able to vote yet.  I like python just as  much--especially since IBM likes it.  I will do that later in the week when I get to a faster connection.  I have been looking for an IDE that was designed to add pluggins.  No open source IDE has this type of feature that I know.  Maybe KDE, but its not cross platform and I never figured out how to use the scripting.  I am looking forward to getting my hands wet.  I have been going through coding withdrawl. :D

jmccay

OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
Re: Scripting/macro language to automate tasks & prototype new features
« Reply #5 on: July 26, 2005, 04:00:36 am »
I should note that I don't really know either language yet.  I've been somewhat following them.
jmccay
OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Scripting/macro language to automate tasks & prototype new features
« Reply #6 on: July 26, 2005, 08:58:36 am »
I should note that I don't really know either language yet.  I've been somewhat following them.
jmccay

I 've used none of them too, so I won't vote. My vote goes to whatever is more popular ;)

Yiannis.
Be patient!
This bug will be fixed soon...

Offline squizzz

  • Almost regular
  • **
  • Posts: 132
Re: Scripting/macro language to automate tasks & prototype new features
« Reply #7 on: July 26, 2005, 12:23:10 pm »
I will look into Lua, but I have books on Ruby & Python.

For Lua you can try this online book. It's freely available directly from Lua's website.
this space is for rent

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
Re: Scripting/macro language to automate tasks & prototype new features
« Reply #8 on: July 27, 2005, 03:02:53 am »
Cool.  I will check it out.
jmccay
OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.