User forums > General (but related to Code::Blocks)

Scripting/macro language to automate tasks & prototype new features

(1/2) > >>

jmccay:
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

mandrav:
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.

Urxae:

--- Quote from: mandrav on July 25, 2005, 08:43:30 am ---You might also want to add Lua as a poll option which is really lightweight and has bindings to wxWidgets (wxLua).

--- End quote ---
I'd like to mention that wxRuby and wxPython are also available, just to clarify.

mandrav:

--- Quote from: Urxae on July 25, 2005, 10:21:48 am ---I'd like to mention that wxRuby and wxPython are also available, just to clarify.

--- End quote ---

Yes, sorry for not mentioning it above. Edited.

Yiannis.

jmccay:
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

Navigation

[0] Message Index

[#] Next page

Go to full version