<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.codeblocks.org/index.php?action=history&amp;feed=atom&amp;title=Creating_a_plugin_that_actually_does_something</id>
	<title>Creating a plugin that actually does something - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.codeblocks.org/index.php?action=history&amp;feed=atom&amp;title=Creating_a_plugin_that_actually_does_something"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Creating_a_plugin_that_actually_does_something&amp;action=history"/>
	<updated>2026-05-02T18:47:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Creating_a_plugin_that_actually_does_something&amp;diff=4149&amp;oldid=prev</id>
		<title>Artojon: removed extra category</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Creating_a_plugin_that_actually_does_something&amp;diff=4149&amp;oldid=prev"/>
		<updated>2006-11-11T19:29:02Z</updated>

		<summary type="html">&lt;p&gt;removed extra category&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:29, 11 November 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Developer Documentation]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Plugin development]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Plugin development]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''NOTE: this article is a work in progress.''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''NOTE: this article is a work in progress.''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Artojon</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Creating_a_plugin_that_actually_does_something&amp;diff=3847&amp;oldid=prev</id>
		<title>Mandrav: Changed plugin type from &quot;Tool&quot; to &quot;Generic&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Creating_a_plugin_that_actually_does_something&amp;diff=3847&amp;oldid=prev"/>
		<updated>2006-09-22T11:07:13Z</updated>

		<summary type="html">&lt;p&gt;Changed plugin type from &amp;quot;Tool&amp;quot; to &amp;quot;Generic&amp;quot;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:07, 22 September 2006&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l78&quot; &gt;Line 78:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 78:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this page, we must decide what type of plugin we want to make as well as its name. For the name enter &amp;quot;InterpretedLangs&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this page, we must decide what type of plugin we want to make as well as its name. For the name enter &amp;quot;InterpretedLangs&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Also, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;leave &lt;/del&gt;the plugin's type to &amp;quot;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Tool&lt;/del&gt;&amp;quot;. For more info on the various plugin types and their differences, see the Code::Blocks SDK documentation.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Also, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;set &lt;/ins&gt;the plugin's type to &amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Generic&lt;/ins&gt;&amp;quot;. For more info on the various plugin types and their differences, see the Code::Blocks SDK documentation.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Finally, make sure you check the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;Provides configuration dialog&amp;quot; option&lt;/del&gt;. This will allow our plugin to add a configuration page in the Code::Blocks settings dialogs.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Finally, make sure you check the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;options as seen in the picture above&lt;/ins&gt;. This will allow our plugin to add a configuration page in the Code::Blocks settings dialogs &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and generally integrate nicer&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Click &amp;quot;Next&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Click &amp;quot;Next&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mandrav</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Creating_a_plugin_that_actually_does_something&amp;diff=3846&amp;oldid=prev</id>
		<title>Mandrav: Initial text</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Creating_a_plugin_that_actually_does_something&amp;diff=3846&amp;oldid=prev"/>
		<updated>2006-09-22T10:51:28Z</updated>

		<summary type="html">&lt;p&gt;Initial text&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Developer Documentation]]&lt;br /&gt;
