xserver: Branch 'master'

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Sat Jan 5 03:20:27 PST 2008


 hw/xquartz/Makefile.am        |    1 +
 hw/xquartz/X11Application.m   |    2 +-
 hw/xquartz/applewm.c          |   15 ++++++---------
 hw/xquartz/darwin.c           |   18 ------------------
 hw/xquartz/darwinEvents.c     |    7 +++----
 hw/xquartz/darwinEvents.h     |    5 +++--
 hw/xquartz/darwinKeyboard.c   |    6 +++---
 hw/xquartz/darwinXinput.c     |    9 +++------
 hw/xquartz/quartzAudio.c      |    2 +-
 hw/xquartz/quartzCocoa.m      |    1 +
 hw/xquartz/quartzForeground.c |    2 ++
 hw/xquartz/quartzForeground.h |    2 +-
 hw/xquartz/quartzPasteboard.h |    4 ++--
 hw/xquartz/quartzStartup.c    |    7 ++++---
 hw/xquartz/xpr/appledri.c     |    1 +
 15 files changed, 32 insertions(+), 50 deletions(-)

New commits:
commit 7d226d6a251cb90765be2b50a1973986c5b7605b
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Sat Jan 5 03:14:07 2008 -0800

    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)

diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index 9ac6e0a..99d23eb 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -19,6 +19,7 @@ DIST_SUBDIRS = xpr bundle
 libXquartz_la_SOURCES = \
 	$(top_srcdir)/fb/fbcmap_mi.c \
 	$(top_srcdir)/mi/miinitext.c \
+	$(top_srcdir)/Xext/dpmsstubs.c \
 	X11Application.m \
 	X11Controller.m \
 	applewm.c \
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 56db2c4..72537bb 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -855,7 +855,7 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
     NSWindow *window;
     int pointer_x, pointer_y, ev_button, ev_type; 
     //    int num_events=0, i=0, state;
-    xEvent xe;
+    // xEvent xe;
 	
     /* convert location to global top-left coordinates */
     location = [e locationInWindow];
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 72dca28..c460ec6 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -264,8 +264,7 @@ WMFreeEvents (data, id)
 }
 
 static int
