Fresh IDE . Check-in [2d4d2404aa]
Not logged in

This repository is a mirror!

The original is located on: https://fresh.flatassembler.net/fossil/repo/fresh
If you want to follow the project, please update your remote-url

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Some work on the text caret and Linux expose events processing priority.
Timelines: family | ancestors | descendants | both | NoCanvasGUI
Files: files | file ages | folders
SHA1:2d4d2404aa58210be7db921c5de36e33201b10e9
User & Date: johnfound 2019-04-19 12:58:12
Context
2019-04-19
12:58
Text caret color. check-in: 11ee3a3d7f user: johnfound tags: NoCanvasGUI
12:58
Some work on the text caret and Linux expose events processing priority. check-in: 2d4d2404aa user: johnfound tags: NoCanvasGUI
2019-04-16
10:40
Fixed the Linux port WaitForSystemEvents procedure that caused hands sometimes (there is a message in the queue, but the procedure does not return).

The mouse.asm library refactored to use interface/body syntax.

ZeroMouseMove procedure introduced. It generates mouse move events, without moving mouse actually.

Work on the TAsmEdit control. As a result changed a little the Win32 message processing (WM_PAINT processed with higher priority).

Work on the different GUI controls in order to make them work with the new interfaces. check-in: fb9af5561c user: johnfound tags: NoCanvasGUI

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to freshlib/gui/Linux/Main.asm.

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

52




53
54

55
56
57
58
59
60
61
62
63
...
495
496
497
498
499
500
501


502
503
504
505
506
507
508
...
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
begin
        push    ebx ecx edx

.event_loop:
; check for quit

        get     eax, [pApplication], TApplication:MainWindow

        test    eax, eax
        jz      .continue     ; ???????????

        cmp     dword [eax], 0
        jne     .continue

;        cinvoke XFlush, [hApplicationDisplay]
        xor     eax, eax
        mov     [fGlobalTerminate], 1
        stc
        pop     edx ecx ebx
        return

.continue:
        cinvoke XEventsQueued, [hApplicationDisplay], QueuedAfterFlush
        test    eax, eax
        jz      .noevents


        lea     ebx, [.event]




        cinvoke  XNextEvent, [hApplicationDisplay], ebx


        stdcall  __ProcessOneSystemEvent, ebx
        jnc     .event_loop

.noevents:
        clc
        pop     edx ecx ebx
        return

endp
................................................................................
        jmp     .finish


;.........................................................................
; Window paint event

.expose:


        stdcall CreateArray, sizeof.RECT
        mov     edi, eax

.add_rect:
        stdcall RectListAddXY, edi, [ebx+XExposeEvent.x], [ebx+XExposeEvent.y], [ebx+XExposeEvent.width], [ebx+XExposeEvent.height]
        mov     edi, edx

................................................................................
        mov     edx, [edi+TArray.count]

        get     edi, esi, TWindow:Screen
        test    edi, edi
        jz      .free_rectangles

if defined Caret
        stdcall __PaintCaret, esi
end if

if defined options.DebugMode.ComputeFPS & options.DebugMode.ComputeFPS
        stdcall FramesPerSecond
end if

        stdcall LockImg, edi







<






<











>

>
>
>
>


>
|
|







 







>
>







 







|







26
27
28
29
30
31
32

33
34
35
36
37
38

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
...
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
...
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
begin
        push    ebx ecx edx

.event_loop:
; check for quit

        get     eax, [pApplication], TApplication:MainWindow

        test    eax, eax
        jz      .continue     ; ???????????

        cmp     dword [eax], 0
        jne     .continue


        xor     eax, eax
        mov     [fGlobalTerminate], 1
        stc
        pop     edx ecx ebx
        return

.continue:
        cinvoke XEventsQueued, [hApplicationDisplay], QueuedAfterFlush
        test    eax, eax
        jz      .noevents

; process Expose events first.
        lea     ebx, [.event]
        cinvoke XCheckTypedEvent, [hApplicationDisplay], Expose, ebx
        test    eax, eax
        jnz     .processit

        cinvoke  XNextEvent, [hApplicationDisplay], ebx

