News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

SpellChecker plugin

Started by danselmi, October 09, 2009, 04:37:24 PM

Previous topic - Next topic

MortenMacFly

Quote from: danselmi on January 07, 2011, 12:12:17 AM
Is solved with the new patch.
Applied in trunk after succesful testing. Thanks!
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]

stahta01

Patch to Spell Checker Plugin; needed to compile under Windows when not using precompiled header sdk.h

Tim S.


Index: SpellCheckerPlugin.cpp
===================================================================
--- SpellCheckerPlugin.cpp (revision 41)
+++ SpellCheckerPlugin.cpp (working copy)
@@ -17,6 +17,11 @@
*
*/
#include <sdk.h> // Code::Blocks SDK
+#ifndef CB_PRECOMP
+    #include <configmanager.h>
+    #include <cbeditor.h>
+    #include <editormanager.h>
+#endif
#include <configurationpanel.h>
#include <editor_hooks.h>
#include <cbstyledtextctrl.h>
Index: OnlineSpellChecker.cpp
===================================================================
--- OnlineSpellChecker.cpp (revision 41)
+++ OnlineSpellChecker.cpp (working copy)
@@ -1,6 +1,11 @@
#include "OnlineSpellChecker.h"

#include <sdk.h> // Code::Blocks SDK
+#ifndef CB_PRECOMP
+    #include <cbeditor.h>
+    #include <editormanager.h>
+    #include <manager.h>
+#endif
#include <editorcolourset.h>
#include <cbstyledtextctrl.h>
#include "SpellCheckEngineInterface.h"
Index: SpellCheckHelper.cpp
===================================================================
--- SpellCheckHelper.cpp (revision 41)
+++ SpellCheckHelper.cpp (working copy)
@@ -19,6 +19,10 @@
#include "SpellCheckHelper.h"

#include <sdk.h> // Code::Blocks SDK
+#ifndef CB_PRECOMP
+    #include <configmanager.h>
+    #include <logmanager.h>
+#endif
#include "SpellCheckerPlugin.h"
SpellCheckHelper::SpellCheckHelper()
{
Index: SpellCheckerConfig.cpp
===================================================================
--- SpellCheckerConfig.cpp (revision 41)
+++ SpellCheckerConfig.cpp (working copy)
@@ -19,6 +19,10 @@
#include "SpellCheckerConfig.h"
#include "SpellCheckerPlugin.h"
#include "sdk.h" // Code::Blocks SDK
+#ifndef CB_PRECOMP
+    #include <wx/dir.h>
+#endif
+
#include "configmanager.h"

#define CFG_SPELLCHECK_ENABLE_ONLINE_CHECK _T("/SpellChecker/EnableOnlineChecker")
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

virtuosonic

Hi, i actually was thinking of writing something similar but to check "literals" , i'll give it a try

votes++
language:C++, jesusonic
libraries:WX, Stk, Vst
virtuosonic at sf_net

pacrook

Nice plug-in but a note on how to compile it would be useful (until it makes it into the C::B contributes).

I compiled it using C::B (svn trunk version) on Ubuntu. The first issue I had was related to not knowing where the Spell Check project sources should be installed relative to the C::B source tree. A point I'm still confused on.

I initially installed the Spell Check sources in a too shallow part of the directory tree and the post-build script tried to create impossible directories, i.e. "/home/devel/share".  If put it too deep in the directory tree the "devel" and "output" directories were hidden among the C::B source tree. I assume it is supposed to be installed inside the C::B source tree as otherwise various header files aren't found (unless I resort to editing the #includes).

The linker option "--enable-auto-import" isn't supported, at least not in Ubuntu. Deleting it get round this problem. (From "man ld", this option is only supported on "i386 PE" targeted versions of ld. Although my Ubunutu version is 32 bit I guess its not "i386 PE".)

Finally, its not obvious what to do once it does build. I expected to find a plugin that I could then load into C::B using the add plugin interface.  Eventually I worked out that the post-build script was trying to copy files directly into where it assumed the working copy of C::B was, i.e. /devel/share and /devel/output directories. I had to resort to manually copying the various Spell Checker files and directories into  /usr/local/lib/codeblocks, /use/local/share/codeblocks (the standard development dirs on Linux for C::B). I'm guessing the current post-build script is written for windows?

ouch

I was just thinking how I wished I had this. And now I do... :)

I created a new folder called unofficial in the  src/codeblocks directory and downloaded from svn there. Everything fell into place then.

the dictionaries are expected to be in a folder called dictionaries in the spellcheckers base directory. You need the aff, dic, dat, and idx files extracted from the open office plugin download. Honestly i just extracted the whole thing there though, works fine.

yeah the post build stuff is a direct xcopy console command instead of a portable squirrel script...

luckily I believe the syntax is the same though so just replace instances of xcopy with cp and you should be good.

pacrook

Quoteyeah the post build stuff is a direct xcopy console command instead of a portable squirrel script...

luckily I believe the syntax is the same though so just replace instances of xcopy with cp and you should be good.

The "SpellCheck-unix.cbp" project script uses "cp" okay, it just doesn't copy them to anywhere sensible (as far as my Linux box is concerned).

P.S. thanks for the pointers about where to put things.

ouch

#66
didn't even see the unix version there, heh...

But the cp stuff looks right once you put it one level above the plugins like I did everything should fall into place for linux people too.

also, don't forget to run the update shell or batch file after it's compiled to actually get the plugin installed into codeblocks.

I noticed a setting called "Enable online spell checker" Shouldn't that be inline? otherwise it kind of sounds like it's searching some sort of dictionary found on the internet...

I've also noticed it makes a notable impact on codeblocks speed. I get screen tearing sometimes with this turned on. So for now I'm just using it for right clicking on stuff to spell check. But it's just what I was looking for otherwise.

AnotherCodeMonkey

I tried to build the code from code::blocks, using the Spell-Checker-unix project file and it fails to compile because it can't find hunspell/hunspell.hxx. The non '-unix' project has the hunspell code included in it. any suggestions?

oBFusCATed

Install hunspell-dev/-devel or whatever is called on you distro, I guess.
(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!]

ouch

hunspell is included in the spellchecker svn.

So my guess would be to check your os permissions.

failing that, make sure there aren't any broken file links in the project. if so, just re-add them.

danselmi


Hunspell is only in the repository for the windows project. The unix project expects hunspell as a system-library. So:
Quote from: oBFusCATed on June 20, 2011, 11:51:42 PM
Install hunspell-dev/-devel or whatever is called on you distro...
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

AnotherCodeMonkey

Thank you, I have gotten further but is still fails to compile. Now its complaining about annoyingdialog.h and not being able to find that. What package is annoyingdialog.h part of?

Thanks

oBFusCATed

It is part of the C::B's sdk and it should be placed in /usr/include/codeblocks
(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!]

eckard_klotz

Hello Everybody.

Is this plugin somewhere available in a version to install with the plug-in-manager on a windows-computer (xp and 7)?

Best Regards,
                   Eckard Klotz.

MortenMacFly

Quote from: eckard_klotz on August 03, 2011, 07:08:17 AM
Is this plugin somewhere available in a version to install with the plug-in-manager on a windows-computer (xp and 7)?
You can use this:
http://forums.next.codeblocks.org/index.php/topic,13234.msg88948.html#msg88948

Maybe it's time to merge the sources in the main repo anyways...
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]