ftp.nice.ch/Attic/openStep/implementation/gnustep/sources/objcX-0.87.tgz#/objcX-0.87/dpsclient/dpsGNU.h

This is dpsGNU.h in view mode; [Download] [Up]

/* dpsGNU.h - interface to DPS routines specific to the GNU implementation.
    
   Copyright (C) 1995 Free Software Foundation, Inc.

   Written by:  Adam Fedor <fedor@boulder.colorado.edu>
   Date: Nov 1995
   
   This file is part of the GNU Objective C User interface library.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
   
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   */

#ifndef _dpsGNU_h_INCLUDE
#define _dpsGNU_h_INCLUDE

#include<stdio.h>
#include <Foundation/NSZone.h>
#include "streams/streams.h"
#include "event.h"
#include "dpsclient.h"

/*=== CONSTANTS ===*/

#define NX_CLEAR	0	/* composite operators */
#define NX_COPY		1
#define NX_SOVER	2
#define NX_SIN		3
#define NX_SOUT		4
#define NX_SATOP	5
#define NX_DOVER	6
#define NX_DIN		7
#define NX_DOUT		8
#define NX_DATOP	9
#define NX_XOR		10
#define NX_PLUSD	11
#define NX_HIGHLIGHT	12
#define NX_PLUSL	13		/* not implemented for 1.0 */
#define NX_PLUS		NX_PLUSD	/* for back compatibility. NX_PLUSD
					 * is preferred */

#define NX_DATA		1	/* special values for alpha */
#define NX_ONES		2

#define NX_RETAINED	0	/* A complete offscreen buffer holds */
				/* the obscured parts of the window */
#define NX_NONRETAINED	1	/* Only the screen parts exist */
#define NX_BUFFERED	2	/* Complete offscreen copy exists, */
				/* holds entire contents */

#define	NX_ABOVE	1	/* Place window above reference window */
#define	NX_BELOW	(-1)	/* Place window below reference window */
#define	NX_OUT		0	/* Remove it from screen and window List */

#define NX_FOREVER	(6307200000.0)	/* 200 years of seconds */

#define DPS_ALLCONTEXTS	((DPSContext)-1) /* refers to all existing contexts */


/*=== TYPES ===*/

typedef int (*DPSEventFilterFunc)( NXEvent *ev );
  /* Callback proc for filtering events of a context.  It is passed the
     event just read from the context before it is put in the global
     event queue.  If the proc returns TRUE, the event will be inserted
     into the queue as usual, otherwise it not put in the queue.
  */

typedef struct __DPSTimedEntry *DPSTimedEntry;

typedef void (*DPSTimedEntryProc)(
    DPSTimedEntry te,
    double now,
    void *userData );
  /* Callback proc for timed entries registered by DPSAddTimedEntry. */

typedef void (*DPSFDProc)( int fd, void *userData );
  /* Callback proc for fds registered by DPSAddFD. */

typedef void (*DPSPingProc)(DPSContext ctxt, void *userData);
  /* Callback proc for DPSAsynchronousWaitContext. */

extern void DPSAsynchronousWaitContext(DPSContext ctxt, DPSPingProc handler, void *userData);
  /* Calls handler when all PS code has been processed for this context. */

/*=== PROCEDURES ===*/

extern DPSContext DPSCreateContext(
    const char *hostName,
    const char *serverName,
    DPSTextProc textProc,
    DPSErrorProc errorProc );
  /* Creates a connection to the window server with default timeout. */

extern DPSContext DPSCreateContextWithTimeoutFromZone(
    const char *hostName,
    const char *serverName,
    DPSTextProc textProc,
    DPSErrorProc errorProc,
    int timeout,
    NSZone *zone );
  /* Creates a connection to the window server with specified ms timeout. */

extern DPSContext DPSCreateNonsecureContext(
    const char *hostName,
    const char *serverName,
    DPSTextProc textProc,
    DPSErrorProc errorProc,
    int timeout,
    NSZone *zone );
  /* Creates a non secure connection to the window server. */

extern DPSContext DPSCreateStreamContext(
    NXStream *st,
    int debugging,
    DPSProgramEncoding progEnc,
    DPSNameEncoding nameEnc,
    DPSErrorProc errorProc );
  /* Creates a context that writes to a NXStream. */

#define DPSFlush()	DPSFlushContext(DPSGetCurrentContext())
  /* Flushes the current connection */

extern int DPSSetTracking( int flag );
  /* Enables or disables the coalescing of mouse events. */

extern void DPSStartWaitCursorTimer(void);
  /* Starts the wait cursor timeout.  To be used before a time-consuming
     operations that is NOT initiated by a user event.
   */

extern DPSTimedEntry DPSAddTimedEntry(
    double period,
    DPSTimedEntryProc handler,
    void *userData,
    int priority );
  /* Creates a timed entry. */

extern void DPSRemoveTimedEntry( DPSTimedEntry te );
  /* Destroys a timed entry. */

extern void DPSAddFD(
    int fd,
    DPSFDProc routine,
    void *data,
    int priority );
  /* Adds a file descriptor to be listened to. */

extern void DPSRemoveFD( int fd );
  /* Removes a file descriptor previously added. */

extern void DPSSetDeadKeysEnabled(DPSContext ctxt, int flag);
  /* Enables and disabled dead key processing for a context's events. */

extern DPSEventFilterFunc DPSSetEventFunc(
    DPSContext ctxt,
    DPSEventFilterFunc func );
  /* Installs a function to filter events from a given context. */

extern int _DPSGetOrPeekEvent( DPSContext ctxt, NXEvent *eventStorage,
			int mask, double wait, int threshold, int peek );
#define DPSGetEvent( ctxt, evPtr, mask, timeout, thresh )	\
	_DPSGetOrPeekEvent( (ctxt), (evPtr), (mask), (timeout), (thresh), 0 )
  /* Finds a matching event, removing it from the queue. */

#define DPSPeekEvent( ctxt, evPtr, mask, timeout, thresh )	\
	_DPSGetOrPeekEvent( (ctxt), (evPtr), (mask), (timeout), (thresh), 1 )
  /* Finds a matching event, but does not remove it from the queue. */

extern int DPSPostEvent( NXEvent *event, int atStart );
  /* Posts an event to the front or back of the client side event queue. */

extern void DPSDiscardEvents( DPSContext ctxt, int mask );
  /* Removes matching events from the event queue.  DPS_ALLCONTEXTS can
     be used as the first argument to match to all contexts.
   */

extern int DPSTraceContext( DPSContext ctxt, int flag );
  /* Turns on and off debugging tracing of a context's input and output.
     DPS_ALLCONTEXTS can be used as the first argument to match to
     all contexts.
   */

void DPSTraceEvents(DPSContext ctxt, int flag);
  /* Turns on and off debugging tracing of the events a context receives.
     DPS_ALLCONTEXTS can be used as the first argument to match to
     all contexts.
   */

void DPSSendEOF(DPSContext ctxtArg);
  /* sends an EOF marker to the context */

#endif

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.