Author Topic: OpenFilesListPlus plugin  (Read 21241 times)

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
OpenFilesListPlus plugin
« 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 )
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: OpenFilesListPlus plugin
« Reply #1 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.

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.
« Last Edit: September 27, 2015, 05:33:46 pm by oBFusCATed »
(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!]

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: OpenFilesListPlus plugin
« Reply #2 on: September 27, 2015, 05:42:22 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.

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

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
« Last Edit: September 27, 2015, 05:45:47 pm by earlgrey »
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5906
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: OpenFilesListPlus plugin
« Reply #3 on: October 05, 2015, 06:37:41 am »
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.

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: OpenFilesListPlus plugin
« Reply #4 on: October 05, 2015, 06:23:50 pm »
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 :
Code
#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 ?
« Last Edit: October 05, 2015, 06:56:25 pm by earlgrey »
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5906
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: OpenFilesListPlus plugin
« Reply #5 on: October 06, 2015, 08:23:36 am »
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.

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: OpenFilesListPlus plugin
« Reply #6 on: October 06, 2015, 06:56:36 pm »
What memory leaks do you have?
I dont know, I m searching for them

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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: OpenFilesListPlus plugin
« Reply #7 on: October 06, 2015, 07:09:27 pm »
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!]

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: OpenFilesListPlus plugin
« Reply #8 on: October 06, 2015, 07:37:07 pm »
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

Offline Abdulqayoom

  • Single posting newcomer
  • *
  • Posts: 9
Re: OpenFilesListPlus plugin
« Reply #9 on: December 22, 2015, 05:19:02 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

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: OpenFilesListPlus plugin
« Reply #10 on: December 23, 2015, 08:48:42 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 :)
« Last Edit: December 23, 2015, 10:23:01 pm by earlgrey »
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: OpenFilesListPlus plugin
« Reply #11 on: December 30, 2015, 10:55:51 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
Code
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 :

Code
@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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: OpenFilesListPlus plugin
« Reply #12 on: December 31, 2015, 12:32:39 am »
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!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: OpenFilesListPlus plugin
« Reply #13 on: January 01, 2016, 05:00:09 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: OpenFilesListPlus plugin
« Reply #14 on: January 01, 2016, 05:53:50 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?
« Last Edit: January 01, 2016, 05:55:47 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