I am working on recreating Spell.dll for AkelPad 4.9.9 x86.
I already have a working base:
- the DLL compiles with MinGW32,
- AkelPad loads the plugin,
- these exports work:
DllAkelPadID
Spell_StartSpy
Spell_ReadText
I do not need a general description of AkelDLL.
I need the complete technical path required to build a working Spell.dll:
AkelEdit
↓
text change
↓
notification
↓
plugin DLL
↓
get text
↓
mark error
Please prepare a complete API map needed for a minimal Spell.dll.
1. CONNECTING A DLL PLUGIN WITH AKELPAD
Please explain exactly:
- which functions must be exported by a DLL plugin,
- the role of:
DllAkelPadID
Main
PLUGINCALLBACK
- whether the plugin must register a callback,
- whether AkelPad calls exported functions automatically,
- what the minimal DLL skeleton should look like.
2. RECEIVING TEXT CHANGES
I have this information:
"AEN_TEXTCHANGED and AEN_TEXTCHANGING are the way."
Please explain completely:
- who generates AEN_TEXTCHANGED,
- who receives it,
- how a plugin becomes a receiver,
- whether AKD_* or AKDN_* messages are required,
- which function in the DLL receives the notification.
Please provide:
- constant names,
- definitions,
- structures,
- complete data flow.
3. AEN_TEXTCHANGING VS AEN_TEXTCHANGED
Explain:
- when each notification is sent,
- what data is available,
- which one should be used for a spell checker.
Example goal:
When the user types:
kot_
(space after "kot")
the plugin should receive:
- text changed,
- last character is a space,
- previous word is "kot".
4. CHANGE DATA
Please provide complete definitions and usage of:
AECHANGENOTIFY
AECHANGEDATA
Explain:
- start position of the change,
- length of the change,
- old text,
- new text,
- line number,
- character index.
5. GETTING TEXT FROM AKELEDIT
I need exact methods for:
- getting the whole document,
- getting selected text,
- getting the current line,
- getting text around the cursor.
Please provide:
- AEM_* messages,
- structures,
- C++ usage examples.
6. CURSOR POSITION
I need:
- character index in the document,
- line number,
- column,
- screen coordinates.
Please provide:
- messages,
- structures,
- examples.
7. SELECTING THE WRONG WORD
I need:
- how to set a selection in AkelEdit,
- how to select a range from the beginning to the end of a word.
Please provide:
- AEM_* or AKD_* messages,
- structures,
- example code.
8. MINIMAL WORKING EXAMPLE
At the end, please provide a complete minimal C++ example:
DLL:
- starts in AkelPad,
- receives AEN_TEXTCHANGED,
- gets changed text,
- writes diagnostic output:
"text changed: ..."
Requirements:
- no timer,
- no polling every 500 ms,
- no subclassing window procedure.
The goal is the first working prototype:
AkelPad
↓
user types a character
↓
AEN_TEXTCHANGED
↓
Spell.dll
↓
read text
↓
dictionary analysis later
Implementing Spell.dll for AkelPad - AEN_TEXTCHANGED and AkelEdit API
- Author
- Message
-
Offline
- Posts: 294
- Joined: Thu Sep 10, 2015 9:53 am
- Location: Deutschland
-
Offline
- Posts: 1348
- Joined: Thu Nov 16, 2006 11:53 am
- Location: Kyiv, Ukraine
Re: Implementing Spell.dll for AkelPad - AEN_TEXTCHANGED and AkelEdit API
Very good questions! Following them, you may ask the next questions:
- what is the minimal source code of AkelPad's plugin?
- how all of these mentioned messages and structures work in the existing plugins?
- how is the existing SpellCheck plugin implemented? why not re-use some its code?
And here you go:
- all the sources are available here: https://akelpad.sourceforge.net/en/download.php
- in particular, the "AkelPad-4.9.9-src.zip" contains "AkelFiles\Plugs\AkelDLL" which is an example of a small plugin
- also, the "AkelPad-4.9.9-src.zip" contains the source code of all Instructor's plugins under "AkelFiles\Plugs"
- also, all the plugin's sources are available here, including the SpellChecker: https://akelpad.sourceforge.net/en/plugins.php
The process of developing of any software consists of analyzing the available documentation and code, of experiments, of trials and errors, of trials and success, that's it. I can assure that neither me nor Aleksander Shengalts can answer all your questions directly from our heads. We need to dig into the code and analyze how it works. In the same way as I explained above: by looking into the existing code that already works.
Next, If you don't like Visual Studio Community Edition, which is free and contains very good debugger, you may use e.g. Visual Studio Code (aka VS Code) and configure it to use MinGW's debugger. This will allow to debug, i.e. to see what's inside each structure right when the code is being executed. Just search e.g. stackoverflow.com or directly ask Gemini/ChatGPT/etc. how to set up a MinGW debugger in VS Code.
Next, you may ask Gemini/ChatGPT/etc. to analyze certain parts of source code (e.g. taken from AkelPad's plugins), as well as ask it to suggest you how you can achieve certain functionality in AkelPad.
If you have an IDE with AI incorporated (such as Cursor), it can write code for you.
- what is the minimal source code of AkelPad's plugin?
- how all of these mentioned messages and structures work in the existing plugins?
- how is the existing SpellCheck plugin implemented? why not re-use some its code?
And here you go:
- all the sources are available here: https://akelpad.sourceforge.net/en/download.php
- in particular, the "AkelPad-4.9.9-src.zip" contains "AkelFiles\Plugs\AkelDLL" which is an example of a small plugin
- also, the "AkelPad-4.9.9-src.zip" contains the source code of all Instructor's plugins under "AkelFiles\Plugs"
- also, all the plugin's sources are available here, including the SpellChecker: https://akelpad.sourceforge.net/en/plugins.php
The process of developing of any software consists of analyzing the available documentation and code, of experiments, of trials and errors, of trials and success, that's it. I can assure that neither me nor Aleksander Shengalts can answer all your questions directly from our heads. We need to dig into the code and analyze how it works. In the same way as I explained above: by looking into the existing code that already works.
Next, If you don't like Visual Studio Community Edition, which is free and contains very good debugger, you may use e.g. Visual Studio Code (aka VS Code) and configure it to use MinGW's debugger. This will allow to debug, i.e. to see what's inside each structure right when the code is being executed. Just search e.g. stackoverflow.com or directly ask Gemini/ChatGPT/etc. how to set up a MinGW debugger in VS Code.
Next, you may ask Gemini/ChatGPT/etc. to analyze certain parts of source code (e.g. taken from AkelPad's plugins), as well as ask it to suggest you how you can achieve certain functionality in AkelPad.
If you have an IDE with AI incorporated (such as Cursor), it can write code for you.
-
Offline
- Posts: 294
- Joined: Thu Sep 10, 2015 9:53 am
- Location: Deutschland