xserver: Branch 'xorg-server-1.6-apple' - 3 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Thu Oct 1 13:38:04 PDT 2009


 hw/xquartz/Makefile.am           |    2 
 hw/xquartz/bundle/Info.plist.cpp |    4 -
 hw/xquartz/darwinEvents.c        |    2 
 hw/xquartz/darwinEvents.h        |    2 
 hw/xquartz/quartz.h              |    2 
 hw/xquartz/quartzCocoa.m         |   57 ---------------
 hw/xquartz/quartzPasteboard.c    |  147 ---------------------------------------
 hw/xquartz/quartzPasteboard.h    |   44 -----------
 include/inputstr.h               |    2 
 9 files changed, 4 insertions(+), 258 deletions(-)

New commits:
commit d8c867764e64839edb6c77cab334ec0428d6850f
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Thu Oct 1 13:37:32 2009 -0700

    XQuartz: Updated bundle version to 2.4.1

diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp
index d385e07..3c7bdfb 100644
--- a/hw/xquartz/bundle/Info.plist.cpp
+++ b/hw/xquartz/bundle/Info.plist.cpp
@@ -19,9 +19,9 @@
 	<key>CFBundlePackageType</key>
 		<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-		<string>2.4.0</string>
+		<string>2.4.1</string>
 	<key>CFBundleVersion</key>
-		<string>2.4.0</string>
+		<string>2.4.1</string>
 	<key>CFBundleSignature</key>
 		<string>x11a</string>
 	<key>CSResourcesFileMapped</key>
commit 385adb19afe5c6c6a88370a422b722fc06e50b23
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Thu Oct 1 13:36:59 2009 -0700

    XQuartz: Dead code removal: quartzPasteboard.[hc]
    (cherry picked from commit 9936b5b188dd85f169c41ef8ec46c9a210528c3f)

diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am
index ae8aa7f..65c70b0 100644
--- a/hw/xquartz/Makefile.am
+++ b/hw/xquartz/Makefile.am
@@ -33,7 +33,6 @@ libXquartz_la_SOURCES = \
 	quartzAudio.c \
 	quartzCocoa.m \
 	quartzKeyboard.c \
-	quartzPasteboard.c \
 	quartzStartup.c \
 	threadSafety.c
 
@@ -50,7 +49,6 @@ EXTRA_DIST = \
 	quartzAudio.h \
 	quartzCommon.h \
 	quartzKeyboard.h \
