コード例 #1
0
ファイル: scroll.c プロジェクト: daemqn/Atari_ST_Sources
void scrollup(int hand, short howmany)
{
GRECT box;
GRECT area;
int xy[8],temp;
area.g_x=wn[hand].wwa.g_x;
area.g_y=wn[hand].wwa.g_y;
area.g_w=wn[hand].wwa.g_w-NLW;
area.g_h=wn[hand].wwa.g_h-ith*2-VT+3;
if(wn[hand].stat==WMDONTWRITE)return;
startupdate();
wind_get(wn[hand].hand,WF_FIRSTXYWH,&box.g_x,&box.g_y,&box.g_w,&box.g_h);
while (box.g_w && box.g_h){
if(rc_intersect(&area,&box)){
temp=th*howmany;
if(temp>box.g_h)temp=box.g_h;
xy[0]=box.g_x;xy[1]=box.g_y+temp;
xy[2]=box.g_x+box.g_w-1;xy[3]=box.g_y+box.g_h-1;
xy[4]=box.g_x;xy[5]=box.g_y;
xy[6]=box.g_x+box.g_w-1;xy[7]=box.g_y+box.g_h-temp;
vro_cpyfm(ws.handle,S_ONLY,xy,&scr,&scr);
box.g_y=box.g_y+box.g_h-temp;
box.g_h=temp+1;
dodirty(hand,box);
}
wind_get(wn[hand].hand,WF_NEXTXYWH,&box.g_x,&box.g_y,&box.g_w,&box.g_h);
}
finishupdate();
return;
}
コード例 #2
0
ファイル: winds.c プロジェクト: amine-bouassida/PFEAirstrike
/* get_object_wind()
 * x -- object x position within screen
 * y -- object y position within screen
 * wind -- wind x,y value array
 * 
 * sets wind according to given object position and size
 */
void get_object_wind(int x, int y, float *wind)
{
	wind[0] = wind_get(x, level.xmax, h_wind.count, h_wind.off, h_wind.val);
	wind[1] = wind_get(y, level.ymax, v_wind.count, v_wind.off, v_wind.val);
	
	/* TODO: scale wind according to object size */
}
コード例 #3
0
ファイル: WINDOWS.C プロジェクト: daemqn/Atari_ST_Sources
/* open_window()
 *==========================================================================
 * Open the Xcontrol window
 *
 * IN:  VOID
 * OUT: BOOLEAN:	TRUE if window opening was success
 *
 * GLOBAL:  WINFO w:	window structure
 */
void
open_window( void )
{
    wind_set( w.id, WF_NAME, w.name );

    /* cjg - re-init window width and height every time we open */
    w.work.g_w = WIND_WIDTH;
    w.work.g_h = WIND_HEIGHT;

#if 0
   /* Convert to 3D if possible - ONLY if AES 0x0330 or Greater */
   if( AES_Version >= 0x0330 )
      w.work.g_h = WIND_HEIGHT + 4;
#endif

    wind_calc( 0, w.kind, w.work.g_x, w.work.g_y, w.work.g_w, w.work.g_h,
    		          &w.r.g_x, &w.r.g_y, &w.r.g_w, &w.r.g_h );
    w.r.g_x = max( desk.g_x, (desk.g_w - w.r.g_w )/2 );
    w.r.g_y = max( desk.g_y, (desk.g_h - w.r.g_h )/2 );
    wind_calc( 1, w.kind, w.r.g_x, w.r.g_y, w.r.g_w, w.r.g_h,
   			  &w.work.g_x, &w.work.g_y, &w.work.g_w, &w.work.g_h );
    GrowShrinkBox( GROWBOX );    
    
    Wind_open( w.id, &w.r );  

    wind_get( w.id, WF_WORKXYWH, &w.work.g_x,&w.work.g_y,&w.work.g_w,&w.work.g_h );
    wind_get( w.id, WF_CURRXYWH, &w.r.g_x,&w.r.g_y,&w.r.g_w,&w.r.g_h );
    
    ObX( FRONT ) = w.work.g_x;
    ObY( FRONT ) = w.work.g_y;
}
コード例 #4
0
ファイル: HANDLERS.C プロジェクト: daemqn/Atari_ST_Sources
/* do_redraw();
 * ================================================================
 */
