static Bool
xf86CursorCloseScreen(int i, ScreenPtr pScreen)
{
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate(
	&pScreen->devPrivates, miPointerScreenKey);
    xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
	&pScreen->devPrivates, xf86CursorScreenKey);

    if (ScreenPriv->isUp && pScrn->vtSema)
	xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);

    if (ScreenPriv->CurrentCursor)
	FreeCursor(ScreenPriv->CurrentCursor, None);

    pScreen->CloseScreen = ScreenPriv->CloseScreen;
    pScreen->QueryBestSize = ScreenPriv->QueryBestSize;
    pScreen->RecolorCursor = ScreenPriv->RecolorCursor;
    if (ScreenPriv->InstallColormap)
	pScreen->InstallColormap = ScreenPriv->InstallColormap;

    PointPriv->spriteFuncs = ScreenPriv->spriteFuncs;
    PointPriv->showTransparent = ScreenPriv->showTransparent;

    pScrn->EnableDisableFBAccess = ScreenPriv->EnableDisableFBAccess;
    pScrn->SwitchMode = ScreenPriv->SwitchMode;

    free(ScreenPriv->transparentData);
    free(ScreenPriv);

    return (*pScreen->CloseScreen)(i, pScreen);
}
Beispiel #2
0
static void
crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 * image)
{
    xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
    modesettingPtr ms = modesettingPTR(crtc->scrn);

    /* Older X servers have cursor reference counting bugs leading to use of
     * freed memory and consequently random crashes. Should be fixed as of
     * xserver 1.8, but this workaround shouldn't hurt anyway.
     */
    if (config->cursor)
       config->cursor->refcnt++;

    if (ms->cursor)
       FreeCursor(ms->cursor, None);

    ms->cursor = config->cursor;

    if (ms->screen)
	crtc_load_cursor_argb_ga3d(crtc, image);
#ifdef HAVE_LIBKMS
    else if (ms->kms)
	crtc_load_cursor_argb_kms(crtc, image);
#endif
}
void
Tk_FreeCursorFromObj(
    Tk_Window tkwin,		/* The window this cursor lives in. Needed for
				 * the display value. */
    Tcl_Obj *objPtr)		/* The Tcl_Obj * to be freed. */
{
    FreeCursor(GetCursorFromObj(tkwin, objPtr));
    FreeCursorObjProc(objPtr);
}
Beispiel #4
0
static void
FreeGrab(GrabPtr pGrab)
{
    free(pGrab->modifiersDetail.pMask);
    free(pGrab->detail.pMask);

    if (pGrab->cursor)
	FreeCursor(pGrab->cursor, (Cursor)0);

    free(pGrab);
}
Beispiel #5
0
void
FreeGrab(GrabPtr pGrab)
{
    BUG_RETURN(!pGrab);

    free(pGrab->modifiersDetail.pMask);
    free(pGrab->detail.pMask);

    if (pGrab->cursor)
        FreeCursor(pGrab->cursor, (Cursor) 0);

    xi2mask_free(&pGrab->xi2mask);
    free(pGrab);
}
Beispiel #6
0
void
FreeGrab(GrabPtr pGrab)
{
    if (pGrab->grabtype == XI2 && pGrab->type == XI_TouchBegin)
        TouchListenerGone(pGrab->resource);

    free(pGrab->modifiersDetail.pMask);
    free(pGrab->detail.pMask);

    if (pGrab->cursor)
	FreeCursor(pGrab->cursor, (Cursor)0);

    xi2mask_free(&pGrab->xi2mask);
    free(pGrab);
}
Beispiel #7
0
/**
 * Clean up CRTC-based cursor code
 */
void
xf86_cursors_fini(ScreenPtr screen)
{
    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
    xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);

    if (xf86_config->cursor_info) {
        xf86DestroyCursorInfoRec(xf86_config->cursor_info);
        xf86_config->cursor_info = NULL;
    }
    free(xf86_config->cursor_image);
    xf86_config->cursor_image = NULL;
    if (xf86_config->cursor) {
        FreeCursor(xf86_config->cursor, None);
        xf86_config->cursor = NULL;
    }
}
static Bool
xf86_use_hw_cursor (ScreenPtr screen, CursorPtr cursor)
{
    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;

    ++cursor->refcnt;
    if (xf86_config->cursor)
	FreeCursor (xf86_config->cursor, None);
    xf86_config->cursor = cursor;

    if (cursor->bits->width > cursor_info->MaxWidth ||
	cursor->bits->height> cursor_info->MaxHeight)
	return FALSE;

    return TRUE;
}
void
Tk_FreeCursor(
    Display *display,		/* Display for which cursor was allocated. */
    Tk_Cursor cursor)		/* Identifier for cursor to be released. */
{
    Tcl_HashEntry *idHashPtr;
    TkDisplay *dispPtr = TkGetDisplay(display);

    if (!dispPtr->cursorInit) {
	Tcl_Panic("Tk_FreeCursor called before Tk_GetCursor");
    }

    idHashPtr = Tcl_FindHashEntry(&dispPtr->cursorIdTable, (char *) cursor);
    if (idHashPtr == NULL) {
	Tcl_Panic("Tk_FreeCursor received unknown cursor argument");
    }
    FreeCursor((TkCursor *) Tcl_GetHashValue(idHashPtr));
}
Beispiel #10
0
void __cdecl free_game()
{
	int i; // esi

	FreeControlPan();
	FreeInvGFX();
	FreeGMenu();
	FreeQuestText();
	FreeStoreMem();

	for(i = 0; i < 4; i++)
		FreePlayerGFX(i);

	FreeItemGFX();
	FreeCursor();
	FreeLightTable();
	FreeDebugGFX();
	FreeGameMem();
}
Beispiel #11
0
static Bool
AnimCurUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
    AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
    Bool ret;

    Unwrap(as, pScreen, UnrealizeCursor);
    if (IsAnimCur(pCursor)) {
        AnimCurPtr ac = GetAnimCur(pCursor);
        int i;

        if (pScreen->myNum == 0)
            for (i = 0; i < ac->nelt; i++)
                FreeCursor(ac->elts[i].pCursor, 0);
        ret = TRUE;
    }
    else
        ret = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor);
    Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
    return ret;
}
static Bool
xf86_use_hw_cursor_argb (ScreenPtr screen, CursorPtr cursor)
{
    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
    
    ++cursor->refcnt;
    if (xf86_config->cursor)
	FreeCursor (xf86_config->cursor, None);
    xf86_config->cursor = cursor;
    
    /* Make sure ARGB support is available */
    if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0)
	return FALSE;
    
    if (cursor->bits->width > cursor_info->MaxWidth ||
	cursor->bits->height> cursor_info->MaxHeight)
	return FALSE;

    return TRUE;
}
Beispiel #13
0
CGeneral::~CGeneral()
{
   FreeCursor();
   FreeImages();
   FreeSound();
}