home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kyūkyoku!! X68000 Emulator
/
X68000Book.dat
/
mac
/
OLS
/
X68000
/
Ko-Window
/
kow142s.lzh
/
wsrv
/
open.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-26
|
4KB
|
142 lines
/* 1995 11/25 âfâUâCâôò╧ìXé¬é┼é½éΘéµéñé╔ò╧ìX COR. */
#include <stdio.h>
#include "clip.h"
#include "slider.h"
#include "window.h"
#include "simple.h"
#include "title.h"
#include "scroll.h"
#include "manager.h"
#include "wopen.h"
static void SendEventOpen( WindowClass*, int, int, int, int );
SystemWindowFunc systemfunc[]= {
{ WindowResize, WindowScroll, WindowSet, SendEvent },
{ SimpleResize, WindowScroll, SimpleSet, SimpleEvent },
{ TitleResize, WindowScroll, TitleSet, TitleEvent },
{ ScrollResize, ScrollScroll, ScrollSet, ScrollEvent },
};
void *
WindowSetManagerExec( type, page, args )
int type, page;
void *args;
{
void **vp= (void*)&systemfunc[type],
*ret= vp[page];
if( args )
vp[page]= args;
return ret;
}
WindowClass *WindowOpen( id, x, y, h, v, parent, event )
int id ;
int x, y, h, v ;
WindowClass *parent ;
int (*event)() ;
{
WindowClass *wp ;
if ( parent == NULL )
parent = & RootWindow ;
wp = WindowMemoryAlloc( sizeof( WindowClass ) );
WindowSet( wp, x, y, h, v, parent, id, event );
wp->window.ownerid = id ;
SendEventOpen( wp, x, y, h, v );
return( wp );
}
SimpleClass *SimpleOpen( id, x, y, h, v, parent, event )
int id ;
int x, y, h, v ;
WindowClass *parent ;
int (*event)() ;
{
SimpleClass *wp ;
if ( parent == NULL )
parent = & RootWindow ;
wp = WindowMemoryAlloc( sizeof( SimpleClass ) );
(*systemfunc[SimpleType].setfunc)( wp, x, y, h, v, parent, id, event );
/* SimpleSet( wp, x, y, h, v, parent, id, event );*/
wp->window.ownerid = id ;
SendEventOpen( (WindowClass*)wp, x, y, h, v );
return( wp );
}
TitleClass *TitleOpen( id, x, y, h, v, parent, label, button, event )
int id ;
int x, y, h, v ;
WindowClass *parent ;
char *label ;
int button ;
int (*event)();
{
TitleClass *wp ;
if ( parent == NULL )
parent = & RootWindow ;
wp = WindowMemoryAlloc( sizeof( TitleClass ) );
(*systemfunc[TitleType].setfunc)(
wp, x, y, h, v, parent, label, button, id, event );
/* TitleSet( wp, x, y, h, v, parent, label, button, id, event );*/
wp->window.ownerid = id ;
SendEventOpen( (WindowClass*)wp, x, y, h, v );
return( wp );
}
ScrollClass *ScrollOpen( id, x, y, h, v, parent, maxh, maxv, dir, xstep, ystep, event )
int id ;
int x, y, h, v ;
WindowClass *parent ;
int maxh, maxv ;
int dir, xstep, ystep ;
int (*event)() ;
{
ScrollClass *wp ;
if ( parent == NULL )
parent = & RootWindow ;
wp = WindowMemoryAlloc( sizeof( ScrollClass ) );
(*systemfunc[ScrollType].setfunc)( wp, x, y, h, v, parent,
maxh, maxv, dir, xstep, ystep, id, event );
/* ScrollSet( wp, x, y, h, v, parent, maxh, maxv, dir, xstep, ystep, id, event );*/
wp->window.ownerid = id ;
SendEventOpen( (WindowClass*)wp, x, y, h, v );
return( wp );
}
static void SendEventOpen( wp, x, y, h, v )
WindowClass *wp ;
int x, y, h, v ;
{
EventInfo info ;
info.option = EventOpen ;
info.x = x ;
info.y = y ;
info.h = h ;
info.v = v ;
WindowSendEvent( wp, &info );
}
void SelectResize( wp, x, y, h, v )
WindowClass *wp ;
int x, y, h, v ;
{
/* static void (*resizefunc[])() =
{ WindowResize, SimpleResize, TitleResize, ScrollResize };*/
(*systemfunc[ wp->window.type].resizefunc)( wp, x, y, h, v );
}
void SelectScroll( wp, dx, dy )
WindowClass *wp ;
int dx, dy ;
{
/* static void (*scrollfunc[])() =
{ WindowScroll, WindowScroll, WindowScroll, ScrollScroll };*/
(*systemfunc[ wp->window.type].scrollfunc)( wp, dx, dy );
}