Author Topic: BETA - Image Editor plugin  (Read 76233 times)

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #45 on: July 13, 2010, 11:51:02 pm »
PS: 1st impression: it is a lot faster than on Vista (same laptop...) Code completions is much more reactive, load time of the codeblocks project took only a few seconds (against 30 seconds approximately on Vista). Do you know why there are so much differences ?
I have a similar experience about the parsing time of CodeCompletion. In the same notebook, Windows Vista is much slower than windows XP. To load the codeblocks.cbp, in Vista, it will take more than 1 minutes, but in XP, it is only 20 seconds. I'm not sure why, but surely XP is faster than Vista. Vista is too "bloat". :D

I have never used any linux like OS though.

I confirm the speed difference between Ubuntu & Windows Vista. I have read somewhere it has something to do with DRM (Digital Rigths Management - anti-piracy).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Image Editor - new plugin
« Reply #46 on: July 14, 2010, 07:18:04 am »
 - I have found the "update" script and ran it. The output directory was created, as expected
  - I cannot run codeblocks from output (using "./codeblocks" command line), it complains about "libwxscintilla.
You cannot run C::B directly (that would need a make install, indeed) - but the update script also creates a run.sh script for you. You need to use this to run C::B.
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 seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #47 on: July 14, 2010, 07:20:21 am »
To start your new C::B you can run it through C::B or call the wrapper-script output/run.sh, using the new executable will not work directly.

And that will teach me to read correctly the posts.
Thank you jens, now I can start CB.

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #48 on: July 14, 2010, 07:30:50 am »
I can start CodeBlocks, but the plugin does not load.

/home/seb/.codeblocks/share/codeblocks/plugins/XPMEditor.so: not loaded (missing symbols?)

There is probably something wrong in the plugin code.
I do not give up, I will find the solution !

I will try to create a simple plugin (using the wizard) and see what happens.

Sebastien

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #49 on: July 15, 2010, 07:38:49 am »
OK, I have managed to load a minimal version of the plugin in Code::Blocks.
This narrow down the problem to the plugin code (as expected).

I will backtrack the svn revision to see where the problem occured at the first time

SVN 31 does not work ...

Note: please also be patient: my internet is flacky these last days. So if I do not post, it simply means I cannot !

Sebastien

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Image Editor - new plugin
« Reply #50 on: July 15, 2010, 10:47:03 am »
I've found that adding '-z defs' to the linking options of a plugin helps a lot in the debugging undefined references... 8)
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Image Editor - new plugin
« Reply #51 on: July 15, 2010, 11:14:33 am »
What you can (and should do), if a plugin can not be loaded (or other problems occur), is to enable extra logging by setting the parameter of wxLog::EnableLogging at the beginning of OnInit in app.cpp to true.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Image Editor - new plugin
« Reply #52 on: July 15, 2010, 12:39:57 pm »
I've found that adding '-z defs' to the linking options of a plugin helps a lot in the debugging undefined references... 8)
True. We should add this to EVERY plugin in fact (I've done this partially already some time back...)
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 seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #53 on: July 15, 2010, 10:10:19 pm »
Hello,

thank you for everybody who helped.

Jens: I have followed your advice, Code::Blocks is currently recompiling.
Morten & oBFusCATed : once I have a new code::blocks, I will recompile the plugin with this option "-z defs"

I will post the results here.

Sebastien

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #54 on: July 15, 2010, 10:32:55 pm »
You rock !!!!!!!!!!  :D :D :D :D :D :D :D :D :D :D :D

It works now !

I have applied the 2 tips above, and I got a message from Code::Blocks "OnDrawCanvasMouseLeave is not defined", or something like that.
I looked at the code, and I had a  #if __WXMSW__ around this method.
Strangely, it was not compiled on Ubuntu.

Now everything is working. Just this simple thing !!

I will update the svn (using Windows, because I have added several files, and I do not want to forget them.
I have to reboot now.

Sebastien

PS : how do we do a screenshot in Ubuntu ?

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #55 on: July 15, 2010, 11:01:45 pm »
svn updated (revision 41) with new code & Unix project file

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #56 on: July 19, 2010, 11:42:30 pm »
svn updated

1 - Remove files from SVN (*.layout, *.obj, *.depends, build log)
 2 - Remove ColourPickerPanel.cpp and ColourPickerPanel.h (unused - replaced by XPMColourPickerPanel.cpp and XPMColourPickerPanel.h)
     Remove XPMToggleBMPButton.cpp and .h from SVN
 3 - Add help support (via html display. Help remains to be written, but it is limited to writing 6 simple HTML files, located in the resource archive XPMEditor.zip)
 4 - Minimum size needed for the tool panel has been reduced and fixed
 5 - Load and Save file: use dynamic handler instead of static hard-coded switch statements based on file extension
     Moved all the code handling file format into XPMEditor.cpp

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #57 on: July 20, 2010, 09:39:03 pm »
SVN Updated

 1 - advanced options implemented (JPG compression, PNG options).
 2 - added menu entries in Code::Blocks:
         File/New/New Image
         File/Open with XPMEditor
         wxSmith/Add Image
 3 - added file filter for FileOpen and FileSave dialog box.
 4 - file saving format can now be choosen by the user, bypassing file extension on request.
 5 - start to add fill options


Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #58 on: July 20, 2010, 09:43:29 pm »
A few thoughts:
  • AFAIK it is not foreseen to add a file filter in the global CodeBlocks file open / save dialog box. The only way I found is to generate a lexer-configuration file (even if there does not exist a scintilla-lexer for bitmaps ).
  • Why do you not commit the code to the svn repo on sorceforge? It is also helpful for you.
  • Most other plugins use CamelCase namings (class and filenames) but this is only a matter of personal taste.

regards,
danselmi

Hello danselmi,

I have found a way to add file filters in the File Open / File Save dialog in CodeBlocks
You have to call FileFilters::Add()
You can have a look at how I have done it in XPMEditor.cpp
Code
void XPMEditor::AddFileMasksToFileOpenSaveDialog(wxArrayString sFileMasks)
{
    wxString sImageMasks;
    wxString sMask;
    size_t i;

    //sImageMasks = wxImage::GetImageExtWildcard();
    sImageMasks = _("");
    for(i=0;i<sFileMasks.GetCount();i++)
    {
        sMask = sFileMasks.Item(i);
        if (sImageMasks.Len() > 0) sImageMasks += _(",");
        sImageMasks += sMask;
    }

    FileFilters::Add(_("Image Files"), sImageMasks);
}

This one work. I do not know if it is the best way to do it, but it make the job done.

Regards,

Sebastien

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #59 on: July 21, 2010, 10:47:35 pm »
Hello,

SVN is updated (44)

 1 - Draw Opaque / transparent implemented
 2 - Line Style / Fill Style implemented wherever possible
 3 - Fixed a bug in Expand / Collapse panels at start

To do:
  1 - SHIFT key for drawing Square / Circle / horizontal line / vertical line
  2 - Helps + tooltips
  3 - bug correction (6 bugs to solve, 1 annoying)

Sebastien