Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   Primitives and EEL Subroutines
      . . .
      File Primitives
         File Reading Primitives
         File Writing Primitives
         Line Translation Primitives
         . . .
         Tagging Internals
      Operating System Primitives
         System Primitives
         Window System Primitives
            WinHelp Interface
            Menu Bar Primitives
            Tool Bar Primitives
            Printing Primitives
         Timing
         Calling Windows DLLs
         . . .
      Control Primitives
         Control Flow
         Character Types
         Examining Strings
         . . .
         Help Subroutines
      . . .

Previous   Up    Next
System Primitives  Primitives and EEL Subroutines   WinHelp Interface


Epsilon User's Manual and Reference > Primitives and EEL Subroutines > Operating System Primitives >

Window System Primitives

windows_maximize()
windows_minimize()
windows_restore()
windows_foreground()
int windows_state()
int screen_to_window_id(int screen)

In Epsilon for Windows, and in Unix under X11, the windows_maximize( ), windows_minimize( ), and windows_restore( ) primitives perform the indicated action on the main Epsilon screen. The windows_foreground( ) primitive tries to make Epsilon the foreground window. (Under X11, some window managers may not let Epsilon do this. Also see the server-raises-window variable.)

The windows_state( ) primitive returns a code indicating the state of Epsilon's main window. The value WINSTATE_MINIMIZED indicates the window has been minimized or iconified. The value WINSTATE_MAXIMIZED indicates the window has been maximized. Zero indicates the window is in some other state.

The screen_to_window_id( ) primitive returns the system's window id (for X11) or window handle (for Windows) corresponding to a particular screen number. For Windows, specify a screen number of -1 to retrieve the window handle of the frame window that contains Epsilon's menu bar, title bar and so forth. It returns 0 if there is no screen with that number.

int drag_drop_result(char *file)
drag_drop_handler()
do_resume_client()
short reject_client_connections;

Epsilon uses the drag_drop_result( ) primitive to retrieve the names of files dropped on an Epsilon window using drag and drop, after receiving the event key WIN_DRAG_DROP. Pass the primitive a character array big enough to hold a file name. The primitive will return a nonzero value and fill the array with the first file name. Call the primitive again to retrieve the next file name. When the function returns zero, there are no more file names.

Epsilon uses this same method to retrieve server messages or DDE messages. When such a message arrives from another program, Epsilon parses the message as if it were a command line and then adds each file name to its list of drag-drop results. Epsilon for Unix doesn't support file drag and drop or DDE, only server messages from another copy of Epsilon.

When Epsilon returns the WIN_DRAG_DROP key, it also sets some mouse variables to indicate the source of the files that can be retrieved through drag_drop_result( ). It sets mouse_screen, mouse_x, mouse_y, and similar variables to indicate exactly where the files were dropped. If the message arrived via DDE or due to -add or -wait, then mouse_screen will be -1.

The drag_drop_result( ) primitive returns 2 to indicate -wait was used to send the file name; 1 otherwise. If -wait was used in a client instance of Epsilon, the do_resume_client( ) primitive may be used to signal waiting clients that the user has finished editing the desired file and they may now resume.

The drag_drop_handler( ) subroutine in mouse.e handles the WIN_DRAG_DROP key. Don't bind this key to a subroutine with a different name; Epsilon requires that the WIN_DRAG_DROP key be bound to a function named drag_drop_handler( ) for correct handling of drag-drop.

A function may set the reject_client_connections variable to keep Epsilon from accepting any files or other messages from other clients, via either server messages or DDE. (Files may still be dropped on Epsilon.) The 1 bit keeps Epsilon from accepting these messages. Other instances of Epsilon that use the -add flag will not see an instance of Epsilon where this bit has been set.

The 2 bit in reject_client_connections lets Epsilon accept and queue such messages, but doesn't deliver them. Epsilon won't return the WIN_DRAG_DROP key as long as this bit is set, but will remember the list of queued files and deliver them once this bit has been cleared.

int dde_open(char *server, char *topic)
int dde_execute(int conv, char *msg, int timeout)
int dde_close(int conv)

Epsilon provides some primitives that you can use to send a DDE Execute message to another program under Windows.

First call dde_open( ) to open a conversation, providing the name of a DDE server and the topic name. It returns a conversation handle, or 0 if it couldn't open the conversation for any reason.

To send each DDE message, call dde_execute( ). Pass the conversation handle from dde_open( ), the DDE Execute message text to send, and a timeout value in milliseconds (10000, the recommended value, waits 10 seconds for a response). The primitive returns nonzero if it successfully sent the message.

Finally, call dde_close( ) when you've completed sending DDE Execute messages, passing the conversation handle. It returns nonzero if it successfully closed the connection.



Previous   Up    Next
System Primitives  Primitives and EEL Subroutines   WinHelp Interface


Lugaru Copyright (C) 1984, 2012 Lugaru Software Ltd. All Rights Reserved.