void
do_redraw( int *msg )
{
   GRECT area;
   GRECT rect;

   area.g_x = msg[4];
   area.g_y = msg[5];
   area.g_w = msg[6];
   area.g_h = msg[7];

   graf_mouse( M_OFF, 0L );
   wind_update( BEG_UPDATE );
   wind_get( msg[3], WF_FIRSTXYWH, &rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h );

   while( rect.g_w && rect.g_h )
   {
     if( rc_intersect( &area, &rect ) )
         ObjcDraw( tree, ROOT, MAX_DEPTH, &rect );

     wind_get( msg[3], WF_NEXTXYWH,&rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h );
   }
   wind_update( END_UPDATE );
   graf_mouse( M_ON, 0L );
}
コード例 #5
0
ファイル: MT_MAIN.C プロジェクト: daemqn/Atari_ST_Sources
/* --------------------------- */
void redraw_w0(int ind)
{
int w0x, w0y, w0w, w0h;

wind_get(0, WF_FIRSTXYWH, &w0x, &w0y, &w0w, &w0h);
while (w0w > 0 && w0h > 0)
	{
	objc_draw(back, ind, 1, w0x, w0y, w0w, w0h);
	wind_get(0, WF_NEXTXYWH, &w0x, &w0y, &w0w, &w0h);
	}
}
コード例 #6
0
ファイル: RCSLIB.C プロジェクト: daemqn/Atari_ST_Sources
VOID set_slpos(WORD w_handle, WORD h_pos, WORD v_pos)
{
	WORD	cur_pos, foo;

	wind_get(w_handle, WF_HSLIDE, &cur_pos, &foo, &foo, &foo);
	if (cur_pos != h_pos)
		wind_set(w_handle, WF_HSLIDE, h_pos, 0, 0, 0);
	wind_get(w_handle, WF_VSLIDE, &cur_pos, &foo, &foo, &foo);
	if (cur_pos != v_pos)
		wind_set(w_handle, WF_VSLIDE, v_pos, 0, 0, 0);
}
コード例 #7
0
ファイル: RCSLIB.C プロジェクト: daemqn/Atari_ST_Sources
VOID set_slsize(WORD w_handle, WORD h_size, WORD v_size)
{
	WORD	cur_size, foo;

	wind_get(w_handle, WF_HSLSIZE, &cur_size, &foo, &foo, &foo);
	if (cur_size != h_size)
		wind_set(w_handle, WF_HSLSIZE, h_size, 0, 0, 0);
	wind_get(w_handle, WF_VSLSIZE, &cur_size, &foo, &foo, &foo);
	if (cur_size != v_size)
		wind_set(w_handle, WF_VSLSIZE, v_size, 0, 0, 0);
}	
コード例 #8
0
ファイル: WINDIAL.C プロジェクト: daemqn/Atari_ST_Sources
/* ***Dialog neu zeichnen, Rechteckliste beachten*** */
void wdial_redraw(int dwhndl, OBJECT *tree, GRECT *redrwrect)
{
 GRECT clip;               /* F�r Rechtecksliste */

 wind_update(BEG_UPDATE); graf_mouse(M_OFF, 0L);

 wind_get(dwhndl, WF_FIRSTXYWH, &clip.g_x, &clip.g_y, &clip.g_w, &clip.g_h);
 while(clip.g_w!=0 && clip.g_h!=0)
  {
   if( rc_intersect(redrwrect, &clip) )
     objc_draw(tree, ROOT, MAX_DEPTH, clip.g_x, clip.g_y, clip.g_w, clip.g_h);
   wind_get(dwhndl, WF_NEXTXYWH, &clip.g_x, &clip.g_y, &clip.g_w, &clip.g_h);
  }

 graf_mouse(M_ON, 0L); wind_update(END_UPDATE);
}
コード例 #9
0
void GEM_SetCaption(_THIS, const char *title, const char *icon)
{
	short parm[4];
	const char *new_name;

	new_name = NULL;

	if (title)
		GEM_title_name = title;

	if (icon)
		GEM_icon_name = icon;

	/* Is window iconified ? */
	parm[0]=0;
	if (GEM_wfeatures & (1<<WF_ICONIFY))
		wind_get(GEM_handle, WF_ICONIFY, &parm[0], &parm[1], &parm[2], &parm[3]);

	if (parm[0]==0) {
		/* Change window name */
		if (title)
			new_name = title;
	} else {
		/* Change icon name */
		if (icon)
			new_name = icon;
	}

	parm[0]= ((unsigned long) new_name)>>16;
	parm[1]= ((unsigned long) new_name) & 65535;

	if (new_name) {
		wind_set(GEM_handle, WF_NAME, parm[0], parm[1], 0, 0);
	}
}
コード例 #10
0
ファイル: HEXDUMP.C プロジェクト: daemqn/Atari_ST_Sources
static int OnRestoreFulled(void *wnd)
{
  GEM_WINDOW *gwnd = (GEM_WINDOW *) wnd ;
  HEX_DUMP   *hex_dump = (HEX_DUMP *) gwnd->Extension ;
  long       old_xcursor, old_ycursor, old_ystart ;
  int        xywh[4], cxywh[4] ;

  old_xcursor = hex_dump->xcursor ;
  old_ycursor = hex_dump->ycursor ;
  old_ystart  = hex_dump->ystart ;
  ShowCursor( gwnd, 0 ) ;

  wind_get( gwnd->window_handle, WF_PREVXYWH, &cxywh[0], &cxywh[1], &cxywh[2], &cxywh[3] ) ;
  wind_calc( WC_WORK, gwnd->window_kind, cxywh[0], cxywh[1], cxywh[2], cxywh[3], &xywh[0], &xywh[1], &xywh[2], &xywh[3] ) ;
  xywh[3] = SetupNbLines( hex_dump, xywh[3] ) ;

  CheckValid( hex_dump ) ;

  if ( ( old_xcursor != hex_dump->xcursor ) || ( old_ycursor != hex_dump->ycursor ) ) SmartInfos( gwnd ) ;
  if ( old_ystart != hex_dump->ystart ) SmartRePaint( gwnd, old_ystart ) ;

  wind_calc( WC_BORDER, gwnd->window_kind, xywh[0], xywh[1], xywh[2], xywh[3], &cxywh[0], &cxywh[1], &cxywh[2], &cxywh[3] ) ;
  GWOnRestoreFulled( wnd, cxywh ) ;
  UpdateVSlider( gwnd ) ;

  return( GW_EVTSTOPROUTING ) ;
}
コード例 #11
0
ファイル: HDX.C プロジェクト: daemqn/Atari_ST_Sources
/*
 * Top level;
 * we get control from the desktop.
 */
