diff --git a/WINGs/Extras/wtabledelegates.c b/WINGs/Extras/wtabledelegates.c index 488900b..14cae32 100644 --- a/WINGs/Extras/wtabledelegates.c +++ b/WINGs/Extras/wtabledelegates.c @@ -76,7 +76,7 @@ stringDraw(WMScreen * scr, Drawable d, GC gc, GC sgc, WMColor * textColor, WMDrawString(scr, d, textColor, font, x, y, data, strlen(data)); } - XSetClipMask(dpy, gc, None); + XSetClipMask(dpy, gc, WM_NATIVE_NONE); } static void pixmapDraw(WMScreen * scr, Drawable d, GC gc, GC sgc, WMPixmap * pixmap, WMRect rect, Bool selected) @@ -114,7 +114,7 @@ static void pixmapDraw(WMScreen * scr, Drawable d, GC gc, GC sgc, WMPixmap * pix } } - XSetClipMask(dpy, gc, None); + XSetClipMask(dpy, gc, WM_NATIVE_NONE); } /* ---------------------------------------------------------------------- */ diff --git a/WINGs/WINGs/WMEvent.h b/WINGs/WINGs/WMEvent.h index 6608ee4..f91ad15 100644 --- a/WINGs/WINGs/WMEvent.h +++ b/WINGs/WINGs/WMEvent.h @@ -108,8 +108,8 @@ typedef struct { unsigned long time; int x, y; int x_root, y_root; - int mode; /* NotifyNormal / NotifyGrab / NotifyUngrab */ - int detail; /* NotifyAncestor / NotifyInferior / etc. */ + int mode; /* WM_NOTIFY_NORMAL / WM_NOTIFY_GRAB / WM_NOTIFY_UNGRAB */ + int detail; /* WM_NOTIFY_ANCESTOR / WM_NOTIFY_INFERIOR / etc. */ } WMECrossing; typedef struct { @@ -161,7 +161,7 @@ typedef struct { WNativeWindow window; unsigned long atom; unsigned long time; - int state; /* PropertyNewValue or PropertyDelete */ + int state; /* WM_PROPERTY_NEW_VALUE or WM_PROPERTY_DELETE */ } WMEProperty; typedef struct { @@ -186,7 +186,7 @@ typedef struct { typedef struct { WNativeWindow window; - int state; /* VisibilityUnobscured, etc. */ + int state; /* WM_VISIBILITY_UNOBSCURED, etc. */ } WMEVisibility; typedef struct { @@ -197,7 +197,7 @@ typedef struct { } WMEColormap; typedef struct { - int request; /* MappingModifier, MappingKeyboard, MappingPointer */ + int request; /* WM_MAPPING_MODIFIER, WM_MAPPING_KEYBOARD, WM_MAPPING_POINTER */ int first_keycode; int count; } WMEMapping; diff --git a/WINGs/WINGs/wnative.h b/WINGs/WINGs/wnative.h index bd19c6e..0bc2d69 100644 --- a/WINGs/WINGs/wnative.h +++ b/WINGs/WINGs/wnative.h @@ -103,7 +103,7 @@ typedef int WMNativeBool; /* ------------------------------------------------------------------ */ /* Crossing modes / details (WMECrossing.mode / detail). */ -/* Values match X11 NotifyNormal..NotifyDetailNone. */ +/* Values match X11 WM_NOTIFY_NORMAL..WM_NOTIFY_DETAIL_NONE. */ /* ------------------------------------------------------------------ */ #define WM_NOTIFY_NORMAL 0 diff --git a/WINGs/dragcommon.c b/WINGs/dragcommon.c index 3598550..e44d705 100644 --- a/WINGs/dragcommon.c +++ b/WINGs/dragcommon.c @@ -12,7 +12,7 @@ Atom W_OperationToAction(WMScreen * scr, WMDragOperationType operation) { switch (operation) { case WDOperationNone: - return None; + return WM_NATIVE_NONE; case WDOperationCopy: return scr->xdndActionCopy; @@ -30,7 +30,7 @@ Atom W_OperationToAction(WMScreen * scr, WMDragOperationType operation) return scr->xdndActionPrivate; default: - return None; + return WM_NATIVE_NONE; } } @@ -51,7 +51,7 @@ WMDragOperationType W_ActionToOperation(WMScreen * scr, Atom action) } else if (action == scr->xdndActionPrivate) { return WDOperationPrivate; - } else if (action == None) { + } else if (action == WM_NATIVE_NONE) { return WDOperationNone; } else { diff --git a/WINGs/dragdestination.c b/WINGs/dragdestination.c index a788140..d2f7951 100644 --- a/WINGs/dragdestination.c +++ b/WINGs/dragdestination.c @@ -97,7 +97,7 @@ static WMArray *getTypesFromThreeTypes(WMScreen * scr, XClientMessageEvent * eve typeList = createSourceTypeArray(3); for (i = 2; i < 5; i++) { - if (event->data.l[i] != None) { + if (event->data.l[i] != WM_NATIVE_NONE) { atom = (Atom) event->data.l[i]; WMAddToArray(typeList, XGetAtomName(scr->display, atom)); } @@ -376,7 +376,7 @@ static void sendStatusMessage(WMView * destView, WMDraggingInfo * info, Atom act { unsigned long data1; - data1 = (action == None) ? 0 : 1; + data1 = (action == WM_NATIVE_NONE) ? 0 : 1; if (destView->childrenList == NULL) { WMScreen *scr = W_VIEW_SCREEN(destView); @@ -429,7 +429,7 @@ static Bool requestDropDataInSelection(WMView * destView, const char *type) if (!WMRequestSelection(destView, scr->xdndSelectionAtom, XInternAtom(scr->display, type, False), - CurrentTime, storeDropData, NULL)) { + WM_CURRENT_TIME, storeDropData, NULL)) { wwarning("could not request data for dropped data"); return False; } @@ -464,7 +464,7 @@ static void concludeDrop(WMView * destView) /* send cancel message to the source */ static void cancelDrop(WMView * destView, WMDraggingInfo * info) { - sendStatusMessage(destView, info, None); + sendStatusMessage(destView, info, WM_NATIVE_NONE); concludeDrop(destView); freeDestinationViewInfos(info); } @@ -473,7 +473,7 @@ static void cancelDrop(WMView * destView, WMDraggingInfo * info) or a register view that doesn't accept the drop */ static void suspendDropAuthorization(WMView * destView, WMDraggingInfo * info) { - sendStatusMessage(destView, info, None); + sendStatusMessage(destView, info, WM_NATIVE_NONE); /* Free datas that depend on destination behaviour */ if (XDND_DROP_DATAS(info) != NULL) { @@ -490,7 +490,7 @@ void W_DragDestinationCancelDropOnEnter(WMView * toplevel, WMDraggingInfo * info if (XDND_DEST_VIEW_IS_REGISTERED(info)) cancelDrop(XDND_DEST_VIEW(info), info); else - sendStatusMessage(toplevel, info, None); + sendStatusMessage(toplevel, info, WM_NATIVE_NONE); W_DragDestinationInfoClear(info); } @@ -518,7 +518,7 @@ static void *checkActionAllowed(WMView * destView, WMDraggingInfo * info) { XDND_DEST_ACTION(info) = getAllowedAction(destView, info); - if (XDND_DEST_ACTION(info) == None) { + if (XDND_DEST_ACTION(info) == WM_NATIVE_NONE) { suspendDropAuthorization(destView, info); return dropNotAllowedState; } @@ -593,7 +593,7 @@ static void dragSourceResponseTimeOut(void *destView) if (XDND_DEST_VIEW_IS_REGISTERED(info)) cancelDrop(view, info); else { - sendStatusMessage(view, info, None); + sendStatusMessage(view, info, WM_NATIVE_NONE); } W_DragDestinationInfoClear(info); @@ -728,7 +728,7 @@ static void *dropNotAllowedState(WMView * destView, XClientMessageEvent * event, if (XDND_SOURCE_ACTION_CHANGED(info)) { return checkDropAllowed(destView, info); } else { - sendStatusMessage(destView, info, None); + sendStatusMessage(destView, info, WM_NATIVE_NONE); return dropNotAllowedState; } } diff --git a/WINGs/dragsource.c b/WINGs/dragsource.c index 6d3226b..c295ced 100644 --- a/WINGs/dragsource.c +++ b/WINGs/dragsource.c @@ -70,12 +70,12 @@ static void endDragProcess(WMDraggingInfo * info, Bool deposited) WMScreen *scr = W_VIEW_SCREEN(XDND_SOURCE_VIEW(info)); /* free selection handler while view exists */ - WMDeleteSelectionHandler(view, scr->xdndSelectionAtom, CurrentTime); + WMDeleteSelectionHandler(view, scr->xdndSelectionAtom, WM_CURRENT_TIME); wfree(XDND_SELECTION_PROCS(info)); - if (XDND_DRAG_CURSOR(info) != None) { + if (XDND_DRAG_CURSOR(info) != WM_NATIVE_NONE) { XFreeCursor(scr->display, XDND_DRAG_CURSOR(info)); - XDND_DRAG_CURSOR(info) = None; + XDND_DRAG_CURSOR(info) = WM_NATIVE_NONE; } if (view->dragSourceProcs->endedDrag != NULL) { @@ -434,7 +434,7 @@ static Atom *getTypeAtomList(WMScreen * scr, WMView * view, int *count) *count = 1; typeAtoms = wmalloc(sizeof(Atom)); - *typeAtoms = None; + *typeAtoms = WM_NATIVE_NONE; return typeAtoms; } @@ -451,7 +451,7 @@ static void registerDropTypes(WMScreen * scr, WMView * view, WMDraggingInfo * in XDND_3_TYPES(info)[i] = typeList[i]; for (; i < 3; i++) - XDND_3_TYPES(info)[i] = None; + XDND_3_TYPES(info)[i] = WM_NATIVE_NONE; /* store the entire type list */ XChangeProperty(scr->display, @@ -532,14 +532,14 @@ static void initSourceDragInfo(WMView * sourceView, WMDraggingInfo * info) XDND_SOURCE_INFO(info) = (W_DragSourceInfo *) wmalloc(sizeof(W_DragSourceInfo)); XDND_SOURCE_VIEW(info) = sourceView; - XDND_DEST_WIN(info) = None; - XDND_DRAG_ICON(info) = None; + XDND_DEST_WIN(info) = WM_NATIVE_NONE; + XDND_DRAG_ICON(info) = WM_NATIVE_NONE; XDND_SOURCE_ACTION(info) = W_OperationToAction(W_VIEW_SCREEN(sourceView), sourceView->dragSourceProcs-> wantedDropOperation(sourceView)); - XDND_DEST_ACTION(info) = None; + XDND_DEST_ACTION(info) = WM_NATIVE_NONE; XDND_SOURCE_STATE(info) = idleState; @@ -650,7 +650,7 @@ static Bool isXdndAware(WMScreen * scr, Window win) unsigned long count, remain; unsigned char *winXdndVersion; - if (win == None) + if (win == WM_NATIVE_NONE) return False; XGetWindowProperty(scr->display, win, scr->xdndAwareAtom, @@ -689,13 +689,13 @@ static Window lookForAwareWindow(WMScreen * scr, WMPoint * mousePos, Window win) /* inspect child under pointer */ if (XTranslateCoordinates(scr->display, scr->rootWin, win, mousePos->x, mousePos->y, &tmpx, &tmpy, &child)) { - if (child == None) - return None; + if (child == WM_NATIVE_NONE) + return WM_NATIVE_NONE; else return lookForAwareWindow(scr, mousePos, child); } - return None; + return WM_NATIVE_NONE; } static Window findDestination(WMDraggingInfo * info, WMPoint * mousePos) @@ -719,7 +719,7 @@ static Window findDestination(WMDraggingInfo * info, WMPoint * mousePos) if (i < 0) { /* root window has no child under drag icon, and is not xdnd aware. */ - return None; + return WM_NATIVE_NONE; } /* inspecting children, from upper to lower */ @@ -734,7 +734,7 @@ static Window findDestination(WMDraggingInfo * info, WMPoint * mousePos) } /* No child window under drag pointer */ - return None; + return WM_NATIVE_NONE; } static void storeDestinationProtocolVersion(WMDraggingInfo * info) @@ -745,7 +745,7 @@ static void storeDestinationProtocolVersion(WMDraggingInfo * info) unsigned char *winXdndVersion; WMScreen *scr = W_VIEW_SCREEN(XDND_SOURCE_VIEW(info)); - wassertr(XDND_DEST_WIN(info) != None); + wassertr(XDND_DEST_WIN(info) != WM_NATIVE_NONE); if (XGetWindowProperty(scr->display, XDND_DEST_WIN(info), scr->xdndAwareAtom, @@ -770,7 +770,7 @@ static void initMotionProcess(WMView * view, WMDraggingInfo * info, WMEvent * ev XDND_SELECTION_PROCS(info)->selectionDone = selectionDone; XDND_TIMESTAMP(info) = event->u.motion.time; - if (!WMCreateSelectionHandler(view, scr->xdndSelectionAtom, CurrentTime, XDND_SELECTION_PROCS(info), NULL)) { + if (!WMCreateSelectionHandler(view, scr->xdndSelectionAtom, WM_CURRENT_TIME, XDND_SELECTION_PROCS(info), NULL)) { wwarning(_("could not get ownership of XDND selection")); return; } @@ -794,23 +794,23 @@ static void processMotion(WMDraggingInfo * info, WMPoint * mousePos) if (newDestination != XDND_DEST_WIN(info)) { recolorCursor(info, False); - if (XDND_DEST_WIN(info) != None) { + if (XDND_DEST_WIN(info) != WM_NATIVE_NONE) { /* leaving a xdnd window */ sendLeaveMessage(info); } XDND_DEST_WIN(info) = newDestination; - XDND_DEST_ACTION(info) = None; + XDND_DEST_ACTION(info) = WM_NATIVE_NONE; XDND_NO_POS_ZONE(info).size.width = 0; XDND_NO_POS_ZONE(info).size.height = 0; - if (newDestination != None) { + if (newDestination != WM_NATIVE_NONE) { /* entering a xdnd window */ XDND_SOURCE_STATE(info) = idleState; storeDestinationProtocolVersion(info); if (!sendEnterMessage(info)) { - XDND_DEST_WIN(info) = None; + XDND_DEST_WIN(info) = WM_NATIVE_NONE; return; } @@ -819,9 +819,9 @@ static void processMotion(WMDraggingInfo * info, WMPoint * mousePos) XDND_SOURCE_STATE(info) = NULL; } } else { - if (XDND_DEST_WIN(info) != None) { + if (XDND_DEST_WIN(info) != WM_NATIVE_NONE) { if (!sendPositionMessage(info, mousePos)) { - XDND_DEST_WIN(info) = None; + XDND_DEST_WIN(info) = WM_NATIVE_NONE; return; } @@ -842,7 +842,7 @@ static Bool processButtonRelease(WMDraggingInfo * info) W_DragSourceStartTimer(info); return True; } else { - if (XDND_DEST_WIN(info) != None) + if (XDND_DEST_WIN(info) != WM_NATIVE_NONE) sendLeaveMessage(info); W_DragSourceStopTimer(); @@ -907,7 +907,7 @@ void WMDragImageFromView(WMView * view, WMEvent * event) if (abs(XDND_DRAG_ICON_POS(info).x - mouseLocation.x) >= MIN_X_MOVE_OFFSET || abs(XDND_DRAG_ICON_POS(info).y - mouseLocation.y) >= MIN_Y_MOVE_OFFSET) { - if (XDND_DRAG_ICON(info) == None) { + if (XDND_DRAG_ICON(info) == WM_NATIVE_NONE) { initMotionProcess(view, info, event, &mouseLocation); startDragImage(view, info, event); } else { @@ -968,7 +968,7 @@ static void storeDropAction(WMDraggingInfo * info, Atom destAction) W_ActionToOperation(scr, destAction))) XDND_DEST_ACTION(info) = destAction; else - XDND_DEST_ACTION(info) = None; + XDND_DEST_ACTION(info) = WM_NATIVE_NONE; } else { XDND_DEST_ACTION(info) = destAction; } @@ -995,11 +995,11 @@ static void storeStatusMessageInfos(WMDraggingInfo * info, XClientMessageEvent * noPosZone->size.height = statusEvent->data.l[3] & 0xFFFFL; } - if ((statusEvent->data.l[1] & 0x1L) || statusEvent->data.l[4] != None) { + if ((statusEvent->data.l[1] & 0x1L) || statusEvent->data.l[4] != WM_NATIVE_NONE) { /* destination accept drop */ storeDropAction(info, statusEvent->data.l[4]); } else { - XDND_DEST_ACTION(info) = None; + XDND_DEST_ACTION(info) = WM_NATIVE_NONE; } } @@ -1013,7 +1013,7 @@ static void *idleState(WMView * view, XClientMessageEvent * event, WMDraggingInf if (destMsg == scr->xdndStatusAtom) { storeStatusMessageInfos(info, event); - if (XDND_DEST_ACTION(info) != None) { + if (XDND_DEST_ACTION(info) != WM_NATIVE_NONE) { recolorCursor(info, True); W_DragSourceStartTimer(info); return dropAllowedState; @@ -1040,7 +1040,7 @@ static void *dropAllowedState(WMView * view, XClientMessageEvent * event, WMDrag if (destMsg == scr->xdndStatusAtom) { storeStatusMessageInfos(info, event); - if (XDND_DEST_ACTION(info) == None) { + if (XDND_DEST_ACTION(info) == WM_NATIVE_NONE) { /* drop denied */ recolorCursor(info, False); return idleState; diff --git a/WINGs/selection.c b/WINGs/selection.c index 5aa3366..3c3f7c5 100644 --- a/WINGs/selection.c +++ b/WINGs/selection.c @@ -53,8 +53,8 @@ void WMDeleteSelectionHandler(WMView * view, Atom selection, Time timestamp) /*//printf("deleting selection handler for %d", win); */ WM_ITERATE_ARRAY(selHandlers, handler, iter) { - if (handler->view == view && (handler->selection == selection || selection == None) - && (handler->timestamp == timestamp || timestamp == CurrentTime)) { + if (handler->view == view && (handler->selection == selection || selection == WM_NATIVE_NONE) + && (handler->timestamp == timestamp || timestamp == WM_CURRENT_TIME)) { if (handler->flags.done_pending) { handler->flags.delete_pending = 1; @@ -82,8 +82,8 @@ static void WMDeleteSelectionCallback(WMView * view, Atom selection, Time timest return; WM_ITERATE_ARRAY(selCallbacks, handler, iter) { - if (handler->view == view && (handler->selection == selection || selection == None) - && (handler->timestamp == timestamp || timestamp == CurrentTime)) { + if (handler->view == view && (handler->selection == selection || selection == WM_NATIVE_NONE) + && (handler->timestamp == timestamp || timestamp == WM_CURRENT_TIME)) { if (handler->flags.done_pending) { handler->flags.delete_pending = 1; @@ -190,7 +190,7 @@ static void handleRequestEvent(XEvent * event) /* they're requesting for something old.. maybe another handler * can handle it */ if (event->xselectionrequest.time < handler->timestamp - && event->xselectionrequest.time != CurrentTime) { + && event->xselectionrequest.time != WM_CURRENT_TIME) { break; } @@ -205,7 +205,7 @@ static void handleRequestEvent(XEvent * event) prop = event->xselectionrequest.property; /* obsolete clients that don't set the property field */ - if (prop == None) + if (prop == WM_NATIVE_NONE) prop = event->xselectionrequest.target; if (data) { @@ -216,7 +216,7 @@ static void handleRequestEvent(XEvent * event) WMReleaseData(data); } - notifySelection(event, (handledRequest == True ? prop : None)); + notifySelection(event, (handledRequest == True ? prop : WM_NATIVE_NONE)); if (handler->procs.selectionDone != NULL) { handler->procs.selectionDone(handler->view, @@ -277,7 +277,7 @@ static void handleNotifyEvent(XEvent * event) } handler->flags.done_pending = 1; - if (event->xselection.property == None) { + if (event->xselection.property == WM_NATIVE_NONE) { data = NULL; } else { data = getSelectionData(event->xselection.display, diff --git a/WINGs/wappresource.c b/WINGs/wappresource.c index 013049c..7ab7588 100644 --- a/WINGs/wappresource.c +++ b/WINGs/wappresource.c @@ -63,8 +63,8 @@ void WMSetApplicationIconPixmap(WMScreen * scr, WMPixmap * icon) hints = XGetWMHints(scr->display, scr->groupLeader); hints->flags |= IconPixmapHint | IconMaskHint; - hints->icon_pixmap = (icon != NULL ? icon->pixmap : None); - hints->icon_mask = (icon != NULL ? icon->mask : None); + hints->icon_pixmap = (icon != NULL ? icon->pixmap : WM_NATIVE_NONE); + hints->icon_mask = (icon != NULL ? icon->mask : WM_NATIVE_NONE); XSetWMHints(scr->display, scr->groupLeader, hints); XFree(hints); diff --git a/WINGs/wballoon.c b/WINGs/wballoon.c index 68d7e28..3a29e38 100644 --- a/WINGs/wballoon.c +++ b/WINGs/wballoon.c @@ -155,7 +155,7 @@ void W_BalloonHandleLeaveView(WMView * view) bPtr->timer = NULL; - bPtr->forWindow = None; + bPtr->forWindow = WM_NATIVE_NONE; } } diff --git a/WINGs/wbutton.c b/WINGs/wbutton.c index 3b6f743..bb50738 100644 --- a/WINGs/wbutton.c +++ b/WINGs/wbutton.c @@ -225,7 +225,7 @@ static void updateDisabledMask(WMButton * bPtr) if (bPtr->image) { if (bPtr->dimage->mask) { R->pixmap_free(rctx, (WMDrawable)bPtr->dimage->mask); - bPtr->dimage->mask = None; + bPtr->dimage->mask = WM_NATIVE_NONE; } if (bPtr->flags.dimsWhenDisabled) { @@ -249,14 +249,14 @@ void WMSetButtonImage(WMButton * bPtr, WMPixmap * image) bPtr->image = WMRetainPixmap(image); if (bPtr->dimage) { - bPtr->dimage->pixmap = None; + bPtr->dimage->pixmap = WM_NATIVE_NONE; WMReleasePixmap(bPtr->dimage); bPtr->dimage = NULL; } if (image) { bPtr->dimage = WMCreatePixmapFromXPixmaps(WMWidgetScreen(bPtr), - image->pixmap, None, + image->pixmap, WM_NATIVE_NONE, image->width, image->height, image->depth); updateDisabledMask(bPtr); } @@ -741,7 +741,7 @@ static void destroyButton(Button * bPtr) if (bPtr->dimage) { /* yuck.. kluge */ - bPtr->dimage->pixmap = None; + bPtr->dimage->pixmap = WM_NATIVE_NONE; WMReleasePixmap(bPtr->dimage); } diff --git a/WINGs/wclient_wl.c b/WINGs/wclient_wl.c index 3b45dd8..a38e911 100644 --- a/WINGs/wclient_wl.c +++ b/WINGs/wclient_wl.c @@ -538,8 +538,8 @@ pointer_handle_enter(void *data, struct wl_pointer *p, uint32_t serial, ev.u.crossing.y = (int)wlc_ptr_y; ev.u.crossing.x_root = (int)wlc_ptr_x; ev.u.crossing.y_root = (int)wlc_ptr_y; - ev.u.crossing.mode = NotifyNormal; - ev.u.crossing.detail = NotifyAncestor; + ev.u.crossing.mode = WM_NOTIFY_NORMAL; + ev.u.crossing.detail = WM_NOTIFY_ANCESTOR; W_WL_EnqueueEvent(ctx->scr, &ev, NULL); } @@ -556,8 +556,8 @@ pointer_handle_leave(void *data, struct wl_pointer *p, uint32_t serial, ev.type = WME_LEAVE; ev.window = wlc_ptr_focused->view->window; ev.u.crossing.window = ev.window; - ev.u.crossing.mode = NotifyNormal; - ev.u.crossing.detail = NotifyAncestor; + ev.u.crossing.mode = WM_NOTIFY_NORMAL; + ev.u.crossing.detail = WM_NOTIFY_ANCESTOR; W_WL_EnqueueEvent(ctx->scr, &ev, NULL); wlc_ptr_focused = NULL; } diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c index 6fe4946..fd25f50 100644 --- a/WINGs/wcolorpanel.c +++ b/WINGs/wcolorpanel.c @@ -1219,7 +1219,7 @@ void WMSetColorPanelPickerMode(WMColorPanel * panel, WMColorPanelMode mode) WMUnmapWidget(panel->wheelFrm); if (panel->selectionBackImg) { scr->renderBackend->pixmap_free(scr->renderBackendCtx, panel->selectionBackImg); - panel->selectionBackImg = None; + panel->selectionBackImg = WM_NATIVE_NONE; } } if (mode != WMGrayModeColorPanel) @@ -1234,7 +1234,7 @@ void WMSetColorPanelPickerMode(WMColorPanel * panel, WMColorPanelMode mode) WMUnmapWidget(panel->customPaletteFrm); if (panel->selectionBackImg) { scr->renderBackend->pixmap_free(scr->renderBackendCtx, panel->selectionBackImg); - panel->selectionBackImg = None; + panel->selectionBackImg = WM_NATIVE_NONE; } } if (mode != WMColorListModeColorPanel) @@ -1541,10 +1541,10 @@ static Pixmap magnifyCreatePixmap(WMColorPanel * panel) unsigned long color; if (!panel->magnifyGlass->image) - return None; + return WM_NATIVE_NONE; if (!panel->magnifyGlass->magPix) - return None; + return WM_NATIVE_NONE; /* * Copy an area of only 5x5 pixels from the center of the image. @@ -1577,7 +1577,7 @@ static Pixmap magnifyCreatePixmap(WMColorPanel * panel) #else pixmap = XCreatePixmap(scr->display, W_DRAWABLE(scr), Cursor_mask_width, Cursor_mask_height, scr->depth); if (!pixmap) - return None; + return WM_NATIVE_NONE; XPutImage(scr->display, pixmap, scr->copyGC, panel->magnifyGlass->image, 0, 0, 0, 0, Cursor_mask_width, Cursor_mask_height); @@ -1639,7 +1639,7 @@ static Cursor magnifyGrabPointer(W_ColorPanel * panel) /* Set up Pointer */ XGrabPointer(scr->display, panel->magnifyGlass->view->window, True, WM_EVMASK_POINTER_MOTION | WM_EVMASK_BUTTON_PRESS, - GrabModeAsync, GrabModeAsync, scr->rootWin, magCursor, CurrentTime); + WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, scr->rootWin, magCursor, WM_CURRENT_TIME); return magCursor; } @@ -1710,7 +1710,7 @@ void W_ColorPanelMagnify(WMWidget * w, void *data) /* Destroy wheelBackImg, so it'll update properly */ if (panel->selectionBackImg) { scr->renderBackend->pixmap_free(scr->renderBackendCtx, panel->selectionBackImg); - panel->selectionBackImg = None; + panel->selectionBackImg = WM_NATIVE_NONE; } /* Create magnifying glass */ @@ -1797,7 +1797,7 @@ void W_ColorPanelMagnify(WMWidget * w, void *data) /* Put new image (with magn.) in view */ pixmap = magnifyCreatePixmap(panel); - if (pixmap != None) { + if (pixmap != WM_NATIVE_NONE) { /* Change the window background */ XSetWindowBackgroundPixmap(scr->display, WMViewXID(panel->magnifyGlass->view), pixmap); @@ -1826,7 +1826,7 @@ void W_ColorPanelMagnify(WMWidget * w, void *data) * BUG Doesn't work with focus switches between two windows * if none of them is the color panel. */ - XUngrabPointer(scr->display, CurrentTime); + XUngrabPointer(scr->display, WM_CURRENT_TIME); W_UnmapView(panel->magnifyGlass->view); magnifyInitialize(panel); @@ -1834,7 +1834,7 @@ void W_ColorPanelMagnify(WMWidget * w, void *data) W_MapView(panel->magnifyGlass->view); XGrabPointer(scr->display, panel->magnifyGlass->view->window, True, WM_EVMASK_POINTER_MOTION | WM_EVMASK_BUTTON_PRESS, - GrabModeAsync, GrabModeAsync, scr->rootWin, magCursor, CurrentTime); + WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, scr->rootWin, magCursor, WM_CURRENT_TIME); break; #endif default: @@ -1843,11 +1843,11 @@ void W_ColorPanelMagnify(WMWidget * w, void *data) } /* of switch */ } - XUngrabPointer(scr->display, CurrentTime); + XUngrabPointer(scr->display, WM_CURRENT_TIME); XFreeCursor(scr->display, magCursor); XFreePixmap(scr->display, panel->magnifyGlass->magPix); - panel->magnifyGlass->magPix = None; + panel->magnifyGlass->magPix = WM_NATIVE_NONE; W_UnmapView(panel->magnifyGlass->view); W_DestroyView(panel->magnifyGlass->view); diff --git a/WINGs/wcolorwell.c b/WINGs/wcolorwell.c index 86135a1..ff45f4d 100644 --- a/WINGs/wcolorwell.c +++ b/WINGs/wcolorwell.c @@ -306,7 +306,7 @@ static WMPixmap *makeDragPixmap(WMColorWell * cPtr) R->draw_rect(rctx, pix, scr->black, 0, 0, 15, 15); - return WMCreatePixmapFromXPixmaps(scr, (Pixmap)pix, None, 16, 16, scr->depth); + return WMCreatePixmapFromXPixmaps(scr, (Pixmap)pix, WM_NATIVE_NONE, 16, 16, scr->depth); } static void handleDragEvents(WMEvent * event, void *data) diff --git a/WINGs/wevent.c b/WINGs/wevent.c index 63affc7..9fc04df 100644 --- a/WINGs/wevent.c +++ b/WINGs/wevent.c @@ -307,7 +307,7 @@ int WMIsDoubleClick(WMEvent * event) if (event->u.button.time - view->screen->lastClickTime < WINGsConfiguration.doubleClickDelay) { view->screen->lastClickTime = 0; - view->screen->lastClickWindow = None; + view->screen->lastClickWindow = WM_NATIVE_NONE; view->screen->ignoreNextDoubleClick = 1; return True; } else diff --git a/WINGs/wevent_x11.c b/WINGs/wevent_x11.c index 3445442..174b151 100644 --- a/WINGs/wevent_x11.c +++ b/WINGs/wevent_x11.c @@ -248,7 +248,7 @@ x11_fetch(void *ectx, WMEvent *ev) /* X11-specific pre-processing */ if (slot->type == MappingNotify) XRefreshKeyboardMapping(&slot->xmapping); - if (XFilterEvent(slot, None) == True) { + if (XFilterEvent(slot, WM_NATIVE_NONE) == True) { /* Consumed by input method — return a no-op event */ memset(ev, 0, sizeof(*ev)); ev->type = WME_NONE; diff --git a/WINGs/widgets.c b/WINGs/widgets.c index b82ecf2..ffe9a10 100644 --- a/WINGs/widgets.c +++ b/WINGs/widgets.c @@ -853,7 +853,7 @@ WMScreen *WMCreateScreenWithRContext(Display * display, int screen, RContext * c scrPtr->depth = context ? context->depth : 32; scrPtr->visual = context ? context->visual : NULL; scrPtr->colormap = context ? context->cmap : 0; - scrPtr->rootWin = display ? RootWindow(display, screen) : None; + scrPtr->rootWin = display ? RootWindow(display, screen) : WM_NATIVE_NONE; scrPtr->fontCache = WMCreateHashTable(WMStringPointerHashCallbacks); diff --git a/WINGs/winputmethod.c b/WINGs/winputmethod.c index 1b7be21..314cc66 100644 --- a/WINGs/winputmethod.c +++ b/WINGs/winputmethod.c @@ -204,7 +204,7 @@ int W_LookupString(W_View *view, XKeyPressedEvent *event, char *buffer, int bufl { WMScreen *scr = W_VIEW_SCREEN(view); - XSetInputFocus(scr->display, view->window, RevertToParent, CurrentTime); + XSetInputFocus(scr->display, view->window, WM_REVERT_TO_PARENT, WM_CURRENT_TIME); #ifdef X_HAVE_UTF8_STRING if (view->xic) diff --git a/WINGs/wpixmap.c b/WINGs/wpixmap.c index a188c87..0491359 100644 --- a/WINGs/wpixmap.c +++ b/WINGs/wpixmap.c @@ -42,7 +42,7 @@ WMPixmap *WMCreatePixmap(WMScreen * scrPtr, int width, int height, int depth, Bo if (masked) { pixPtr->mask = (Pixmap)scrPtr->renderBackend->pixmap_create(scrPtr->renderBackendCtx, width, height, 1); } else { - pixPtr->mask = None; + pixPtr->mask = WM_NATIVE_NONE; } return pixPtr; @@ -182,14 +182,14 @@ WMPixmap *WMCreatePixmapFromXPMData(WMScreen * scrPtr, char **data) Pixmap WMGetPixmapXID(WMPixmap * pixmap) { - wassertrv(pixmap != NULL, None); + wassertrv(pixmap != NULL, WM_NATIVE_NONE); return pixmap->pixmap; } Pixmap WMGetPixmapMaskXID(WMPixmap * pixmap) { - wassertrv(pixmap != NULL, None); + wassertrv(pixmap != NULL, WM_NATIVE_NONE); return pixmap->mask; } diff --git a/WINGs/wpopupbutton.c b/WINGs/wpopupbutton.c index 2182c6f..6dab179 100644 --- a/WINGs/wpopupbutton.c +++ b/WINGs/wpopupbutton.c @@ -634,7 +634,7 @@ static void handleActionEvents(WMEvent * event, void *data) bPtr->flags.insideMenu = 0; } bPtr->view->screen->viewBackend->pointer_grab( - bPtr->view->screen->viewBackendCtx, bPtr->menuView, False, CurrentTime); + bPtr->view->screen->viewBackendCtx, bPtr->menuView, False, WM_CURRENT_TIME); break; case WME_BUTTON_RELEASE: diff --git a/WINGs/wrender_x11.c b/WINGs/wrender_x11.c index b03d35c..6c6bf51 100644 --- a/WINGs/wrender_x11.c +++ b/WINGs/wrender_x11.c @@ -92,7 +92,7 @@ render_x11_composite_pixmap(void *rctx, WMDrawable dst, W_Pixmap *src, XSetClipMask(dpy, gc, src->mask); XSetClipOrigin(dpy, gc, dx - sx, dy - sy); } else { - XSetClipMask(dpy, gc, None); + XSetClipMask(dpy, gc, WM_NATIVE_NONE); } if (src->depth == 1) @@ -101,7 +101,7 @@ render_x11_composite_pixmap(void *rctx, WMDrawable dst, W_Pixmap *src, XCopyArea(dpy, src->pixmap, (Drawable)dst, gc, sx, sy, w, h, dx, dy); if (src->mask) - XSetClipMask(dpy, gc, None); + XSetClipMask(dpy, gc, WM_NATIVE_NONE); } static void @@ -152,7 +152,7 @@ render_x11_create_disabled_mask(void *rctx, Pixmap src_mask, XFillRectangle(dpy, mask, scr->monoGC, 0, 0, width, height); gcv.fill_style = FillSolid; - gcv.clip_mask = None; + gcv.clip_mask = WM_NATIVE_NONE; XChangeGC(dpy, scr->monoGC, GCFillStyle | GCClipMask, &gcv); return mask; diff --git a/WINGs/wtext.c b/WINGs/wtext.c index d6154b7..b864756 100644 --- a/WINGs/wtext.c +++ b/WINGs/wtext.c @@ -219,9 +219,9 @@ static char *default_bullet[] = { }; /* These id are used when sharing the selected text between applications */ -static Atom XA_Targets = None; -static Atom XA_Format_Text = None; -static Atom XA_Format_Compound_Text = None; +static Atom XA_Targets = WM_NATIVE_NONE; +static Atom XA_Format_Text = WM_NATIVE_NONE; +static Atom XA_Format_Compound_Text = WM_NATIVE_NONE; static void handleEvents(WMEvent * event, void *data); static void layOutDocument(Text * tPtr); @@ -2038,7 +2038,7 @@ static void releaseSelection(Text * tPtr) tb = tb->next; } tPtr->flags.ownsSelection = False; - WMDeleteSelectionHandler(tPtr->view, XA_PRIMARY, CurrentTime); + WMDeleteSelectionHandler(tPtr->view, XA_PRIMARY, WM_CURRENT_TIME); paintText(tPtr); } @@ -2401,7 +2401,7 @@ static void handleActionEvents(WMEvent * event, void *data) if (tPtr->flags.focused) { tPtr->view->screen->viewBackend->pointer_grab( tPtr->view->screen->viewBackendCtx, - W_VIEW(tPtr), False, CurrentTime); + W_VIEW(tPtr), False, WM_CURRENT_TIME); tPtr->flags.pointerGrabbed = True; handleTextKeyPress(tPtr, event); @@ -2422,7 +2422,7 @@ tPtr->view->screen->viewBackend->pointer_grab( if (tPtr->flags.pointerGrabbed) { tPtr->flags.pointerGrabbed = False; tPtr->view->screen->viewBackend->pointer_ungrab( - tPtr->view->screen->viewBackendCtx, CurrentTime); + tPtr->view->screen->viewBackendCtx, WM_CURRENT_TIME); } if (tPtr->flags.waitingForSelection) @@ -2452,7 +2452,7 @@ tPtr->view->screen->viewBackend->pointer_grab( if (tPtr->flags.pointerGrabbed) { tPtr->flags.pointerGrabbed = False; tPtr->view->screen->viewBackend->pointer_ungrab( - tPtr->view->screen->viewBackendCtx, CurrentTime); + tPtr->view->screen->viewBackendCtx, WM_CURRENT_TIME); break; } @@ -2563,7 +2563,7 @@ tPtr->view->screen->viewBackend->pointer_grab( if (tPtr->flags.pointerGrabbed) { tPtr->flags.pointerGrabbed = False; tPtr->view->screen->viewBackend->pointer_ungrab( - tPtr->view->screen->viewBackendCtx, CurrentTime); + tPtr->view->screen->viewBackendCtx, WM_CURRENT_TIME); break; } @@ -2646,7 +2646,7 @@ static void handleEvents(WMEvent * event, void *data) #endif WMReleaseFont(tPtr->dFont); WMReleaseColor(tPtr->dColor); - WMDeleteSelectionHandler(tPtr->view, XA_PRIMARY, CurrentTime); + WMDeleteSelectionHandler(tPtr->view, XA_PRIMARY, WM_CURRENT_TIME); WMRemoveNotificationObserver(tPtr); WMFreeArray(tPtr->xdndSourceTypes); diff --git a/WINGs/wtextfield.c b/WINGs/wtextfield.c index 7a17f35..cbe462c 100644 --- a/WINGs/wtextfield.c +++ b/WINGs/wtextfield.c @@ -288,7 +288,7 @@ static void lostSelection(WMView * view, Atom selection, void *cdata) (void) cdata; if (tPtr->flags.ownsSelection) { - WMDeleteSelectionHandler(view, selection, CurrentTime); + WMDeleteSelectionHandler(view, selection, WM_CURRENT_TIME); tPtr->flags.ownsSelection = 0; } if (tPtr->selection.count != 0) { @@ -305,7 +305,7 @@ static void selectionNotification(void *observerData, WMNotification * notificat if (observerView != newOwnerView) { /* //if (tPtr->flags.ownsSelection) - // WMDeleteSelectionHandler(observerView, XA_PRIMARY, CurrentTime); + // WMDeleteSelectionHandler(observerView, XA_PRIMARY, WM_CURRENT_TIME); */ lostSelection(observerView, XA_PRIMARY, NULL); } @@ -1569,7 +1569,7 @@ static void destroyTextField(TextField * tPtr) WMReleaseFont(tPtr->font); /*// use lostSelection() instead of WMDeleteSelectionHandler here? */ - WMDeleteSelectionHandler(tPtr->view, XA_PRIMARY, CurrentTime); + WMDeleteSelectionHandler(tPtr->view, XA_PRIMARY, WM_CURRENT_TIME); WMRemoveNotificationObserver(tPtr); if (tPtr->text) diff --git a/WINGs/wview.c b/WINGs/wview.c index 617f1e3..51598ef 100644 --- a/WINGs/wview.c +++ b/WINGs/wview.c @@ -54,9 +54,9 @@ static void adoptChildView(W_View * view, W_View * child) } static const XSetWindowAttributes defAtts = { - None, /* background_pixmap */ + WM_NATIVE_NONE, /* background_pixmap */ 0, /* background_pixel */ - None, /* border_pixmap */ + WM_NATIVE_NONE, /* border_pixmap */ 0, /* border_pixel */ NorthWestGravity, /* bit_gravity */ NorthWestGravity, /* win_gravity */ @@ -70,8 +70,8 @@ static const XSetWindowAttributes defAtts = { WM_EVMASK_SUBSTRUCTURE_NOTIFY, /* event_mask */ 0, /* do_not_propagate_mask */ False, /* override_redirect */ - None, /* colormap */ - None /* cursor */ + WM_NATIVE_NONE, /* colormap */ + WM_NATIVE_NONE /* cursor */ }; static W_View *createView(W_Screen * screen, W_View * parent) @@ -86,7 +86,7 @@ static W_View *createView(W_Screen * screen, W_View * parent) view->attribs = defAtts; view->attribFlags |= CWBackPixel | CWColormap | CWBorderPixel | CWBackPixmap; - view->attribs.background_pixmap = None; + view->attribs.background_pixmap = WM_NATIVE_NONE; view->attribs.background_pixel = W_PIXEL(screen->gray); view->attribs.border_pixel = W_PIXEL(screen->black); view->attribs.colormap = screen->colormap; @@ -514,8 +514,8 @@ void W_SetFocusOfTopLevel(W_View * toplevel, W_View * view) scr->focusInfo = info; } else { memset(&event, 0, sizeof(event)); - event.u.focus.mode = NotifyNormal; - event.u.focus.detail = NotifyDetailNone; + event.u.focus.mode = WM_NOTIFY_NORMAL; + event.u.focus.detail = WM_NOTIFY_DETAIL_NONE; if (info->focused) { /* simulate FocusOut event */ event.type = WME_FOCUS_OUT; @@ -544,7 +544,7 @@ void W_BroadcastMessage(W_View * targetParent, WMEvent * event) void W_DispatchMessage(W_View * target, WMEvent * event) { - if (target->window == None) + if (target->window == WM_NATIVE_NONE) return; event->window = (WNativeWindow)target->window; event->_view_target = target; diff --git a/WINGs/wview_x11.c b/WINGs/wview_x11.c index f27daad..9243872 100644 --- a/WINGs/wview_x11.c +++ b/WINGs/wview_x11.c @@ -211,7 +211,7 @@ static void x11_selection_release(void *vctx, W_View *view, Atom selection) Window win = W_VIEW_DRAWABLE(view); XGrabServer(dpy); if (XGetSelectionOwner(dpy, selection) == win) - XSetSelectionOwner(dpy, selection, None, CurrentTime); + XSetSelectionOwner(dpy, selection, WM_NATIVE_NONE, WM_CURRENT_TIME); XUngrabServer(dpy); } @@ -219,7 +219,7 @@ static Bool x11_selection_request(void *vctx, W_View *view, Atom selection, Atom { W_Screen *scr = (W_Screen *)vctx; Display *dpy = scr->display; - if (XGetSelectionOwner(dpy, selection) == None) + if (XGetSelectionOwner(dpy, selection) == WM_NATIVE_NONE) return False; return XConvertSelection(dpy, selection, target, scr->clipboardAtom, W_VIEW_DRAWABLE(view), timestamp) != 0; @@ -255,7 +255,7 @@ static void x11_pointer_grab(void *vctx, W_View *view, int owner_events, unsigne W_Screen *scr = (W_Screen *)vctx; XGrabPointer(scr->display, view->window, owner_events, WM_EVMASK_BUTTON_RELEASE | WM_EVMASK_BUTTON_MOTION | WM_EVMASK_ENTER_WINDOW | WM_EVMASK_LEAVE_WINDOW, - GrabModeAsync, GrabModeAsync, None, None, time); + WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE, time); } static void x11_pointer_ungrab(void *vctx, unsigned long time) @@ -270,9 +270,9 @@ static void x11_bell(void *vctx) XBell(scr->display, 0); } -static Atom XA_Targets = None; -static Atom XA_Format_Text = None; -static Atom XA_Format_Compound_Text = None; +static Atom XA_Targets = WM_NATIVE_NONE; +static Atom XA_Format_Text = WM_NATIVE_NONE; +static Atom XA_Format_Compound_Text = WM_NATIVE_NONE; static void x11_text_init(void *vctx, W_View *view, void *stipple_gc_out) { @@ -281,7 +281,7 @@ static void x11_text_init(void *vctx, W_View *view, void *stipple_gc_out) GC *gc_out = (GC *)stipple_gc_out; XGCValues gcv; - if (XA_Targets == None) { + if (XA_Targets == WM_NATIVE_NONE) { XA_Targets = XInternAtom(dpy, "TARGETS", False); XA_Format_Text = XInternAtom(dpy, "TEXT", False); XA_Format_Compound_Text = XInternAtom(dpy, "COMPOUND_TEXT", False); @@ -439,7 +439,7 @@ static void x11_window_realize(void *vctx, W_View *view, const char *name, hints->flags |= IconPixmapHint; hints->icon_pixmap = WMGetPixmapXID(win->miniImage); hints->icon_mask = WMGetPixmapMaskXID(win->miniImage); - if (hints->icon_mask != None) { + if (hints->icon_mask != WM_NATIVE_NONE) { hints->flags |= IconMaskHint; } } diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index 92589b5..c45a3db 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -728,12 +728,12 @@ static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int default: wwarning(_("type '%s' is not a supported type for a texture"), type); RReleaseImage(timage); - return None; + return WM_NATIVE_NONE; } } if (!image) - return None; + return WM_NATIVE_NONE; if (path) { dumpRImage(path, image); @@ -781,7 +781,7 @@ static Pixmap renderMenu(_Panel * panel, WMPropList * texture, int width, int ih pix = renderTexture(scr, texture, width, iheight * 4, NULL, RBEV_RAISED2); break; default: - pix = None; + pix = WM_NATIVE_NONE; } XFreeGC(dpy, gc); @@ -823,7 +823,7 @@ static void updatePreviewBox(_Panel * panel, int elements) gc = XCreateGC(dpy, WMWidgetXID(panel->parent), 0, NULL); - if (panel->preview == None) { + if (panel->preview == WM_NATIVE_NONE) { WMPixmap *p; panel->previewNoText = XCreatePixmap(dpy, WMWidgetXID(panel->parent), @@ -1322,31 +1322,31 @@ static Pixmap loadRImage(WMScreen * scr, const char *path) f = fopen(path, "rb"); if (!f) - return None; + return WM_NATIVE_NONE; cnt = fscanf(f, "%02x%02x%1x", &w, &h, &d); if (cnt != 3) { wwarning(_("could not read size of image from '%s', ignoring"), path); fclose(f); - return None; + return WM_NATIVE_NONE; } if (d < 3 || d > 4) { wwarning(_("image \"%s\" has an invalid depth of %d, ignoring"), path, d); fclose(f); - return None; + return WM_NATIVE_NONE; } image = RCreateImage(w, h, d == 4); if (image == NULL) { wwarning(_("could not create RImage for \"%s\": %s"), path, RMessageForError(RErrorCode)); fclose(f); - return None; + return WM_NATIVE_NONE; } read_size = w * h * d; if (fread(image->data, 1, read_size, f) == read_size) RConvertImage(WMScreenRContext(scr), image, &pixmap); else - pixmap = None; + pixmap = WM_NATIVE_NONE; fclose(f); @@ -1661,7 +1661,7 @@ static void updateColorPreviewBox(_Panel * panel, int elements) titem = (TextureListItem *) item->clientData; pix = renderTexture(scr, titem->prop, 64, 64, NULL, titem->ispixmap ? 0 : RBEV_RAISED3); - tile = RCreateImageFromDrawable(WMScreenRContext(scr), pix, None); + tile = RCreateImageFromDrawable(WMScreenRContext(scr), pix, WM_NATIVE_NONE); black.alpha = 255; black.red = black.green = black.blue = 0; diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c index 9b59fae..9fa99d2 100644 --- a/WPrefs.app/KeyboardShortcuts.c +++ b/WPrefs.app/KeyboardShortcuts.c @@ -317,7 +317,7 @@ char *capture_shortcut(WMScreen *scr, Bool *capturing, Bool convert_case) unsigned int numlock_mask; while (*capturing) { - XAllowEvents(dpy, AsyncKeyboard, CurrentTime); + XAllowEvents(dpy, AsyncKeyboard, WM_CURRENT_TIME); WMNextEvent(scr, &ev); if (ev.type == KeyPress && ev.u.key.keycode != 0) { numlock_mask = NumLockMask(dpy); @@ -413,7 +413,7 @@ static void captureClick(WMWidget * w, void *data) WMSetButtonText(w, _("Cancel")); WMSetLabelText(panel->instructionsL, _("Press the desired shortcut key(s) or click Cancel to stop capturing.")); - XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, GrabModeAsync, GrabModeAsync, CurrentTime); + XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_CURRENT_TIME); shortcut = capture_shortcut(scr, &panel->capturing, 1); if (shortcut) { int key_idx = -1; @@ -447,7 +447,7 @@ static void captureClick(WMWidget * w, void *data) panel->capturing = 0; WMSetButtonText(w, _("Capture")); WMSetLabelText(panel->instructionsL, _("Click on Capture to interactively define the shortcut key.")); - XUngrabKeyboard(dpy, CurrentTime); + XUngrabKeyboard(dpy, WM_CURRENT_TIME); } static void clearShortcut(WMWidget * w, void *data) diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c index 2649c47..0b1e261 100644 --- a/WPrefs.app/Menu.c +++ b/WPrefs.app/Menu.c @@ -273,7 +273,7 @@ static void sgrabClicked(WMWidget * w, void *data) if (!panel->capturing) { panel->capturing = 1; WMSetButtonText(w, _("Cancel")); - XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, GrabModeAsync, GrabModeAsync, CurrentTime); + XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_CURRENT_TIME); shortcut = capture_shortcut(WMWidgetScreen(panel->parent), &panel->capturing, 0); if (shortcut) { WMSetTextFieldText(panel->shortT, shortcut); @@ -283,7 +283,7 @@ static void sgrabClicked(WMWidget * w, void *data) } panel->capturing = 0; WMSetButtonText(w, _("Capture")); - XUngrabKeyboard(dpy, CurrentTime); + XUngrabKeyboard(dpy, WM_CURRENT_TIME); } static void changedItemPad(WMWidget * w, void *data) diff --git a/WPrefs.app/TexturePanel.c b/WPrefs.app/TexturePanel.c index f5863a3..841da2f 100644 --- a/WPrefs.app/TexturePanel.c +++ b/WPrefs.app/TexturePanel.c @@ -420,7 +420,7 @@ static void sliderChangeCallback(WMWidget *w, void *data) } colors[i] = NULL; - if (panel->gimage != None) + if (panel->gimage != WM_NATIVE_NONE) XFreePixmap(WMScreenDisplay(scr), panel->gimage); image = RRenderMultiGradient(30, i * WMGetListItemHeight(panel->gcolL), colors, RVerticalGradient); diff --git a/WPrefs.app/editmenu.c b/WPrefs.app/editmenu.c index af7e6e6..bd63a2f 100644 --- a/WPrefs.app/editmenu.c +++ b/WPrefs.app/editmenu.c @@ -1070,7 +1070,7 @@ static void dragMenu(WEditMenu * menu) XGrabPointer(scr->display, scr->rootWin, False, WM_EVMASK_BUTTON_RELEASE | WM_EVMASK_BUTTON_MOTION, - GrabModeAsync, GrabModeAsync, None, scr->defaultCursor, CurrentTime); + WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, scr->defaultCursor, WM_CURRENT_TIME); if (menu->parent) WTearOffEditMenu(menu->parent, menu); @@ -1104,7 +1104,7 @@ static void dragMenu(WEditMenu * menu) } } - XUngrabPointer(scr->display, CurrentTime); + XUngrabPointer(scr->display, WM_CURRENT_TIME); } static WEditMenuItem *duplicateItem(WEditMenuItem * item) @@ -1211,7 +1211,7 @@ static void dragItem(WEditMenu * menu, WEditMenuItem * item, Bool copy) XGrabPointer(dpy, scr->rootWin, False, WM_EVMASK_BUTTON_PRESS | WM_EVMASK_BUTTON_RELEASE | WM_EVMASK_BUTTON_MOTION, - GrabModeAsync, GrabModeAsync, None, scr->defaultCursor, CurrentTime); + WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, scr->defaultCursor, WM_CURRENT_TIME); if (menu->flags.acceptsDrop) XRecolorCursor(dpy, scr->defaultCursor, &green, &back); @@ -1268,7 +1268,7 @@ static void dragItem(WEditMenu * menu, WEditMenuItem * item, Bool copy) } XRecolorCursor(dpy, scr->defaultCursor, &black, &back); - XUngrabPointer(dpy, CurrentTime); + XUngrabPointer(dpy, WM_CURRENT_TIME); if (!enteredMenu) { Bool rem = True; diff --git a/src/actions.c b/src/actions.c index 8067d0a..27e5c17 100644 --- a/src/actions.c +++ b/src/actions.c @@ -142,7 +142,7 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin) oapp = wApplicationOf(old_focused->main_window); if (wwin == NULL) { - wm_backend->focus_set(scr->no_focus_win, RevertToParent, CurrentTime); + wm_backend->focus_set(scr->no_focus_win, WM_REVERT_TO_PARENT, WM_CURRENT_TIME); if (old_focused) wWindowUnfocus(old_focused); @@ -174,11 +174,11 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin) /* set input focus */ switch (wwin->focus_mode) { case WFM_NO_INPUT: - wm_backend->focus_set(scr->no_focus_win, RevertToParent, CurrentTime); + wm_backend->focus_set(scr->no_focus_win, WM_REVERT_TO_PARENT, WM_CURRENT_TIME); break; case WFM_PASSIVE: case WFM_LOCALLY_ACTIVE: - wm_backend->focus_set(wwin->client_win, RevertToParent, CurrentTime); + wm_backend->focus_set(wwin->client_win, WM_REVERT_TO_PARENT, WM_CURRENT_TIME); break; case WFM_GLOBALLY_ACTIVE: break; @@ -190,7 +190,7 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin) wm_backend->event_sync(0); } else { - wm_backend->focus_set(scr->no_focus_win, RevertToParent, CurrentTime); + wm_backend->focus_set(scr->no_focus_win, WM_REVERT_TO_PARENT, WM_CURRENT_TIME); } if (WFLAGP(wwin, no_focusable)) @@ -268,7 +268,7 @@ void wShadeWindow(WWindow *wwin) wWindowSynthConfigureNotify(wwin); /* - wClientSetState(wwin, IconicState, None); + wClientSetState(wwin, IconicState, WM_NATIVE_NONE); */ WMPostNotificationName(WMNChangedState, wwin, "shade"); @@ -1322,7 +1322,7 @@ static void unmapTransientsFor(WWindow *wwin) /* if (!tmp->flags.shaded) */ - wClientSetState(tmp, IconicState, None); + wClientSetState(tmp, IconicState, WM_NATIVE_NONE); WMPostNotificationName(WMNChangedState, tmp, "iconify-transient"); } @@ -1349,7 +1349,7 @@ static void mapTransientsFor(WWindow *wwin) /* if (!tmp->flags.shaded) */ - wClientSetState(tmp, NormalState, None); + wClientSetState(tmp, NormalState, WM_NATIVE_NONE); WMPostNotificationName(WMNChangedState, tmp, "iconify-transient"); } @@ -1485,7 +1485,7 @@ void wIconifyWindow(WWindow *wwin) wm_backend->event_sync(0); if (wPreferences.disable_miniwindows || wwin->flags.net_handle_icon) - wClientSetState(wwin, IconicState, None); + wClientSetState(wwin, IconicState, WM_NATIVE_NONE); else wClientSetState(wwin, IconicState, wwin->icon->icon_win); @@ -1627,7 +1627,7 @@ void wDeiconifyWindow(WWindow *wwin) wRaiseFrame(wwin->frame->core); } if (!wwin->flags.shaded) - wClientSetState(wwin, NormalState, None); + wClientSetState(wwin, NormalState, WM_NATIVE_NONE); mapTransientsFor(wwin); } @@ -1897,7 +1897,7 @@ static void unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int if (wwin->screen_ptr->current_workspace == WIN_WORKSPACE(wwin)) { wm_backend->window_map(wwin->client_win); wm_backend->window_map(wwin->frame->core->window); - wClientSetState(wwin, NormalState, None); + wClientSetState(wwin, NormalState, WM_NATIVE_NONE); wwin->flags.mapped = 1; wRaiseFrame(wwin->frame->core); } diff --git a/src/appicon.c b/src/appicon.c index d371a3f..9fe2353 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -259,10 +259,10 @@ void removeAppIconFor(WApplication *wapp) /* since we keep it, we don't care if it was attracted or not */ wapp->app_icon->attracted = 0; wapp->app_icon->icon->shadowed = 0; - wapp->app_icon->main_window = None; + wapp->app_icon->main_window = WM_NATIVE_NONE; wapp->app_icon->pid = 0; wapp->app_icon->icon->owner = NULL; - wapp->app_icon->icon->icon_win = None; + wapp->app_icon->icon->icon_win = WM_NATIVE_NONE; /* Set the icon image */ set_icon_image_from_database(wapp->app_icon->icon, wapp->app_icon->wm_instance, @@ -712,7 +712,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, WMEvent *event) Bool showed_all_clips = False; int clickButton = event->u.button.button; - Pixmap ghost = None; + Pixmap ghost = WM_NATIVE_NONE; Window wins[2]; /* Managing shadow window */ WMEvent ev; @@ -784,7 +784,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, WMEvent *event) wm_backend->stacking_restack((WNativeWindow *)wins, 2); wm_backend->frame_configure((WNativeWindow)scr->dock_shadow, aicon->x_pos, aicon->y_pos, ICON_SIZE, ICON_SIZE); if (superfluous) { - if (icon->pixmap != None) + if (icon->pixmap != WM_NATIVE_NONE) ghost = MakeGhostIcon(scr, icon->pixmap); else ghost = MakeGhostIcon(scr, icon->core->window); @@ -1024,7 +1024,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, WMEvent *event) } */ if (superfluous) { - if (ghost != None) + if (ghost != WM_NATIVE_NONE) wm_backend->pixmap_free((unsigned long)ghost); wm_backend->window_set_background((WNativeWindow)scr->dock_shadow, scr->white_pixel); } @@ -1184,7 +1184,7 @@ WAppIcon *wAppIconFor(Window window) { WObjDescriptor *desc; - if (window == None) + if (window == WM_NATIVE_NONE) return NULL; desc = wm_backend->context_find(window, WM_CTX_CLIENT_WIN); diff --git a/src/application.c b/src/application.c index 9b6a96c..ca8018d 100644 --- a/src/application.c +++ b/src/application.c @@ -71,7 +71,7 @@ WApplication *wApplicationOf(Window window) { WApplication *wapp; - if (window == None) + if (window == WM_NATIVE_NONE) return NULL; wapp = wm_backend->context_find(window, WM_CTX_APP_WIN); if (!wapp) @@ -86,7 +86,7 @@ WApplication *wApplicationCreate(WWindow * wwin) WApplication *wapp; WWindow *leader; - if (main_window == None || main_window == scr->root_win) + if (main_window == WM_NATIVE_NONE || main_window == scr->root_win) return NULL; { diff --git a/src/backend/backend.h b/src/backend/backend.h index 6e0a469..25c2650 100644 --- a/src/backend/backend.h +++ b/src/backend/backend.h @@ -270,8 +270,8 @@ typedef struct WMBackend { * Grab a button+modifier on win. * The X11 backend applies WM_MOD_LOCK and NumLock/ScrollLock variants. * Equivalent to wHackedGrabButton(button, modifier, win, owner_events, - * event_mask, GrabModeSync, GrabModeAsync, - * None, None). + * event_mask, WM_GRAB_MODE_SYNC, WM_GRAB_MODE_ASYNC, + * WM_NATIVE_NONE, WM_NATIVE_NONE). */ void (*button_grab)(WNativeWindow win, unsigned int button, unsigned int modifier, unsigned int event_mask, @@ -294,10 +294,10 @@ typedef struct WMBackend { * event_mask: events to receive during the grab (X11 mask constants). * cursor_id: cursor to display during the grab (WCUR_* constant). * owner_events: non-zero = events routed normally; zero = all to grab_win. - * timestamp: event timestamp; pass 0 for CurrentTime. + * timestamp: event timestamp; pass 0 for WM_CURRENT_TIME. * Returns 1 on success, 0 if the grab failed. * Equivalent to XGrabPointer(dpy, grab_win, owner_events, event_mask, - * GrabModeAsync, GrabModeAsync, + * WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, * confine_to, cursor, timestamp). */ int (*pointer_grab)(WNativeWindow grab_win, WNativeWindow confine_to, @@ -306,14 +306,14 @@ typedef struct WMBackend { /* * Release a previously acquired pointer grab. - * timestamp: event timestamp; pass 0 for CurrentTime. + * timestamp: event timestamp; pass 0 for WM_CURRENT_TIME. * Equivalent to XUngrabPointer(dpy, timestamp). */ void (*pointer_ungrab)(unsigned long timestamp); /* * Warp the pointer by (dx, dy) relative to its current position. - * Equivalent to XWarpPointer(dpy, None, None, 0, 0, 0, 0, dx, dy). + * Equivalent to XWarpPointer(dpy, WM_NATIVE_NONE, WM_NATIVE_NONE, 0, 0, 0, 0, dx, dy). */ void (*pointer_warp)(int dx, int dy); @@ -693,7 +693,7 @@ typedef struct WMBackend { /* * Warp the pointer to absolute root-window coordinates (x, y). * Used by movePointerToWindowCenter after half-maximise. - * Equivalent to XWarpPointer(dpy, None, root, 0,0,0,0, x, y). + * Equivalent to XWarpPointer(dpy, WM_NATIVE_NONE, root, 0,0,0,0, x, y). */ void (*pointer_warp_to)(int x, int y); @@ -718,14 +718,14 @@ typedef struct WMBackend { * Grab the keyboard to win for the duration of an interactive operation * (e.g. Alt-Tab cycling, keyboard-driven move/resize). * Equivalent to XGrabKeyboard(dpy, win, False, - * GrabModeAsync, GrabModeAsync, CurrentTime). - * Returns 1 on success (GrabSuccess), 0 on failure. + * WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_CURRENT_TIME). + * Returns 1 on success (WM_GRAB_SUCCESS), 0 on failure. */ int (*keyboard_grab)(WNativeWindow win); /* * Release a previously acquired keyboard grab. - * Equivalent to XUngrabKeyboard(dpy, CurrentTime). + * Equivalent to XUngrabKeyboard(dpy, WM_CURRENT_TIME). */ void (*keyboard_ungrab)(void); @@ -745,7 +745,7 @@ typedef struct WMBackend { * Change the event mask and/or cursor of an active pointer grab. * Used mid-move/resize when the drag direction is determined. * cursor_id: WCUR_* cursor index; WCUR_NONE leaves cursor unchanged. - * timestamp: event timestamp; pass 0 for CurrentTime. + * timestamp: event timestamp; pass 0 for WM_CURRENT_TIME. * Equivalent to XChangeActivePointerGrab(dpy, event_mask, cursor, time). */ void (*pointer_change_grab)(unsigned int event_mask, int cursor_id, @@ -1077,7 +1077,7 @@ typedef struct WMBackend { /* * Remove any bounding-shape from wwin's frame (restores rectangle). - * Encapsulates XShapeCombineMask(frame, None, ShapeSet) + XFlush. + * Encapsulates XShapeCombineMask(frame, WM_NATIVE_NONE, ShapeSet) + XFlush. * No-op if USE_XSHAPE is not compiled in. */ void (*window_shape_clear)(WWindow *wwin); diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 05de82e..2fae284 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -4823,8 +4823,8 @@ handle_pointer_motion(struct wl_listener *listener, void *data) xev.u.crossing.window = wl_state.last_hovered_id; xev.u.crossing.x_root = wl_state.pointer_x; xev.u.crossing.y_root = wl_state.pointer_y; - xev.u.crossing.mode = NotifyNormal; - xev.u.crossing.detail = NotifyAncestor; + xev.u.crossing.mode = WM_NOTIFY_NORMAL; + xev.u.crossing.detail = WM_NOTIFY_ANCESTOR; W_WL_EnqueueEvent(wmscr, &xev, NULL); } xev.type = WME_ENTER; @@ -4832,8 +4832,8 @@ handle_pointer_motion(struct wl_listener *listener, void *data) xev.u.crossing.window = new_id; xev.u.crossing.x_root = wl_state.pointer_x; xev.u.crossing.y_root = wl_state.pointer_y; - xev.u.crossing.mode = NotifyNormal; - xev.u.crossing.detail = NotifyAncestor; + xev.u.crossing.mode = WM_NOTIFY_NORMAL; + xev.u.crossing.detail = WM_NOTIFY_ANCESTOR; W_WL_EnqueueEvent(wmscr, &xev, NULL); wl_state.last_hovered_id = new_id; } @@ -4905,8 +4905,8 @@ handle_pointer_motion_absolute(struct wl_listener *listener, void *data) xev.u.crossing.window = wl_state.last_hovered_id; xev.u.crossing.x_root = wl_state.pointer_x; xev.u.crossing.y_root = wl_state.pointer_y; - xev.u.crossing.mode = NotifyNormal; - xev.u.crossing.detail = NotifyAncestor; + xev.u.crossing.mode = WM_NOTIFY_NORMAL; + xev.u.crossing.detail = WM_NOTIFY_ANCESTOR; W_WL_EnqueueEvent(wmscr2, &xev, NULL); } xev.type = WME_ENTER; @@ -4914,8 +4914,8 @@ handle_pointer_motion_absolute(struct wl_listener *listener, void *data) xev.u.crossing.window = new_id; xev.u.crossing.x_root = wl_state.pointer_x; xev.u.crossing.y_root = wl_state.pointer_y; - xev.u.crossing.mode = NotifyNormal; - xev.u.crossing.detail = NotifyAncestor; + xev.u.crossing.mode = WM_NOTIFY_NORMAL; + xev.u.crossing.detail = WM_NOTIFY_ANCESTOR; W_WL_EnqueueEvent(wmscr2, &xev, NULL); wl_state.last_hovered_id = new_id; } @@ -9025,9 +9025,9 @@ static void wl_client_send_key(WNativeWindow win, unsigned int keycode, ev.xkey.display = wl_state.x_display; ev.xkey.window = (Window)win; ev.xkey.root = DefaultRootWindow(wl_state.x_display); - ev.xkey.subwindow = None; + ev.xkey.subwindow = WM_NATIVE_NONE; ev.xkey.same_screen = True; - ev.xkey.time = CurrentTime; + ev.xkey.time = WM_CURRENT_TIME; ev.xkey.keycode = keycode; ev.xkey.state = modifier_mask; XSendEvent(wl_state.x_display, (Window)win, press ? False : True, diff --git a/src/backend/x11/wmspec.c b/src/backend/x11/wmspec.c index 93ac391..07a7fb1 100644 --- a/src/backend/x11/wmspec.c +++ b/src/backend/x11/wmspec.c @@ -583,7 +583,7 @@ void wNETWMUpdateWindowOpacity(WWindow *wwin) (unsigned char **)&property) != Success) return; - if (type == None) { + if (type == WM_NATIVE_NONE) { XDeleteProperty(dpy, wwin->frame->core->window, net_wm_window_opacity); } else if (type == WA_CARDINAL && format == 32 && items == 1 && property) { XChangeProperty(dpy, wwin->frame->core->window, net_wm_window_opacity, @@ -1009,7 +1009,7 @@ static void updateFocusHint(WScreen *scr) Window window; if (!scr->focused_window || !scr->focused_window->flags.focused) - window = None; + window = WM_NATIVE_NONE; else window = scr->focused_window->client_win; diff --git a/src/backend/x11/x11_backend.c b/src/backend/x11/x11_backend.c index e8d19b4..9289fe6 100644 --- a/src/backend/x11/x11_backend.c +++ b/src/backend/x11/x11_backend.c @@ -376,7 +376,7 @@ x11_frame_create_toplevel(WScreen *scr, vmask = CWBorderPixel | CWCursor | CWEventMask | CWOverrideRedirect | CWColormap; attribs.override_redirect = True; attribs.cursor = wPreferences.cursor[WCUR_NORMAL]; - attribs.background_pixmap = None; + attribs.background_pixmap = WM_NATIVE_NONE; attribs.background_pixel = scr->black_pixel; attribs.border_pixel = border_pixel; attribs.event_mask = WM_EVMASK_SUBSTRUCTURE_REDIRECT | WM_EVMASK_BUTTON_PRESS | @@ -406,7 +406,7 @@ x11_frame_create_child(WNativeWindow parent_win, WScreen *scr, vmask = CWBorderPixel | CWCursor | CWEventMask | CWColormap; attribs.cursor = wPreferences.cursor[WCUR_NORMAL]; - attribs.background_pixmap = None; + attribs.background_pixmap = WM_NATIVE_NONE; attribs.background_pixel = scr->black_pixel; attribs.event_mask = WM_EVMASK_KEY_PRESS | WM_EVMASK_KEY_RELEASE | WM_EVMASK_BUTTON_PRESS | WM_EVMASK_BUTTON_RELEASE | WM_EVMASK_BUTTON_MOTION | @@ -518,13 +518,13 @@ x11_key_grab(WNativeWindow win, unsigned int keycode, if (modifier != WM_ANY_MODIFIER) { XGrabKey(dpy, keycode, modifier | WM_MOD_LOCK, - w, owner_events, GrabModeAsync, GrabModeAsync); + w, owner_events, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); #ifdef NUMLOCK_HACK wHackedGrabKey(keycode, modifier, w, owner_events, - GrabModeAsync, GrabModeAsync); + WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); #endif } - XGrabKey(dpy, keycode, modifier, w, owner_events, GrabModeAsync, GrabModeAsync); + XGrabKey(dpy, keycode, modifier, w, owner_events, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); } static void @@ -539,7 +539,7 @@ x11_button_grab(WNativeWindow win, unsigned int button, int owner_events) { wHackedGrabButton(button, modifier, WNW_TO_XID(win), owner_events, - event_mask, GrabModeSync, GrabModeAsync, None, None); + event_mask, WM_GRAB_MODE_SYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE); } static void @@ -559,10 +559,10 @@ x11_pointer_grab(WNativeWindow grab_win, WNativeWindow confine_to, { Cursor xcursor = (cursor_id == WCUR_NONE) ? None : wPreferences.cursor[cursor_id]; return XGrabPointer(dpy, WNW_TO_XID(grab_win), owner_events, event_mask, - GrabModeAsync, GrabModeAsync, + WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WNW_TO_XID(confine_to), xcursor, - (Time)timestamp) == GrabSuccess; + (Time)timestamp) == WM_GRAB_SUCCESS; } static void @@ -574,7 +574,7 @@ x11_pointer_ungrab(unsigned long timestamp) static void x11_pointer_warp(int dx, int dy) { - XWarpPointer(dpy, None, None, 0, 0, 0, 0, dx, dy); + XWarpPointer(dpy, WM_NATIVE_NONE, WM_NATIVE_NONE, 0, 0, 0, 0, dx, dy); } static int @@ -707,7 +707,7 @@ x11_workspace_badge_render(WScreen *scr, WNativeWindow badge_win, XSetWindowBackgroundPixmap(dpy, WNW_TO_XID(badge_win), text); XClearWindow(dpy, WNW_TO_XID(badge_win)); - result = RCreateImageFromDrawable(scr->rcontext, text, None); + result = RCreateImageFromDrawable(scr->rcontext, text, WM_NATIVE_NONE); XFreePixmap(dpy, text); XFreePixmap(dpy, mask); @@ -746,14 +746,14 @@ static int x11_keyboard_grab(WNativeWindow win) { return XGrabKeyboard(dpy, WNW_TO_XID(win), False, - GrabModeAsync, GrabModeAsync, - CurrentTime) == GrabSuccess; + WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, + WM_CURRENT_TIME) == WM_GRAB_SUCCESS; } static void x11_keyboard_ungrab(void) { - XUngrabKeyboard(dpy, CurrentTime); + XUngrabKeyboard(dpy, WM_CURRENT_TIME); } static unsigned int @@ -959,7 +959,7 @@ x11_window_set_border_width(WNativeWindow win, int width) static void x11_pointer_warp_to(int x, int y) { - XWarpPointer(dpy, None, DefaultRootWindow(dpy), 0, 0, 0, 0, x, y); + XWarpPointer(dpy, WM_NATIVE_NONE, DefaultRootWindow(dpy), 0, 0, 0, 0, x, y); } /* -------------------------------------------------------------------- */ @@ -988,7 +988,7 @@ x11_pointer_change_grab(unsigned int event_mask, int cursor_id, unsigned long timestamp) { Cursor xcursor = (cursor_id == WCUR_NONE) ? None : wPreferences.cursor[cursor_id]; - Time t = (timestamp == 0) ? CurrentTime : (Time)timestamp; + Time t = (timestamp == 0) ? WM_CURRENT_TIME : (Time)timestamp; XChangeActivePointerGrab(dpy, (long)event_mask, xcursor, t); } @@ -1436,7 +1436,7 @@ x11_icccm_free_command(char **argv) static WNativeWindow x11_prop_get_transient_for(WNativeWindow win) { - Window owner = None; + Window owner = WM_NATIVE_NONE; if (!XGetTransientForHint(dpy, WNW_TO_XID(win), &owner)) return WNATIVE_NONE; return (WNativeWindow)owner; @@ -1562,7 +1562,7 @@ x11_window_shape_clear(WWindow *wwin) #ifdef USE_XSHAPE XShapeCombineMask(dpy, WNW_TO_XID(wwin->frame->core->window), ShapeBounding, 0, wwin->frame->top_width, - None, ShapeSet); + WM_NATIVE_NONE, ShapeSet); XFlush(dpy); #else (void)wwin; @@ -1711,14 +1711,14 @@ x11_screen_replace_wm(WScreen *scr) } attribs.event_mask = WM_EVMASK_STRUCTURE_NOTIFY; if (!XChangeWindowAttributes(dpy, wm, CWEventMask, &attribs)) - wm = None; + wm = WM_NATIVE_NONE; } #endif scr->info_window = XID_TO_WNW(XCreateSimpleWindow(dpy, WNW_TO_XID(scr->root_win), 0, 0, 10, 10, 0, 0, 0)); #ifdef USE_ICCCM_WMREPLACE - current_time = CurrentTime; + current_time = WM_CURRENT_TIME; ret = XSetSelectionOwner(dpy, scr->sn_atom, WNW_TO_XID(scr->info_window), current_time); if (ret == BadAtom || ret == BadWindow) { XDestroyWindow(dpy, WNW_TO_XID(scr->info_window)); @@ -1912,7 +1912,7 @@ x11_screen_alloc_gcs(WScreen *scr) gcm = GCGraphicsExposures; scr->draw_gc = XCreateGC(dpy, WNW_TO_XID(scr->w_win), gcm, &gcv); - assert(scr->stipple_bitmap != None); + assert(scr->stipple_bitmap != WM_NATIVE_NONE); scr->mono_gc = XCreateGC(dpy, scr->stipple_bitmap, gcm, &gcv); } @@ -1930,14 +1930,14 @@ x11_screen_create_internals(WScreen *scr) 0, InputOnly, CopyFromParent, vmask, &attribs)); XSelectInput(dpy, WNW_TO_XID(scr->no_focus_win), WM_EVMASK_KEY_PRESS | WM_EVMASK_KEY_RELEASE); XMapWindow(dpy, WNW_TO_XID(scr->no_focus_win)); - XSetInputFocus(dpy, WNW_TO_XID(scr->no_focus_win), RevertToParent, CurrentTime); + XSetInputFocus(dpy, WNW_TO_XID(scr->no_focus_win), WM_REVERT_TO_PARENT, WM_CURRENT_TIME); vmask = CWBorderPixel | CWBackPixmap | CWBackPixel | CWCursor | CWSaveUnder | CWOverrideRedirect | CWColormap; attribs.border_pixel = scr->black_pixel; attribs.save_under = True; attribs.override_redirect = True; - attribs.background_pixmap = None; + attribs.background_pixmap = WM_NATIVE_NONE; attribs.background_pixel = scr->white_pixel; attribs.cursor = wPreferences.cursor[WCUR_NORMAL]; attribs.colormap = scr->w_colormap; @@ -2138,8 +2138,8 @@ x11_screen_capture_area(WScreen *scr) if (XGrabPointer(dpy, WNW_TO_XID(scr->root_win), False, WM_EVMASK_BUTTON_MOTION | WM_EVMASK_BUTTON_RELEASE | WM_EVMASK_BUTTON_PRESS, - GrabModeAsync, GrabModeAsync, None, - wPreferences.cursor[WCUR_CAPTURE], CurrentTime) != Success) + WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, + wPreferences.cursor[WCUR_CAPTURE], WM_CURRENT_TIME) != Success) return NULL; XGrabServer(dpy); @@ -2162,13 +2162,13 @@ x11_screen_capture_area(WScreen *scr) XDrawRectangle(dpy, WNW_TO_XID(scr->root_win), scr->frame_gc, x, y, w, h); XUngrabServer(dpy); - XUngrabPointer(dpy, CurrentTime); + XUngrabPointer(dpy, WM_CURRENT_TIME); pimg = XGetImage(dpy, WNW_TO_XID(scr->root_win), x, y, w, h, AllPlanes, ZPixmap); if (!pimg) return NULL; { - RImage *img = RCreateImageFromXImage(scr->rcontext, pimg, None); + RImage *img = RCreateImageFromXImage(scr->rcontext, pimg, WM_NATIVE_NONE); XDestroyImage(pimg); return img; } @@ -2204,7 +2204,7 @@ x11_screen_capture_area(WScreen *scr) } XUngrabServer(dpy); - XUngrabPointer(dpy, CurrentTime); + XUngrabPointer(dpy, WM_CURRENT_TIME); return NULL; } @@ -2230,7 +2230,7 @@ x11_screen_capture_window(WScreen *scr, WWindow *wwin) AllPlanes, ZPixmap); if (!pimg) return NULL; - img = RCreateImageFromXImage(scr->rcontext, pimg, None); + img = RCreateImageFromXImage(scr->rcontext, pimg, WM_NATIVE_NONE); XDestroyImage(pimg); return img; } @@ -2594,7 +2594,7 @@ x11_extensions_init(void) static void x11_cursors_init(void) { - wPreferences.cursor[WCUR_NORMAL] = None; /* inherit from root */ + wPreferences.cursor[WCUR_NORMAL] = WM_NATIVE_NONE; /* inherit from root */ wPreferences.cursor[WCUR_ROOT] = XCreateFontCursor(dpy, XC_left_ptr); wPreferences.cursor[WCUR_ARROW] = XCreateFontCursor(dpy, XC_top_left_arrow); wPreferences.cursor[WCUR_MOVE] = XCreateFontCursor(dpy, XC_fleur); @@ -2735,7 +2735,7 @@ x11_catch_error(Display *edpy, XErrorEvent *error) if (error->error_code == BadMatch && error->request_code == X_SetInputFocus) return 0; - if (error->resourceid != None + if (error->resourceid != WM_NATIVE_NONE && ((error->error_code == BadDrawable && error->request_code == X_GetGeometry) || (error->error_code == BadWindow) /* @@ -2914,7 +2914,7 @@ x11_frame_paint_titlebar(WFrameWindow *fwin, int state) y = (*fwin->title_min_height - h) / 2; buf = XCreatePixmap(dpy, fwin->titlebar->window, w + 2, h, scr->w_depth); - XSetClipMask(dpy, scr->copy_gc, None); + XSetClipMask(dpy, scr->copy_gc, WM_NATIVE_NONE); if (fwin->title_texture[state]->any.type != WTEX_SOLID) { XCopyArea(dpy, fwin->title_back[state], buf, scr->copy_gc, @@ -3044,7 +3044,7 @@ x11_frame_paint_button(WCoreWindow *button, WTexture *texture, width = image->width; } } - XSetClipMask(dpy, copy_gc, None); + XSetClipMask(dpy, copy_gc, WM_NATIVE_NONE); if (wPreferences.new_style == TS_NEXT) XSetForeground(dpy, copy_gc, scr->black_pixel); else @@ -3217,7 +3217,7 @@ static void x11_prop_set_icon_tile(WScreen *scr, RImage *image) unsigned char *tmp; int x, y; - if (scr->info_window == None) + if (scr->info_window == WM_NATIVE_NONE) return; if (!imageAtom) imageAtom = XInternAtom(dpy, "_RGBA_IMAGE", False); @@ -3308,22 +3308,22 @@ static void x11_key_grab_hacked(WNativeWindow window, int keycode, unsigned int return; if (_NumLockMask) XGrabKey(dpy, keycode, modifiers | _NumLockMask, - (Window)window, True, GrabModeAsync, GrabModeAsync); + (Window)window, True, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); if (_ScrollLockMask) XGrabKey(dpy, keycode, modifiers | _ScrollLockMask, - (Window)window, True, GrabModeAsync, GrabModeAsync); + (Window)window, True, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); if (_NumLockMask && _ScrollLockMask) XGrabKey(dpy, keycode, modifiers | _NumLockMask | _ScrollLockMask, - (Window)window, True, GrabModeAsync, GrabModeAsync); + (Window)window, True, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); if (_NumLockMask) XGrabKey(dpy, keycode, modifiers | _NumLockMask | WM_MOD_LOCK, - (Window)window, True, GrabModeAsync, GrabModeAsync); + (Window)window, True, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); if (_ScrollLockMask) XGrabKey(dpy, keycode, modifiers | _ScrollLockMask | WM_MOD_LOCK, - (Window)window, True, GrabModeAsync, GrabModeAsync); + (Window)window, True, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); if (_NumLockMask && _ScrollLockMask) XGrabKey(dpy, keycode, modifiers | _NumLockMask | _ScrollLockMask | WM_MOD_LOCK, - (Window)window, True, GrabModeAsync, GrabModeAsync); + (Window)window, True, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); } static void x11_button_grab_hacked(unsigned int button, unsigned int modifiers, @@ -3331,29 +3331,29 @@ static void x11_button_grab_hacked(unsigned int button, unsigned int modifiers, unsigned int event_mask) { XGrabButton(dpy, button, modifiers, (Window)window, owner_events, - event_mask, GrabModeAsync, GrabModeAsync, None, None); + event_mask, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE); if (modifiers == WM_ANY_MODIFIER) return; XGrabButton(dpy, button, modifiers | WM_MOD_LOCK, (Window)window, owner_events, - event_mask, GrabModeAsync, GrabModeAsync, None, None); + event_mask, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE); if (_NumLockMask) XGrabButton(dpy, button, modifiers | _NumLockMask, (Window)window, - owner_events, event_mask, GrabModeAsync, GrabModeAsync, None, None); + owner_events, event_mask, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE); if (_ScrollLockMask) XGrabButton(dpy, button, modifiers | _ScrollLockMask, (Window)window, - owner_events, event_mask, GrabModeAsync, GrabModeAsync, None, None); + owner_events, event_mask, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE); if (_NumLockMask && _ScrollLockMask) XGrabButton(dpy, button, modifiers | _NumLockMask | _ScrollLockMask, (Window)window, - owner_events, event_mask, GrabModeAsync, GrabModeAsync, None, None); + owner_events, event_mask, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE); if (_NumLockMask) XGrabButton(dpy, button, modifiers | _NumLockMask | WM_MOD_LOCK, (Window)window, - owner_events, event_mask, GrabModeAsync, GrabModeAsync, None, None); + owner_events, event_mask, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE); if (_ScrollLockMask) XGrabButton(dpy, button, modifiers | _ScrollLockMask | WM_MOD_LOCK, (Window)window, - owner_events, event_mask, GrabModeAsync, GrabModeAsync, None, None); + owner_events, event_mask, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE); if (_NumLockMask && _ScrollLockMask) XGrabButton(dpy, button, modifiers | _NumLockMask | _ScrollLockMask | WM_MOD_LOCK, (Window)window, - owner_events, event_mask, GrabModeAsync, GrabModeAsync, None, None); + owner_events, event_mask, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC, WM_NATIVE_NONE, WM_NATIVE_NONE); } static void x11_context_init(void) @@ -3401,7 +3401,7 @@ static int x11_parse_color(WScreen *scr, const char *name, XColor *color_out) static int x11_cursor_create_from_files(WScreen *scr, const char *bitmap_path, const char *mask_path, Cursor *cursor_out) { - Pixmap bitmap = None, mask = None; + Pixmap bitmap = WM_NATIVE_NONE, mask = WM_NATIVE_NONE; unsigned int w, h; int x, y; XColor fg, bg; @@ -3424,7 +3424,7 @@ static int x11_cursor_create_from_files(WScreen *scr, const char *bitmap_path, static void x11_cursor_free(Cursor cursor) { - if (cursor != None) + if (cursor != WM_NATIVE_NONE) XFreeCursor(dpy, cursor); } @@ -3436,7 +3436,7 @@ static void x11_cursor_set(WNativeWindow window, Cursor cursor) static void x11_pointer_change_cursor(int cursor_id) { XChangeActivePointerGrab(dpy, WM_EVMASK_BUTTON_MOTION | WM_EVMASK_BUTTON_RELEASE | WM_EVMASK_BUTTON_PRESS, - wPreferences.cursor[cursor_id], CurrentTime); + wPreferences.cursor[cursor_id], WM_CURRENT_TIME); } static void x11_appicon_paint_dock_dots(WAppIcon *aicon, void *wapp_ptr) @@ -3468,7 +3468,7 @@ static void x11_appicon_paint_dock_dots(WAppIcon *aicon, void *wapp_ptr) XDrawLine(dpy, aicon->icon->core->window, scr->icon_title_texture->light_gc, 0, 0, 0, 12); XDrawLine(dpy, aicon->icon->core->window, scr->icon_title_texture->light_gc, 0, 0, 12, 0); } - XSetClipMask(dpy, scr->copy_gc, None); + XSetClipMask(dpy, scr->copy_gc, WM_NATIVE_NONE); if (aicon->launching) XFillRectangle(dpy, aicon->icon->core->window, scr->stipple_gc, 0, 0, wPreferences.icon_size, wPreferences.icon_size); @@ -3544,8 +3544,8 @@ static int x11_event_check_enter_leave(void *dock) return 0; } -static void x11_event_allow_async(void) { XAllowEvents(dpy, AsyncPointer, CurrentTime); } -static void x11_event_replay_pointer(void) { XAllowEvents(dpy, ReplayPointer, CurrentTime); } +static void x11_event_allow_async(void) { XAllowEvents(dpy, AsyncPointer, WM_CURRENT_TIME); } +static void x11_event_replay_pointer(void) { XAllowEvents(dpy, ReplayPointer, WM_CURRENT_TIME); } static void x11_keyboard_mapping_refresh(WMEvent *event) { XEvent *xev = event ? (XEvent *)event->_x11_raw : NULL; @@ -3598,9 +3598,9 @@ static void x11_client_send_key(WNativeWindow win, unsigned int keycode, ev.xkey.display = dpy; ev.xkey.window = (Window)win; ev.xkey.root = DefaultRootWindow(dpy); - ev.xkey.subwindow = None; + ev.xkey.subwindow = WM_NATIVE_NONE; ev.xkey.same_screen = True; - ev.xkey.time = CurrentTime; + ev.xkey.time = WM_CURRENT_TIME; ev.xkey.keycode = keycode; ev.xkey.state = modifier_mask; XSendEvent(dpy, (Window)win, press ? False : True, @@ -3638,7 +3638,7 @@ static void x11_dialog_paint_icon(unsigned long drawable, void *back_color, GC copygc = scr->copy_gc; XFillRectangle(dpy, d, WMColorGC(back), x, y, width, height); - XSetClipMask(dpy, gc, None); + XSetClipMask(dpy, gc, WM_NATIVE_NONE); XDrawLine(dpy, d, WMColorGC(scr->white), x, y + height - 1, x + width, y + height - 1); size = WMGetPixmapSize(pixmap); XSetClipMask(dpy, copygc, WMGetPixmapMaskXID(pixmap)); @@ -3681,7 +3681,7 @@ static char *x11_get_text_selection(WScreen *scr, unsigned long selection) if (!clipboard) clipboard = XInternAtom(dpy, "CLIPBOARD", False); XDeleteProperty(dpy, scr->info_window, clipboard); - XConvertSelection(dpy, (Atom)selection, WA_STRING, clipboard, scr->info_window, CurrentTime); + XConvertSelection(dpy, (Atom)selection, WA_STRING, clipboard, scr->info_window, WM_CURRENT_TIME); WMHandlerID timer = WMAddTimerHandler(1000, NULL, &timeout); while (!XCheckTypedWindowEvent(dpy, scr->info_window, SelectionNotify, &ev) && !timeout) { XSync(dpy, False); @@ -3746,7 +3746,7 @@ static void x11_handle_selection_request(WMEvent *event) if (!xev) return; XSelectionRequestEvent *xsr = &xev->xselectionrequest; #ifdef USE_ICCCM_WMREPLACE - static Atom atom_version = None; + static Atom atom_version = WM_NATIVE_NONE; WScreen *scr; XSelectionEvent notify; @@ -3756,7 +3756,7 @@ static void x11_handle_selection_request(WMEvent *event) notify.requestor = xsr->requestor; notify.selection = xsr->selection; notify.target = xsr->target; - notify.property = None; + notify.property = WM_NATIVE_NONE; notify.time = xsr->time; scr = wScreenForWindow(xsr->owner); @@ -3767,7 +3767,7 @@ static void x11_handle_selection_request(WMEvent *event) if (xsr->selection != scr->sn_atom) goto not_our_selection; - if (atom_version == None) + if (atom_version == WM_NATIVE_NONE) atom_version = XInternAtom(dpy, "VERSION", False); if (xsr->target == atom_version) { @@ -3775,15 +3775,15 @@ static void x11_handle_selection_request(WMEvent *event) /* ICCCM 2.0: "Communication with the Window Manager by Means of * Selections". Setting the property means the content of the - * selection is available. Old clients may pass property=None. */ - notify.property = (xsr->property == None) ? xsr->target : xsr->property; + * selection is available. Old clients may pass property= WM_NATIVE_NONE. */ + notify.property = (xsr->property == WM_NATIVE_NONE) ? xsr->target : xsr->property; XChangeProperty(dpy, xsr->requestor, notify.property, WA_INTEGER, 32, PropModeReplace, (unsigned char *)icccm_version, wlengthof(icccm_version)); } not_our_selection: - if (notify.property == None) + if (notify.property == WM_NATIVE_NONE) wwarning("received SelectionRequest(%s) for target=\"%s\" from " "requestor 0x%lX but we have no answer", XGetAtomName(dpy, xsr->selection), @@ -4016,7 +4016,7 @@ static void x11_restore_desktop(WScreen *scr) wDestroyInspectorPanels(); x11_restore_windows(scr->stacking_list, NULL); XUngrabServer(dpy); - XSetInputFocus(dpy, PointerRoot, RevertToParent, CurrentTime); + XSetInputFocus(dpy, PointerRoot, WM_REVERT_TO_PARENT, WM_CURRENT_TIME); x11_colormap_install(scr, NULL); x11_prop_cleanup((WNativeWindow)scr->root_win); x11_netwm_cleanup(scr); @@ -4069,7 +4069,7 @@ static void x11_colormap_install(WScreen *scr, WWindow *wwin) int i; XWindowAttributes attributes; int done = 0; - Window xwin = None; + Window xwin = WM_NATIVE_NONE; if (wwin) xwin = wwin->client_win; @@ -4089,7 +4089,7 @@ static void x11_colormap_install(WScreen *scr, WWindow *wwin) if (w == wwin->client_win) done = 1; XGetWindowAttributes(dpy, w, &attributes); - if (attributes.colormap == None) + if (attributes.colormap == WM_NATIVE_NONE) attributes.colormap = scr->colormap; if (scr->current_colormap != attributes.colormap) { scr->current_colormap = attributes.colormap; @@ -4100,10 +4100,10 @@ static void x11_colormap_install(WScreen *scr, WWindow *wwin) } if (!done) { - attributes.colormap = None; - if (xwin != None) + attributes.colormap = WM_NATIVE_NONE; + if (xwin != WM_NATIVE_NONE) XGetWindowAttributes(dpy, xwin, &attributes); - if (attributes.colormap == None) + if (attributes.colormap == WM_NATIVE_NONE) attributes.colormap = scr->colormap; if (scr->current_colormap != attributes.colormap) { scr->current_colormap = attributes.colormap; @@ -4446,11 +4446,11 @@ static WPixmap *x11_pixmap_create_from_xbm(WScreen *scr, char *data, char *mask, WPixmap *pix = wmalloc(sizeof(WPixmap)); pix->image = XCreatePixmapFromBitmapData(dpy, scr->w_win, data, width, height, fg, bg, scr->w_depth); - if (pix->image == None) { wfree(pix); return NULL; } + if (pix->image == WM_NATIVE_NONE) { wfree(pix); return NULL; } if (mask) pix->mask = XCreateBitmapFromData(dpy, scr->w_win, mask, width, height); else - pix->mask = None; + pix->mask = WM_NATIVE_NONE; pix->width = width; pix->height = height; pix->depth = scr->w_depth; diff --git a/src/backend/x11/xdnd.c b/src/backend/x11/xdnd.c index 1b60b0a..d136c69 100644 --- a/src/backend/x11/xdnd.c +++ b/src/backend/x11/xdnd.c @@ -295,7 +295,7 @@ Bool wXDNDProcessClientMessage(XClientMessageEvent *event) } else if (event->message_type == _XA_XdndDrop) { if (XDND_DROP_SOURCE_WIN(event) == XGetSelectionOwner(dpy, _XA_XdndSelection)) { XConvertSelection(dpy, _XA_XdndSelection, selected_typelist, - _XA_WINDOWMAKER_XDNDEXCHANGE, event->window, CurrentTime); + _XA_WINDOWMAKER_XDNDEXCHANGE, event->window, WM_CURRENT_TIME); } return True; } else if (event->message_type == _XA_XdndPosition) { diff --git a/src/balloon.c b/src/balloon.c index 7b2c6e1..4e83606 100644 --- a/src/balloon.c +++ b/src/balloon.c @@ -228,7 +228,7 @@ void wBalloonEnteredObject(WScreen *scr, WObjDescriptor *object) wfree(scr->balloon->text); scr->balloon->text = NULL; - scr->balloon->mini_preview = None; + scr->balloon->mini_preview = WM_NATIVE_NONE; if (!object) { wBalloonHide(scr); diff --git a/src/client.c b/src/client.c index 24c73a9..b73660f 100644 --- a/src/client.c +++ b/src/client.c @@ -264,7 +264,7 @@ void wClientCheckProperty(WWindow * wwin, WMEvent * event) break; case WA_WM_COMMAND: - if (wwin->main_window != None) { + if (wwin->main_window != WM_NATIVE_NONE) { WApplication *wapp = wApplicationOf(wwin->main_window); char *command; @@ -312,13 +312,13 @@ void wClientCheckProperty(WWindow * wwin, WMEvent * event) * 6 - create application */ if (new_hints && (new_hints->flags & WindowGroupHint) - && new_hints->window_group != None) { + && new_hints->window_group != WM_NATIVE_NONE) { g2 = 1; } else { g2 = 0; } if (wwin->wm_hints && (wwin->wm_hints->flags & WindowGroupHint) - && wwin->wm_hints->window_group != None) { + && wwin->wm_hints->window_group != WM_NATIVE_NONE) { g1 = 1; } else { g1 = 0; @@ -362,7 +362,7 @@ void wClientCheckProperty(WWindow * wwin, WMEvent * event) case 3: wApplicationDestroy(wApplicationOf(wwin->main_window)); wwin->main_window = wwin->client_leader; - wwin->group_id = None; + wwin->group_id = WM_NATIVE_NONE; wApplicationCreate(wwin); break; @@ -379,8 +379,8 @@ void wClientCheckProperty(WWindow * wwin, WMEvent * event) /* 5 - destroy application */ case 5: wApplicationDestroy(wApplicationOf(wwin->main_window)); - wwin->main_window = None; - wwin->group_id = None; + wwin->main_window = WM_NATIVE_NONE; + wwin->group_id = WM_NATIVE_NONE; break; /* 6 - create application */ @@ -418,7 +418,7 @@ void wClientCheckProperty(WWindow * wwin, WMEvent * event) /*} else if (wwin->fake_group!=NULL) { wwin->group_id = wwin->fake_group->leader; */ } else { - wwin->group_id = None; + wwin->group_id = WM_NATIVE_NONE; } break; @@ -464,7 +464,7 @@ void wClientCheckProperty(WWindow * wwin, WMEvent * event) } } wwin->transient_for = new_owner; - if (new_owner == None) { + if (new_owner == WM_NATIVE_NONE) { if (WFLAGP(wwin, no_miniaturizable)) { wwin->client_flags.no_miniaturizable = 0; wwin->client_flags.no_miniaturize_button = 0; @@ -517,14 +517,14 @@ void wClientCheckProperty(WWindow * wwin, WMEvent * event) foo->client_flags.shared_appicon = 0; foo->fake_group = NULL; - if (foo->group_id != None) + if (foo->group_id != WM_NATIVE_NONE) foo->main_window = foo->group_id; - else if (foo->client_leader != None) + else if (foo->client_leader != WM_NATIVE_NONE) foo->main_window = foo->client_leader; else if (WFLAGP(foo, emulate_appicon)) foo->main_window = foo->client_win; else - foo->main_window = None; + foo->main_window = WM_NATIVE_NONE; if (foo->main_window) wApplicationCreate(foo); @@ -532,11 +532,11 @@ void wClientCheckProperty(WWindow * wwin, WMEvent * event) foo = foo->prev; } - if (fPtr->leader != None) + if (fPtr->leader != WM_NATIVE_NONE) wm_backend->frame_destroy(NULL, (WNativeWindow)fPtr->leader); fPtr->retainCount = 0; - fPtr->leader = None; - fPtr->origLeader = None; + fPtr->leader = WM_NATIVE_NONE; + fPtr->origLeader = WM_NATIVE_NONE; wapp = wApplicationOf(wwin->main_window); if (wapp) { diff --git a/src/defaults.c b/src/defaults.c index c80e52e..4532449 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -2311,7 +2311,7 @@ static int parse_cursor(WScreen * scr, WMPropList * pl, Cursor * cursor) if (strcasecmp(val, "none") == 0) { status = 1; - *cursor = None; + *cursor = WM_NATIVE_NONE; } else if (strcasecmp(val, "builtin") == 0) { if (nelem != 2) { wwarning(_("bad number of arguments in cursor specification")); @@ -3424,13 +3424,13 @@ static int setCursor(WScreen * scr, WDefaultEntry * entry, void *tdata, void *ex /* Parameter not used, but tell the compiler that it is ok */ (void) entry; - if (wPreferences.cursor[widx] != None) { + if (wPreferences.cursor[widx] != WM_NATIVE_NONE) { wm_backend->cursor_free(wPreferences.cursor[widx]); } wPreferences.cursor[widx] = *cursor; - if (widx == WCUR_ROOT && *cursor != None) { + if (widx == WCUR_ROOT && *cursor != WM_NATIVE_NONE) { wm_backend->cursor_set((WNativeWindow)scr->root_win, *cursor); } diff --git a/src/dialog.c b/src/dialog.c index b1f6a96..519c012 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -86,7 +86,7 @@ int wMessageDialog(WScreen *scr, const char *title, const char *message, const c wm_backend->client_reparent((WNativeWindow)WMWidgetXID(panel->win), (WNativeWindow)parent, 0, 0); center = getCenter(scr, pwidth, pheight); - wwin = wManageInternalWindow(scr, parent, None, NULL, center.x, center.y, pwidth, pheight); + wwin = wManageInternalWindow(scr, parent, WM_NATIVE_NONE, NULL, center.x, center.y, pwidth, pheight); wwin->client_leader = WMWidgetXID(panel->win); WMMapWidget(panel->win); @@ -145,7 +145,7 @@ int wExitDialog(WScreen *scr, const char *title, const char *message, const char wm_backend->client_reparent((WNativeWindow)WMWidgetXID(panel->win), (WNativeWindow)parent, 0, 0); center = getCenter(scr, pwidth, pheight); - wwin = wManageInternalWindow(scr, parent, None, NULL, center.x, center.y, pwidth, pheight); + wwin = wManageInternalWindow(scr, parent, WM_NATIVE_NONE, NULL, center.x, center.y, pwidth, pheight); wwin->client_leader = WMWidgetXID(panel->win); @@ -456,7 +456,7 @@ int wAdvancedInputDialog(WScreen *scr, const char *title, const char *message, c wm_backend->client_reparent((WNativeWindow)WMWidgetXID(p->panel->win), (WNativeWindow)parent, 0, 0); center = getCenter(scr, pwidth, pheight); - wwin = wManageInternalWindow(scr, parent, None, NULL, center.x, center.y, pwidth, pheight); + wwin = wManageInternalWindow(scr, parent, WM_NATIVE_NONE, NULL, center.x, center.y, pwidth, pheight); wwin->client_leader = WMWidgetXID(p->panel->win); @@ -513,7 +513,7 @@ int wInputDialog(WScreen *scr, const char *title, const char *message, char **te wm_backend->client_reparent((WNativeWindow)WMWidgetXID(panel->win), (WNativeWindow)parent, 0, 0); center = getCenter(scr, pwidth, pheight); - wwin = wManageInternalWindow(scr, parent, None, NULL, center.x, center.y, pwidth, pheight); + wwin = wManageInternalWindow(scr, parent, WM_NATIVE_NONE, NULL, center.x, center.y, pwidth, pheight); wwin->client_leader = WMWidgetXID(panel->win); @@ -1063,7 +1063,7 @@ Bool wIconChooserDialog(WScreen *scr, char **file, const char *instance, const c center = getCenter(scr, pwidth, pheight); - wwin = wManageInternalWindow(scr, parent, None, title, center.x, center.y, pwidth, pheight); + wwin = wManageInternalWindow(scr, parent, WM_NATIVE_NONE, title, center.x, center.y, pwidth, pheight); wfree(title); } @@ -1487,7 +1487,7 @@ void wShowInfoPanel(WScreen *scr) WMMapWidget(panel->win); center = getCenter(scr, pwidth, pheight); - wwin = wManageInternalWindow(scr, parent, None, _("Info"), center.x, center.y, pwidth, pheight); + wwin = wManageInternalWindow(scr, parent, WM_NATIVE_NONE, _("Info"), center.x, center.y, pwidth, pheight); WSETUFLAG(wwin, no_closable, 0); WSETUFLAG(wwin, no_close_button, 0); @@ -1591,7 +1591,7 @@ void wShowLegalPanel(WScreen *scr) wm_backend->window_resize((WNativeWindow)parent, pwidth, pheight); wm_backend->client_reparent((WNativeWindow)WMWidgetXID(panel->win), (WNativeWindow)parent, 0, 0); center = getCenter(scr, pwidth, pheight); - wwin = wManageInternalWindow(scr, parent, None, _("Legal"), center.x, center.y, pwidth, pheight); + wwin = wManageInternalWindow(scr, parent, WM_NATIVE_NONE, _("Legal"), center.x, center.y, pwidth, pheight); WSETUFLAG(wwin, no_closable, 0); WSETUFLAG(wwin, no_close_button, 0); @@ -1796,7 +1796,7 @@ int wShowCrashingDialogPanel(int whatSig) WMMapWidget(panel->win); - wm_backend->focus_set((WNativeWindow)WMWidgetXID(panel->win), RevertToParent, CurrentTime); + wm_backend->focus_set((WNativeWindow)WMWidgetXID(panel->win), WM_REVERT_TO_PARENT, WM_CURRENT_TIME); while (!panel->done) { WMEvent event; diff --git a/src/dock.c b/src/dock.c index 4722c50..c68df06 100644 --- a/src/dock.c +++ b/src/dock.c @@ -2009,7 +2009,7 @@ int wDockReceiveDNDDrop(WScreen *scr, WMEvent *event) * In this case, let the ClientMessage handler redirect the * message to the app. */ - if (dock->icon_array[icon_pos]->icon->icon_win != None) + if (dock->icon_array[icon_pos]->icon->icon_win != WM_NATIVE_NONE) return True; if (dock->icon_array[icon_pos]->dnd_command != NULL) { @@ -3265,7 +3265,7 @@ static void trackDeadProcess(pid_t pid, unsigned int status, void *cdata) if (icon->launching && icon->pid == pid) { if (!icon->relaunching) { icon->running = 0; - icon->main_window = None; + icon->main_window = WM_NATIVE_NONE; } wDockFinishLaunch(icon); icon->pid = 0; @@ -3592,7 +3592,7 @@ static void handleDockMove(WDock *dock, WAppIcon *aicon, WMEvent *event) int shad_x = x, shad_y = y; WMEvent ev; int grabbed = 0, done, previously_on_right, now_on_right, previous_x_pos, i; - Pixmap ghost = None; + Pixmap ghost = WM_NATIVE_NONE; int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */ if (!wm_backend->pointer_grab((WNativeWindow)aicon->icon->core->window, WNATIVE_NONE, WM_EVMASK_BUTTON_MOTION | WM_EVMASK_BUTTON_RELEASE | WM_EVMASK_BUTTON_PRESS, WCUR_NORMAL, True, 0)) @@ -3609,7 +3609,7 @@ static void handleDockMove(WDock *dock, WAppIcon *aicon, WMEvent *event) wm_backend->frame_configure((WNativeWindow)scr->dock_shadow, aicon->x_pos, aicon->y_pos, ICON_SIZE, ICON_SIZE); if (superfluous) { - if (icon->pixmap!=None) + if (icon->pixmap!= WM_NATIVE_NONE) ghost = MakeGhostIcon(scr, icon->pixmap); else ghost = MakeGhostIcon(scr, icon->core->window); @@ -3789,7 +3789,7 @@ static void handleDockMove(WDock *dock, WAppIcon *aicon, WMEvent *event) } } if (superfluous) { - if (ghost != None) + if (ghost != WM_NATIVE_NONE) wm_backend->pixmap_free((unsigned long)ghost); wm_backend->window_set_background((WNativeWindow)scr->dock_shadow, scr->white_pixel); } diff --git a/src/dockedapp.c b/src/dockedapp.c index 5f2d7b2..5ff3c26 100644 --- a/src/dockedapp.c +++ b/src/dockedapp.c @@ -394,7 +394,7 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon) } } - panel->wwin = wManageInternalWindow(scr, parent, None, + panel->wwin = wManageInternalWindow(scr, parent, WM_NATIVE_NONE, _("Docked Application Settings"), x, y, pwidth, pheight); panel->wwin->client_leader = WMWidgetXID(panel->win); diff --git a/src/event.c b/src/event.c index 2879c60..37b215e 100644 --- a/src/event.c +++ b/src/event.c @@ -239,7 +239,7 @@ void DispatchEvent(WMEvent * event) break; case WME_MAPPING: - if (event->u.mapping.request == MappingKeyboard || event->u.mapping.request == MappingModifier) + if (event->u.mapping.request == WM_MAPPING_KEYBOARD || event->u.mapping.request == WM_MAPPING_MODIFIER) wm_backend->keyboard_mapping_refresh(event); break; @@ -384,7 +384,7 @@ static void handleDeadProcess(void) static void saveTimestamp(WMEvent * event) { /* - * Never save CurrentTime as LastTimestamp because CurrentTime + * Never save WM_CURRENT_TIME as LastTimestamp because WM_CURRENT_TIME * it's not a real timestamp (it's the 0L constant) */ @@ -463,14 +463,14 @@ static void handleMapRequest(WMEvent * ev) * apps that were forcedly docked (like with dockit). */ if (scr->last_dock) { - if (wwin && wwin->main_window != None && wwin->main_window != window) + if (wwin && wwin->main_window != WM_NATIVE_NONE && wwin->main_window != window) wDockTrackWindowLaunch(scr->last_dock, wwin->main_window); else wDockTrackWindowLaunch(scr->last_dock, window); } if (wwin) { - wClientSetState(wwin, NormalState, None); + wClientSetState(wwin, NormalState, WM_NATIVE_NONE); if (wwin->flags.maximized) { wMaximizeWindow(wwin, wwin->flags.maximized, wGetHeadForWindow(wwin)); @@ -521,13 +521,13 @@ static void handleDestroyNotify(WMEvent * event) fPtr = WMGetFromArray(scr->fakeGroupLeaders, widx); if (fPtr->retainCount > 0) { fPtr->retainCount--; - if (fPtr->retainCount == 0 && fPtr->leader != None) { + if (fPtr->retainCount == 0 && fPtr->leader != WM_NATIVE_NONE) { wm_backend->frame_destroy(NULL, (WNativeWindow)fPtr->leader); - fPtr->leader = None; + fPtr->leader = WM_NATIVE_NONE; wm_backend->event_flush(); } } - fPtr->origLeader = None; + fPtr->origLeader = WM_NATIVE_NONE; } } @@ -538,7 +538,7 @@ static void handleDestroyNotify(WMEvent * event) wwin = app->main_window_desc->screen_ptr->focused_window; while (wwin) { if (wwin->main_window == window) { - wwin->main_window = None; + wwin->main_window = WM_NATIVE_NONE; } wwin = wwin->prev; } @@ -738,7 +738,7 @@ static void handleMapNotify(WMEvent * event) } else { wm_backend->server_grab(); wWindowMap(wwin); - wClientSetState(wwin, NormalState, None); + wClientSetState(wwin, NormalState, WM_NATIVE_NONE); wm_backend->server_ungrab(); } } @@ -787,7 +787,7 @@ static void handleUnmapNotify(WMEvent * event) /* withdraw window */ wwin->flags.mapped = 0; if (!reparented) - wClientSetState(wwin, WithdrawnState, None); + wClientSetState(wwin, WithdrawnState, WM_NATIVE_NONE); /* if the window was reparented, do not reparent it back to the * root window */ @@ -1053,8 +1053,8 @@ static void handleEnterNotify(WMEvent * event) } if (event->u.crossing.window == event->u.crossing.window - && event->u.crossing.detail == NotifyNormal - && event->u.crossing.detail != NotifyInferior && wPreferences.focus_mode != WKF_CLICK) { + && event->u.crossing.detail == WM_NOTIFY_NORMAL + && event->u.crossing.detail != WM_NOTIFY_INFERIOR && wPreferences.focus_mode != WKF_CLICK) { wSetFocusTo(scr, scr->focused_window); } @@ -1113,7 +1113,7 @@ static void handleColormapNotify(WMEvent * event) } while (wm_backend->event_check_type(WME_COLORMAP, event) && ((wwin = wWindowFor(event->u.colormap.window)) || 1)); - if (reinstall && scr->current_colormap != None) { + if (reinstall && scr->current_colormap != WM_NATIVE_NONE) { if (!scr->flags.colormap_stuff_blocked) wm_backend->colormap_install(scr, NULL); } @@ -1128,8 +1128,8 @@ static void handleFocusIn(WMEvent * event) */ wm_backend->event_flush_type(WME_FOCUS_IN); saveTimestamp(event); - if (event->u.focus.mode == NotifyUngrab - || event->u.focus.mode == NotifyGrab || event->u.focus.detail > NotifyNonlinearVirtual) { + if (event->u.focus.mode == WM_NOTIFY_UNGRAB + || event->u.focus.mode == WM_NOTIFY_GRAB || event->u.focus.detail > WM_NOTIFY_NONLINEAR_VIRTUAL) { return; } @@ -1327,7 +1327,7 @@ static void handleKeyPress(WMEvent * event) dontLoop++; /* if the focused window is an internal window, try redispatching * the event to the managed window, as it can be a WINGs window */ - if (wwin && wwin->flags.internal_window && wwin->client_leader != None) { + if (wwin && wwin->flags.internal_window && wwin->client_leader != WM_NATIVE_NONE) { /* client_leader contains the WINGs toplevel */ event->window = wwin->client_leader; WMHandleEvent(event); @@ -1943,7 +1943,7 @@ static void handleVisibilityNotify(WMEvent * event) wwin = wWindowFor(event->u.visibility.window); if (!wwin) return; - wwin->flags.obscured = (event->u.visibility.state == VisibilityFullyObscured); + wwin->flags.obscured = (event->u.visibility.state == WM_VISIBILITY_FULLY_OBSCURED); } /* Selection request/clear handling moved to backend diff --git a/src/framewin.c b/src/framewin.c index 38a9922..afa0cb7 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -633,11 +633,11 @@ renderTexture(WScreen * scr, WTexture * texture, int width, int height, #endif int x, w; - *title = None; - *lbutton = None; - *rbutton = None; + *title = WM_NATIVE_NONE; + *lbutton = WM_NATIVE_NONE; + *rbutton = WM_NATIVE_NONE; #ifdef XKB_BUTTON_HINT - *languagebutton = None; + *languagebutton = WM_NATIVE_NONE; #endif img = wTextureRenderImage(texture, width, height, WREL_FLAT); @@ -728,7 +728,7 @@ renderResizebarTexture(WScreen * scr, WTexture * texture, int width, int height, RColor light; RColor dark; - *pmap = None; + *pmap = WM_NATIVE_NONE; img = wTextureRenderImage(texture, width, height, WREL_FLAT); if (!img) { diff --git a/src/framewin.h b/src/framewin.h index 8380ab1..eaccfe9 100644 --- a/src/framewin.h +++ b/src/framewin.h @@ -70,7 +70,7 @@ typedef struct WFrameWindow { WCoreWindow *resizebar; /* bottom resizebar */ Pixmap title_back[3]; /* focused, unfocused, pfocused */ - Pixmap resizebar_back[3]; /* any, None, None */ + Pixmap resizebar_back[3]; /* any, WM_NATIVE_NONE, WM_NATIVE_NONE */ Pixmap lbutton_back[3]; Pixmap rbutton_back[3]; #ifdef XKB_BUTTON_HINT diff --git a/src/icon.c b/src/icon.c index 5954851..7ffa972 100644 --- a/src/icon.c +++ b/src/icon.c @@ -448,7 +448,7 @@ static RImage *get_wwindow_image_from_wmhints(WWindow *wwin, WIcon *icon) image = RCreateImageFromDrawable(icon->core->screen_ptr->rcontext, (Drawable)hints->icon_pixmap, (hints->flags & IconMaskHint) - ? (Drawable)hints->icon_mask : None); + ? (Drawable)hints->icon_mask : WM_NATIVE_NONE); return image; } @@ -616,7 +616,7 @@ void set_icon_minipreview(WIcon *icon, RImage *image) wPreferences.minipreview_size - 2 * MINIPREVIEW_BORDER); if (RConvertImage(scr->rcontext, scaled_mini_preview, &tmp)) { - if (icon->mini_preview != None) + if (icon->mini_preview != WM_NATIVE_NONE) wm_backend->pixmap_free((unsigned long)icon->mini_preview); icon->mini_preview = tmp; } @@ -633,7 +633,7 @@ void wIconUpdate(WIcon *icon) if (wwin && WFLAGP(wwin, always_user_icon)) { /* Forced use user_icon */ get_rimage_icon_from_user_icon(icon); - } else if (icon->icon_win != None) { + } else if (icon->icon_win != WM_NATIVE_NONE) { /* Get the Pixmap from the WIcon */ get_rimage_icon_from_icon_win(icon); } else if (wwin && wwin->net_icon_image) { @@ -656,24 +656,24 @@ void wIconUpdate(WIcon *icon) void update_icon_pixmap(WIcon *icon) { - if (icon->pixmap != None) + if (icon->pixmap != WM_NATIVE_NONE) wm_backend->pixmap_free((unsigned long)icon->pixmap); - icon->pixmap = None; + icon->pixmap = WM_NATIVE_NONE; /* Create the pixmap */ if (icon->file_image) icon_update_pixmap(icon, icon->file_image); /* If dockapp, put inside the icon */ - if (icon->icon_win != None) { + if (icon->icon_win != WM_NATIVE_NONE) { /* file_image is NULL, because is docked app */ icon_update_pixmap(icon, NULL); set_dockapp_in_icon(icon); } /* No pixmap, set default background */ - if (icon->pixmap != None) + if (icon->pixmap != WM_NATIVE_NONE) wm_backend->window_set_background_pixmap((WNativeWindow)icon->core->window, (unsigned long)icon->pixmap); /* Paint it */ @@ -760,8 +760,8 @@ static void set_dockapp_in_icon(WIcon *icon) if (wm_backend->window_get_event_mask((WNativeWindow)icon->icon_win) && WM_EVMASK_BUTTON_PRESS) wHackedGrabButton(Button1, MOD_MASK, icon->core->window, True, - WM_EVMASK_BUTTON_PRESS, GrabModeSync, GrabModeAsync, - None, wPreferences.cursor[WCUR_ARROW]); + WM_EVMASK_BUTTON_PRESS, WM_GRAB_MODE_SYNC, WM_GRAB_MODE_ASYNC, + WM_NATIVE_NONE, wPreferences.cursor[WCUR_ARROW]); } /* Get the RImage from the XWindow wm_hints */ diff --git a/src/main.c b/src/main.c index f233e6e..abccfda 100644 --- a/src/main.c +++ b/src/main.c @@ -562,8 +562,8 @@ int main(int argc, char **argv) memset(&w_global, 0, sizeof(w_global)); w_global.program.state = WSTATE_NORMAL; w_global.program.signal_state = WSTATE_NORMAL; - w_global.timestamp.last_event = CurrentTime; - w_global.timestamp.focus_change = CurrentTime; + w_global.timestamp.last_event = WM_CURRENT_TIME; + w_global.timestamp.focus_change = WM_CURRENT_TIME; w_global.ignore_workspace_change = False; w_global.shortcut.modifiers_mask = 0xff; diff --git a/src/menu.c b/src/menu.c index a27ed63..dfb6f29 100644 --- a/src/menu.c +++ b/src/menu.c @@ -198,7 +198,7 @@ WMenu *wMenuCreate(WScreen *screen, const char *title, int main_menu) menu->menu->descriptor.handle_expose = menuExpose; menu->menu->descriptor.handle_mousedown = menuMouseDown; - menu->menu_texture_data = None; + menu->menu_texture_data = WM_NATIVE_NONE; if (menu->menu->window) wm_backend->window_map((WNativeWindow)menu->menu->window); @@ -404,7 +404,7 @@ static Pixmap renderTexture(WMenu * menu) if (!img) { wwarning(_("could not render texture: %s"), RMessageForError(RErrorCode)); - return None; + return WM_NATIVE_NONE; } if (wPreferences.menu_style == MS_SINGLE_TEXTURE) { @@ -440,7 +440,7 @@ static void updateTexture(WMenu * menu) { WScreen *scr = menu->menu->screen_ptr; - /* Wayland backend: menu windows have ID=None; skip X11 background updates. */ + /* Wayland backend: menu windows have ID= WM_NATIVE_NONE; skip X11 background updates. */ if (!menu->menu->window) return; @@ -1273,7 +1273,7 @@ WMenu *wMenuUnderPointer(WScreen * screen) wm_backend->pointer_get_position(&dummy, &dummy); mask = 0; - if (win == None) + if (win == WM_NATIVE_NONE) return NULL; desc = wm_backend->context_find(win, WM_CTX_CLIENT_WIN); diff --git a/src/rootmenu.c b/src/rootmenu.c index cf412f4..ad9f8ad 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -350,7 +350,7 @@ void wRootMenuBindShortcuts(Window window) wm_backend->key_grab((WNativeWindow)window, ptr->keycode, ptr->modifier | WM_MOD_LOCK, True); #ifdef NUMLOCK_HACK - wHackedGrabKey(ptr->keycode, ptr->modifier, window, True, GrabModeAsync, GrabModeAsync); + wHackedGrabKey(ptr->keycode, ptr->modifier, window, True, WM_GRAB_MODE_ASYNC, WM_GRAB_MODE_ASYNC); #endif } wm_backend->key_grab((WNativeWindow)window, ptr->keycode, diff --git a/src/screen.c b/src/screen.c index 8fb8d4a..1accdf0 100644 --- a/src/screen.c +++ b/src/screen.c @@ -611,7 +611,7 @@ void ScreenCapture(WScreen *scr, int mode) wwin = scr->focused_window; if (wwin && !wwin->flags.shaded) { if (wwin->focus_mode >= WFM_LOCALLY_ACTIVE) { - img = RCreateImageFromDrawable(scr->rcontext, wwin->client_win, None); + img = RCreateImageFromDrawable(scr->rcontext, wwin->client_win, WM_NATIVE_NONE); } else { img = wm_backend->screen_capture_window(scr, wwin); } @@ -622,7 +622,7 @@ void ScreenCapture(WScreen *scr, int mode) break; default: /* PRINT_SCREEN */ - img = RCreateImageFromDrawable(scr->rcontext, scr->root_win, None); + img = RCreateImageFromDrawable(scr->rcontext, scr->root_win, WM_NATIVE_NONE); } if (img) { diff --git a/src/session.c b/src/session.c index da05994..36e9bd3 100644 --- a/src/session.c +++ b/src/session.c @@ -193,7 +193,7 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp) WMPropList *shaded, *miniaturized, *maximized, *hidden, *geometry; WMPropList *dock, *shortcut; - if (wwin->orig_main_window != None && wwin->orig_main_window != wwin->client_win) + if (wwin->orig_main_window != WM_NATIVE_NONE && wwin->orig_main_window != wwin->client_win) win = wwin->orig_main_window; else win = wwin->client_win; @@ -319,7 +319,7 @@ void wSessionSaveState(WScreen * scr) WApplication *wapp = wApplicationOf(wwin->main_window); Window appId = wwin->orig_main_window; - if ((wwin->transient_for == None || wwin->transient_for == wwin->screen_ptr->root_win) + if ((wwin->transient_for == WM_NATIVE_NONE || wwin->transient_for == wwin->screen_ptr->root_win) && (WMGetFirstInArray(wapp_list, (void *)appId) == WANotFound || WFLAGP(wwin, shared_appicon)) && !WFLAGP(wwin, dont_save_session)) { diff --git a/src/startup.c b/src/startup.c index a7dc04a..e118e77 100644 --- a/src/startup.c +++ b/src/startup.c @@ -557,7 +557,7 @@ void wManageAllWindows(WScreen * scr, int crashRecovery) for (i = 0; i < nchildren; i++) { WWMHints *wmhints; - if (children[i] == None) + if (children[i] == WM_NATIVE_NONE) continue; wmhints = wm_backend->prop_get_wm_hints((WNativeWindow)children[i]); @@ -566,7 +566,7 @@ void wManageAllWindows(WScreen * scr, int crashRecovery) if (children[j] == (Window)wmhints->icon_window) { wfree(wmhints); wmhints = NULL; - children[j] = None; + children[j] = WM_NATIVE_NONE; break; } } @@ -577,7 +577,7 @@ void wManageAllWindows(WScreen * scr, int crashRecovery) } for (i = 0; i < nchildren; i++) { - if (children[i] == None) + if (children[i] == WM_NATIVE_NONE) continue; wwin = wManageWindow(scr, children[i]); @@ -589,7 +589,7 @@ void wManageAllWindows(WScreen * scr, int crashRecovery) wShadeWindow(wwin); } if (wwin->flags.miniaturized - && (wwin->transient_for == None + && (wwin->transient_for == WM_NATIVE_NONE || wwin->transient_for == scr->root_win || !windowInList(wwin->transient_for, children, nchildren))) { @@ -597,7 +597,7 @@ void wManageAllWindows(WScreen * scr, int crashRecovery) wwin->flags.miniaturized = 0; wIconifyWindow(wwin); } else { - wClientSetState(wwin, NormalState, None); + wClientSetState(wwin, NormalState, WM_NATIVE_NONE); } if (crashRecovery) { int border; diff --git a/src/superfluous.c b/src/superfluous.c index 5b9021d..9e02fde 100644 --- a/src/superfluous.c +++ b/src/superfluous.c @@ -59,11 +59,11 @@ Pixmap MakeGhostIcon(WScreen * scr, Drawable drawable) Pixmap pixmap; if (!drawable) - return None; + return WM_NATIVE_NONE; - back = RCreateImageFromDrawable(scr->rcontext, drawable, None); + back = RCreateImageFromDrawable(scr->rcontext, drawable, WM_NATIVE_NONE); if (!back) - return None; + return WM_NATIVE_NONE; color.red = 0xff; color.green = 0xff; diff --git a/src/switchpanel.c b/src/switchpanel.c index 1fe95af..f28a8d5 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -722,7 +722,7 @@ WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, WMEvent *event) Window wSwitchPanelGetWindow(WSwitchPanel *swpanel) { if (!swpanel->win) - return None; + return WM_NATIVE_NONE; return WMWidgetXID(swpanel->win); } diff --git a/src/texture.h b/src/texture.h index 09b5868..7d59d6a 100644 --- a/src/texture.h +++ b/src/texture.h @@ -175,7 +175,7 @@ void wTexturePaintTitlebar(struct WWindow *wwin, WTexture *texture, Pixmap *tdat int repaint); -#define FREE_PIXMAP(p) if ((p)!=None) wm_backend->pixmap_free((unsigned long)(p)), (p)=None +#define FREE_PIXMAP(p) if ((p)!= WM_NATIVE_NONE) wm_backend->pixmap_free((unsigned long)(p)), (p)= WM_NATIVE_NONE void wDrawBevel(Drawable d, unsigned width, unsigned height, WTexSolid *texture, int relief); diff --git a/src/window.c b/src/window.c index f742bdb..0dfca05 100644 --- a/src/window.c +++ b/src/window.c @@ -130,7 +130,7 @@ WWindow *wWindowFor(WNativeWindow window) { WObjDescriptor *desc; - if (window == None) + if (window == WM_NATIVE_NONE) return NULL; desc = wm_backend->context_find(window, WM_CTX_CLIENT_WIN); @@ -188,10 +188,10 @@ void wWindowDestroy(WWindow *wwin) if (wwin->fake_group && wwin->fake_group->retainCount > 0) { wwin->fake_group->retainCount--; - if (wwin->fake_group->retainCount == 0 && wwin->fake_group->leader != None) { + if (wwin->fake_group->retainCount == 0 && wwin->fake_group->leader != WM_NATIVE_NONE) { wm_backend->fake_leader_destroy(wwin->fake_group->leader); - wwin->fake_group->leader = None; - wwin->fake_group->origLeader = None; + wwin->fake_group->leader = WM_NATIVE_NONE; + wwin->fake_group->origLeader = WM_NATIVE_NONE; wm_backend->event_flush(); } } @@ -323,7 +323,7 @@ void wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace) wwin->client_flags.kill_close = 1; /* transients can't be iconified or maximized */ - if (wwin->transient_for != None && wwin->transient_for != scr->root_win) { + if (wwin->transient_for != WM_NATIVE_NONE && wwin->transient_for != scr->root_win) { wwin->client_flags.no_miniaturizable = 1; wwin->client_flags.no_miniaturize_button = 1; } @@ -379,7 +379,7 @@ void wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace) *level = tmp_level; } - if (wwin->transient_for != None && wwin->transient_for != scr->root_win) { + if (wwin->transient_for != WM_NATIVE_NONE && wwin->transient_for != scr->root_win) { WWindow *transientOwner = wWindowFor(wwin->transient_for); if (transientOwner) { int ownerLevel = transientOwner->frame->core->stacking->window_level; @@ -418,13 +418,13 @@ void wWindowSetupInitialAttributes(WWindow *wwin, int *level, int *workspace) if (wwin->user_flags.no_appicon && wwin->defined_user_flags.no_appicon) wwin->user_flags.emulate_appicon = 0; - if (wwin->main_window != None) { + if (wwin->main_window != WM_NATIVE_NONE) { WApplication *wapp = wApplicationOf(wwin->main_window); if (wapp && !wapp->flags.emulated) wwin->user_flags.emulate_appicon = 0; } - if (wwin->transient_for != None && wwin->transient_for != wwin->screen_ptr->root_win) + if (wwin->transient_for != WM_NATIVE_NONE && wwin->transient_for != wwin->screen_ptr->root_win) wwin->user_flags.emulate_appicon = 0; if (wwin->user_flags.sunken && wwin->defined_user_flags.sunken @@ -685,7 +685,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) } wwin->client_leader = PropGetClientLeader(window); - if (wwin->client_leader != None) + if (wwin->client_leader != WM_NATIVE_NONE) wwin->main_window = wwin->client_leader; wwin->wm_hints = wm_backend->prop_get_wm_hints(window); @@ -705,7 +705,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) /* window_group has priority over CLIENT_LEADER */ wwin->main_window = wwin->group_id; } else { - wwin->group_id = None; + wwin->group_id = WM_NATIVE_NONE; } if (wwin->wm_hints->flags & UrgencyHint) { @@ -713,20 +713,20 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) wAppBounceWhileUrgent(wApplicationOf(wwin->main_window)); } } else { - wwin->group_id = None; + wwin->group_id = WM_NATIVE_NONE; } wm_backend->prop_get_protocols((WNativeWindow)window, &wwin->protocols); wwin->transient_for = wm_backend->prop_get_transient_for(window); if (wwin->transient_for == WNATIVE_NONE) { - wwin->transient_for = None; + wwin->transient_for = WM_NATIVE_NONE; } else { - if (wwin->transient_for == None || wwin->transient_for == window) { + if (wwin->transient_for == WM_NATIVE_NONE || wwin->transient_for == window) { wwin->transient_for = scr->root_win; } else { transientOwner = wWindowFor(wwin->transient_for); - if (transientOwner && transientOwner->main_window != None) + if (transientOwner && transientOwner->main_window != WM_NATIVE_NONE) wwin->main_window = transientOwner->main_window; } } @@ -776,7 +776,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) WFakeGroupLeader *fPtr; int index; -#define ADEQUATE(x) ((x)!=None && (x)!=wwin->client_win && (x)!=fPtr->leader) +#define ADEQUATE(x) ((x)!= WM_NATIVE_NONE && (x)!=wwin->client_win && (x)!=fPtr->leader) /* // only enter here if PropGetWMClass() succeeds */ PropGetWMClass(wwin->main_window, &class, &instance); @@ -790,7 +790,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) instance, class); fPtr->retainCount++; - if (fPtr->origLeader == None) { + if (fPtr->origLeader == WM_NATIVE_NONE) { if (ADEQUATE(wwin->main_window)) { fPtr->retainCount++; fPtr->origLeader = wwin->main_window; @@ -804,7 +804,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) fPtr->identifier = buffer; fPtr->leader = createFakeWindowGroupLeader(scr, wwin->main_window, instance, class); - fPtr->origLeader = None; + fPtr->origLeader = WM_NATIVE_NONE; fPtr->retainCount = 1; WMAddToArray(scr->fakeGroupLeaders, fPtr); @@ -846,7 +846,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) /* if there is a saved state (from file), restore it */ win_state = NULL; - if (wwin->main_window != None) + if (wwin->main_window != WM_NATIVE_NONE) win_state = (WWindowState *) wWindowGetSavedState(wwin->main_window); else win_state = (WWindowState *) wWindowGetSavedState(window); @@ -972,7 +972,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) if (win_state && win_state->state->w > 0) { x = win_state->state->x; y = win_state->state->y; - } else if ((wwin->transient_for == None || wPreferences.window_placement != WPM_MANUAL) + } else if ((wwin->transient_for == WM_NATIVE_NONE || wPreferences.window_placement != WPM_MANUAL) && !scr->flags.startup && !wwin->flags.miniaturized && !wwin->flags.maximized && !(wwin->normal_hints->flags & (USPosition | PPosition))) { @@ -1173,7 +1173,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) } /* Setup descriptors and save window to internal lists */ - if (wwin->main_window != None) { + if (wwin->main_window != WM_NATIVE_NONE) { WApplication *app; WWindow *leader; @@ -1181,7 +1181,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) * If this is the case, point the leader of this window to * itself */ leader = wWindowFor(wwin->main_window); - if (leader && leader->main_window == None) + if (leader && leader->main_window == WM_NATIVE_NONE) leader->main_window = leader->client_win; app = wApplicationCreate(wwin); @@ -1227,12 +1227,12 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) * WM_STATE set before they get mapped. Else WM_STATE is set later, * after the return from this function. */ if (wwin->wm_hints && (wwin->wm_hints->flags & StateHint)) - wClientSetState(wwin, wwin->wm_hints->initial_state, None); + wClientSetState(wwin, wwin->wm_hints->initial_state, WM_NATIVE_NONE); else - wClientSetState(wwin, NormalState, None); + wClientSetState(wwin, NormalState, WM_NATIVE_NONE); if (wwin->frame && wPreferences.superfluous && !wPreferences.no_animations && !scr->flags.startup && - (wwin->transient_for == None || wwin->transient_for == scr->root_win) && + (wwin->transient_for == WM_NATIVE_NONE || wwin->transient_for == scr->root_win) && (wPreferences.focus_mode == WKF_CLICK || wPreferences.auto_focus)) DoWindowBirth(wwin); @@ -1319,7 +1319,7 @@ WWindow *wManageWindow(WScreen *scr, WNativeWindow window) * Must do some optimization, 'though */ if (withdraw) { wwin->flags.mapped = 0; - wClientSetState(wwin, WithdrawnState, None); + wClientSetState(wwin, WithdrawnState, WM_NATIVE_NONE); wUnmanageWindow(wwin, True, False); wwin = NULL; } @@ -1415,7 +1415,7 @@ WWindow *wManageInternalWindow(WScreen *scr, WNativeWindow window, WNativeWindow wm_backend->frame_paint(wwin->frame); /* setup stacking descriptor */ - if (wwin->transient_for != None && wwin->transient_for != scr->root_win) { + if (wwin->transient_for != WM_NATIVE_NONE && wwin->transient_for != scr->root_win) { WWindow *tmp; tmp = wWindowFor(wwin->transient_for); if (tmp) @@ -1787,7 +1787,7 @@ void wWindowUnfocus(WWindow *wwin) if (wwin->flags.is_gnustep == 0 && wwin->frame) wFrameWindowChangeState(wwin->frame, wwin->flags.semi_focused ? WS_PFOCUSED : WS_UNFOCUSED); - if (wwin->transient_for != None && wwin->transient_for != wwin->screen_ptr->root_win) { + if (wwin->transient_for != WM_NATIVE_NONE && wwin->transient_for != wwin->screen_ptr->root_win) { WWindow *owner; owner = wWindowFor(wwin->transient_for); if (owner && owner->flags.semi_focused) { @@ -2072,7 +2072,7 @@ void wWindowUpdateButtonImages(WWindow *wwin) if (wwin->wm_gnustep_attr->flags & GSMiniaturizeMaskAttr) mask = wwin->wm_gnustep_attr->miniaturize_mask; else - mask = None; + mask = WM_NATIVE_NONE; if (fwin->lbutton_image && (fwin->lbutton_image->image != pixmap || fwin->lbutton_image->mask != mask)) { @@ -2113,7 +2113,7 @@ void wWindowUpdateButtonImages(WWindow *wwin) if (wwin->wm_gnustep_attr->flags & GSCloseMaskAttr) mask = wwin->wm_gnustep_attr->close_mask; else - mask = None; + mask = WM_NATIVE_NONE; if (fwin->rbutton_image && (fwin->rbutton_image->image != pixmap || fwin->rbutton_image->mask != mask)) { diff --git a/src/winspector.c b/src/winspector.c index 121b516..a24fe16 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -654,7 +654,7 @@ static void saveSettings(WMWidget *button, void *client_data) } /* Attributes... --> Application Specific */ - if (wwin->main_window != None && wApplicationOf(wwin->main_window) != NULL) { + if (wwin->main_window != WM_NATIVE_NONE && wApplicationOf(wwin->main_window) != NULL) { for (i = 0; i < wlengthof(application_attr); i++) { value = (WMGetButtonSelected(panel->appChk[i]) != 0) ? Yes : No; different2 |= insertAttribute(dict, appDic, pl_appattrib[i], value, flags); @@ -1190,7 +1190,7 @@ static InspectorPanel *createInspectorForWindow(WWindow *wwin, int xpos, int ypo create_tab_app_specific(wwin, panel, frame_width); /* if the window is a transient, don't let it have a miniaturize button */ - if (wwin->transient_for != None && wwin->transient_for != scr->root_win) + if (wwin->transient_for != WM_NATIVE_NONE && wwin->transient_for != scr->root_win) WMSetButtonEnabled(panel->attrChk[3], False); else WMSetButtonEnabled(panel->attrChk[3], True); @@ -1282,7 +1282,7 @@ void wHideInspectorForWindow(WWindow *wwin) wWindowUnmap(pwin); pwin->flags.hidden = 1; - wClientSetState(pwin, IconicState, None); + wClientSetState(pwin, IconicState, WM_NATIVE_NONE); } void wUnhideInspectorForWindow(WWindow *wwin) @@ -1293,7 +1293,7 @@ void wUnhideInspectorForWindow(WWindow *wwin) pwin->flags.mapped = 1; wm_backend->window_map((WNativeWindow)pwin->client_win); wm_backend->window_map((WNativeWindow)pwin->frame->core->window); - wClientSetState(pwin, NormalState, None); + wClientSetState(pwin, NormalState, WM_NATIVE_NONE); } WWindow *wGetWindowOfInspectorForWindow(WWindow *wwin) @@ -1438,7 +1438,7 @@ static void create_tab_app_specific(WWindow *wwin, InspectorPanel *panel, int fr WScreen *scr = wwin->screen_ptr; int i = 0, tmp; - if (wwin->main_window != None) { + if (wwin->main_window != WM_NATIVE_NONE) { WApplication *wapp = wApplicationOf(wwin->main_window); panel->appFrm = WMCreateFrame(panel->win); @@ -1473,7 +1473,7 @@ static void create_tab_app_specific(WWindow *wwin, InspectorPanel *panel, int fr WMSetButtonEnabled(panel->moreChk[7], False); } } else { - if ((wwin->transient_for != None && wwin->transient_for != scr->root_win) + if ((wwin->transient_for != WM_NATIVE_NONE && wwin->transient_for != scr->root_win) || !wwin->wm_class || !wwin->wm_instance) tmp = False; else