2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-25 01:05:47 +03:00
|
|
|
// $Id$
|
2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2009-12-04 23:02:12 +03:00
|
|
|
|
2001-08-13 19:32:51 +04:00
|
|
|
#include <exec/types.h>
|
|
|
|
#include <exec/exec.h>
|
|
|
|
#include <proto/exec.h>
|
|
|
|
#include <proto/dos.h>
|
|
|
|
#include <proto/intuition.h>
|
|
|
|
#include <proto/asl.h>
|
|
|
|
#include <proto/graphics.h>
|
|
|
|
#include <proto/cybergraphics.h>
|
|
|
|
#include <proto/diskfont.h>
|
|
|
|
#include <proto/gadtools.h>
|
2003-04-06 19:48:58 +04:00
|
|
|
#include <proto/iffparse.h>
|
2001-08-13 19:32:51 +04:00
|
|
|
#include <diskfont/diskfont.h>
|
2003-02-21 18:06:18 +03:00
|
|
|
#include <intuition/intuitionbase.h>
|
2001-08-13 19:32:51 +04:00
|
|
|
#include <intuition/pointerclass.h>
|
|
|
|
#include <devices/input.h>
|
|
|
|
#include <devices/inputevent.h>
|
|
|
|
#include <graphics/gfxbase.h>
|
|
|
|
#include <graphics/videocontrol.h>
|
2003-02-21 18:06:18 +03:00
|
|
|
#include <cybergraphx/cybergraphics.h>
|
2001-08-13 19:32:51 +04:00
|
|
|
#include <libraries/gadtools.h>
|
2003-04-06 19:48:58 +04:00
|
|
|
|
2001-08-13 19:32:51 +04:00
|
|
|
#define FULL(x) (x*0x01010101)
|
2003-04-06 19:48:58 +04:00
|
|
|
#define ID_FTXT MAKE_ID('F','T','X','T')
|
|
|
|
#define ID_CHRS MAKE_ID('C','H','R','S')
|
|
|
|
|
2001-08-13 19:32:51 +04:00
|
|
|
|
|
|
|
void check_toolbar(void);
|
|
|
|
|
|
|
|
struct IntuitionBase *IntuitionBase;
|
|
|
|
struct GfxBase *GfxBase;
|
|
|
|
struct Library *KeymapBase;
|
|
|
|
struct Library *GadToolsBase;
|
|
|
|
|
|
|
|
struct Library *CyberGfxBase;
|
|
|
|
struct Library *AslBase;
|
|
|
|
struct Library *DiskfontBase;
|
2003-04-06 19:48:58 +04:00
|
|
|
struct Library *IFFParseBase;
|
2001-08-13 19:32:51 +04:00
|
|
|
struct Screen *screen = NULL, *pub_screen = NULL;
|
|
|
|
struct Window *window = NULL;
|
|
|
|
struct TextFont *vgafont;
|
|
|
|
|
|
|
|
struct IOStdReq *inputReqBlk = NULL;
|
|
|
|
struct MsgPort *inputPort = NULL;
|
|
|
|
struct Interrupt *inputHandler = NULL;
|
|
|
|
|
|
|
|
int input_error = -1;
|
|
|
|
|
|
|
|
LONG pmap[256];
|
|
|
|
ULONG cmap[256];
|
|
|
|
static UWORD *emptypointer;
|
2003-04-05 02:27:47 +04:00
|
|
|
char verstr[256];
|
2001-08-13 19:32:51 +04:00
|
|
|
|
|
|
|
struct TextAttr vgata = {
|
|
|
|
"vga.font",
|
|
|
|
16,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Image bx_header_image[BX_MAX_PIXMAPS];
|
|
|
|
struct Gadget *bx_header_gadget[BX_MAX_PIXMAPS], *bx_glistptr = NULL, *bx_gadget_handle;
|
|
|
|
static unsigned bx_image_entries = 0, bx_headerbar_entries = 0;
|
|
|
|
static unsigned bx_bordertop, bx_borderleft, bx_borderright, bx_borderbottom,
|
|
|
|
bx_headerbar_y, mouse_button_state = 0, bx_headernext_left,
|
2012-03-03 16:41:24 +04:00
|
|
|
bx_headernext_right, bx_mouseX, bx_mouseY;
|
2001-08-13 19:32:51 +04:00
|
|
|
static LONG apen = -1, black = -1, white = -1;
|
2003-02-21 18:06:18 +03:00
|
|
|
BOOL bx_xchanged = FALSE;
|
2001-08-13 19:32:51 +04:00
|
|
|
void *vi;
|
|
|
|
|
2003-02-21 18:06:18 +03:00
|
|
|
extern "C" { void dprintf(char *, ...) __attribute__ ((format (printf, 1, 2)));}
|
|
|
|
|
2001-08-13 19:32:51 +04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