main()
{
	pnf = 0;		/* set the flag to it isn't partition yet */
    appl_init();
    phys_handle=graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox);
    wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk);
    open_vwork();
    wi_handle=wind_create(0x0040&0x0080, xdesk, ydesk, wdesk, hdesk);

    hidden = FALSE;
    butdown = TRUE;

	/* doing a checking see if the cache in the system */
	cachexst = (char) chkcache();

    rsrc_load(RESOURCEFILE);
    /* Get all addresses of dialogues from resource file */
    getalladdr();

	needscan = TRUE;

   	if (domulti() != 11)
		reboot();

    wind_delete(wi_handle);
    v_clsvwk(handle);
    appl_exit();
}
コード例 #12
0
ファイル: RTZOOM.C プロジェクト: daemqn/Atari_ST_Sources
int init_rtwindow(void)
{
  char name[50] ;
  int err = 0 ;

  if ( WndRTZoom ) WndRTZoom->OnClose( WndRTZoom ) ; ;

  WndRTZoom = RTZoomCreateWindow() ;
  if ( WndRTZoom )
  {
    int mask = 0xFFFF ;
    int x, y, w, h ;

    if ( config.rt_optimizepos ) mask = 0xFFF0 ;
    wind_calc( WC_BORDER, ATTR_WRTZOOM,
               ( Xmax-config.rt_width ) & mask, Ymax - config.rt_height,
               config.rt_width, config.rt_height,
               &x, &y, &w, &h ) ;
    WndRTZoom->OnDraw        = OnDrawRTZoom ;
    WndRTZoom->OnMove        = OnMoveRTZoom ;
    WndRTZoom->OnClose       = OnCloseRTZoom ;
    WndRTZoom->OnRButtonDown = OnRButtonDownRTZoom ;
    GWOpenWindow( WndRTZoom, x, y, w, h ) ;
    sprintf( name, msg[MSG_TITRERTZOOM], config.rt_zoomlevel ) ;
    GWSetWindowCaption( WndRTZoom, name ) ;
    wind_get( WndRTZoom->window_handle, WF_WORKXYWH, &rtx, &rty, &rtw, &rth ) ;
  }
  else err = -3 ;

  return( err ) ;
}
コード例 #13
0
ファイル: AFFICHAG.C プロジェクト: daemqn/Atari_ST_Sources
void selectionne_item(WINDFORM_VAR *nw)
{
    int x,	y;
    int xw,	 yw,	 ww,	 hw;
    int wc,	hc;
    int attr[10];
    C_OBJ	*obj;

    vqt_attributes(VDIhandle,	 attr);

    /* Coordonn‚es zone de travail :	*/
    wind_get (nw->w_handle,	 WF_WORKXYWH,	 &xw,	 &yw,	 &ww,	 &hw);
    hc=hw/attr[9];
    y=(mousey-yw)/attr[9];

    if(nw->w_lin+y<=n_obj)
    {
        y +=nw->w_lin;
        obj=cherche_objet(curr_aff,	nw->w_lin,	&y);
        if (obj!=sel_obj)
        {
            sel_obj=obj;
            redraw (xw,	 yw,	 ww,	 hw);	/* R‚affichage	*/
        }
    }
}
コード例 #14
0
ファイル: utils.c プロジェクト: galexcode/NetSurf68k
unsigned short _systype (void)
{
    int32_t * cptr = NULL;
    _systype_v = SYS_TOS;

    cptr = (int32_t *)Setexc(0x0168, -1L);
    if (cptr == NULL ) {
        return _systype_v;   /* stone old TOS without any cookie support */
    }
    while (*cptr) {
        if (*cptr == C_MgMc || *cptr == C_MgMx ) {
            _systype_v = (_systype_v & ~0xF) | SYS_MAGIC;
        } else if (*cptr == C_MiNT ) {
            _systype_v = (_systype_v & ~0xF) | SYS_MINT;
        } else if (*cptr == C_Gnva /* Gnva */ ) {
            _systype_v |= SYS_GENEVA;
        } else if (*cptr == C_nAES /* nAES */ ) {
            _systype_v |= SYS_NAES;
        }
        cptr += 2;
    }
    if (_systype_v & SYS_MINT) { /* check for XaAES */
        short out = 0, u;
        if (wind_get (0, (((short)'X') <<8)|'A', &out, &u,&u,&u) && out) {
            _systype_v |= SYS_XAAES;
        }
    }
    return _systype_v;
}
コード例 #15
0
ファイル: windows.c プロジェクト: marcelschoen/gemguide
/* open window and enter event loop */
void start_program (void) {
	struct win_data wd;
	int fullx, fully, fullw, fullh;

	graf_mouse (ARROW, 0L); /* ensure mouse is an arrow */

	/* 1. set up and open our window */
	wind_get (0, WF_WORKXYWH, &fullx, &fully, &fullw, &fullh);
	wd.handle = wind_create (NAME|CLOSER, fullx, fully, fullw, fullh);
	wind_set (wd.handle, WF_NAME, "Example: Version 1", 0, 0);
	wind_open (wd.handle, fullx, fully, 300, 200);

	/* create any application-specific data: the string to show, in this case */
	wd.text = "Hello";

	/* display content in window */
	draw_example (app_handle, &wd);

	/* 2. process events for our window */
	event_loop (&wd);

	/* 3. close and remove our window */
	wind_close (wd.handle);
	wind_delete (wd.handle);
}
コード例 #16
0
ファイル: stedinit.c プロジェクト: daemqn/Atari_ST_Sources
/* ***Fenster �ffnen*** */
int open_window(void)
{
 wind_calc(WC_WORK, SWIGADGETS, deskx, desky, deskw, deskh, &wi.g_x, &wi.g_y, &wi.g_w, &wi.g_h);
 wi.g_w=wi.g_w&0xFFF0; wi.g_h=wi.g_h&0xFFF0;
 wind_calc(WC_BORDER, SWIGADGETS, wi.g_x, wi.g_y, wi.g_w, wi.g_h, &wi.g_x, &wi.g_y, &wi.g_w, &wi.g_h);
 wihndl=wind_create(SWIGADGETS, deskx, desky, wi.g_w, wi.g_h);
 if(wihndl<0)
  {
   form_alert(1, "[3][Could not create|the windows!][Cancel]");
   return(-1);
  }

 wind_set(wihndl, WF_NAME, "STED", 0L);
 wind_set(wihndl, WF_INFO, " Spielfeld editieren", 0L);

 wind_calc(WC_BORDER, SWIGADGETS, 32, 32, rww<<4, rwh<<4,
			&wi.g_x, &wi.g_y, &wi.g_w, &wi.g_h);
 wi.g_x=deskx+(deskw-wi.g_w)/2;
 wi.g_y=desky+(deskh-wi.g_h)/2;

 if(aesversion>=0x0300)
  {
   wind_set(wihndl, WF_BEVENT, 1, 0, 0L);
  }

 /* Fenster �ffnen: */
 wind_open(wihndl, wi.g_x, wi.g_y, wi.g_w, wi.g_h);
 wind_get(wihndl, WF_WORKXYWH, &wi.g_x, &wi.g_y, &wi.g_w, &wi.g_h);

 return(0);
}
コード例 #17
0
ファイル: WINDOW.C プロジェクト: daemqn/Atari_ST_Sources
/* HR 050203: drag & drop */
static
boolean itm_drop(WINDOW *w, int n, int *list, int kstate, ICND *icnlist, int x, int y)
{
	int i, item, apid = -1, hdl = wind_find(x, y);
	long fd;
/*	ITMTYPE type;
*/	const char *path;

	if (hdl > 0)
		wind_get(hdl, WF_OWNER, &apid);

	if (apid > 0)
	{
		char ddsexts[32];

		fd = ddcreate(apid, ap_id, hdl, x, y, kstate, ddsexts);
		if (fd > 0)
		{
			if (ddstry(fd, "ARGS", "", sizeof(LNAME)) != DD_NAK)
			{
				for (i = 0; i < n; i++)
				{
					if ((item = list[i]) == -1)
						continue;
			
					path = itm_fullname(w, item);

					if (path)
					{
					/*	type = itm_type(w, item);
						alert_msg("type %d | %s | '%s'", type, name, path);
					*/
						Fwrite(fd, 1, "'");
						Fwrite(fd, strlen(path), path);
						Fwrite(fd, 1, "'");	
					}
					if (i < n - 1)
						Fwrite(fd, 1, " ");
				}
				ddclose(fd);

				itm_select(w, -1, 0, TRUE);
				return TRUE;
			}
			else
				alert_printf(1, APPNOEXT);

			ddclose(fd);
		}
		else
		{
			alert_printf(1, APPNODD);
			return FALSE;
		}
	}

	alert_printf(1, MILLDEST);
	return FALSE;
}
コード例 #18
0
ファイル: HDX.C プロジェクト: daemqn/Atari_ST_Sources
/*
 * Top level;
 * we get control from the desktop.
 */
