News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

OpenFilesListPlus plugin

Started by earlgrey, September 27, 2015, 05:14:37 PM

Previous topic - Next topic

earlgrey

I made an enhanced version of the classic OpenFilesList plugin, called OpenFilesListPlus :

screenshot 1
screenshot 2

It is available on github here

Only for codeblocks versions >= svn revision 10502 - C::B compilation mandatory

Installation instructions are on the wiki, but are only complete for Linux at the moment.

Feedback welcome on this thread.

( and thanx to the C::B team for having added my patch )
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

oBFusCATed

#1
You can check this plugin https://github.com/obfuscated/cb_gdbmi for an example how to implement an autotools based build system for your plugin.

p.s. What are these cci and hhi files?
p.p.s. If you ask me the code is close to unreadable with all this aligning that you're using.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

earlgrey

#2
Quote from: oBFusCATed on September 27, 2015, 05:28:28 PM
You can check this plugin https://github.com/obfuscated/cb_gdbmi for an example how to implement an autotools based build system for your plugin.
-> My work for this week.

Quote from: oBFusCATed on September 27, 2015, 05:28:28 PM
p.s. What are these cci and hhi files?
cci = c++ code include file
hhi = c++ header include file
only 3 (big) files in which the .cci and .hhi files are included are compiled.
It's a ( bad ? ) habbit

Quote from: oBFusCATed on September 27, 2015, 05:28:28 PM
p.p.s. If you ask me the code is close to unreadable with all this aligning that you're using.
I read other's code with difficulty because all seems scattered...

p.s. And I often use goto-s, getting lost with all those brackets
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

ollydbg

Quote from: earlgrey on September 27, 2015, 05:42:22 PM
Quote from: oBFusCATed on September 27, 2015, 05:28:28 PM
p.s. What are these cci and hhi files?
cci = c++ code include file
hhi = c++ header include file
only 3 (big) files in which the .cci and .hhi files are included are compiled.
It's a ( bad ? ) habbit
Why not use the standard .h and .cpp files?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

earlgrey

#4
I group class functionalities by  ".hhi" and ".cci" file.

  • I dont waste time searching in too big files
  • when I get too much ".hhi" & ".cci" files I create other classes :for example, at a moment, the OpenFilesListPlus class went overweighted, so I created the OflpModxxx classes, leaving only the event handlers and the cbPlugin stuff in OpenFileListPlus class
And it avoids me too many paste & copy of things like this :

#include "sdk.h"                                                                // Code::Blocks SDK
//  ............................................................................
#ifndef CB_PRECOMP
    #include "manager.h"
    #include "configmanager.h"
    #include "configurationpanel.h"
    #include "editormanager.h"
    #include "projectmanager.h"
    #include "logmanager.h"
    #include "editorbase.h"
    #include "cbeditor.h"
    #include "sdk_events.h"
    #include "misctreeitemdata.h"

    #include "cbworkspace.h"
    #include "cbproject.h"
    #include "projectmanager.h"
#endif

, just #include the ".cci" & ".hhi" file

But I have never pretented beeing a good software designer :)


By the way,

  • did you try it ? Found it useful ? I always wanted to have at least separators in the OpenFilesList plugin.
  • what do you think is a simple way to track memory leaks in a C::B plugin ? How do you do ?
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

ollydbg

Quote from: earlgrey on October 05, 2015, 06:23:50 PM
By the way,

  • did you try it ? Found it useful ? I always wanted to have at least separators in the OpenFilesList plugin.
  • what do you think is a simple way to track memory leaks in a C::B plugin ? How do you do ?
I haven't try it, since I normally does not use the standard OpenFilesList plugin yet.
What memory leaks do you have? Just run it under GDB?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

earlgrey

Quote from: ollydbg on October 06, 2015, 08:23:36 AM
What memory leaks do you have?
I dont know, I m searching for them

Quote from: ollydbg on October 06, 2015, 08:23:36 AM
Just run it under GDB?
No, valgrind but it takes hours, even when removing lots of C::B plugins

Anyway, thank you for your answer -
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

oBFusCATed

If you're on linux you can try the address sanitizers. I think they can report memory leaks, but I'm not 100% sure.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

earlgrey

I'm on my way to write a minimalistic fake codeblocks sdk for my plugin.
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Abdulqayoom

Quote from: earlgrey on September 27, 2015, 05:14:37 PM
I made an enhanced version of the classic OpenFilesList plugin, called OpenFilesListPlus :

screenshot 1
screenshot 2

It is available on github here

Only for codeblocks versions >= svn revision 10502 - C::B compilation mandatory

Installation instructions are on the wiki, but are only complete for Linux at the moment.

Feedback welcome on this thread.

( and thanx to the C::B team for having added my patch )

how insttal it

earlgrey

#10
Quote from: Abdulqayoom on December 22, 2015, 05:19:02 PM
how insttal it

Which platform ? I would willingly help, the more so as I didn't get many hits on github, although I find my plugin convenient & awsome :)
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

earlgrey

Quote from: oBFusCATed on September 27, 2015, 05:28:28 PM
You can check this plugin https://github.com/obfuscated/cb_gdbmi for an example how to implement an autotools based build system for your plugin.

I' ve done that, but gcc 4.9.2 define the two macros linux and  unix

cpp -dM ./empty-file.hxx
#define __DBL_MIN_EXP__ (-1021)
...
#define unix 1
...
#define linux 1
...
#define __ATOMIC_RELEASE 3


which conflict with 2 static const bool in prep.h :


@line 222 : const bool linux   = (id == platform_linux);
@line 228 : const bool unix    = (linux | freebsd | netbsd | openbsd | darwin | solaris);


so you get a "expected unqualified id before numeric constant" error
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

oBFusCATed

You need to pass -ansi to the compiler or switch to c++11/14.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: earlgrey on September 27, 2015, 05:14:37 PM
Installation instructions are on the wiki, but are only complete for Linux at the moment.
BTW: You don't provide Windows project files. So many people will miss your plugin effort.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

MortenMacFly

#14
Quote from: MortenMacFly on January 01, 2016, 05:00:09 PM
BTW: You don't provide Windows project files. So many people will miss your plugin effort.
OK, I tried to make a Windows project file so I had to look into it.

Unfortunately I have to say although I like the idea I finally gave up. I think in the current stage as the plugin is it won't make it into an official plugin. Here are the various reasons:
- strange file handling with *.cci *.hhi (not conform to C::B standards)
- not following C::B coding guidelines
- using jump marks
- a lot of serious compiler warnings that should be fixed
- many, many #defines for checking "something" the plugin does not need.
- added a lot complexity due to incorporating debug code (in fact it looks to me that w/o debug code the plugin would be 10% of the size)

I am not offending but I would let you now my thoughts. Please keep in mind that we better need to remove complexity from the project, not add. The code must be easy to read, understand and follow. If you want to experiment with features that are not required for the actual plugins functionality you should better use wrapper classes and do whatever you want in there.

Maybe you can create a simple, cleaned-up version in a release branch?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]