home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
500-599
/
ff535.lzh
/
KeyMacro
/
PreInclude.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-26
|
5KB
|
189 lines
/****************************************************************************
*
* KeyMacro.h ------------ KeyMacro main include file.
*
* Author ---------------- Olaf Barthel, MXM
* Brabeckstrasse 35
* D-3000 Hannover 71
*
* KeyMacro © Copyright 1990 by MXM; Executable program,
* documentation and source code are shareware. If you like
* this program a small donation will entitle you to receive
* updates and new programs from MXM.
*
****************************************************************************/
#ifndef KEYMACRO_H
#define KEYMACRO_H 1
#define __NO_PRAGMAS 1
/* Standard include files. */
#include <intuition/intuitionbase.h>
#include <libraries/dosextens.h>
#include <workbench/workbench.h>
#include <devices/inputevent.h>
#include <workbench/startup.h>
#include <graphics/gfxbase.h>
#include <exec/interrupts.h>
#include <devices/console.h>
#include <devices/conunit.h>
#include <devices/keymap.h>
#include <devices/timer.h>
#include <exec/execbase.h>
#include <devices/input.h>
#include <exec/memory.h>
#include <clib/macros.h>
#define FPrintf foo1
#define Printf foo2
#define CreatePort foo3
#include <clib/intuition_protos.h>
#include <clib/graphics_protos.h>
#include <clib/console_protos.h>
#include <clib/exec_protos.h>
#include <clib/alib_protos.h>
#include <clib/dos_protos.h>
#undef FPrintf
#undef Printf
#undef CreatePort
#include <libraries/arpbase.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
/* Name of global MsgPort and program revision. */
#define PORTNAME "KeyMacro"
#define REVISION 12
/* Signal flag names. */
#define SIG_CLOSE SIGBREAKF_CTRL_C
#define SIG_PORT (1 << SigBit)
#define SIG_SHAKE SIGBREAKF_CTRL_F
/* MacroKey tag IDs */
#define MK_WORD 1
#define MK_COMMAND 2
/* MacroMessage tag IDs */
#define MM_INPUT 0
#define MM_EXECUTE 2
/* KeyMacro InputEvent subclass. */
#define KM_SUBCLASS 97
/* Values for non-ASCII key codes. */
#define KC_CURSORUP 140
#define KC_CURSORDOWN 141
#define KC_CURSORRIGHT 142
#define KC_CURSORLEFT 143
#define KC_FKEY1 129
#define KC_FKEY2 130
#define KC_FKEY3 131
#define KC_FKEY4 132
#define KC_FKEY5 133
#define KC_FKEY6 134
#define KC_FKEY7 135
#define KC_FKEY8 136
#define KC_FKEY9 137
#define KC_FKEY10 138
#define KC_HELP 139
/* ToUpper macro, will also handle international characters. */
#define ToUpper(c) (((c >= 224 && c <= 254) || (c >= 'a' && c <= 'z')) ? c - 32 : c)
/* Allocate public memory. */
#define AllocPub(Size) AllocRem(Size,MEMF_PUBLIC | MEMF_CLEAR)
/* Qualifier flags to hide before comparing macros and inputevents. */
#define HIDEFLAGS (IEQUALIFIER_REPEAT|IEQUALIFIER_INTERRUPT|IEQUALIFIER_MULTIBROADCAST|IEQUALIFIER_MIDBUTTON|IEQUALIFIER_RBUTTON|IEQUALIFIER_LEFTBUTTON|IEQUALIFIER_RELATIVEMOUSE)
/* A keyboard alias, includes a name string and a value
* to be used as an equivalent.
*/
struct KeyAlias
{
UBYTE *ka_Name;
UWORD ka_Key;
};
/* A MacroKey structure. */
struct MacroKey
{
UBYTE mk_Type; /* Type of macro key. */
UBYTE mk_CommandKey; /* Key to call this macro. */
UWORD mk_CommandQualifier; /* Qualifier needed to hold while pressing the key. */
UBYTE *mk_String; /* String to be entered/Name of command to be executed. */
UBYTE *mk_Window; /* Name of window to look for. */
};
/* A MacroMessage structure. */
struct MacroMessage
{
struct Message mm_Message; /* Standard Exec message. */
UBYTE mm_Type; /* Message type. */
struct MacroKey *mm_MacroKey; /* A list of macro keys. */
LONG mm_NumMacros; /* Number of macros to follow. */
struct MacroKey *mm_MacroList; /* A list of macros to add to the list. */
UBYTE *mm_FileName; /* A file to execute. */
UBYTE *mm_WindowName; /* A window title to look for. */
};
/* A MSeg structure, basically an extended MsgPort. */
struct MSeg
{
struct MsgPort Port; /* Standard Exec MsgPort. */
BPTR Segment; /* Pointer to handler segment. */
LONG SegSize; /* Length of MSeg structure. */
UBYTE Revision; /* Handler revision. */
struct Task *Father; /* Calling task. */
struct Task *Child; /* Waiting task. */
ULONG RingBack; /* Global wait signal. */
struct SignalSemaphore MacroSemaphore;/* Macro list access protection. */
LONG NumMacros; /* Number of macros in list. */
LONG MaxMacros; /* Maximum number of macros in list. */
struct MacroKey **MacroList; /* A list of macro keys. */
struct KeyMap *DefaultKeyMap; /* Default keymap used for key translation. */
LONG Delay; /* Key event delay in microseconds. */
BYTE Pri; /* Input handler priority. */
BYTE Pad1;
UWORD Pad2;
};
#endif /* KEYMACRO_H */