main()
{
	pnf = 0;		/* set the flag to it isn't partition yet */
    appl_init();
    phys_handle=graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox);
    wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk);
    open_vwork();
    wi_handle=wind_create(0x0040&0x0080, xdesk, ydesk, wdesk, hdesk);

    hidden = FALSE;
    butdown = TRUE;

	/* doing a checking see if the cache in the system */
	cachexst = (char) chkcache();

	/* check the existence of the BLiTTER */
	blitxst = chkblit();

    if (!rsrc_load(RESOURCEFILE)) {
	errs("[2][|", RESOURCEFILE, "][ EXIT ]");
	goto punt;
    }

    
    /* Get all addresses of dialogues from resource file */
    if (getalladdr() != OK) {
	errs("[2][|", RESOURCEFILE, "][ EXIT ]");
	goto punt;
    }


	needscan = TRUE;

redomul:
    ARROW_MOUSE;

    /* display menu bar */
    menu_bar(menuobj, 1);

    running = TRUE;
    while (running) {
    	domulti();
    }

    /*
     * If nothing has been done to the hard disks
     * then just get out, back to the desktop.
     * Otherwise reboot the system.
     */
    menu_bar(menuobj, 0);		/* erase menu bar */

punt:

    wind_delete(wi_handle);
    v_clsvwk(handle);
    appl_exit();
}
コード例 #19
0
ファイル: HANDLERS.C プロジェクト: daemqn/Atari_ST_Sources
/* Do_Redraw();
 * ================================================================
 */
