Path: blob/master/utils/xorg-deps/xf86-video-dummy/v0.3.8/src/compat-api.h
1013 views
/*1* Copyright 2012 Red Hat, Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER20* DEALINGS IN THE SOFTWARE.21*22* Author: Dave Airlie <[email protected]>23*/2425/* this file provides API compat between server post 1.13 and pre it,26it should be reused inside as many drivers as possible */27#ifndef COMPAT_API_H28#define COMPAT_API_H2930#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR31#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]32#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p33#endif3435#ifndef XF86_HAS_SCRN_CONV36#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]37#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]38#endif3940#ifndef XF86_SCRN_INTERFACE4142#define SCRN_ARG_TYPE int43#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]4445#define SCREEN_ARG_TYPE int46#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]4748#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv4950#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask51#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask5253#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen54#define CLOSE_SCREEN_ARGS scrnIndex, pScreen5556#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags57#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 05859#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags60#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 06162#define FREE_SCREEN_ARGS_DECL int arg, int flags63#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 06465#define VT_FUNC_ARGS_DECL int arg, int flags66#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)6768#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)69#else70#define SCRN_ARG_TYPE ScrnInfoPtr71#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)7273#define SCREEN_ARG_TYPE ScreenPtr74#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)7576#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv7778#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask79#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask8081#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen82#define CLOSE_SCREEN_ARGS pScreen8384#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y85#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y8687#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode88#define SWITCH_MODE_ARGS(arg, m) arg, m8990#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg91#define FREE_SCREEN_ARGS(x) (x)9293#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg94#define VT_FUNC_ARGS(flags) pScrn9596#define XF86_ENABLEDISABLEFB_ARG(x) (x)9798#endif99100#endif101102103