[[Category:Plugin development]]&lt;br /&gt;
''NOTE: this article is a work in progress.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this article we are going to create a &amp;quot;real&amp;quot; plugin. That is a plugin that actually does something more elaborate than just greeting the world ;).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Interpreted languages support plugin ==&lt;br /&gt;
&lt;br /&gt;
We are going to create a plugin that will add support for interpreted languages in Code::Blocks. &amp;quot;Interpreted&amp;quot; are considered the languages that do not generate native machine code but rather generate an intermediate code that an interpreter understands and converts to native machine code at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Planning stage ===&lt;br /&gt;
&lt;br /&gt;
While we 're in the early development stage (a.k.a. planning), let's decide what this plugin will be able to do and what it won't.&lt;br /&gt;
This plugin should allow the user to:&lt;br /&gt;
&lt;br /&gt;
* define as many interpreters as needed&lt;br /&gt;
* associate specific file extensions with each interpreter&lt;br /&gt;
* run any interpreter's shell&lt;br /&gt;
* run any interpreter with the appropriate arguments to operate on or accept as input a source file (more on that below)&lt;br /&gt;
&lt;br /&gt;
As you see, while we 're not over-complicating things, we should hopefully end up with a really useful plugin :).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Data structures ====&lt;br /&gt;
&lt;br /&gt;
Let's decide now what structures we will need (code-wise) to store the above requirements and their relationships.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Requirement: define as many interpreters as needed.'''&lt;br /&gt;
&lt;br /&gt;
Since we don't want to impose any limits, we need a dynamic container of some sort. I guess std::vector will suite us just fine :).&lt;br /&gt;
&lt;br /&gt;
'''Requirement: associate specific file extensions with each interpreter.'''&lt;br /&gt;
&lt;br /&gt;
A simple semicolon-separated string will suffice. E.g. &amp;lt;tt&amp;gt;&amp;quot;*.py;*.pyc&amp;quot;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Requirement: run any interpreter's shell.'''&lt;br /&gt;
&lt;br /&gt;
A string is enough. E.g. &amp;quot;C:\Python\Python24\pythonw.exe&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Requirement: run any interpreter with the appropriate arguments to operate on or accept as input a source file.'''&lt;br /&gt;
&lt;br /&gt;
So we need a dynamic array holding somekind of struct defining the available actions. Because nothing beats a good example, here is the most common (and important action): &amp;quot;Run&amp;quot;. This action would cause the interpreter to be launched with the source file as argument and run it.&lt;br /&gt;
&lt;br /&gt;
 struct InterpreterAction&lt;br /&gt;
 {&lt;br /&gt;
    wxString name; // the action's name, e.g. &amp;quot;Run&amp;quot;&lt;br /&gt;
    wxString command; // the command, e.g. &amp;quot;$interpreter --run $file&amp;quot;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
The final struct that glues all of the above together is this:&lt;br /&gt;
 struct Interpreter&lt;br /&gt;
 {&lt;br /&gt;
    wxString name; // a friendly name for the interpreter&lt;br /&gt;
    wxString executable; // the full path to the interpreter's executable&lt;br /&gt;
    wxString extensions; // a semicolon-separated list of extension wildcards (e.g. &amp;quot;*.py;*.pyc&amp;quot;)&lt;br /&gt;
    std::vector&amp;lt;InterpreterAction&amp;gt; actions; // an array of possible actions with this interpreter&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation stage ===&lt;br /&gt;
&lt;br /&gt;
Let's roll our sleeves up and start working on this plugin :).&lt;br /&gt;
&lt;br /&gt;
First thing we need is to create a new project for this plugin. Thankfully, the Code::Blocks Team has already provided us with a nice and easy wizard that will generate all the boilerplate code for us. Let's get going.&lt;br /&gt;
&lt;br /&gt;
Click on &amp;quot;File-&amp;gt;New-&amp;gt;Project&amp;quot; and a dialog with the available project wizards will appear. Select the &amp;quot;Code::Blocks plugin&amp;quot; and click &amp;quot;Go&amp;quot;.&lt;br /&gt;
[[Image:Intlng_1.png]]&lt;br /&gt;
&lt;br /&gt;
This will start the Code::Blocks plugin wizard. The first page of this wizard displays some important info which you should read. When you 're done reading, click &amp;quot;Next&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now enter the plugin's title, e.g. &amp;quot;Interpreted languages support&amp;quot;. If you don't need to edit anything else in this page (like the destination directory), click &amp;quot;Next&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Intlng_2.png]]&lt;br /&gt;
&lt;br /&gt;
In this page, we must decide what type of plugin we want to make as well as its name. For the name enter &amp;quot;InterpretedLangs&amp;quot;.&lt;br /&gt;
Also, leave the plugin's type to &amp;quot;Tool&amp;quot;. For more info on the various plugin types and their differences, see the Code::Blocks SDK documentation.&lt;br /&gt;
Finally, make sure you check the &amp;quot;Provides configuration dialog&amp;quot; option. This will allow our plugin to add a configuration page in the Code::Blocks settings dialogs.&lt;br /&gt;
Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the next page, fill in any info you deem appropriate for this plugin. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the compiler page, select (if not already selected) the &amp;quot;GCC&amp;quot; compiler because that's what Code::Blocks is built with.&lt;br /&gt;
&lt;br /&gt;
Finally click &amp;quot;Finish&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You should find yourself in Code::Blocks again with the new plugin project open and ready for editing :).&lt;br /&gt;
But first let's see if this compiles. If it doesn't, don't bother reading more. This article assumes a valid development setup from your side...&lt;br /&gt;
&lt;br /&gt;
Note that the Code::Blocks plugin wizard was kind enough to add some post-build commands that will copy the plugin and its resources where Code::Blocks expects to find them. It even set Code::Blocks as a &amp;quot;host&amp;quot; application for our plugin (which is a dynamic library and can't run on its own). This means that after you build the plugin, you can &amp;quot;run&amp;quot; it too :).&lt;br /&gt;
&lt;br /&gt;
Go on, build and run it. Does it work? OK, let's move on :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued...&lt;br /&gt;
&lt;br /&gt;
[[User:Mandrav|Mandrav]] 06:51, 22 September 2006 (EDT)&lt;/div&gt;</summary>
		<author><name>Mandrav</name></author>
	</entry>
</feed>