; _______________________________________________________________________________________
;|                                                                                       |
;| ..::FreshLib::..  Free, open source. Licensed under "BSD 2-clause" license."          |
;|_______________________________________________________________________________________|
;
;  Description: Main procedure of GUI application library.
;
;  Target OS: Dummy
;
;  Dependencies:
;
;  Notes: Organize the main message/event loop needed by every GUI engine.
;_________________________________________________________________________________________

proc ProcessSystemEvents
begin
        stc
        return
endp



proc WaitForSystemEvent
begin
        return
endp



;----------------------------------------------------------------------------------------------------------
; This procedure makes following:
;   1. Takes as arguments one windows message
;   2. Converts this message to FreshLib system event (or not, depending on the message)
;   3. Calls SysEventHandler procedures for the given object (if any) with the created event structure.
;   4. returns CF=0 if the event was properly processed.
;   5. returns CF=1 if the event was not processed.
;
; The event can be not processed in the following cases:
;   1. The window that receives the message is not FreshLib object.
;   2. TObjectClass.procSysEventHandler = 0 for the given class and all parents.
;   3. All procSysEventHandler procedures refuse to process the event (CF=1)
;----------------------------------------------------------------------------------------------------------

dproc __ProcessOneSystemEvent, .hwnd, .wmsg, .wparam, .lparam
begin

        dispatch [.wmsg]

.ondefault:
        stc
        return

oncase 0
       clc
       return
enddp


