1
0
mirror of https://github.com/Halofreak1990/XFXFramework synced 2024-12-26 13:49:34 +01:00

Added missing TypeInfos to XFX::Input namespace

Updated function incorrect signatures in libXFX
This commit is contained in:
Tom Lint 2013-10-03 14:40:24 +02:00
parent 7c5bc83237
commit 95bf1d7ebc
16 changed files with 155 additions and 74 deletions

View File

@ -10,6 +10,7 @@
#include <System/Collections/Generic/Interfaces.h> #include <System/Collections/Generic/Interfaces.h>
#include <System/Delegates.h> #include <System/Delegates.h>
#include <System/Interfaces.h> #include <System/Interfaces.h>
#include <System/Nullable.h>
#include <System/TimeSpan.h> #include <System/TimeSpan.h>
#include <System/Types.h> #include <System/Types.h>
#include <Storage/StorageDevice.h> #include <Storage/StorageDevice.h>
@ -47,7 +48,7 @@ namespace XFX
static IAsyncResult* BeginShowStorageDeviceSelector(const PlayerIndex_t player, AsyncCallback callback, Object* state); static IAsyncResult* BeginShowStorageDeviceSelector(const PlayerIndex_t player, AsyncCallback callback, Object* state);
static void DelayNotifications(const TimeSpan timespan); static void DelayNotifications(const TimeSpan timespan);
static String EndShowKeyboardInput(IAsyncResult* result); static String EndShowKeyboardInput(IAsyncResult* result);
static int EndShowMessageBox(IAsyncResult* result); static Nullable<int> EndShowMessageBox(IAsyncResult* result);
static StorageDevice EndShowStorageDeviceSelector(IAsyncResult* result); static StorageDevice EndShowStorageDeviceSelector(IAsyncResult* result);
}; };
} }

View File

@ -1,8 +1,8 @@
/***************************************************************************** /*****************************************************************************
* Keyboard.h * * Keyboard.h *
* * * *
* XFX::Input::Keyboard class definition file * * XFX::Input::Keyboard class definition file. *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved. *
*****************************************************************************/ *****************************************************************************/
#ifndef _XFX_INPUT_KEYBOARD_ #ifndef _XFX_INPUT_KEYBOARD_
#define _XFX_INPUT_KEYBOARD_ #define _XFX_INPUT_KEYBOARD_

View File

@ -9,6 +9,7 @@
#include <System/Runtime/InteropServices/ExternalException.h> #include <System/Runtime/InteropServices/ExternalException.h>
using namespace System;
using namespace System::Runtime::InteropServices; using namespace System::Runtime::InteropServices;
namespace XFX namespace XFX

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* ExternalException.h * * ExternalException.h *
* * * *
* XFX ExternalException definition * * System::Runtime::InteropServices::ExternalException definition file. *
* Copyright © XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _SYSTEM_RUNTIME_INTEROPSERVICES_ExternalException_ #ifndef _SYSTEM_RUNTIME_INTEROPSERVICES_ExternalException_
#define _SYSTEM_RUNTIME_INTEROPSERVICES_ExternalException_ #define _SYSTEM_RUNTIME_INTEROPSERVICES_ExternalException_
@ -15,15 +15,15 @@ namespace System
{ {
namespace InteropServices namespace InteropServices
{ {
/// <summary> /**
/// The base exception type for all COM interop exceptions and structured exception handling (SEH) exceptions. * The base exception type for all COM interop exceptions and structured exception handling (SEH) exceptions.
/// </summary> */
class ExternalException : public SystemException class ExternalException : public SystemException
{ {
public: public:
ExternalException(); ExternalException();
ExternalException(char* message); ExternalException(const String& message);
ExternalException(char* message, Exception* inner); ExternalException(const String& message, Exception * const inner);
}; };
} }
} }

View File

@ -60,10 +60,12 @@ namespace XFX
ContentReader::~ContentReader() ContentReader::~ContentReader()
{ {
// TODO: implement
} }
Stream* ContentReader::PrepareStream(Stream * const, const String& assetName) Stream* ContentReader::PrepareStream(Stream * const, const String& assetName)
{ {
// TODO: implement
} }
Matrix ContentReader::ReadMatrix() Matrix ContentReader::ReadMatrix()

View File

@ -34,6 +34,7 @@ extern "C"
#include <Input/GamePad.h> #include <Input/GamePad.h>
#include <System/Array.h> #include <System/Array.h>
#include <System/String.h> #include <System/String.h>
#include <System/Type.h>
using namespace System; using namespace System;
@ -50,7 +51,12 @@ namespace XFX
{ {
namespace Input namespace Input
{ {
GamePadState g_State; static GamePadState g_State;
const Type GamePadDPadTypeInfo("GamePadDPad", "XFX::Input::GamePadDPad", TypeCode::Object);
const Type GamePadButtonsTypeInfo("GamePadButtons", "XFX::Input::GamePadButtons", TypeCode::Object);
const Type GamePadStateTypeInfo("GamePadState", "XFX::Input::GamePadState", TypeCode::Object);
const Type GamePadThumbSticksTypeInfo("GamePadThumbSticks", "XFX::Input::GamePadThumbSticks", TypeCode::Object);
const Type GamePadTriggersTypeInfo("GamePadTriggers", "XFX::Input::GamePadTriggers", TypeCode::Object);
GamePadState GamePad::GetState(const PlayerIndex_t playerIndex) GamePadState GamePad::GetState(const PlayerIndex_t playerIndex)
{ {
@ -136,9 +142,9 @@ namespace XFX
return (((Buttons.GetHashCode() + DPad.GetHashCode()) ^ ThumbSticks.GetHashCode()) ^ Triggers.GetHashCode()); return (((Buttons.GetHashCode() + DPad.GetHashCode()) ^ ThumbSticks.GetHashCode()) ^ Triggers.GetHashCode());
} }
int GamePadState::GetType() const Type& GamePadState::GetType()
{ {
// TODO: implement return GamePadStateTypeInfo;
} }
bool GamePadState::IsButtonDown(const Buttons_t button) const bool GamePadState::IsButtonDown(const Buttons_t button) const
@ -194,6 +200,7 @@ namespace XFX
case Buttons::Y: case Buttons::Y:
return Buttons.Y == ButtonState::Pressed; return Buttons.Y == ButtonState::Pressed;
} }
return false; return false;
} }
@ -265,9 +272,9 @@ namespace XFX
Start + White + X + Y); Start + White + X + Y);
} }
int GamePadButtons::GetType() const Type& GamePadButtons::GetType()
{ {
// TODO: implement return GamePadButtonsTypeInfo;
} }
const String GamePadButtons::ToString() const const String GamePadButtons::ToString() const
@ -367,9 +374,9 @@ namespace XFX
return Down + Left + Right + Up; return Down + Left + Right + Up;
} }
int GamePadDPad::GetType() const Type& GamePadDPad::GetType()
{ {
// TODO: implement return GamePadDPadTypeInfo;
} }
const String GamePadDPad::ToString() const const String GamePadDPad::ToString() const
@ -441,9 +448,9 @@ namespace XFX
return Left.GetHashCode() ^ Right.GetHashCode(); return Left.GetHashCode() ^ Right.GetHashCode();
} }
int GamePadThumbSticks::GetType() const Type& GamePadThumbSticks::GetType()
{ {
// TODO: implement return GamePadThumbSticksTypeInfo;
} }
const String GamePadThumbSticks::ToString() const const String GamePadThumbSticks::ToString() const
@ -491,9 +498,9 @@ namespace XFX
return (int)Left ^ (int)Right; return (int)Left ^ (int)Right;
} }
int GamePadTriggers::GetType() const Type& GamePadTriggers::GetType()
{ {
// TODO: implement return GamePadTriggersTypeInfo;
} }
const String GamePadTriggers::ToString() const const String GamePadTriggers::ToString() const

View File

@ -45,14 +45,21 @@ namespace XFX
IAsyncResult* Guide::BeginShowKeyboardInput(const PlayerIndex_t player, String& title, String& description, String& defaultText, AsyncCallback callback, Object* state) IAsyncResult* Guide::BeginShowKeyboardInput(const PlayerIndex_t player, String& title, String& description, String& defaultText, AsyncCallback callback, Object* state)
{ {
if (String::IsNullOrEmpty(title)) if (String::IsNullOrEmpty(title))
{
title = String::Empty; title = String::Empty;
}
if (String::IsNullOrEmpty(description)) if (String::IsNullOrEmpty(description))
{
description = String::Empty; description = String::Empty;
}
if (String::IsNullOrEmpty(defaultText)) if (String::IsNullOrEmpty(defaultText))
{
defaultText = String::Empty; defaultText = String::Empty;
}
// TODO: implement
// just return null to stop warning until this thing's coded // just return null to stop warning until this thing's coded
return null; return null;
} }
@ -60,48 +67,56 @@ namespace XFX
IAsyncResult* Guide::BeginShowMessageBox(const PlayerIndex_t player, String& title, String& text, IEnumerable<String>* buttons, const int focusButton, const MessageBoxIcon_t icon, AsyncCallback callback, Object* state) IAsyncResult* Guide::BeginShowMessageBox(const PlayerIndex_t player, String& title, String& text, IEnumerable<String>* buttons, const int focusButton, const MessageBoxIcon_t icon, AsyncCallback callback, Object* state)
{ {
if (String::IsNullOrEmpty(title)) if (String::IsNullOrEmpty(title))
{
title = String::Empty; title = String::Empty;
}
sassert(buttons != NULL, String::Format("buttons: %s", FrameworkResources::ArgumentNull_Generic)); sassert(buttons != NULL, String::Format("buttons: %s", FrameworkResources::ArgumentNull_Generic));
// TODO: implement
// just return null to stop warning until this thing's coded // just return null to stop warning until this thing's coded
return null; return null;
} }
IAsyncResult* Guide::BeginShowStorageDeviceSelector(const int sizeInBytes, const int directoryCount, AsyncCallback callback, Object* state) IAsyncResult* Guide::BeginShowStorageDeviceSelector(const int sizeInBytes, const int directoryCount, AsyncCallback callback, Object* state)
{ {
// TODO: implement
// just return null to stop warning until this thing's coded // just return null to stop warning until this thing's coded
return null; return null;
} }
IAsyncResult* Guide::BeginShowStorageDeviceSelector(AsyncCallback callback, Object* state) IAsyncResult* Guide::BeginShowStorageDeviceSelector(AsyncCallback callback, Object* state)
{ {
// TODO: implement
// just return null to stop warning until this thing's coded // just return null to stop warning until this thing's coded
return null; return null;
} }
IAsyncResult* Guide::BeginShowStorageDeviceSelector(const PlayerIndex_t player, const int sizeInBytes, const int directoryCount, AsyncCallback callback, Object* state) IAsyncResult* Guide::BeginShowStorageDeviceSelector(const PlayerIndex_t player, const int sizeInBytes, const int directoryCount, AsyncCallback callback, Object* state)
{ {
// TODO: implement
// just return null to stop warning until this thing's coded // just return null to stop warning until this thing's coded
return null; return null;
} }
IAsyncResult* Guide::BeginShowStorageDeviceSelector(const PlayerIndex_t player, AsyncCallback callback, Object* state) IAsyncResult* Guide::BeginShowStorageDeviceSelector(const PlayerIndex_t player, AsyncCallback callback, Object* state)
{ {
// TODO: implement
// just return null to stop warning until this thing's coded // just return null to stop warning until this thing's coded
return null; return null;
} }
const char* Guide::EndShowKeyboardInput(IAsyncResult* result) String Guide::EndShowKeyboardInput(IAsyncResult* result)
{ {
// TODO: implement
// just return an empty string to stop warning until this thing's coded // just return an empty string to stop warning until this thing's coded
return ""; return "";
} }
int Guide::EndShowMessageBox(IAsyncResult* result) Nullable<int> Guide::EndShowMessageBox(IAsyncResult* result)
{ {
// Since C++ doesn't have a nullable type, we return -1, since it represents an invalid value anyways. // TODO: implement
return -1; return NULL;
} }
StorageDevice Guide::EndShowStorageDeviceSelector(IAsyncResult* asyncResult) StorageDevice Guide::EndShowStorageDeviceSelector(IAsyncResult* asyncResult)

