amops.h 5.95 KB
/*
 * amops.h
 *
 * Copyright 1994, Silicon Graphics, Inc.
 * All Rights Reserved.
 *
 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
 * the contents of this file may not be disclosed to third parties, copied or
 * duplicated in any form, in whole or in part, without the prior written
 * permission of Silicon Graphics, Inc.
 *
 * RESTRICTED RIGHTS LEGEND:
 * Use, duplication or disclosure by the Government is subject to restrictions
 * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
 * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
 * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
 * rights reserved under the Copyright Laws of the United States.
 */

#ifndef __TV_appmgr_operations_h_
#define __TV_appmgr_operations_h_

#include <amkern.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __TV_DEBUG
#define DPRINTF(ARG) printf ARG
#else
#define DPRINTF(ARG)
#endif

typedef TVuchar Bool;

/* Messages to and within the application manager (0x0080 to 0x00af) */
#define TV_MSG_ABORT			0x0080
#define TV_MSG_PIN_STATE		0x0081
#define TV_MSG_NUMERIC_INPUT		0x0082
#define TV_MSG_RUN_APPLICATION		0x0083
#define TV_MSG_HELPER			0x0084
#define TV_MSG_ID_REGISTRY		0x0085
#define TV_MSG_GEN_SESSION_TOKEN	0x0086
#define TV_MSG_TIME_ZONE		0x0087
#define TV_MSG_RETURN_COMMAND		0x0088
#define TV_MSG_SWAP_BUFFERS		0x0089
#define TV_MSG_OVERLAY			0x008a
#define TV_MSG_USER_INPUT		0x008b
#define TV_MSG_GET_USER_DATA		0x008c
#define TV_MSG_CABLE_BOX		0x008d
#define TV_MSG_MAIN_RENDERER		0x008e
#define TV_MSG_TUNE_ANALOG		0x008f
#define TV_MSG_REMOVE_RENDERER		0x0090
#define TV_MSG_TUNE_ATM			0x0091
#define TV_MSG_PROGRAM_NAME		0x0092
#define TV_MSG_SESSION_START		0x0093
#define TV_MSG_GIVE_USER_DATA		0x0094
#define TV_MSG_INFO_COMPLETE		0x0095
#define TV_MSG_NEW_APP			0x0096
#define TV_MSG_WRITE_LED		0x0097
#define TV_MSG_GRAB_REMOTE		0x0098
#define TV_MSG_DO_RETURN		0x0099
#define TV_MSG_BOOKMARK			0x009a
#define TV_MSG_CHANNEL_BLOCK		0x009b
#define TV_MSG_SET_FUSE			0x009c
#define TV_MSG_GET_ARGS			0x009d
#define TV_MSG_USER_NMTRAP		0x009e
#define TV_MSG_MPEG_MIXER		0x009f
#define TV_MSG_CC_BYPASS		0x00a0
#define TV_MSG_MACRO_VISION		0x00a1
#define TV_MSG_POWER			0x00a2
#define TV_MSG_BLINK_MSG_LED		0x00a3
#define TV_MSG_DECRYPT_BUFFER		0x00a4
#define TV_MSG_RETUNE			0x00a5
#define TV_MSG_ANALOG_OPTIONS		0x00a6
#define TV_MSG_SET_NAME			0x00a8
#define TV_MSG_SYNCHRONIZE		0x00a9

/* last message				0x00af */

/*
 * generic functions for "simple" messages
 */
#define TV_AM_QUERY	0
#define TV_AM_ON	1
#define TV_AM_DEFINE	TV_AM_ON
#define TV_AM_OFF	2
#define TV_AM_DELETE	TV_AM_OFF
#define TV_AM_REQUEST	3
#define TV_AM_REBOOT	4
/*
 * functions for helper messages
 */
#define TV_HELPER_PROMOTE   1
#define TV_HELPER_DESTROY   2
#define TV_HELPER_GET_ID    3

/*
 * flags passed in TVAppMgrClientMsgStr.run record
 */
#define TV_RUN_FLAG_STOPPED	    0x01
#define TV_RUN_FLAG_NAVIGATOR	    0x02

