XQuartz: Cleanup for strict-prototyping
Also fixed DarwinEQEnqueue to match changes to the callback And also use dpmsstubs.c rather than copying the code into darwin.c (cherry picked from commit 4c5c30a4beb7a427b00b18097f548876ad3c11d7)
This commit is contained in:
parent
11967dce11
commit
7d226d6a25
|
@ -19,6 +19,7 @@ DIST_SUBDIRS = xpr bundle
|
||||||
libXquartz_la_SOURCES = \
|
libXquartz_la_SOURCES = \
|
||||||
$(top_srcdir)/fb/fbcmap_mi.c \
|
$(top_srcdir)/fb/fbcmap_mi.c \
|
||||||
$(top_srcdir)/mi/miinitext.c \
|
$(top_srcdir)/mi/miinitext.c \
|
||||||
|
$(top_srcdir)/Xext/dpmsstubs.c \
|
||||||
X11Application.m \
|
X11Application.m \
|
||||||
X11Controller.m \
|
X11Controller.m \
|
||||||
applewm.c \
|
applewm.c \
|
||||||
|
|
|
@ -855,7 +855,7 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
||||||
NSWindow *window;
|
NSWindow *window;
|
||||||
int pointer_x, pointer_y, ev_button, ev_type;
|
int pointer_x, pointer_y, ev_button, ev_type;
|
||||||
// int num_events=0, i=0, state;
|
// int num_events=0, i=0, state;
|
||||||
xEvent xe;
|
// xEvent xe;
|
||||||
|
|
||||||
/* convert location to global top-left coordinates */
|
/* convert location to global top-left coordinates */
|
||||||
location = [e locationInWindow];
|
location = [e locationInWindow];
|
||||||
|
|
|
@ -264,8 +264,7 @@ WMFreeEvents (data, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcAppleWMSelectInput (client)
|
ProcAppleWMSelectInput (register ClientPtr client)
|
||||||
register ClientPtr client;
|
|
||||||
{
|
{
|
||||||
REQUEST(xAppleWMSelectInputReq);
|
REQUEST(xAppleWMSelectInputReq);
|
||||||
WMEventPtr pEvent, pNewEvent, *pHead;
|
WMEventPtr pEvent, pNewEvent, *pHead;
|
||||||
|
@ -479,13 +478,11 @@ ProcAppleWMSetFrontProcess(
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcAppleWMSetWindowLevel(
|
ProcAppleWMSetWindowLevel(register ClientPtr client)
|
||||||
register ClientPtr client
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
REQUEST(xAppleWMSetWindowLevelReq);
|
REQUEST(xAppleWMSetWindowLevelReq);
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
int errno;
|
int err;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
|
REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
|
||||||
|
|
||||||
|
@ -497,9 +494,9 @@ ProcAppleWMSetWindowLevel(
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
errno = appleWMProcs->SetWindowLevel(pWin, stuff->level);
|
err = appleWMProcs->SetWindowLevel(pWin, stuff->level);
|
||||||
if (errno != Success) {
|
if (err != Success) {
|
||||||
return errno;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (client->noClientException);
|
return (client->noClientException);
|
||||||
|
|
|
@ -879,24 +879,6 @@ void AbortDDX( void )
|
||||||
ddxGiveUp();
|
ddxGiveUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* DPMS extension stubs
|
|
||||||
*/
|
|
||||||
Bool DPMSSupported(void)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DPMSSet(int level)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int DPMSGet(int *level)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "mivalidate.h" // for union _Validate used by windowstr.h
|
#include "mivalidate.h" // for union _Validate used by windowstr.h
|
||||||
#include "windowstr.h" // for struct _Window
|
#include "windowstr.h" // for struct _Window
|
||||||
#include "scrnintstr.h" // for struct _Screen
|
#include "scrnintstr.h" // for struct _Screen
|
||||||
|
|
|
@ -45,6 +45,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include "darwin.h"
|
#include "darwin.h"
|
||||||
#include "quartz.h"
|
#include "quartz.h"
|
||||||
#include "darwinKeyboard.h"
|
#include "darwinKeyboard.h"
|
||||||
|
#include "darwinEvents.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
@ -213,9 +214,8 @@ Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) {
|
||||||
*
|
*
|
||||||
* This should be deprecated in favor of miEQEnqueue -- BB
|
* This should be deprecated in favor of miEQEnqueue -- BB
|
||||||
*/
|
*/
|
||||||
void DarwinEQEnqueue(const xEvent *e) {
|
void DarwinEQEnqueue(const xEventPtr e) {
|
||||||
HWEventQueueType oldtail, newtail;
|
HWEventQueueType oldtail, newtail;
|
||||||
char byte = 0;
|
|
||||||
|
|
||||||
oldtail = darwinEventQueue.tail;
|
oldtail = darwinEventQueue.tail;
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ void DarwinEQEnqueue(const xEvent *e) {
|
||||||
* DarwinEQPointerPost
|
* DarwinEQPointerPost
|
||||||
* Post a pointer event. Used by the mipointer.c routines.
|
* Post a pointer event. Used by the mipointer.c routines.
|
||||||
*/
|
*/
|
||||||
void DarwinEQPointerPost(xEvent *e) {
|
void DarwinEQPointerPost(DeviceIntPtr pdev, xEventPtr e) {
|
||||||
(*darwinEventQueue.pPtr->processInputProc)
|
(*darwinEventQueue.pPtr->processInputProc)
|
||||||
(e, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
|
(e, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,6 @@ void ProcessInputEvents(void) {
|
||||||
EventRec *e;
|
EventRec *e;
|
||||||
int x, y;
|
int x, y;
|
||||||
xEvent xe;
|
xEvent xe;
|
||||||
static int old_flags = 0; // last known modifier state
|
|
||||||
// button number and modifier mask of currently pressed fake button
|
// button number and modifier mask of currently pressed fake button
|
||||||
input_check_flag=0;
|
input_check_flag=0;
|
||||||
|
|
||||||
|
|
|
@ -28,12 +28,13 @@
|
||||||
#define _DARWIN_EVENTS_H
|
#define _DARWIN_EVENTS_H
|
||||||
|
|
||||||
Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
|
Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
|
||||||
void DarwinEQEnqueue(const xEvent *e);
|
void DarwinEQEnqueue(const xEventPtr e);
|
||||||
void DarwinEQPointerPost(xEvent *e);
|
void DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e);
|
||||||
void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
|
void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
|
||||||
void DarwinPokeEQ(void);
|
void DarwinPokeEQ(void);
|
||||||
void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y);
|
void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y);
|
||||||
void DarwinSendKeyboardEvents(int ev_type, int keycode);
|
void DarwinSendKeyboardEvents(int ev_type, int keycode);
|
||||||
void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y);
|
void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y);
|
||||||
|
void DarwinUpdateModKeys(int flags);
|
||||||
|
|
||||||
#endif /* _DARWIN_EVENTS_H */
|
#endif /* _DARWIN_EVENTS_H */
|
||||||
|
|
|
@ -330,7 +330,7 @@ static void parse_next_char_code(DataStream *s, KeySym *k) {
|
||||||
* DarwinReadKeymapFile
|
* DarwinReadKeymapFile
|
||||||
* Read the appropriate keymapping from a keymapping file.
|
* Read the appropriate keymapping from a keymapping file.
|
||||||
*/
|
*/
|
||||||
Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
|
static Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
NXEventSystemDevice info[20];
|
NXEventSystemDevice info[20];
|
||||||
int interface = 0, handler_id = 0;
|
int interface = 0, handler_id = 0;
|
||||||
|
@ -439,7 +439,7 @@ Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
|
||||||
/*
|
/*
|
||||||
* DarwinParseNXKeyMapping
|
* DarwinParseNXKeyMapping
|
||||||
*/
|
*/
|
||||||
Bool DarwinParseNXKeyMapping(darwinKeyboardInfo *info) {
|
static Bool DarwinParseNXKeyMapping(darwinKeyboardInfo *info) {
|
||||||
KeySym *k;
|
KeySym *k;
|
||||||
int i;
|
int i;
|
||||||
short numMods, numKeys, numPadKeys = 0;
|
short numMods, numKeys, numPadKeys = 0;
|
||||||
|
@ -933,7 +933,7 @@ int DarwinModifierNXMaskToNXKey(int mask) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *DarwinModifierNXMaskTostring(int mask) {
|
static const char *DarwinModifierNXMaskTostring(int mask) {
|
||||||
switch (mask) {
|
switch (mask) {
|
||||||
case NX_ALPHASHIFTMASK: return "NX_ALPHASHIFTMASK";
|
case NX_ALPHASHIFTMASK: return "NX_ALPHASHIFTMASK";
|
||||||
case NX_SHIFTMASK: return "NX_SHIFTMASK";
|
case NX_SHIFTMASK: return "NX_SHIFTMASK";
|
||||||
|
|
|
@ -63,6 +63,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
|
#include "chgkbd.h"
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
|
@ -88,16 +89,12 @@ SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev) {
|
||||||
ChangeKeyboardDevice (old_dev, new_dev)
|
|
||||||
DeviceIntPtr old_dev;
|
|
||||||
DeviceIntPtr new_dev;
|
|
||||||
{
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c *
|
DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c *
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
void NSBeep();
|
void NSBeep(void);
|
||||||
|
|
||||||
typedef struct QuartzAudioRec {
|
typedef struct QuartzAudioRec {
|
||||||
double frequency;
|
double frequency;
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "quartzCommon.h"
|
#include "quartzCommon.h"
|
||||||
|
#include "quartzPasteboard.h"
|
||||||
|
|
||||||
#define BOOL xBOOL
|
#define BOOL xBOOL
|
||||||
#include "darwin.h"
|
#include "darwin.h"
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "quartzForeground.h"
|
||||||
|
|
||||||
int QuartzMoveToForeground() {
|
int QuartzMoveToForeground() {
|
||||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||||
OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);
|
OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);
|
||||||
|
|
|
@ -32,6 +32,6 @@
|
||||||
#ifndef _QUARTZ_FOREGROUND_H_
|
#ifndef _QUARTZ_FOREGROUND_H_
|
||||||
#define _QUARTZ_FOREGROUND_H_
|
#define _QUARTZ_FOREGROUND_H_
|
||||||
|
|
||||||
int QuartzMoveToForeground();
|
int QuartzMoveToForeground(void);
|
||||||
|
|
||||||
#endif /* _QUARTZ_FOREGROUND_H_ */
|
#endif /* _QUARTZ_FOREGROUND_H_ */
|
||||||
|
|
|
@ -34,11 +34,11 @@
|
||||||
#define _QUARTZPASTEBOARD_H
|
#define _QUARTZPASTEBOARD_H
|
||||||
|
|
||||||
// Aqua->X
|
// Aqua->X
|
||||||
void QuartzReadPasteboard();
|
void QuartzReadPasteboard(void);
|
||||||
char * QuartzReadCocoaPasteboard(void); // caller must free string
|
char * QuartzReadCocoaPasteboard(void); // caller must free string
|
||||||
|
|
||||||
// X->Aqua
|
// X->Aqua
|
||||||
void QuartzWritePasteboard();
|
void QuartzWritePasteboard(void);
|
||||||
void QuartzWriteCocoaPasteboard(char *text);
|
void QuartzWriteCocoaPasteboard(char *text);
|
||||||
|
|
||||||
#endif /* _QUARTZPASTEBOARD_H */
|
#endif /* _QUARTZPASTEBOARD_H */
|
||||||
|
|
|
@ -52,8 +52,11 @@
|
||||||
char **envpGlobal; // argcGlobal and argvGlobal
|
char **envpGlobal; // argcGlobal and argvGlobal
|
||||||
// are from dix/globals.c
|
// are from dix/globals.c
|
||||||
|
|
||||||
|
int main(int argc, char **argv, char **envp);
|
||||||
|
void _InitHLTB(void);
|
||||||
|
void DarwinHandleGUI(int argc, char **argv, char **envp);
|
||||||
|
|
||||||
static void server_thread (void *arg) {
|
static void server_thread (void *arg) {
|
||||||
extern int main(int argc, char **argv, char **envp);
|
|
||||||
exit (main (argcGlobal, argvGlobal, envpGlobal));
|
exit (main (argcGlobal, argvGlobal, envpGlobal));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,8 +106,6 @@ void DarwinHandleGUI(int argc, char **argv, char **envp) {
|
||||||
before the main thread when we're _not_ prebound, things fail,
|
before the main thread when we're _not_ prebound, things fail,
|
||||||
so initialize by hand. */
|
so initialize by hand. */
|
||||||
|
|
||||||
extern void _InitHLTB(void);
|
|
||||||
|
|
||||||
_InitHLTB();
|
_InitHLTB();
|
||||||
X11ControllerMain(argc, (const char **)argv, server_thread, NULL);
|
X11ControllerMain(argc, (const char **)argv, server_thread, NULL);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
|
@ -55,6 +55,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
#include "dri.h"
|
#include "dri.h"
|
||||||
#include "dristruct.h"
|
#include "dristruct.h"
|
||||||
|
#include "xpr.h"
|
||||||
|
|
||||||
static int DRIErrorBase = 0;
|
static int DRIErrorBase = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue