19974adabSmrg/*
29974adabSmrg * Copyright 2012 Red Hat, Inc.
39974adabSmrg *
49974adabSmrg * Permission is hereby granted, free of charge, to any person obtaining a
59974adabSmrg * copy of this software and associated documentation files (the "Software"),
69974adabSmrg * to deal in the Software without restriction, including without limitation
79974adabSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
89974adabSmrg * and/or sell copies of the Software, and to permit persons to whom the
99974adabSmrg * Software is furnished to do so, subject to the following conditions:
109974adabSmrg *
119974adabSmrg * The above copyright notice and this permission notice (including the next
129974adabSmrg * paragraph) shall be included in all copies or substantial portions of the
139974adabSmrg * Software.
149974adabSmrg *
159974adabSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
169974adabSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
179974adabSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
189974adabSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
199974adabSmrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
209974adabSmrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
219974adabSmrg * DEALINGS IN THE SOFTWARE.
229974adabSmrg *
239974adabSmrg * Author: Dave Airlie <airlied@redhat.com>
249974adabSmrg */
259974adabSmrg
269974adabSmrg/* this file provides API compat between server post 1.13 and pre it,
279974adabSmrg   it should be reused inside as many drivers as possible */
289974adabSmrg#ifndef COMPAT_API_H
299974adabSmrg#define COMPAT_API_H
309974adabSmrg
319974adabSmrg#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
329974adabSmrg#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
339974adabSmrg#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
349974adabSmrg#endif
359974adabSmrg
369974adabSmrg#ifndef XF86_HAS_SCRN_CONV
379974adabSmrg#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
389974adabSmrg#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
399974adabSmrg#endif
409974adabSmrg
419974adabSmrg#ifndef XF86_SCRN_INTERFACE
429974adabSmrg
439974adabSmrg#define SCRN_ARG_TYPE int
449974adabSmrg#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
459974adabSmrg
469974adabSmrg#define SCREEN_ARG_TYPE int
479974adabSmrg#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
489974adabSmrg
499974adabSmrg#define SCREEN_INIT_ARGS_DECL int scrnIndex, ScreenPtr pScreen, int argc, char **argv
509974adabSmrg
519974adabSmrg#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
529974adabSmrg#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
539974adabSmrg
549974adabSmrg#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
559974adabSmrg#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
569974adabSmrg
579974adabSmrg#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
589974adabSmrg#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0
599974adabSmrg
609974adabSmrg#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
619974adabSmrg#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0
629974adabSmrg
639974adabSmrg#define FREE_SCREEN_ARGS_DECL int arg, int flags
649974adabSmrg
659974adabSmrg#define VT_FUNC_ARGS_DECL int arg, int flags
669974adabSmrg#define VT_FUNC_ARGS pScrn->scrnIndex, 0
679974adabSmrg
689974adabSmrg#define XF86_SCRN_ARG(x) ((x)->scrnIndex)
699974adabSmrg#else
709974adabSmrg#define SCRN_ARG_TYPE ScrnInfoPtr
719974adabSmrg#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
729974adabSmrg
739974adabSmrg#define SCREEN_ARG_TYPE ScreenPtr
749974adabSmrg#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
759974adabSmrg
769974adabSmrg#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
779974adabSmrg
789974adabSmrg#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
799974adabSmrg#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
809974adabSmrg
819974adabSmrg#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
829974adabSmrg#define CLOSE_SCREEN_ARGS pScreen
839974adabSmrg
849974adabSmrg#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
859974adabSmrg#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y
869974adabSmrg
879974adabSmrg#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
889974adabSmrg#define SWITCH_MODE_ARGS(arg, m) arg, m
899974adabSmrg
909974adabSmrg#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
919974adabSmrg
929974adabSmrg#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
939974adabSmrg#define VT_FUNC_ARGS pScrn
949974adabSmrg
959974adabSmrg#define XF86_SCRN_ARG(x) (x)
969974adabSmrg
979974adabSmrg#endif
989974adabSmrg
999974adabSmrg#endif
100