Author Topic: OpenFilesListPlus plugin  (Read 23795 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: 13406
    • 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: 6034
  • 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: 6034
  • 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: 13406
    • 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: 13406
    • 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: 9693
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: 9693
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

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: OpenFilesListPlus plugin
« Reply #15 on: January 01, 2016, 08:00:19 pm »
>> You don't provide Windows project files.
>> - a lot of serious compiler warnings that should be fixed

I'm currently downloading that "community edition 2015" thing

>>- using jump marks Non-negotiable

All the rest sounds right ( I think that since I didn't have many downloads, I felt free to digress and experiment ).

>>Maybe you can create a simple, cleaned-up version in a release branch? It is work in progress, and I shall remove also the logs and the checks in it.

>>in the current stage as the plugin is it won't make it into an official plugin That's not my final goal, I use my plugin myself and I'm happy with that, it does what I wanted. But I knew the idea was good :)
* 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 #16 on: January 06, 2016, 08:48:51 am »
Quote
BTW: You don't provide Windows project files. So many people will miss your plugin effort.
I have not used ms products since years, but I got some skills in that ; unfortunately :


I am unable to compile a vc++ ( visual studio community 2015 ) solution of my plugin :
  • wxWidgets-2.8.12-rc2 related unresolved external
    • virtual wxDragResult    wxDataObject::OnData (wxCoord x, wxCoord y, wxDragResult defResult)=0
      Calling convention / some compilation option between plugin and wxWidgets dll ? I tried with x32-TDMgcc .lib and x32-VC++ .lib
       
  • codeblocks unresolved externals
    • All functions
      using C::B@svn10631 codeblocks.lib created from C::B@svn10631[x32-TDMgcc] codeblocks.dll with dlltool
       
  • I have to modify C::B sources
    • prep.h : std::nullptr_t already defined
    • prep.h : #include <memory> instead of #include <tr1/memory>
       

I am unable to compile C::B@svn10631 within C::B@10631[x32-TDMgcc] with VC++ toolchain
  • core incompatibility
    • somefile.h : #include <sys/time.h> is unix specific
      something has to be configured somewhere ?
       

Is codeblocks-13.12-setup.exe built with VC++ ? how do you do that ?

All that stuff is eating my time up ; Any tip / advice welcome
« Last Edit: January 06, 2016, 09:01:05 am by earlgrey »
* 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: 13406
    • Travis build status
Re: OpenFilesListPlus plugin
« Reply #17 on: January 06, 2016, 09:01:53 am »
Nope, use a tdm release of the GCC compiler.
(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: 9693
Re: OpenFilesListPlus plugin
« Reply #18 on: January 06, 2016, 11:32:43 am »
I am unable to compile a vc++ ( visual studio community 2015 ) solution of my plugin :
Why would you want to do that? With Windows files I mean C::B project files that compile under Windows using (TDM)/GCC, of course.

That was maybe a misunderstanding. We use GCC on Windows, too. Not VC.

Check the other plugins they usually have a FOO-unix.cbp and a FOO.cbp file. The first one is for Unix, the latter for Windows. Take this as a starter.
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 earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: OpenFilesListPlus plugin
« Reply #19 on: January 06, 2016, 02:24:37 pm »
That was maybe a misunderstanding
Yes - Anyway, I am relieved that I shall not have to deal with msvc ( and incidentally I fixed by MOOTMGR-is-missing pb )
« Last Edit: January 06, 2016, 02:35:39 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 #20 on: January 07, 2016, 09:52:26 pm »
BTW: You don't provide Windows project files. So many people will miss your plugin effort.
Done, you can checkout the "pub" branch if you want.
- Windows targets : "Debug-ms" & "devel-ms"
- svn build still required ( unable to build against latest nightly on win, and Jens debian packages are for wx-3 )
* 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 #21 on: January 10, 2016, 12:17:10 am »
I made some binaries for linux & win - feedback welcome !

Edit [2016.10.01] Links updated in wiki, there was an error : a .cbplugin filename must match the plugin's name it contains.
« Last Edit: January 10, 2016, 11:23:31 am by earlgrey »
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit