forked from tryphotino/photino.Native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding menu support. Fixes tryphotino#44.
- Loading branch information
Showing
9 changed files
with
1,402 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "Photino.Errors.h" | ||
#include <mutex> | ||
#include <string> | ||
|
||
static thread_local std::string _lastError; | ||
|
||
void ClearErrorMessage() noexcept | ||
{ | ||
_lastError.clear(); | ||
} | ||
|
||
int GetErrorMessageLength() noexcept | ||
{ | ||
return _lastError.length(); | ||
} | ||
|
||
void GetErrorMessage(int length, char* buffer) noexcept | ||
{ | ||
_lastError.copy(buffer, length, 0); | ||
} | ||
|
||
void SetErrorMessage(std::string message) noexcept | ||
{ | ||
_lastError = message; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
#include <string> | ||
|
||
/// <summary> | ||
/// The kind of error message that occurred. | ||
/// </summary> | ||
enum class PhotinoErrorKind | ||
{ | ||
NoError = 0, | ||
GenericError | ||
}; | ||
|
||
/// <summary> | ||
/// Clears the last error message to occur. | ||
/// </summary> | ||
void ClearErrorMessage() noexcept; | ||
|
||
/// <summary> | ||
/// Gets the length of the message of the last error to occur. | ||
/// </summary> | ||
/// <returns>The length of the last error to occur on this thread.</returns> | ||
int GetErrorMessageLength() noexcept; | ||
|
||
/// <summary> | ||
/// Gets the message of the last error to occur. | ||
/// </summary> | ||
/// <param name="length">The length of the buffer.</param> | ||
/// <param name="buffer">The buffer to which the message should be written.</param> | ||
void GetErrorMessage(int length, char* buffer) noexcept; | ||
|
||
/// <summary> | ||
/// Sets the message of the last error to occur. | ||
/// </summary> | ||
/// <param name="message">The message.</param> | ||
void SetErrorMessage(std::string message) noexcept; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#ifdef __APPLE__ | ||
// TODO: Implement this. | ||
#elif __linux__ | ||
// TODO: Implement this. | ||
#else | ||
#include "Photino.Windows.Menu.h" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.