View File

@ -47,27 +47,24 @@ namespace XFX
// Initializes the KeyboardState class // Initializes the KeyboardState class
KeyboardState::KeyboardState() KeyboardState::KeyboardState()
: pressedKeys(NULL)
{ {
KeyboardState(null);
} }
// Initializes the KeyboardState class with the specified keys pressed // Initializes the KeyboardState class with the specified keys pressed
KeyboardState::KeyboardState(Keys_t keys[]) KeyboardState::KeyboardState(Keys_t keys[])
: pressedKeys(keys)
{ {
if (keys == null)
pressedKeys = 0;
else
pressedKeys = keys;
} }
KeyboardState::KeyboardState(const KeyboardState &obj) KeyboardState::KeyboardState(const KeyboardState &obj)
: pressedKeys(obj.pressedKeys)
{ {
pressedKeys = obj.pressedKeys;
} }
Keys_t* KeyboardState::GetPressedKeys() Keys_t* KeyboardState::GetPressedKeys()
{ {
return (Keys_t*)pressedKeys; return pressedKeys;
} }
// Returns whether the specified key is currently pressed // Returns whether the specified key is currently pressed
@ -79,8 +76,10 @@ namespace XFX
{ {
return true; return true;
} }
return false; return false;
} }
//The keyboard was not connected...bail out. //The keyboard was not connected...bail out.
return -1; return -1;
} }
@ -94,8 +93,10 @@ namespace XFX
{ {
return true; return true;
} }
return false; return false;
} }
// The keyboard was not connected...bail out. // The keyboard was not connected...bail out.
return -1; return -1;
} }

View File

@ -67,25 +67,49 @@ namespace XFX
XMOUSE_current.y = 0; XMOUSE_current.y = 0;
if((XMOUSE_current.buttons & XMOUSE_BUTTON_1)) if((XMOUSE_current.buttons & XMOUSE_BUTTON_1))
{
result.LeftButton = ButtonState::Pressed; result.LeftButton = ButtonState::Pressed;
}
else else
{
result.LeftButton = ButtonState::Released; result.LeftButton = ButtonState::Released;
}
if((XMOUSE_current.buttons & XMOUSE_BUTTON_3)) if((XMOUSE_current.buttons & XMOUSE_BUTTON_3))
{
result.MiddleButton = ButtonState::Pressed; result.MiddleButton = ButtonState::Pressed;
}
else else
{
result.MiddleButton = ButtonState::Released; result.MiddleButton = ButtonState::Released;
}
if((XMOUSE_current.buttons & XMOUSE_BUTTON_2)) if((XMOUSE_current.buttons & XMOUSE_BUTTON_2))
{
result.RightButton = ButtonState::Pressed; result.RightButton = ButtonState::Pressed;
}
else else
{
result.RightButton = ButtonState::Released; result.RightButton = ButtonState::Released;
}
if((XMOUSE_current.buttons & XMOUSE_BUTTON_4)) if((XMOUSE_current.buttons & XMOUSE_BUTTON_4))
{
result.XButton1 = ButtonState::Pressed; result.XButton1 = ButtonState::Pressed;
}
else else
{
result.XButton1 = ButtonState::Released; result.XButton1 = ButtonState::Released;
}
if((XMOUSE_current.buttons & XMOUSE_BUTTON_5)) if((XMOUSE_current.buttons & XMOUSE_BUTTON_5))
{
result.XButton2 = ButtonState::Pressed; result.XButton2 = ButtonState::Pressed;
}
else else
{
result.XButton2 = ButtonState::Released; result.XButton2 = ButtonState::Released;
}
return result; return result;
} }
@ -94,6 +118,8 @@ namespace XFX
{ {
result.X = x; result.X = x;
result.Y = y; result.Y = y;
// TODO: update 'hardware' cursor
} }
} }
} }

