Author Topic: How to learn about plugin programming  (Read 7255 times)

Offline LonelySTar

  • Multiple posting newcomer
  • *
  • Posts: 30
How to learn about plugin programming
« on: December 01, 2005, 05:40:57 pm »
Is there any handbook/reference on how to write a plugin?
If I need a specific function, how can I find out how to do it?
Thanks!

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4305
    • Code::Blocks IDE
Be patient!
This bug will be fixed soon...

Offline LonelySTar

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to learn about plugin programming
« Reply #2 on: December 01, 2005, 05:46:28 pm »
Well, that gives an outline for how to write a plugin. Usefull but not enought.
At present, I want to know How a plugin can find out the filenames and directories of all files in the project. How is that done and how did you find out?
Thanks!
Nathan

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4305
    • Code::Blocks IDE
Re: How to learn about plugin programming
« Reply #3 on: December 01, 2005, 06:09:45 pm »
How is that done and how did you find out?

:D I guess, I have my ways ;)
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: How to learn about plugin programming
« Reply #4 on: December 01, 2005, 06:12:50 pm »
LonelySTar: Download the codeblocks sourcecode and study the SDK, specially the headers - of these, pay attention to the ones that end with "manager".

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: How to learn about plugin programming
« Reply #5 on: December 01, 2005, 06:26:18 pm »
(I started this post before the last two were posted. I'll post it as it's somewhat more detailed ;))
Well, that gives an outline for how to write a plugin. Usefull but not enought.
At present, I want to know How a plugin can find out the filenames and directories of all files in the project. How is that done and how did you find out?
Thanks!
Nathan

Manager::Get()->GetProjectManager() returns a ProjectManager*.
ProjectManager::GetProjects() returns a ProjectsArray* (IIRC basically the wx-version of std::vector<cbProject*>, but without iterators)
cbProject::GetFilesCount() returns the number of files in a project.
cbProject::GetFile(int index) returns a ProjectFile*.
From there ProjectFile::file or ProjectFile::relativeFilename should be able to help you.

Now where did I find all this?
Well, I started looking in sdk/projectmanager.h, and went from there. Like Rick said: look at the managers ;). The only time I actually had to perform a search for the next file was when I got to ProjectFile, which is conveniently located in sdk/projectbuildtarget.h :roll:.
The SDK headers are quite helpful, but you can always get doxygen and process sdk.doxy for a HTML version with hyperlinks :).

Offline LonelySTar

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: How to learn about plugin programming
« Reply #6 on: December 01, 2005, 10:05:01 pm »
Thanks for all your help!

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How to learn about plugin programming
« Reply #7 on: December 02, 2005, 12:17:06 am »
You might want to try THIS.

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: How to learn about plugin programming
« Reply #8 on: December 02, 2005, 12:40:10 am »
You might want to try THIS.

Beware though: that's for RC2, there have been a lot of changes since then in SVN. So if you're using the SVN version of C::B I would recommend generating the documentation yourself, though you can probably use the last link in the post Takeshi mentioned to do so.

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How to learn about plugin programming
« Reply #9 on: December 02, 2005, 01:18:09 am »
Exactly.

Though it would be good if we can have online docs autogenerated from SVN.
« Last Edit: December 02, 2005, 01:21:16 am by Takeshi Miya »

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: How to learn about plugin programming
« Reply #10 on: December 02, 2005, 01:26:44 am »
Though it would be good if we can have online docs autogenerated from SVN.

Now there's a good use for cron if I ever saw one 8).