new [cache/pointer]: don't require pointer functions to be set

This as cleanup/rework of PR #4581.
This commit is contained in:
Bernhard Miklautz 2018-10-18 14:32:08 +02:00
parent 3d0ccb3f5d
commit e114ee44e4
1 changed files with 6 additions and 12 deletions

View File

@ -71,7 +71,7 @@ static BOOL update_pointer_position(rdpContext* context,
return FALSE; return FALSE;
pointer = context->graphics->Pointer_Prototype; pointer = context->graphics->Pointer_Prototype;
return pointer->SetPosition(context, pointer_position->xPos, return IFCALLRESULT(TRUE, pointer->SetPosition, context, pointer_position->xPos,
pointer_position->yPos); pointer_position->yPos);
} }
@ -89,17 +89,14 @@ static BOOL update_pointer_system(rdpContext* context,
switch (pointer_system->type) switch (pointer_system->type)
{ {
case SYSPTR_NULL: case SYSPTR_NULL:
IFCALL(pointer->SetNull, context); return IFCALLRESULT(TRUE, pointer->SetNull, context);
break;
case SYSPTR_DEFAULT: case SYSPTR_DEFAULT:
IFCALL(pointer->SetDefault, context); return IFCALLRESULT(TRUE, pointer->SetDefault, context);
break;
default: default:
WLog_ERR(TAG, "Unknown system pointer type (0x%08"PRIX32")", pointer_system->type); WLog_ERR(TAG, "Unknown system pointer type (0x%08"PRIX32")", pointer_system->type);
} }
return TRUE; return TRUE;
} }
@ -148,7 +145,7 @@ static BOOL update_pointer_color(rdpContext* context,
if (!pointer_cache_put(cache->pointer, pointer_color->cacheIndex, pointer)) if (!pointer_cache_put(cache->pointer, pointer_color->cacheIndex, pointer))
goto out_fail; goto out_fail;
return pointer->Set(context, pointer); return IFCALLRESULT(TRUE, pointer->Set, context, pointer);
} }
return FALSE; return FALSE;
@ -209,7 +206,7 @@ static BOOL update_pointer_new(rdpContext* context,
pointer)) pointer))
goto out_fail; goto out_fail;
return pointer->Set(context, pointer); return IFCALLRESULT(TRUE, pointer->Set, context, pointer);
out_fail: out_fail:
pointer_free(context, pointer); pointer_free(context, pointer);
return FALSE; return FALSE;
@ -223,10 +220,7 @@ static BOOL update_pointer_cached(rdpContext* context,
pointer = pointer_cache_get(cache->pointer, pointer_cached->cacheIndex); pointer = pointer_cache_get(cache->pointer, pointer_cached->cacheIndex);
if (pointer != NULL) if (pointer != NULL)
{ return IFCALLRESULT(TRUE, pointer->Set, context, pointer);
pointer->Set(context, pointer);
return TRUE;
}
return FALSE; return FALSE;
} }