View File

@ -127,7 +127,7 @@ namespace XFX
SoundEffect* SoundEffect::FromStream(Stream * const stream) SoundEffect* SoundEffect::FromStream(Stream * const stream)
{ {
// TODO: implement
} }
const Type& SoundEffect::GetType() const Type& SoundEffect::GetType()

View File

@ -38,34 +38,42 @@ namespace XFX
bool SoundEffectInstance::IsDisposed() const bool SoundEffectInstance::IsDisposed() const
{ {
// TODO: implement
} }
bool SoundEffectInstance::IsLooped() const bool SoundEffectInstance::IsLooped() const
{ {
// TODO: implement
} }
void SoundEffectInstance::IsLooped(bool value) void SoundEffectInstance::IsLooped(bool value)
{ {
// TODO: implement
} }
float SoundEffectInstance::getPan() const float SoundEffectInstance::getPan() const
{ {
// TODO: implement
} }
void SoundEffectInstance::setPan(float value) void SoundEffectInstance::setPan(float value)
{ {
// TODO: implement
} }
float SoundEffectInstance::getPitch() const float SoundEffectInstance::getPitch() const
{ {
// TODO: implement
} }
void SoundEffectInstance::setPitch(float value) void SoundEffectInstance::setPitch(float value)
{ {
// TODO: implement
} }
SoundState_t SoundEffectInstance::getState() const SoundState_t SoundEffectInstance::getState() const
{ {
// TODO: implement
} }
float SoundEffectInstance::getVolume() const float SoundEffectInstance::getVolume() const
@ -75,6 +83,7 @@ namespace XFX
void SoundEffectInstance::setVolume(float value) void SoundEffectInstance::setVolume(float value)
{ {
// TODO: implement
} }
SoundEffectInstance::SoundEffectInstance(SoundEffect * const parent, bool fireAndForget) SoundEffectInstance::SoundEffectInstance(SoundEffect * const parent, bool fireAndForget)
@ -90,10 +99,12 @@ namespace XFX
void SoundEffectInstance::Apply3D(AudioListener listener, AudioEmitter emitter) void SoundEffectInstance::Apply3D(AudioListener listener, AudioEmitter emitter)
{ {
// TODO: implement
} }
void SoundEffectInstance::Apply3D(AudioListener listeners[], AudioEmitter emitter) void SoundEffectInstance::Apply3D(AudioListener listeners[], AudioEmitter emitter)
{ {
// TODO: implement
} }
void SoundEffectInstance::Dispose() void SoundEffectInstance::Dispose()
@ -116,14 +127,17 @@ namespace XFX
void SoundEffectInstance::Pause() void SoundEffectInstance::Pause()
{ {
// TODO: implement
} }
void SoundEffectInstance::Play() void SoundEffectInstance::Play()
{ {
// TODO: implement
} }
void SoundEffectInstance::Resume() void SoundEffectInstance::Resume()
{ {
// TODO: implement
} }
void SoundEffectInstance::Stop() void SoundEffectInstance::Stop()
@ -133,6 +147,7 @@ namespace XFX
void SoundEffectInstance::Stop(bool immediate) void SoundEffectInstance::Stop(bool immediate)
{ {
// TODO: implement
} }
} }
} }

View File

