mirror of
https://github.com/reactos/wine.git
synced 2024-12-03 01:12:25 +00:00
329f0680e4
Sun Apr 14 12:51:27 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/menu.c] [include/dialog.h] [windows/dialog.c] Made the resource loading code always use the correct Windows layout for Winelib on other CPUs. * [include/module.h] [loader/module.c] Added self handle in NE_MODULE structure, so we can use a pointer instead of a handle. Added function MODULE_GetPtr() to validate a HMODULE. * [memory/heap.c] Implemented Win32 heap management. * [memory/selector.c] Fix selector limit for huge blocks. Sat Apr 13 00:19:12 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [objects/metafile.c] Fixed memcpy bug to allow memory based metafiles to work. Fri Apr 12 19:25:41 1996 Frans van Dorsselaer <dorssel@rulhm1.leidenuniv.nl> * [controls/edit.c] [controls/EDIT.TODO] Complete rewrite. Everything changed: new features, new bugs. Main addition: WordWrap. Fri Apr 12 20:29:55 1996 Tristan Tarrant <tst@dcs.ed.ac.uk> * [resources/sysres_It.rc] Fixed a few mistakes in the file and resized some of the controls. Fri Apr 12 09:55:13 1996 John Harvey <john@division.co.uk> * [misc/winsocket.c] Fixed broken #if defined that stopped unixware compiling. * [win32/resource.c] Added missing return to end of FindResource32. Thu Apr 11 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/keyboard.c] [windows/event.c] Fixed GetKeyState for mouse buttons. * [windows/message.c] WM_MOUSEACTIVATE wasn't sent in some cases. Wed Apr 10 18:59:53 1996 Niels de Carpentier <niels@cindy.et.tudelft.nl> * [objects/font.c] Match slightly bigger font if height negative. Mon Apr 8 13:46:15 1996 Deano Calver <deano@rattie.demon.co.uk> * [multimedia/mmsystem.c] Changed read's to FILE_read's in mmsystem to fix mmio bug. Sun Apr 7 21:40:29 1996 Albrecht Kleine <kleine@ak.sax.de> * [misc/commdlg.c] [resources/sysres_En.rc] [resources/sysres_De.rc] Introduced ColorDlgProc() for ChooseColor() and replaced fitting En-,De- resources. As written in TODO: some national language support is needed here.
112 lines
4.6 KiB
Plaintext
112 lines
4.6 KiB
Plaintext
This file gives some information about the code in edit.c. If you want to
|
|
change, add, or fix code, please read this text. If you're not interested
|
|
in doing actual work on edit.c only C & D will be of interest to you.
|
|
|
|
A) basic policy
|
|
B) special functions
|
|
C) not implemented
|
|
D) known bugs
|
|
|
|
A) Basic Policy
|
|
|
|
The code has been made in such a way, that functions try to call other
|
|
(documented) functions if that is sufficient. This might sometimes not be
|
|
the most efficient way, but it keeps the code clear. This way I tried to keep
|
|
the number of functions that rely on the internal EDITSTATE structure as
|
|
low as possible. For instance EDIT_WM_Cut() simply calls EDIT_WM_Copy() and
|
|
EDIT_WM_Clear(). The latter two are well documented message handlers, so
|
|
as long as they are right EDIT_WM_Cut() will never have to change again.
|
|
|
|
Example:
|
|
The best thing to do, when you want to know the offset of line 3, is calling
|
|
EDIT_EM_LineIndex(). Again this is a well documented message handler. Don't
|
|
look at es->LineDefs[2].offset. It would just be another reference to the
|
|
internal structure, and that would make it more difficult to change things.
|
|
Refer to EDIT_WM_???? and EDIT_EM_????? functions as much as possible.
|
|
|
|
The WND * pointer is used internally whenever possible. Although it is not
|
|
the real HWND, it improves performance enough to use it.
|
|
|
|
All displaying is done by invalidating regions / rects. Only
|
|
EDIT_EM_LineScroll() uses direct painting. This way things become much
|
|
faster. Although sometimes the response time might appear to be slow, it
|
|
would be much slower even, when everything would be painted instantly. This
|
|
is especially true for scrollbar tracking and selection changes..
|
|
|
|
|
|
|
|
B) Special functions
|
|
|
|
The edit control needs to use local heap memory because applications may
|
|
rely on EM_GETHANDLE. This is bad, but it can't be helped, we have to live
|
|
with that. For this reason there is a nice EDIT_GetPointer() function,
|
|
which locks the heap buffer *only once*, no matter how often it is called.
|
|
Only at the end of the message handler EDIT_ReleasePointer() is called. You
|
|
don't have to worry about unlocking the heap. Calling EDIT_GetPointer() is
|
|
very fast if the buffer is already locked.
|
|
This way, the buffer gets locked / unlock only once every message, although
|
|
EDIT_GetPointer() may actually have been called a hundred times.
|
|
Only when the actual HLOCAL is needed (for example to ReAlloc), a call to
|
|
EDIT_ReleasePointer() is needed. Look for instance in EDIT_MakeFit().
|
|
|
|
This brings us to EDIT_MakeFit(). It automatically re-allocates the buffer
|
|
if the size parameter > buffersize. If everything is successful TRUE is
|
|
returned, otherwise FALSE. Only when the buffer contents may grow you need
|
|
to call EDIT_MakeFit(). Currently this is only in EDIT_ReplaceSel() and
|
|
EDIT_WM_SetText().
|
|
|
|
EDIT_BuildLineDefs() is the most important function in edit.c. It builds
|
|
the internal EDITSTATE structure. As soon as text *might* have changed, or
|
|
when the appearance of the text on the screen *might* have changed, call
|
|
this function ! This includes changes of screen size, change of the font,
|
|
clipboard actions, etc. etc. Most other functions that rely on EDITSTATE,
|
|
rely on the stuff this function builds.
|
|
|
|
|
|
|
|
C) Not Implemented
|
|
|
|
- ES_PASSWORD
|
|
- ES_CENTER
|
|
- ES_RIGHT
|
|
- EM_SETRECT
|
|
- EM_SETRECTNP
|
|
- EM_FMTLINES
|
|
- ES_AUTOVSCROLL (every multi line *is* auto vscroll)
|
|
- ES_AUTOHSCROLL (multi line can be yes or no, but single line only yes)
|
|
- WM_UNDO (=EM_UNDO)
|
|
- EM_CANUNDO
|
|
- EM_SCROLL (scrolling works, but this appears to be an undocumented message)
|
|
- ES_LOWERCASE
|
|
- ES_UPPERCASE
|
|
- ES_OEMCONVERT
|
|
- ES_WANTRETURN
|
|
- probably much, MUCH more
|
|
|
|
I encountered several undocumented messages, or message parameters.
|
|
EditWndProc() reports any unknown message with an id > WM_USER.
|
|
|
|
|
|
|
|
D) Known bugs.
|
|
|
|
- Scrolling is weird, sometimes. The current code makes the scrollbar
|
|
of Notepad work, but the scrollbar code itself is broken. Currently
|
|
the scroll code of edit.c is *not* according to specs. Instead, it
|
|
is according to the broken scrollbar code. If that gets fixed, this
|
|
should be fixed, too.
|
|
- The clipboard is broken. Whenever things go wrong with
|
|
cut/copy/paste, it is probably the clipboard that messes up things,
|
|
not edit.c.
|
|
- With Notepad, if you select New File a couple of times and enter
|
|
text, the buffer is sometimes corrupted.
|
|
- Switching on/off WordWrap with Notepad sometimes corrupts the buffer.
|
|
|
|
|
|
I am still very actively changing things. Especially I am working
|
|
on Undo capabilities. If you want to do things, other than bug fixes,
|
|
please mail me so we can synchronize.
|
|
|
|
Frans van Dorsselaer
|
|
dorssel@rulhm1.LeidenUniv.nl
|