-ProcAppleWMSelectInput (client)
-    register ClientPtr  client;
+ProcAppleWMSelectInput (register ClientPtr client)
 {
     REQUEST(xAppleWMSelectInputReq);
     WMEventPtr      pEvent, pNewEvent, *pHead;
@@ -479,13 +478,11 @@ ProcAppleWMSetFrontProcess(
 }
 
 static int
-ProcAppleWMSetWindowLevel(
-    register ClientPtr client
-)
+ProcAppleWMSetWindowLevel(register ClientPtr client)
 {
     REQUEST(xAppleWMSetWindowLevelReq);
     WindowPtr pWin;
-    int errno;
+    int err;
 
     REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
 
@@ -497,9 +494,9 @@ ProcAppleWMSetWindowLevel(
         return BadValue;
     }
 
-     errno = appleWMProcs->SetWindowLevel(pWin, stuff->level);
-     if (errno != Success) {
-        return errno;
+     err = appleWMProcs->SetWindowLevel(pWin, stuff->level);
+     if (err != Success) {
+        return err;
     }
 
     return (client->noClientException);
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 3ad9e14..20bcee5 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -879,24 +879,6 @@ void AbortDDX( void )
     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 "windowstr.h"  // for struct _Window
 #include "scrnintstr.h" // for struct _Screen
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 1760792..827fd81 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -45,6 +45,7 @@ in this Software without prior written authorization from The Open Group.
 #include "darwin.h"
 #include "quartz.h"
 #include "darwinKeyboard.h"
+#include "darwinEvents.h"
 
 #include <sys/types.h>
 #include <sys/uio.h>
@@ -213,9 +214,8 @@ Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) {
  * 
  * This should be deprecated in favor of miEQEnqueue -- BB
  */
-void DarwinEQEnqueue(const xEvent *e) {
+void DarwinEQEnqueue(const xEventPtr e) {
     HWEventQueueType oldtail, newtail;
-    char byte = 0;
 
     oldtail = darwinEventQueue.tail;
 
@@ -253,7 +253,7 @@ void DarwinEQEnqueue(const xEvent *e) {
  * DarwinEQPointerPost
  *  Post a pointer event. Used by the mipointer.c routines.
  */
-void DarwinEQPointerPost(xEvent *e) {
+void DarwinEQPointerPost(DeviceIntPtr pdev, xEventPtr e) {
     (*darwinEventQueue.pPtr->processInputProc)
             (e, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
 }
@@ -274,7 +274,6 @@ void ProcessInputEvents(void) {
     EventRec *e;
     int     x, y;
     xEvent  xe;
-    static int  old_flags = 0;  // last known modifier state
     // button number and modifier mask of currently pressed fake button
     input_check_flag=0;
 
diff --git a/hw/xquartz/darwinEvents.h b/hw/xquartz/darwinEvents.h
index d6cab2e..82cc26b 100644
--- a/hw/xquartz/darwinEvents.h
+++ b/hw/xquartz/darwinEvents.h
@@ -28,12 +28,13 @@
 #define _DARWIN_EVENTS_H
 
 Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
-void DarwinEQEnqueue(const xEvent *e);
-void DarwinEQPointerPost(xEvent *e);
+void DarwinEQEnqueue(const xEventPtr e);
+void DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e);
 void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
 void DarwinPokeEQ(void);
 void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y);
 void DarwinSendKeyboardEvents(int ev_type, int keycode);
 void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y);
+void DarwinUpdateModKeys(int flags);
 
 #endif  /* _DARWIN_EVENTS_H */
diff --git a/hw/xquartz/darwinKeyboard.c b/hw/xquartz/darwinKeyboard.c
index f1b90b7..b368fe9 100644
--- a/hw/xquartz/darwinKeyboard.c
+++ b/hw/xquartz/darwinKeyboard.c
@@ -330,7 +330,7 @@ static void parse_next_char_code(DataStream *s, KeySym *k) {
  * DarwinReadKeymapFile
  *      Read the appropriate keymapping from a keymapping file.
  */
-Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
+static Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
     struct stat         st;
     NXEventSystemDevice info[20];
     int                 interface = 0, handler_id = 0;
@@ -439,7 +439,7 @@ Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
 /*
  * DarwinParseNXKeyMapping
  */
-Bool DarwinParseNXKeyMapping(darwinKeyboardInfo  *info) {
+static Bool DarwinParseNXKeyMapping(darwinKeyboardInfo  *info) {
     KeySym              *k;
     int                 i;
     short               numMods, numKeys, numPadKeys = 0;
@@ -933,7 +933,7 @@ int DarwinModifierNXMaskToNXKey(int mask) {
     return -1;
 }
 
-const char *DarwinModifierNXMaskTostring(int mask) {
+static const char *DarwinModifierNXMaskTostring(int mask) {
     switch (mask) {
         case NX_ALPHASHIFTMASK:      return "NX_ALPHASHIFTMASK";
         case NX_SHIFTMASK:           return "NX_SHIFTMASK";
diff --git a/hw/xquartz/darwinXinput.c b/hw/xquartz/darwinXinput.c
index ee456a4..e62ec0a 100644
--- a/hw/xquartz/darwinXinput.c
+++ b/hw/xquartz/darwinXinput.c
@@ -63,6 +63,7 @@ SOFTWARE.
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
 #include "XIstubs.h"
+#include "chgkbd.h"
 
 /***********************************************************************
  *
@@ -88,16 +89,12 @@ SOFTWARE.
  *
  */
 
-int
-ChangeKeyboardDevice (old_dev, new_dev)
-    DeviceIntPtr	old_dev;
-    DeviceIntPtr	new_dev;
-    {
+int ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev) {
     /***********************************************************************
      DeleteFocusClassDeviceStruct(old_dev);	 * defined in xchgptr.c *
     **********************************************************************/
     return BadMatch;
-    }
+}
 
 
 /***********************************************************************
diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c
index 86bb200..5dee32f 100644
--- a/hw/xquartz/quartzAudio.c
+++ b/hw/xquartz/quartzAudio.c
@@ -50,7 +50,7 @@
 #include <X11/extensions/XI.h>
 #include <assert.h>
 
-void NSBeep();
+void NSBeep(void);
 
 typedef struct QuartzAudioRec {
     double frequency;
diff --git a/hw/xquartz/quartzCocoa.m b/hw/xquartz/quartzCocoa.m
index 0086c5c..53e3f08 100644
--- a/hw/xquartz/quartzCocoa.m
+++ b/hw/xquartz/quartzCocoa.m
@@ -37,6 +37,7 @@
 #endif
 
 #include "quartzCommon.h"
+#include "quartzPasteboard.h"
 
 #define BOOL xBOOL
 #include "darwin.h"
diff --git a/hw/xquartz/quartzForeground.c b/hw/xquartz/quartzForeground.c
index bfea642..0e724de 100644
--- a/hw/xquartz/quartzForeground.c
+++ b/hw/xquartz/quartzForeground.c
@@ -32,6 +32,8 @@
 #include <ApplicationServices/ApplicationServices.h>
 #include <stdio.h>
 
+#include "quartzForeground.h"
+
 int QuartzMoveToForeground() {
    ProcessSerialNumber psn = { 0, kCurrentProcess };
    OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);
diff --git a/hw/xquartz/quartzForeground.h b/hw/xquartz/quartzForeground.h
index 4fc21c7..b5422ff 100644
--- a/hw/xquartz/quartzForeground.h
+++ b/hw/xquartz/quartzForeground.h
@@ -32,6 +32,6 @@
 #ifndef _QUARTZ_FOREGROUND_H_
 #define _QUARTZ_FOREGROUND_H_
 
-int QuartzMoveToForeground();
+int QuartzMoveToForeground(void);
 
 #endif /* _QUARTZ_FOREGROUND_H_ */
diff --git a/hw/xquartz/quartzPasteboard.h b/hw/xquartz/quartzPasteboard.h
index afcb6e5..d6a8ee8 100644
--- a/hw/xquartz/quartzPasteboard.h
+++ b/hw/xquartz/quartzPasteboard.h
@@ -34,11 +34,11 @@
 #define _QUARTZPASTEBOARD_H
 
 // Aqua->X 
-void QuartzReadPasteboard();
+void QuartzReadPasteboard(void);
 char * QuartzReadCocoaPasteboard(void);	// caller must free string
 
 // X->Aqua
-void QuartzWritePasteboard();
+void QuartzWritePasteboard(void);
 void QuartzWriteCocoaPasteboard(char *text);
 
 #endif	/* _QUARTZPASTEBOARD_H */
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
index 1b2a226..e25e155 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -52,8 +52,11 @@
 char **envpGlobal;      // argcGlobal and argvGlobal
                         // 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) {
-  extern int main(int argc, char **argv, char **envp);
   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,
        so initialize by hand. */
 
-    extern void _InitHLTB(void);
-    
     _InitHLTB();    
     X11ControllerMain(argc, (const char **)argv, server_thread, NULL);
     exit(0);
diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index 95a4439..b4a4725 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -55,6 +55,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "swaprep.h"
 #include "dri.h"
 #include "dristruct.h"
+#include "xpr.h"
 
 static int DRIErrorBase = 0;
 


More information about the xorg-commit mailing list