@ -125,9 +125,11 @@ namespace XFX
isDisposed = true; isDisposed = true;
if (disposing) if (disposing)
{
Disposing(this, EventArgs::Empty); Disposing(this, EventArgs::Empty);
} }
} }
}
const String StorageContainer::Path() const const String StorageContainer::Path() const
{ {

View File

@ -38,14 +38,17 @@ namespace XFX
{ {
long long StorageDevice::FreeSpace() const long long StorageDevice::FreeSpace() const
{ {
// TODO: implement
} }
bool StorageDevice::IsConnected() const bool StorageDevice::IsConnected() const
{ {
// TODO: implement
} }
long long StorageDevice::TotalSpace() const long long StorageDevice::TotalSpace() const
{ {
// TODO: implement
} }
StorageDevice::StorageDevice(uint deviceIndex, PlayerIndex_t playerIndex) StorageDevice::StorageDevice(uint deviceIndex, PlayerIndex_t playerIndex)
@ -58,6 +61,7 @@ namespace XFX
{ {
sassert(!String::IsNullOrEmpty(titleName), "titleName cannot be null."); sassert(!String::IsNullOrEmpty(titleName), "titleName cannot be null.");
// TODO: implement
//return new StorageContainer(this, titleName, _deviceIndex, _playerIndex); //return new StorageContainer(this, titleName, _deviceIndex, _playerIndex);
} }
} }

View File

@ -12,10 +12,11 @@ namespace XFX
bool StorageDeviceAsyncResult::CompletedSynchronously() bool StorageDeviceAsyncResult::CompletedSynchronously()
{ {
// TODO: implement
return true; return true;
} }
StorageDeviceAsyncResult::StorageDeviceAsyncResult(Object* stateObject, int player) StorageDeviceAsyncResult::StorageDeviceAsyncResult(Object * const stateObject, int player)
{ {
syncObject = stateObject; syncObject = stateObject;
playerIndex = player; playerIndex = player;
@ -29,7 +30,7 @@ namespace XFX
StorageDeviceAsyncResult::StorageDeviceAsyncResult(IAsyncResult* &obj) StorageDeviceAsyncResult::StorageDeviceAsyncResult(IAsyncResult* &obj)
{ {
// TODO: implement
} }
} }
} }

View File

@ -26,6 +26,7 @@
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
#include <Storage/StorageDeviceNotConnectedException.h> #include <Storage/StorageDeviceNotConnectedException.h>
#include <System/String.h>
namespace XFX namespace XFX
{ {
@ -36,12 +37,12 @@ namespace XFX
{ {
} }
StorageDeviceNotConnectedException::StorageDeviceNotConnectedException(char* message) StorageDeviceNotConnectedException::StorageDeviceNotConnectedException(const String& message)
: ExternalException(message) : ExternalException(message)
{ {
} }
StorageDeviceNotConnectedException::StorageDeviceNotConnectedException(char* message, Exception* innerException) StorageDeviceNotConnectedException::StorageDeviceNotConnectedException(const String& message, Exception * const innerException)
: ExternalException(message, innerException) : ExternalException(message, innerException)
{ {
} }

View File

@ -34,24 +34,29 @@ namespace XFX
{ {
const Type VideoTypeInfo("Video", "XFX::Media::Video", TypeCode::Object); const Type VideoTypeInfo("Video", "XFX::Media::Video", TypeCode::Object);
TimeSpan Video::getDuration() TimeSpan Video::getDuration() const
{ {
// TODO: implement
} }
float Video::getFramesPerSecond() float Video::getFramesPerSecond() const
{ {
// TODO: implement
} }
int Video::getHeight() int Video::getHeight() const
{ {
// TODO: implement
} }
VideoSoundtrackType_t Video::getVideoSoundtrackType() VideoSoundtrackType_t Video::getVideoSoundtrackType() const
{ {
// TODO: implement
} }
int Video::getWidth() int Video::getWidth() const
{ {
// TODO: implement
} }
const Type& Video::GetType() const Type& Video::GetType()