Author Topic: IRC plugin; Where to start?  (Read 5702 times)

Cualli

  • Guest
IRC plugin; Where to start?
« on: June 09, 2007, 10:54:53 pm »
I have a working grasp of C and not much else. I intend to code an IRC plugin because:

A) It'd be useful to hang out in #c or #codeblocks while coding.
B) IRC = Decent collaboration tool. Not a bad idea to talk to other programmers while you work on something.

and

C) I like IRC.

Would anybody like to help me? What do I need to know?

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: IRC plugin; Where to start?
« Reply #1 on: June 10, 2007, 04:56:32 pm »
What do I need to know?
C++.

... At least enough of it to interface a C::B plugin in C++ with whatever you choose for the IRC portion.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: IRC plugin; Where to start?
« Reply #2 on: June 10, 2007, 06:04:21 pm »
It's funny to see, once again, such proposal (search the forums and you will see :wink:).

Just like TDragon said, C++ is the first thing you must know. You will also need some basic knowledge about wxWidgets (interface and sockets), the Code::Blocks' SDK (just check the source of some plugins to get an idea) and you'll need to have the RFC of IRC handy.

Have fun.

Cualli

  • Guest
Re: IRC plugin; Where to start?
« Reply #3 on: June 11, 2007, 07:52:05 am »
It's funny to see, once again, such proposal (search the forums and you will see :wink:).

Just like TDragon said, C++ is the first thing you must know. You will also need some basic knowledge about wxWidgets (interface and sockets), the Code::Blocks' SDK (just check the source of some plugins to get an idea) and you'll need to have the RFC of IRC handy.

Have fun.

Why is C++ necessary? Is it truly impossible to write it in straight C?

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: IRC plugin; Where to start?
« Reply #4 on: June 11, 2007, 03:13:14 pm »
Is it truly impossible to write it in straight C?
As far as I know. First, a plugin must define a class which inherits at least from the cbPlugin class. I'll admit that, with a lot of skill and trickery, this can probably be emulated in C -- but, in order to properly register a plugin, C::B needs the plugin DLL to create a static instance of another class, templated on your cbPlugin inheritor. This static instance in turn registers the plugin class with the main C::B program's plugin set (actually, this takes place in codeblocks.dll, but that's irrelevant). The upshot of all this is that C::B merely calls wxWidget's dynamic DLL loading routines, then examines its list of plugins to find the one that's newly loaded.

On the side of the standard C++ plugin, getting this done is quite easy:
Code
namespace
{
    PluginRegistrant<MyPlugin> reg(_T("MyPlugin"));
}
Getting that done somehow in C would be a lot harder, I imagine.

Cheers,
John E. / TDM
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline lubos

  • Almost regular
  • **
  • Posts: 131
Re: IRC plugin; Where to start?
« Reply #5 on: June 11, 2007, 07:42:31 pm »
if it could be possible to open web pages inside c::b editor tabs, then you could use an internet irc client  :)