void
Do_Redraw( OBJECT *tree, GRECT *area )
{
   GRECT rect;

   graf_mouse( M_OFF, 0L );
   wind_update( BEG_UPDATE );
   wind_get( wid, WF_FIRSTXYWH, &rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h );

   while( rect.g_w && rect.g_h )
   {
     if( rc_intersect( area, &rect ) )
         ObjcDraw( tree, ROOT, MAX_DEPTH, &rect );

     wind_get( wid, WF_NEXTXYWH,&rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h );
   }
   wind_update( END_UPDATE );
   graf_mouse( M_ON, 0L );
}
コード例 #20
0
ファイル: HINSTALL.C プロジェクト: daemqn/Atari_ST_Sources
/*
 * Top level;
 * we get control from the desktop.
 *
 */
main()
{
    long *cookptr;	/* pointer to AHDI cookie */

    running = TRUE;
    appl_init();
    phys_handle = graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox);
    wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk);
    open_vwork();
    wi_handle = wind_create(WI_KIND, xdesk, ydesk, wdesk, hdesk);
  
    hidden = FALSE;
    butdown = TRUE;
  
    if (!rsrc_load(RESOURCEFILE)) {
	errs("[2][", RESOURCEFILE, "][ OK ]");
	goto punt;
    }
  
    graf_mouse(ARROW, 0L);
  
    /* display menu bar */
    if (getalladdr() == ERROR) {
	errs("[2][", RESOURCEFILE, "][ OK ]");
	goto punt;
    }
  
    ostack = Super(NULL);	/* Superuser mode for low memory access */
    pun = (int *)(*(long *)PUNPTR);
    Super(ostack);		/* back to User mode */

    if (!pun || !(*pun)) {	/* if no unit exists */
	err(noavdrv);		/* return error */
	goto punt;
    }

    cookptr = (long *)((char *)pun + 2 + 16 + 16*4);
    if (*cookptr != AHDI || cookptr != *(long *)(cookptr + 1))
	vernum = 0L;
    else
	vernum = (int *)(cookptr + 2);

    menu_bar(menubar, 1);	/* put up menu bar */
  
    while (running)
	domulti();
    
    menu_bar(menubar, 0);	/* erase menu bar */
  