/*
 * all messages from client to app mgr have clients ID in 2nd word
 */

typedef struct {
    TVuchar		why;
    TVuchar		helper;
    TVuchar		count;
    TVuchar		flags;
    unsigned short	transition;
    short		channel;
    TVuchar		lengths[16];	    /* includes the trailing null */
    char		*strings;
} TVAMCommand;

typedef union  {
    struct {
	TVushort	type;
	TVuchar		client;
	unsigned char	func;
	TVid		id;
	char		name[TV_NAME_SIZE];
    } simple;
    struct {
	TVushort	type;
	TVuchar		client;
	TVuchar		func;
	TVTime		time;
    } power;
    struct {
	TVushort	type;
	TVuchar		client;
	TVuchar		func;
	TVAnalogOptions	options;
    } analog;
    struct {
	TVushort	type;
	TVuchar		client;
	TVuchar		status;
	short		why;
	short		chan;
    } tuning;
    struct {
	TVushort	type;
	TVuchar		client;
	TVuchar		func;
	int		transition;
	int		helper;
    } helper;
    struct {
	TVushort	type;
	TVuchar		client;
	unsigned char	func;
	int		x;
	int		y;
    } panel;
    struct {
	TVushort	type;
	TVuchar		client;
	unsigned char	pad;
	TVid		id;
	TVTime		time;
    } fuse;
    struct {
	TVushort	type;
	TVuchar		client;
	TVuchar		func;
	char *		value;
	char		attribute[TV_NAME_SIZE];
    } userdata;
    struct {
	TVushort	type;
	TVuchar		client;
	TVAMCommand	cmd;
    } run;
    struct {
	TVushort	type;
	TVuchar		client;
	TVuchar		why;
	TVuchar		flags;
				/* cmdLine == transition == count == 0 */
	char		appName[TV_NAME_SIZE];
    } debugRun;
    struct {
	TVushort	type;
	TVuchar		client;
	unsigned char	level;
	TVid		notify;
	int		cost;
    } overlay;
    struct {
	TVushort	type;
	TVuchar		client;
	short		secondsWest;
	short		isDST;
    } timezone;
    struct {
	TVushort	type;
	TVuchar		client;
	float		portion;
    } mpegMix;
    struct {
	TVushort	type;
	TVuchar		client;
	unsigned char	ret;
	int		length;
	union {
	    int		contentLength;
	    int		serial;
	}u;
	void*		buffer;
    } buffer;
    struct {
	TVushort	type;
	TVushort	pad;
	TVuchar		sessionToken[18];
    } tokenReply;
    struct {
	TVushort	type;
	TVuchar		client;
	TVuchar		pad;
	TVPrincipalId	acceptorID;
        TVulong         initDate;
	TVuchar		sessionKey[8];
    } tokenRequest;
    struct {
	TVushort	type;
	TVuchar		client;
	unsigned char	tuner;
	unsigned int 	frequency;
    } tune;
    struct {
    /*
     * createBM must be same basic shape as createBookmark
     * structure in rkfsn.h
     */
	TVushort	type;
	TVuchar		client;
	unsigned char	func;
	TVlong		id;
	TVuchar		service[TV_NAME_SIZE];
    } createBM;
    struct {
	TVushort	type;
	TVuchar		client;
	unsigned char	redrawInterval;
	TVid		notify;
    } main;
    TVMessage base;
    TVAppMgrMsg amm;
} TVAppMgrClientMsg;

#define TV_AM_LOG_STANDARD_TIME		0
#define TV_AM_LOG_DAYLIGHT_SAVINGS	1
#define TV_AM_LOG_SET_MASK		2
#define TV_AM_LOG_CLEAR_MASK		3
#define TV_AM_LOG_SET_RATE		4
#define TV_AM_LOG_CONTROL		5

#define TV_AM_LOG_SIGNATURE		0xabadfade
#define TV_AM_LOG_PORT			22847

typedef struct {
    short   serial;
    short   bytes;
} TVAppMgrLogHeader;

#ifdef __cplusplus
}
#endif

#endif /* __TV_appmgr_operations_h_ */