Author Topic: New Event Request  (Read 3148 times)

Offline Wolf

  • Multiple posting newcomer
  • *
  • Posts: 30
New Event Request
« on: March 14, 2008, 12:46:53 am »
Hello,
I would like to create a plugin that extends the core compiler plugin, without having to make my own compiler plugin.
After asking in the Plugins development forum, I have been told to request a new event to be launched.
Should I request a new event to be launched?

This sounds like the thing to do.

Here are more details on what I need to be able to do.
Hello,
I would like to add G15 support for Code::Blocks which would display the active project, which file is being compiled, or which project is being built... The only events I found available were the ones about "compiling started" and "compiling finished", which gave me no information about the project or anything.
*removed text for simplicity*

The G15 keyboard has a programmable LCD display and 4 dual-state buttons (pressed/released). It has a resolution of 160x43 pixels, 2 colors, which can be used to display text and images (bitmap). I would use it to display compiler messages (status, errors and warnings), the currently loaded project (browse through the project files), to execute some commonly used functions (even though a single key could do it, a button could be programmed to do a lot more). It could also be used to play games like Snake or Pong, if byo wants to port the games to the G15 keyboard. ;) It could display a nice welcome message when loading Code::Blocks along with displaying the Code::Blocks logo, or display tips. The SDK is freely available, and is for Windows only (actually, writing this down, I found http://www.g15tools.com/ which lists some tools available to use the G15 keyboard on Linux, so I guess it would be possible to have the plugin on Linux too). More and more applications are adding built-in support for the G15 keyboard, while for others, we have to get it from a third-party application. And when versions change, it is rare it still works, so it needs constant modifications, unless the support is built-in.

In other words, I need events to be launched when updating the workspace (already defined), when updating a project (already defined), but the most important one would be when building a project, to display the build progress, the messages, warnings and errors, which project is being built, which files (I admit this could be retrieved from the build log, so maybe the event could point me to the build log along with the project). I tried cbEVT_COMPILER_STARTED, but it does not give me any information about the project or anything, it only acts as a signal. Also, according to the documentation (http://wiki.codeblocks.org/index.php?title=Code::Blocks_SDK_events), there is no event thrown when a new log entry is made, so there is no way to intercept the log updates.

The ideal thing for me would be events when building the workspace (cbEVT_WORKSPACE_BEGIN_BUILD, cbEVT_WORKSPACE_END_BUILD) and when building the project (cbEVT_PROJECT_BEGIN_BUILD, cbEVT_PROJECT_END_BUILD), with the project build event pointing to the project and, if possible, the build log. The names of the events are just suggestions according to the names of existing events.

If possible, it would be pretty useful, and a lot more flexible, to have a grasp of when a log is modified, whichever log window it is. This could allow us to write wrappers around plugins that produce a textual output in a log window, rather than modify the whole plugin, like I would need to do (even though for now, I can't do any of them). I know this could cause a lot of events to be processed in Code::Blocks, so let me propose an option to enable the launch of such events. If it is not enabled, the events won't be launched. If, however, it is tested and does not slow down noticeably the environment (tested on slow machines, of course), then I see no reason not to keep it.

Thanks,

-- Wolf --

Warning: Like dependency hell and DLL hell, Code::Blocks must not become event hell. If you believe more events would make Code::Blocks messy, then say so, I shall find another way to do it.