.processit:
        stdcall __ProcessOneSystemEvent, ebx
        jmp     .event_loop

.noevents:
        clc
        pop     edx ecx ebx
        return

endp
................................................................................
        jmp     .finish


;.........................................................................
; Window paint event

.expose:
        DebugMsg "Expose event."

        stdcall CreateArray, sizeof.RECT
        mov     edi, eax

.add_rect:
        stdcall RectListAddXY, edi, [ebx+XExposeEvent.x], [ebx+XExposeEvent.y], [ebx+XExposeEvent.width], [ebx+XExposeEvent.height]
        mov     edi, edx

................................................................................
        mov     edx, [edi+TArray.count]

        get     edi, esi, TWindow:Screen
        test    edi, edi
        jz      .free_rectangles

if defined Caret
        stdcall __PaintCaret, esi, edi
end if

if defined options.DebugMode.ComputeFPS & options.DebugMode.ComputeFPS
        stdcall FramesPerSecond
end if

        stdcall LockImg, edi

Changes to freshlib/gui/textcaret.asm.

246
247
248
249
250
251
252
253
254
255
256
257
258


259
260
261
262




263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279

280
281
282
283
284
285
286


287
288
289
290
291
292
293
.finish:
        stdcall MutexRelease, Caret.mxLock
.exit:
        return
endp


proc __PaintCaret, .topWindow
begin
        push    ebx

        stdcall WaitForMutex, Caret.mxLock, CARET_MUTEX_WAIT
        jc      .exit



        mov     ebx, [.topWindow]
        cmp     ebx, [Caret.pTopWindow]
        jne     .release





        cmp     [Caret.state], 0
        je      .release

        cmp     [Caret.visible], 0
        je      .release

        get     ebx, ebx, TWindow:Screen
        test    ebx, ebx
        jz      .release

        push    ecx edx
        mov     ecx, [Caret.Pos.x]
        mov     edx, [Caret.Pos.y]
        add     ecx, [Caret.xOffs]
        add     edx, [Caret.yOffs]
        stdcall XorRect, ebx, ecx, edx, [Caret.Pos.width], [Caret.Pos.height], [GUI.clTextCaret]

;        stdcall BlendSolidRect, ebx, ecx, edx, [Caret.Pos.width], [Caret.Pos.height], [GUI.clTextCaret]  ; ????????? does not look good this way...
        pop     edx ecx

.release:
        stdcall MutexRelease, Caret.mxLock
.exit:
        pop     ebx


        return
endp


endmodule









|

<
<


>
>




>
>
>
>







<
<
<
<





|
>
|




<

>
>







246
247
248
249
250
251
252
253
254


255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273




274
275
276
277
278
279
280
281
282
283
284
285

286
287
288
289
290
291
292
293
294
295
.finish:
        stdcall MutexRelease, Caret.mxLock
.exit:
        return
endp


proc __PaintCaret, .topWindow, .screen
begin


        stdcall WaitForMutex, Caret.mxLock, CARET_MUTEX_WAIT
        jc      .exit

        push    ebx

        mov     ebx, [.topWindow]
        cmp     ebx, [Caret.pTopWindow]
        jne     .release

        mov     ebx, [.screen]
        test    ebx, ebx
        jz      .release

        cmp     [Caret.state], 0
        je      .release

        cmp     [Caret.visible], 0
        je      .release





        push    ecx edx
        mov     ecx, [Caret.Pos.x]
        mov     edx, [Caret.Pos.y]
        add     ecx, [Caret.xOffs]
        add     edx, [Caret.yOffs]
;        stdcall XorRect, ebx, ecx, edx, [Caret.Pos.width], [Caret.Pos.height], [GUI.clTextCaret]

        stdcall BlendSolidRect, ebx, ecx, edx, [Caret.Pos.width], [Caret.Pos.height], [GUI.clTextCaret]  ; ????????? does not look good this way...
        pop     edx ecx

.release:
        stdcall MutexRelease, Caret.mxLock

        pop     ebx

.exit:
        return
endp


endmodule