punt:
    wind_delete(wi_handle);	/* close window on screen */
    v_clsvwk(handle);		/* close virtual workstation */
    appl_exit();		/* exit application HDX */
    Pterm(0);			/* terminate process */
}
コード例 #21
0
OUTPUT_WINDOW* setup_output_window(short workstation) {
    OUTPUT_WINDOW *window = calloc(1, sizeof(OUTPUT_WINDOW));
    window->obj_tree_length = 2;
    window->obj_tree = calloc(window->obj_tree_length, sizeof(OBJECT));
    window->workstation = workstation;
    window->text = "Llama llama llama\nllama duck\nllama llama llama llama llama llama\nHOLLLLLLAAAAAAAAAAAAAAAAAAAAAAAAAA";

    short x_loc;
    short y_loc;
    short height;
    short width;

    wind_get(0, WF_CURRXYWH, &x_loc, &y_loc, &width, &height);
    window->handle = wind_create(NAME, x_loc, y_loc, width, height);
    wind_open(window->handle, x_loc + 10, y_loc + 10, width / 2, height / 2);

    OBJECT *box = &window->obj_tree[0];
    box->ob_next = -1;
    box->ob_head = -1;
    box->ob_tail = -1;
    box->ob_type = G_BOX;
    wind_get(window->handle, WF_WORKXYWH, &box->ob_x, &box->ob_y, &box->ob_width, &box->ob_height);

    //Add our own multiline handling block
    OBJECT *text = &window->obj_tree[1];
    text->ob_next = -1;
    text->ob_head = -1;
    text->ob_tail = -1;

    USERBLK *user_block = malloc(sizeof(USERBLK));
    user_block->ub_code = &draw_multiline;
    user_block->ub_parm = (int)window;

    objc_add(window->obj_tree, 0, 1);
    text->ob_type = G_USERDEF;
    text->ob_width = box->ob_width - 1; //adjust for border
    text->ob_height = box->ob_height - 1;
    text->ob_spec.userblk = user_block;

    wind_set_str(window->handle, WF_NAME, "Twitter");
    return window;
}
コード例 #22
0
ファイル: DRAWSCL.C プロジェクト: eviltester/gem-guitar-tools
void refix_start_fret()
	{
		GRECT c;
		int no_frets_on;

		wind_get(scale_window.handle,WF_WXYWH,&c.g_x,&c.g_y,&c.g_w,&c.g_h);
		no_frets_on=c.g_w/frets_length;

		if(no_frets_on>(global_frets-start_fret))
			start_fret=global_frets-no_frets_on;
	}
コード例 #23
0
ファイル: MAILBOX.C プロジェクト: daemqn/Atari_ST_Sources
void initialize(void)
{
	int c;

	if (appl_init()<0)
		exit(EXIT_FAILURE);
	getcd( 0, program_path );
	for (c=0;c<10000;c++) { email[c]='\0'; }
	wind_get(DESK,WF_WORKXYWH,&screenx,&screeny,&screenw,&screenh);
	graf_mouse(ARROW,NULL);
}
コード例 #24
0
ファイル: gencoup.c プロジェクト: daemqn/Atari_ST_Sources
void  coup_mu_mesag( const short *message )
{
	GRECT *rect ;
	short dummy ;

	switch( message[0] )
	{
		case WM_REDRAW :
			form_redraw( message, &coup_form ) ;
			break ;
		case WM_MOVED :
			rect = (GRECT *) &(message[4]) ;
			wind_set( coup_form.fm_handle, WF_CURRXYWH, PTRS( rect ) ) ;
			coup_form.fm_box = *rect ;
			wind_calc( WC_WORK, wind_form_kind, ELTS( coup_form.fm_box ),
					&coup_form.fm_ptr[ROOT].ob_x, &coup_form.fm_ptr[ROOT].ob_y,
					&dummy, &dummy ) ;
			break ;
		case WM_TOPPED :
			if( message[3] == coup_form.fm_handle )
				wind_set( coup_form.fm_handle, WF_TOP ) ;
			break ;
		case WM_BOTTOM :
			wind_set( coup_form.fm_handle, WF_BOTTOM ) ;
			break ;
		case WM_CLOSED :
			save_couple( edit_coup_ref, edit_coup_block, edit_coup_cptr ) ;
			close_couple() ;
			break ;
		case WM_ALLICONIFY :
			iconify_all( coup_form.fm_box.g_x ) ;
			break ;
		case WM_ICONIFY :
			wind_set( coup_form.fm_handle, WF_UNICONIFYXYWH, ELTS( coup_form.fm_box ) ) ;
			coup_form.fm_box = *(GRECT *)&message[4] ;
			coup_form.iconified = TRUE ;
			wind_set( coup_form.fm_handle, WF_ICONIFY, ELTS( coup_form.fm_box ) ) ;
			wind_title( coup_form.fm_handle, coup_form.icon_title ) ;
			send_redraw_message( &coup_form.fm_box, coup_form.fm_handle ) ;
			break ;
		case WM_UNICONIFY :
			wind_get( coup_form.fm_handle, WF_UNICONIFY, REFS( coup_form.fm_box ) ) ;
			wind_calc( WC_WORK, wind_form_kind, ELTS( coup_form.fm_box ),
					&coup_form.fm_ptr[ROOT].ob_x, &coup_form.fm_ptr[ROOT].ob_y,
					&dummy, &dummy ) ;
			wind_set( coup_form.fm_handle, WF_UNICONIFY, ELTS( coup_form.fm_box ) ) ;
			wind_title( coup_form.fm_handle, coup_form.title_str ) ;
			coup_form.iconified = FALSE ;
			break ;
		default :
			break ;
	}
}
コード例 #25
0
ファイル: DRAWSCL.C プロジェクト: eviltester/gem-guitar-tools
void set_big_y_offset(short pos)
	{

		GRECT c;

		float fpos=(float)pos;
		float per=fpos/1000.0;
		float fydist=(float)total_y_dist;
		
		wind_get(scale_window.handle,WF_WXYWH,&c.g_x,&c.g_y,&c.g_w,&c.g_h);
		big_y_offset=((fydist-(float)c.g_h)*per)*-1.0;
	}
