~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/hw/darwin/darwin.h

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
 
3
 *
 
4
 * Permission is hereby granted, free of charge, to any person obtaining a
 
5
 * copy of this software and associated documentation files (the "Software"),
 
6
 * to deal in the Software without restriction, including without limitation
 
7
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
8
 * and/or sell copies of the Software, and to permit persons to whom the
 
9
 * Software is furnished to do so, subject to the following conditions:
 
10
 *
 
11
 * The above copyright notice and this permission notice shall be included in
 
12
 * all copies or substantial portions of the Software.
 
13
 *
 
14
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
15
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
16
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 
17
 * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
18
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
19
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
20
 * DEALINGS IN THE SOFTWARE.
 
21
 *
 
22
 * Except as contained in this notice, the name(s) of the above copyright
 
23
 * holders shall not be used in advertising or otherwise to promote the sale,
 
24
 * use or other dealings in this Software without prior written authorization.
 
25
 */
 
26
/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.15 2002/12/10 00:00:38 torrey Exp $ */
 
27
 
 
28
#ifndef _DARWIN_H
 
29
#define _DARWIN_H
 
30
 
 
31
#include <IOKit/IOTypes.h>
 
32
#include "inputstr.h"
 
33
#include "screenint.h"
 
34
#include "extensions/XKB.h"
 
35
#include "quartz/quartzShared.h"
 
36
 
 
37
typedef struct {
 
38
    void                *framebuffer;
 
39
    int                 x;
 
40
    int                 y;
 
41
    int                 width;
 
42
    int                 height;
 
43
    int                 pitch;
 
44
    int                 colorType;
 
45
    int                 bitsPerPixel;
 
46
    int                 colorBitsPerPixel;
 
47
    int                 bitsPerComponent;
 
48
} DarwinFramebufferRec, *DarwinFramebufferPtr;
 
49
 
 
50
 
 
51
void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
 
52
 
 
53
// From darwinEvents.c
 
54
Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
 
55
void DarwinEQEnqueue(const xEvent *e);
 
56
void DarwinEQPointerPost(xEvent *e);
 
57
void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
 
58
 
 
59
// From darwinKeyboard.c
 
60
int DarwinModifierNXKeyToNXKeycode(int key, int side);
 
61
void DarwinKeyboardInit(DeviceIntPtr pDev);
 
62
int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide);
 
63
int DarwinModifierNXKeyToNXMask(int key);
 
64
int DarwinModifierNXMaskToNXKey(int mask);
 
65
int DarwinModifierStringToNXKey(const char *string);
 
66
 
 
67
#undef assert
 
68
#define assert(x) { if ((x) == 0) \
 
69
    FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
 
70
#define kern_assert(x) { if ((x) != KERN_SUCCESS) \
 
71
    FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \
 
72
                __LINE__, __FILE__, x); }
 
73
#define SCREEN_PRIV(pScreen) \
 
74
    ((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr)
 
75
 
 
76
 
 
77
#define MIN_KEYCODE XkbMinLegalKeyCode     // unfortunately, this isn't 0...
 
78
 
 
79
/*
 
80
 * Global variables from darwin.c
 
81
 */
 
82
extern int              darwinScreenIndex; // index into pScreen.devPrivates
 
83
extern int              darwinScreensFound;
 
84
extern io_connect_t     darwinParamConnect;
 
85
extern int              darwinEventFD;
 
86
extern Bool             quartz;
 
87
 
 
88
/*
 
89
 * Special ddx events understood by the X server
 
90
 */
 
91
enum {
 
92
  kXDarwinUpdateModifiers   // update all modifier keys
 
93
            = LASTEvent+1,  // (from X.h list of event names)
 
94
  kXDarwinUpdateButtons,    // update state of mouse buttons 2 and up
 
95
  kXDarwinScrollWheel,      // scroll wheel event
 
96
  kXDarwinShow,             // vt switch to X server;
 
97
                            // recapture screen and restore X drawing
 
98
  kXDarwinHide,             // vt switch away from X server;
 
99
                            // release screen and clip X drawing
 
100
  kXDarwinSetRootClip,      // enable or disable drawing to the X screen
 
101
  kXDarwinQuit,             // kill the X server and release the display
 
102
  kXDarwinReadPasteboard,   // copy Mac OS X pasteboard into X cut buffer
 
103
  kXDarwinWritePasteboard   // copy X cut buffer onto Mac OS X pasteboard
 
104
};
 
105
 
 
106
#endif  /* _DARWIN_H */