-	quartzPasteboard.h \
 	sanitizedCarbon.h \
 	sanitizedCocoa.h \
 	threadSafety.h
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index de2a60e..9930694 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -331,8 +331,6 @@ Bool DarwinEQInit(void) {
     mieqSetHandler(kXquartzReloadPreferences, DarwinEventHandler);
     mieqSetHandler(kXquartzSetRootClip, DarwinEventHandler);
     mieqSetHandler(kXquartzQuit, DarwinEventHandler);
-    mieqSetHandler(kXquartzReadPasteboard, QuartzReadPasteboard);
-    mieqSetHandler(kXquartzWritePasteboard, QuartzWritePasteboard);
     mieqSetHandler(kXquartzToggleFullscreen, DarwinEventHandler);
     mieqSetHandler(kXquartzSetRootless, DarwinEventHandler);
     mieqSetHandler(kXquartzSpaceChanged, DarwinEventHandler);
diff --git a/hw/xquartz/darwinEvents.h b/hw/xquartz/darwinEvents.h
index 1268514..e1585fe 100644
--- a/hw/xquartz/darwinEvents.h
+++ b/hw/xquartz/darwinEvents.h
@@ -54,8 +54,6 @@ enum {
     kXquartzDeactivate,       // clip X drawing and switch to Aqua cursor
     kXquartzSetRootClip,      // enable or disable drawing to the X screen
     kXquartzQuit,             // kill the X server and release the display
-    kXquartzReadPasteboard,   // copy Mac OS X pasteboard into X cut buffer
-    kXquartzWritePasteboard,  // copy X cut buffer onto Mac OS X pasteboard
     kXquartzBringAllToFront,  // bring all X windows to front
     kXquartzToggleFullscreen, // Enable/Disable fullscreen mode
     kXquartzSetRootless,      // Set rootless mode
diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h
index 2570551..c1169b1 100644
--- a/hw/xquartz/quartz.h
+++ b/hw/xquartz/quartz.h
@@ -33,8 +33,6 @@
 #ifndef _QUARTZ_H
 #define _QUARTZ_H
 
-#include "quartzPasteboard.h"
-
 #include "screenint.h"
 #include "window.h"
 
diff --git a/hw/xquartz/quartzCocoa.m b/hw/xquartz/quartzCocoa.m
index 0ab9493..4501472 100644
--- a/hw/xquartz/quartzCocoa.m
+++ b/hw/xquartz/quartzCocoa.m
@@ -40,67 +40,10 @@
 
 #include "quartzCommon.h"
 #include "inputstr.h"
-#include "quartzPasteboard.h"
 
 #include "darwin.h"
 
 /*
- * QuartzWriteCocoaPasteboard
- *  Write text to the Mac OS X pasteboard.
- */
-void QuartzWriteCocoaPasteboard(
-    char *text)
-{
-    NSPasteboard *pasteboard;
-    NSArray *pasteboardTypes;
-    NSString *string;
-
-    if (! text) return;
-    pasteboard = [NSPasteboard generalPasteboard];
-    if (! pasteboard) return;
-    string = [NSString stringWithCString:text];
-    if (! string) return;
-    pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
-
-    // nil owner because we don't provide type translations
-    [pasteboard declareTypes:pasteboardTypes owner:nil];
-    [pasteboard setString:string forType:NSStringPboardType];
-}
-
-
-/*
- * QuartzReadCocoaPasteboard
- *  Read text from the Mac OS X pasteboard and return it as a heap string.
- *  The caller must free the string.
- */
-char *QuartzReadCocoaPasteboard(void)
-{
-    NSPasteboard *pasteboard;
-    NSArray *pasteboardTypes;
-    NSString *existingType;
-    char *text = NULL;
-
-    pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
-    pasteboard = [NSPasteboard generalPasteboard];
-    if (! pasteboard) return NULL;
-
-    existingType = [pasteboard availableTypeFromArray:pasteboardTypes];
-    if (existingType) {
-        NSString *string = [pasteboard stringForType:existingType];
-        char *buffer;
-
-        if (! string) return NULL;
-        buffer = (char *) [string UTF8String];
-        text = (char *) malloc(strlen(buffer)+1);
-        if (text)
-            strcpy(text, buffer);
-    }
-
-    return text;
-}
-
-
-/*
  * QuartzFSUseQDCursor
  *  Return whether the screen should use a QuickDraw cursor.
  */
diff --git a/hw/xquartz/quartzPasteboard.c b/hw/xquartz/quartzPasteboard.c
deleted file mode 100644
index 60bcabe..0000000
--- a/hw/xquartz/quartzPasteboard.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/**************************************************************
- * quartzPasteboard.c
- *
- * Aqua pasteboard <-> X cut buffer
- * Greg Parker     gparker at cs.stanford.edu     March 8, 2001
- **************************************************************/
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "misc.h"
-#include "inputstr.h"
-#include "quartzPasteboard.h"
-
-#include <X11/Xatom.h>
-#include "windowstr.h"
-#include "propertyst.h"
-#include "scrnintstr.h"
-#include "selection.h"
-#include "globals.h"
-
-
-// Helper function to read the X11 cut buffer
-// FIXME: What about multiple screens? Currently, this reads the first
-// CUT_BUFFER0 from the first screen where the buffer content is a string.
-// Returns a string on the heap that the caller must free.
-// Returns NULL if there is no cut text or there is not enough memory.
-static char * QuartzReadCutBuffer(void)
-{
-    int rc, i;
-    char *text = NULL;
-
-    for (i = 0; i < screenInfo.numScreens; i++) {
-        ScreenPtr pScreen = screenInfo.screens[i];
-        PropertyPtr pProp;
-
-	rc = dixLookupProperty(&pProp, WindowTable[pScreen->myNum],
-			       XA_CUT_BUFFER0, serverClient, DixReadAccess);
-        if (rc != Success) continue;
-        if (pProp->type != XA_STRING) continue;
-        if (pProp->format != 8) continue;
-
-        text = xalloc(1 + pProp->size);
-        if (! text) continue;
-        memcpy(text, pProp->data, pProp->size);
-        text[pProp->size] = '\0';
-        return text;
-    }
-
-    // didn't find any text
-    return NULL;
-}
-
-// Write X cut buffer to Mac OS X pasteboard
-// Called by mieqProcessInputEvents() in response to request from X server thread.
-void QuartzWritePasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents)
-{
-    char *text;
-    text = QuartzReadCutBuffer();
-    if (text) {
-        QuartzWriteCocoaPasteboard(text);
-        free(text);
-    }
-}
-
-#define strequal(a, b) (0 == strcmp((a), (b)))
-
-// Read Mac OS X pasteboard into X cut buffer
-// Called by mieqProcessInputEvents() in response to request from X server thread.
-void QuartzReadPasteboard(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents)
-{
-    char *oldText = QuartzReadCutBuffer();
-    char *text = QuartzReadCocoaPasteboard();
-
-    // Compare text with current cut buffer contents.
-    // Change the buffer if both exist and are different
-    //   OR if there is new text but no old text.
-    // Otherwise, don't clear the selection unnecessarily.
-
-    if ((text && oldText && !strequal(text, oldText)) ||
-        (text && !oldText)) {
-        int scrn, rc;
-	Selection *pSel;
-
-        for (scrn = 0; scrn < screenInfo.numScreens; scrn++) {
-	    ScreenPtr pScreen = screenInfo.screens[scrn];
-	    // Set the cut buffers on each screen
-	    // fixme really on each screen?
-	    dixChangeWindowProperty(serverClient, WindowTable[pScreen->myNum],
-				    XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace,
-				    strlen(text), (pointer)text, TRUE);
-        }
-
-        // Undo any current X selection (similar to code in dispatch.c)
-        // FIXME: what about secondary selection?
-        // FIXME: only touch first XA_PRIMARY selection?
-	rc = dixLookupSelection(&pSel, XA_PRIMARY, serverClient,
-				DixSetAttrAccess);
-        if (rc == Success) {
-	    // Notify client if necessary
-	    if (pSel->client) {
-	        xEvent event;
-
-	        event.u.u.type = SelectionClear;
-		event.u.selectionClear.time = GetTimeInMillis();
-		event.u.selectionClear.window = pSel->window;
-		event.u.selectionClear.atom = pSel->selection;
-		TryClientEvents(pSel->client, dev, &event, 1, NoEventMask,
-				NoEventMask /*CantBeFiltered*/, NullGrab);
-	    }
-
-	    // Erase it
-	    pSel->pWin = NullWindow;
-	    pSel->window = None;
-	    pSel->client = NullClient;
-        }
-    }
-
-    if (text) free(text);
-    if (oldText) free(oldText);
-}
diff --git a/hw/xquartz/quartzPasteboard.h b/hw/xquartz/quartzPasteboard.h
deleted file mode 100644
index b51cd88..0000000
--- a/hw/xquartz/quartzPasteboard.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* 
-   QuartzPasteboard.h
-
-   Mac OS X pasteboard <-> X cut buffer
-   Greg Parker     gparker at cs.stanford.edu     March 8, 2001
-*/
-/*
- * Copyright (c) 2001 Greg Parker. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above copyright
- * holders shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written authorization.
- */
-
-#ifndef _QUARTZPASTEBOARD_H
-#define _QUARTZPASTEBOARD_H
-
-// Aqua->X 
-void QuartzReadPasteboard(int, xEventPtr, DeviceIntPtr, int);
-char * QuartzReadCocoaPasteboard(void);	// caller must free string
-
-// X->Aqua
-void QuartzWritePasteboard(int, xEventPtr, DeviceIntPtr, int);
-void QuartzWriteCocoaPasteboard(char *text);
-
-#endif	/* _QUARTZPASTEBOARD_H */
commit 60f4fe18caebbc91f3feea3ff9e158273f40740d
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Dec 12 10:49:53 2008 +1000

    dix: add SetBit(arr, bit) and ClearBit(arr, bit) to include/inputstr.h
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 5e0967f5fc2e0fcf2a55128eb03931cf6f5709e9)

diff --git a/include/inputstr.h b/include/inputstr.h
index a6f823c..3f0d875 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -57,6 +57,8 @@ SOFTWARE.
 #include "privates.h"
 
 #define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
+#define SetBit(ptr, bit)  (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
+#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
 
 #define SameClient(obj,client) \
 	(CLIENT_BITS((obj)->resource) == (client)->clientAsMask)


More information about the xorg-commit mailing list