コード例 #26
0
ファイル: MP2EVENT.C プロジェクト: ysei/Atari_ST_Sources
void update_objects(WINDFORM *wind,int obj_id,int depth, int pipe[8])
{
	CORDS2 r,u,o;
	CORDS t;

	if(pipe)
	{
		o.x1=pipe[4];
		o.y1=pipe[5];
		o.x2=pipe[4]+pipe[6]-1;
		o.y2=pipe[5]+pipe[7]-1;
	}

	graf_mouse(M_OFF,0);
	wind_update(BEG_UPDATE);
	wind_get(wind->whandle,WF_FIRSTXYWH,&t.x,&t.y,&t.w,&t.h);
	while(t.w || t.h)
	{
		if(pipe)
		{
			r.x1=t.x;				r.y1=t.y;
			r.x2=t.x+t.w-1;		r.y2=t.y+t.h-1;
			u.x1=max(r.x1,o.x1);	u.y1=max(r.y1,o.y1);
			u.x2=min(r.x2,o.x2);	u.y2=min(r.y2,o.y2);
		}
		else
		{
			u.x1=t.x;				u.y1=t.y;
			u.x2=t.x+t.w-1;		u.y2=t.y+t.h-1;
		}
		
		if((u.x2>=u.x1) && (u.y2>=u.y1)) 
			objc_draw(wind->formtree,obj_id,depth,
				u.x1, u.y1, u.x2-u.x1+1, u.y2-u.y1+1);
		wind_get(wind->whandle,WF_NEXTXYWH,&t.x,&t.y,&t.w,&t.h);
	}
	wind_update(END_UPDATE);
	graf_mouse(M_ON,0);
}
コード例 #27
0
ファイル: blowaccc.c プロジェクト: daemqn/Atari_ST_Sources
/*---------------------------------------------------*/
void quit_all()
{
(void)wind_get(wid,WF_CURRXYWH,&cx,&cy,&cw,&ch);
wind_close(wid);
wind_delete(wid);
open_f=0;
if (!_app) 
	{/* ACCESSORY */ 
	return;
	}
(void)appl_exit();
exit(0);
}
コード例 #28
0
ファイル: gem_init.c プロジェクト: jttkim/jtk-misclibs
int gem_init(int *px, int *py, int *pw, int *ph, int *aes_screenhandle, int *screenhandle, int work_in[], int work_out[])
{
    int ap_id;
    int wc, hc, wb, hb;

    ap_id = appl_init();
    if (ap_id == -1)
    {
        fprintf(stderr, "Error initialising AES process\n");
        getchar();
        exit(1);
    }
#ifdef WND_DEBUG
    wdebug_report = fopen("wndhndlr.dbg", "w");
    sprintf(wdbg_tmpbuf, "wind_set(%1d, WF_NEWDESK, p%p, %d)", 0, (void *) NULL, 0);
    wnd_report(wdbg_tmpbuf);
#endif
    /* wind_set(0, WF_NEWDESK, NULL, 0); */
#ifdef WND_DEBUG
    wnd_report("wind_get");
#endif
    wind_get(0, WF_WORKXYWH, px, py, pw, ph);
    _wndh_gl.dw_x = *px;
    _wndh_gl.dw_y = *py;
    _wndh_gl.dw_w = *pw;
    _wndh_gl.dw_h = *ph;
    *aes_screenhandle = graf_handle(&wc, &hc, &wb, &hb);
    _wndh_gl.aes_screen = *aes_screenhandle;
    work_in[0] = 1;         /* current screen driver */
    work_in[1] = LT_SOLID;  /* line type */
    work_in[2] = BLACK;     /* line color */
    work_in[3] = MT_DOT;    /* marker type */
    work_in[4] = BLACK;     /* marker color */
    work_in[5] = 1;         /* font number (?) */
    work_in[6] = BLACK;     /* text color */
    work_in[7] = FIS_SOLID; /* fill pattern */
    work_in[8] = 1;         /* fill pattern index */
    work_in[9] = BLACK;     /* fill color */
    work_in[10] = 2;        /* RC coordinate system */
    *screenhandle = *aes_screenhandle;
    v_opnvwk(work_in, screenhandle, work_out);
    if (*screenhandle == 0)
    {
        fprintf(stderr, "Error initialising VDI screen workstation\n");
        getchar();
        exit(1);
    }
    _wndh_gl.vwk_screen = *screenhandle;
    graf_mouse(ARROW, NULL);
    return (ap_id);
}
コード例 #29
0
ファイル: FRAME.C プロジェクト: daemqn/Atari_ST_Sources
main()
{
	int gr_mkmx, gr_mkmy;
	int gr_mkmstate, gr_mkkstate;
	int tmpx, tmpy;
	int tmpx1, tmpy1;
	int tmpx2, tmpy2;
	int index, rgb_in[3];
	int draw;

	appl_init();
	phys_handle = graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox);
	wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk);
	open_vwork();
	wi_handle = wind_create(0x0040&0x0080, xdesk, ydesk, wdesk, hdesk);
	graf_mouse(3, 0x0L);
	vswr_mode(handle, 3);
	graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate);
	while(!(0x0002&gr_mkmstate))	{
		graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate);
		if (0x0001&gr_mkmstate)	{
			tmpy = gr_mkmy;
			tmpx = gr_mkmx;
			graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate);
			graf_mouse(M_OFF, 0x0L);
			tmpy1 = gr_mkmy;
			tmpx1 = gr_mkmx;
			drawframe(tmpx, tmpy, tmpx1, tmpy1);
			graf_mouse(M_ON, 0x0L);
			while (0x0001&gr_mkmstate)	{
				graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate);
				if (((tmpx1 != gr_mkmx) || (tmpy1 != gr_mkmy)) &&
					(0x0001&gr_mkmstate))	{
					graf_mouse(M_OFF, 0x0L);
					drawframe(tmpx, tmpy, tmpx1, tmpy1);
					drawframe(tmpx, tmpy, gr_mkmx, gr_mkmy);
					graf_mouse(M_ON, 0x0L);
					tmpy1 = gr_mkmy;
					tmpx1 = gr_mkmx;
				}
			}
			graf_mouse(M_OFF, 0x0L);
			drawframe(tmpx, tmpy, tmpx1, tmpy1);
			graf_mouse(M_ON, 0x0L);
		}
	}
	wind_delete(wi_handle);
	v_clsvwk(handle);
	appl_exit();
}
コード例 #30
0
ファイル: DRIVERS.C プロジェクト: daemqn/Atari_ST_Sources
/* driver_redraw()
 * ================================================================
 */
void
driver_redraw( int *msg )
{
   GRECT area;
   GRECT rect;
   int   clip[4];

   area.g_x = msg[4];
   area.g_y = msg[5];
   area.g_w = msg[6];
   area.g_h = msg[7];

   graf_mouse( M_OFF, 0L );
   wind_get( msg[3], WF_FIRSTXYWH, &rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h );

   while( rect.g_w && rect.g_h )
   {
     if( rc_intersect( &area, &rect ) )
     {
	 rc_2xy( &rect, clip );
	 vs_clip( vhandle, 1, clip );

	 /* Redraw Meta Driver */
#if 0
	 if( gl_meta )
	   do_cross_draw( ad_driver, PMETA2 );

	 /* Redraw Memory Driver */
	 if( gl_mem )
	   do_cross_draw( ad_driver, PMEM2 );	 
#endif
     }
     wind_get( msg[3], WF_NEXTXYWH,&rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h );
   }
   vs_clip( vhandle, 0, clip );
   graf_mouse( M_ON, 0L );
}