Author Topic: SpellChecker plugin  (Read 157693 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: SpellChecker plugin
« Reply #60 on: January 21, 2011, 03:52:25 pm »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7699
    • My Best Post
Re: SpellChecker plugin
« Reply #61 on: February 02, 2011, 05:06:36 pm »
Patch to Spell Checker Plugin; needed to compile under Windows when not using precompiled header sdk.h

Tim S.

Code
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline virtuosonic

  • Multiple posting newcomer
  • *
  • Posts: 18
    • virtuosonic at sf_net
Re: SpellChecker plugin
« Reply #62 on: April 03, 2011, 12:40:12 am »
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

Offline pacrook

  • Single posting newcomer
  • *
  • Posts: 3
Re: SpellChecker plugin
« Reply #63 on: June 07, 2011, 06:56:21 pm »
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?

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: SpellChecker plugin
« Reply #64 on: June 07, 2011, 10:13:55 pm »
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.

Offline pacrook

  • Single posting newcomer
  • *
  • Posts: 3
Re: SpellChecker plugin
« Reply #65 on: June 07, 2011, 10:40:50 pm »
Quote
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.

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.

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: SpellChecker plugin
« Reply #66 on: June 07, 2011, 11:57:47 pm »
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.
« Last Edit: June 08, 2011, 12:51:14 am by ouch »

Offline AnotherCodeMonkey

  • Single posting newcomer
  • *
  • Posts: 2
Re: SpellChecker plugin
« Reply #67 on: June 20, 2011, 11:10:17 pm »
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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: SpellChecker plugin
« Reply #68 on: June 20, 2011, 11:51:42 pm »
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!]

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: SpellChecker plugin
« Reply #69 on: June 21, 2011, 12:01:30 am »
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.

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 205
Re: SpellChecker plugin
« Reply #70 on: June 21, 2011, 12:52:23 am »

Hunspell is only in the repository for the windows project. The unix project expects hunspell as a system-library. So:
 
Install hunspell-dev/-devel or whatever is called on you distro...

Offline AnotherCodeMonkey

  • Single posting newcomer
  • *
  • Posts: 2
Re: SpellChecker plugin
« Reply #71 on: June 21, 2011, 02:27:05 am »
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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: SpellChecker plugin
« Reply #72 on: June 21, 2011, 08:56:01 am »
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!]

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 201
Re: SpellChecker plugin
« Reply #73 on: August 03, 2011, 07:08:17 am »
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: SpellChecker plugin
« Reply #74 on: August 03, 2011, 07:23:11 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.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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