1*bbb1b6f9SApple OSS Distributions /* 2*bbb1b6f9SApple OSS Distributions * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3*bbb1b6f9SApple OSS Distributions * 4*bbb1b6f9SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5*bbb1b6f9SApple OSS Distributions * 6*bbb1b6f9SApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code 7*bbb1b6f9SApple OSS Distributions * as defined in and that are subject to the Apple Public Source License 8*bbb1b6f9SApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in 9*bbb1b6f9SApple OSS Distributions * compliance with the License. The rights granted to you under the License 10*bbb1b6f9SApple OSS Distributions * may not be used to create, or enable the creation or redistribution of, 11*bbb1b6f9SApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to 12*bbb1b6f9SApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any 13*bbb1b6f9SApple OSS Distributions * terms of an Apple operating system software license agreement. 14*bbb1b6f9SApple OSS Distributions * 15*bbb1b6f9SApple OSS Distributions * Please obtain a copy of the License at 16*bbb1b6f9SApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file. 17*bbb1b6f9SApple OSS Distributions * 18*bbb1b6f9SApple OSS Distributions * The Original Code and all software distributed under the License are 19*bbb1b6f9SApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20*bbb1b6f9SApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21*bbb1b6f9SApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22*bbb1b6f9SApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23*bbb1b6f9SApple OSS Distributions * Please see the License for the specific language governing rights and 24*bbb1b6f9SApple OSS Distributions * limitations under the License. 25*bbb1b6f9SApple OSS Distributions * 26*bbb1b6f9SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27*bbb1b6f9SApple OSS Distributions */ 28*bbb1b6f9SApple OSS Distributions /* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. 29*bbb1b6f9SApple OSS Distributions * 30*bbb1b6f9SApple OSS Distributions * kmreg_com.h - machine independent km ioctl interface. 31*bbb1b6f9SApple OSS Distributions * 32*bbb1b6f9SApple OSS Distributions * HISTORY 33*bbb1b6f9SApple OSS Distributions * 16-Jan-92 Doug Mitchell at NeXT 34*bbb1b6f9SApple OSS Distributions * Created. 35*bbb1b6f9SApple OSS Distributions */ 36*bbb1b6f9SApple OSS Distributions 37*bbb1b6f9SApple OSS Distributions #ifdef KERNEL_PRIVATE 38*bbb1b6f9SApple OSS Distributions 39*bbb1b6f9SApple OSS Distributions #ifndef _BSD_DEV_KMREG_COM_ 40*bbb1b6f9SApple OSS Distributions #define _BSD_DEV_KMREG_COM_ 41*bbb1b6f9SApple OSS Distributions 42*bbb1b6f9SApple OSS Distributions #include <sys/types.h> 43*bbb1b6f9SApple OSS Distributions #include <sys/ioctl.h> 44*bbb1b6f9SApple OSS Distributions 45*bbb1b6f9SApple OSS Distributions /* 46*bbb1b6f9SApple OSS Distributions * Colors for fg, bg in struct km_drawrect 47*bbb1b6f9SApple OSS Distributions */ 48*bbb1b6f9SApple OSS Distributions #define KM_COLOR_WHITE 0 49*bbb1b6f9SApple OSS Distributions #define KM_COLOR_LTGRAY 1 50*bbb1b6f9SApple OSS Distributions #define KM_COLOR_DKGRAY 2 51*bbb1b6f9SApple OSS Distributions #define KM_COLOR_BLACK 3 52*bbb1b6f9SApple OSS Distributions 53*bbb1b6f9SApple OSS Distributions /* 54*bbb1b6f9SApple OSS Distributions * The data to be rendered is treated as a pixmap of 2 bit pixels. 55*bbb1b6f9SApple OSS Distributions * The most significant bits of each byte is the leftmost pixel in that 56*bbb1b6f9SApple OSS Distributions * byte. Pixel values are assigned as described above. 57*bbb1b6f9SApple OSS Distributions * 58*bbb1b6f9SApple OSS Distributions * Each scanline should start on a 4 pixel boundry within the bitmap, 59*bbb1b6f9SApple OSS Distributions * and should be a multiple of 4 pixels in length. 60*bbb1b6f9SApple OSS Distributions * 61*bbb1b6f9SApple OSS Distributions * For the KMIOCERASERECT call, 'data' should be an integer set to the 62*bbb1b6f9SApple OSS Distributions * color to be used for the clear operation (data.fill). 63*bbb1b6f9SApple OSS Distributions * A rect at (x,y) measuring 'width' by 'height' will be cleared to 64*bbb1b6f9SApple OSS Distributions * the specified value. 65*bbb1b6f9SApple OSS Distributions */ 66*bbb1b6f9SApple OSS Distributions struct km_drawrect { 67*bbb1b6f9SApple OSS Distributions unsigned short x; /* Upper left corner of rect to be imaged. */ 68*bbb1b6f9SApple OSS Distributions unsigned short y; 69*bbb1b6f9SApple OSS Distributions unsigned short width; /* Width and height of rect to be imaged, 70*bbb1b6f9SApple OSS Distributions * in pixels */ 71*bbb1b6f9SApple OSS Distributions unsigned short height; 72*bbb1b6f9SApple OSS Distributions union { 73*bbb1b6f9SApple OSS Distributions void *bits; /* Pointer to 2 bit per pixel raster data. */ 74*bbb1b6f9SApple OSS Distributions int fill; /* Const color for erase operation. */ 75*bbb1b6f9SApple OSS Distributions } data; 76*bbb1b6f9SApple OSS Distributions }; 77*bbb1b6f9SApple OSS Distributions 78*bbb1b6f9SApple OSS Distributions /* 79*bbb1b6f9SApple OSS Distributions * Argument to KMIOCANIMCTL. 80*bbb1b6f9SApple OSS Distributions */ 81*bbb1b6f9SApple OSS Distributions typedef enum { 82*bbb1b6f9SApple OSS Distributions KM_ANIM_STOP, /* stop permanently */ 83*bbb1b6f9SApple OSS Distributions KM_ANIM_SUSPEND, /* suspend */ 84*bbb1b6f9SApple OSS Distributions KM_ANIM_RESUME /* resume */ 85*bbb1b6f9SApple OSS Distributions } km_anim_ctl_t; 86*bbb1b6f9SApple OSS Distributions 87*bbb1b6f9SApple OSS Distributions #define KMIOCPOPUP _IO('k', 1) /* popup new window */ 88*bbb1b6f9SApple OSS Distributions #define KMIOCRESTORE _IO('k', 2) /* restore background */ 89*bbb1b6f9SApple OSS Distributions #define KMIOCDUMPLOG _IO('k', 3) /* dump message log */ 90*bbb1b6f9SApple OSS Distributions #define KMIOCDRAWRECT _IOW('k', 5, struct km_drawrect) /* Draw rect from 91*bbb1b6f9SApple OSS Distributions * bits */ 92*bbb1b6f9SApple OSS Distributions #define KMIOCERASERECT _IOW('k', 6, struct km_drawrect) /* Erase a rect */ 93*bbb1b6f9SApple OSS Distributions 94*bbb1b6f9SApple OSS Distributions #ifdef KERNEL_PRIVATE 95*bbb1b6f9SApple OSS Distributions #define KMIOCDISABLCONS _IO('k', 8) /* disable console messages */ 96*bbb1b6f9SApple OSS Distributions #endif /* KERNEL_PRIVATE */ 97*bbb1b6f9SApple OSS Distributions 98*bbb1b6f9SApple OSS Distributions #define KMIOCANIMCTL _IOW('k',9, km_anim_ctl_t) 99*bbb1b6f9SApple OSS Distributions /* stop animation */ 100*bbb1b6f9SApple OSS Distributions #define KMIOCSTATUS _IOR('k',10, int) /* get status bits */ 101*bbb1b6f9SApple OSS Distributions #define KMIOCSIZE _IOR('k',11, struct winsize) /* get screen size */ 102*bbb1b6f9SApple OSS Distributions 103*bbb1b6f9SApple OSS Distributions /* 104*bbb1b6f9SApple OSS Distributions * Status bits returned via KMIOCSTATUS. 105*bbb1b6f9SApple OSS Distributions */ 106*bbb1b6f9SApple OSS Distributions #define KMS_SEE_MSGS 0x00000001 107*bbb1b6f9SApple OSS Distributions 108*bbb1b6f9SApple OSS Distributions #endif /* _BSD_DEV_KMREG_COM_ */ 109*bbb1b6f9SApple OSS Distributions 110*bbb1b6f9SApple OSS Distributions #endif /* KERNEL_PRIVATE */ 111