mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-31 02:26:29 +03:00
Keep it creating some UI elements creators.
Chipmunk updated.
This commit is contained in:
@@ -43,8 +43,10 @@ cpMessage(const char *message, const char *condition, const char *file, int line
|
||||
if(isError) abort();
|
||||
}
|
||||
|
||||
#define XSTR(s) STR(s)
|
||||
#define STR(s) #s
|
||||
|
||||
const char *cpVersionString = "6.0.0b";
|
||||
const char *cpVersionString = XSTR(CP_VERSION_MAJOR)"."XSTR(CP_VERSION_MINOR)"."XSTR(CP_VERSION_RELEASE);
|
||||
|
||||
void
|
||||
cpInitChipmunk(void)
|
||||
|
||||
@@ -55,12 +55,22 @@ void cpMessage(const char *message, const char *condition, const char *file, int
|
||||
#include "chipmunk_types.h"
|
||||
|
||||
// Maximum allocated size for various Chipmunk buffers
|
||||
#define CP_BUFFER_BYTES (32*1024)
|
||||
#ifndef CP_BUFFER_BYTES
|
||||
#define CP_BUFFER_BYTES (32*1024)
|
||||
#endif
|
||||
|
||||
//TODO allow redifinition
|
||||
#define cpcalloc calloc
|
||||
#define cprealloc realloc
|
||||
#define cpfree free
|
||||
// Chipmunk memory function aliases.
|
||||
#ifndef cpcalloc
|
||||
#define cpcalloc calloc
|
||||
#endif
|
||||
|
||||
#ifndef cprealloc
|
||||
#define cprealloc realloc
|
||||
#endif
|
||||
|
||||
#ifndef cpfree
|
||||
#define cpfree free
|
||||
#endif
|
||||
|
||||
typedef struct cpArray cpArray;
|
||||
typedef struct cpHashSet cpHashSet;
|
||||
@@ -86,6 +96,10 @@ typedef struct cpSpace cpSpace;
|
||||
|
||||
#include "cpSpace.h"
|
||||
|
||||
#define CP_VERSION_MAJOR 6
|
||||
#define CP_VERSION_MINOR 0
|
||||
#define CP_VERSION_RELEASE 0
|
||||
|
||||
/// Version string.
|
||||
extern const char *cpVersionString;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// TODO update me
|
||||
#ifdef CHIPMUNK_FFI
|
||||
|
||||
// Create non static inlined copies of Chipmunk functions, useful for working with dynamic FFIs
|
||||
// This file should only be included in chipmunk.c
|
||||
@@ -13,6 +13,9 @@
|
||||
#define MAKE_REF(name) __typeof__(name) *_##name = name
|
||||
#endif
|
||||
|
||||
#define MAKE_PROPERTIES_REF(struct, property) \
|
||||
MAKE_REF(struct##Get##property); MAKE_REF(struct##Set##property);
|
||||
|
||||
MAKE_REF(cpv); // makes a variable named _cpv that contains the function pointer for cpv()
|
||||
MAKE_REF(cpveql);
|
||||
MAKE_REF(cpvadd);
|
||||
@@ -36,26 +39,120 @@ MAKE_REF(cpvdist);
|
||||
MAKE_REF(cpvdistsq);
|
||||
MAKE_REF(cpvnear);
|
||||
|
||||
MAKE_REF(cpfmax);
|
||||
MAKE_REF(cpfmin);
|
||||
MAKE_REF(cpfabs);
|
||||
MAKE_REF(cpfclamp);
|
||||
MAKE_REF(cpflerp);
|
||||
MAKE_REF(cpflerpconst);
|
||||
|
||||
MAKE_REF(cpBBNew);
|
||||
MAKE_REF(cpBBIntersects);
|
||||
MAKE_REF(cpBBContainsBB);
|
||||
MAKE_REF(cpBBContainsVect);
|
||||
MAKE_REF(cpBBMerge);
|
||||
MAKE_REF(cpBBExpand);
|
||||
MAKE_REF(cpBBArea);
|
||||
MAKE_REF(cpBBMergedArea);
|
||||
MAKE_REF(cpBBIntersectsSegment);
|
||||
|
||||
MAKE_REF(cpBodyWorld2Local);
|
||||
MAKE_REF(cpBodyLocal2World);
|
||||
MAKE_REF(cpBodyApplyImpulse);
|
||||
MAKE_REF(cpBodyGetMass);
|
||||
MAKE_REF(cpBodyGetMoment);
|
||||
MAKE_REF(cpBodyGetPos);
|
||||
MAKE_REF(cpBodyGetAngle);
|
||||
MAKE_REF(cpBodyGetRot);
|
||||
MAKE_PROPERTIES_REF(cpBody, Vel);
|
||||
MAKE_PROPERTIES_REF(cpBody, Force);
|
||||
MAKE_PROPERTIES_REF(cpBody, AngVel);
|
||||
MAKE_PROPERTIES_REF(cpBody, Torque);
|
||||
MAKE_PROPERTIES_REF(cpBody, VelLimit);
|
||||
MAKE_PROPERTIES_REF(cpBody, AngVelLimit);
|
||||
MAKE_PROPERTIES_REF(cpBody, UserData);
|
||||
MAKE_REF(cpBodyIsSleeping);
|
||||
MAKE_REF(cpBodyIsStatic);
|
||||
MAKE_REF(cpBodyIsRogue);
|
||||
MAKE_REF(cpBodyLocal2World);
|
||||
MAKE_REF(cpBodyWorld2Local);
|
||||
MAKE_REF(cpBodyKineticEnergy);
|
||||
|
||||
MAKE_REF(cpArbiterIsFirstContact);
|
||||
MAKE_REF(cpArbiterGetShapes);
|
||||
MAKE_REF(cpArbiterGetNormal);
|
||||
MAKE_REF(cpArbiterGetPoint);
|
||||
MAKE_REF(cpShapeGetBB);
|
||||
MAKE_PROPERTIES_REF(cpShape, Body);
|
||||
MAKE_PROPERTIES_REF(cpShape, IsSensor);
|
||||
MAKE_PROPERTIES_REF(cpShape, Elasticity);
|
||||
MAKE_PROPERTIES_REF(cpShape, Friction);
|
||||
MAKE_PROPERTIES_REF(cpShape, SurfaceVelocity);
|
||||
MAKE_PROPERTIES_REF(cpShape, UserData);
|
||||
MAKE_PROPERTIES_REF(cpShape, CollisionType);
|
||||
MAKE_PROPERTIES_REF(cpShape, Group);
|
||||
MAKE_PROPERTIES_REF(cpShape, Layers);
|
||||
|
||||
MAKE_REF(cpArbiterGetShapes);
|
||||
MAKE_REF(cpArbiterGetBodies);
|
||||
MAKE_REF(cpArbiterIsFirstContact);
|
||||
MAKE_REF(cpArbiterGetCount);
|
||||
|
||||
MAKE_REF(cpConstraintGetA);
|
||||
MAKE_REF(cpConstraintGetB);
|
||||
MAKE_PROPERTIES_REF(cpConstraint, MaxForce);
|
||||
MAKE_PROPERTIES_REF(cpConstraint, ErrorBias);
|
||||
MAKE_PROPERTIES_REF(cpConstraint, MaxBias);
|
||||
MAKE_PROPERTIES_REF(cpConstraint, UserData);
|
||||
MAKE_REF(cpConstraintGetImpulse);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpDampedRotarySpring, RestAngle);
|
||||
MAKE_PROPERTIES_REF(cpDampedRotarySpring, Stiffness);
|
||||
MAKE_PROPERTIES_REF(cpDampedRotarySpring, Damping);
|
||||
//MAKE_PROPERTIES_REF(cpDampedRotarySpring, SpringTorqueFunc);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpDampedSpring, Anchr1);
|
||||
MAKE_PROPERTIES_REF(cpDampedSpring, Anchr2);
|
||||
MAKE_PROPERTIES_REF(cpDampedSpring, RestLength);
|
||||
MAKE_PROPERTIES_REF(cpDampedSpring, Stiffness);
|
||||
MAKE_PROPERTIES_REF(cpDampedSpring, Damping);
|
||||
//MAKE_PROPERTIES_REF(cpDampedSpring, SpringForceFunc);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpGearJoint, Phase);
|
||||
MAKE_REF(cpGearJointGetRatio);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpGrooveJoint, Anchr2);
|
||||
MAKE_REF(cpGrooveJointGetGrooveA);
|
||||
MAKE_REF(cpGrooveJointGetGrooveB);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpPinJoint, Anchr1);
|
||||
MAKE_PROPERTIES_REF(cpPinJoint, Anchr2);
|
||||
MAKE_PROPERTIES_REF(cpPinJoint, Dist);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpPivotJoint, Anchr1);
|
||||
MAKE_PROPERTIES_REF(cpPivotJoint, Anchr2);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpRatchetJoint, Angle);
|
||||
MAKE_PROPERTIES_REF(cpRatchetJoint, Phase);
|
||||
MAKE_PROPERTIES_REF(cpRatchetJoint, Ratchet);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpRotaryLimitJoint, Min);
|
||||
MAKE_PROPERTIES_REF(cpRotaryLimitJoint, Max);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpSimpleMotor, Rate);
|
||||
|
||||
MAKE_PROPERTIES_REF(cpSlideJoint, Anchr1);
|
||||
MAKE_PROPERTIES_REF(cpSlideJoint, Anchr2);
|
||||
MAKE_PROPERTIES_REF(cpSlideJoint, Min);
|
||||
MAKE_PROPERTIES_REF(cpSlideJoint, Max);
|
||||
|
||||
MAKE_REF(cpSegmentQueryHitPoint);
|
||||
MAKE_REF(cpSegmentQueryHitDist);
|
||||
|
||||
MAKE_REF(cpSpatialIndexDestroy);
|
||||
MAKE_REF(cpSpatialIndexCount);
|
||||
MAKE_REF(cpSpatialIndexEach);
|
||||
MAKE_REF(cpSpatialIndexContains);
|
||||
MAKE_REF(cpSpatialIndexInsert);
|
||||
MAKE_REF(cpSpatialIndexRemove);
|
||||
MAKE_REF(cpSpatialIndexReindex);
|
||||
MAKE_REF(cpSpatialIndexReindexObject);
|
||||
MAKE_REF(cpSpatialIndexPointQuery);
|
||||
MAKE_REF(cpSpatialIndexSegmentQuery);
|
||||
MAKE_REF(cpSpatialIndexQuery);
|
||||
MAKE_REF(cpSpatialIndexReindexQuery);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -181,3 +181,12 @@ void cpShapeUpdateFunc(cpShape *shape, void *unused);
|
||||
void cpSpaceActivateBody(cpSpace *space, cpBody *body);
|
||||
void cpSpaceLock(cpSpace *space);
|
||||
void cpSpaceUnlock(cpSpace *space, cpBool runPostStep);
|
||||
|
||||
static inline cpCollisionHandler *
|
||||
cpSpaceLookupHandler(cpSpace *space, cpCollisionType a, cpCollisionType b)
|
||||
{
|
||||
cpCollisionType types[] = {a, b};
|
||||
return (cpCollisionHandler *)cpHashSetFind(space->collisionHandlers, CP_HASH_PAIR(a, b), types);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ CP_DefineConstraintStructGetter(cpBody *, b, B);
|
||||
CP_DefineConstraintStructProperty(cpFloat, maxForce, MaxForce);
|
||||
CP_DefineConstraintStructProperty(cpFloat, errorBias, ErrorBias);
|
||||
CP_DefineConstraintStructProperty(cpFloat, maxBias, MaxBias);
|
||||
CP_DefineConstraintStructProperty(cpDataPointer, data, Data);
|
||||
CP_DefineConstraintStructProperty(cpDataPointer, data, UserData);
|
||||
|
||||
/// Get the last impulse applied by this constraint.
|
||||
static inline cpFloat
|
||||
|
||||
@@ -190,12 +190,7 @@ CP_DefineBodyStructProperty(cpFloat, t, Torque);
|
||||
CP_DefineBodyStructGetter(cpVect, rot, Rot);
|
||||
CP_DefineBodyStructProperty(cpFloat, v_limit, VelLimit);
|
||||
CP_DefineBodyStructProperty(cpFloat, w_limit, AngVelLimit);
|
||||
CP_DefineBodyStructProperty(cpDataPointer, data, Data);
|
||||
|
||||
/// Return the user data pointer for a body.
|
||||
static inline cpDataPointer cpBodyGetUserData(const cpBody *body){return body->data;}
|
||||
/// Set the user data pointer for a body.
|
||||
static inline void cpBodySetUserData(cpBody *body, cpDataPointer data){body->data = data;}
|
||||
CP_DefineBodyStructProperty(cpDataPointer, data, UserData);
|
||||
|
||||
/// Default Integration functions.
|
||||
void cpBodyUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt);
|
||||
|
||||
@@ -84,13 +84,7 @@ cpShapeFree(cpShape *shape)
|
||||
void
|
||||
cpShapeSetBody(cpShape *shape, cpBody *body)
|
||||
{
|
||||
// This is a little tricky, but was requested by a user.
|
||||
// Changing the body on an active shape swapping out the shape lists on the bodies
|
||||
if(shape->next){
|
||||
cpBodyRemoveShape(shape->body, shape);
|
||||
cpBodyAddShape(body, shape);
|
||||
}
|
||||
|
||||
cpAssert(shape->next == NULL, "You cannot change the body on an active shape. You must remove the shape, then ");
|
||||
shape->body = body;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,11 @@
|
||||
void
|
||||
cpSpaceActivateBody(cpSpace *space, cpBody *body)
|
||||
{
|
||||
cpAssert(!cpBodyIsRogue(body), "Internal error: Attempting to activate a rouge body.");
|
||||
|
||||
if(space->locked){
|
||||
// cpSpaceActivateBody() is called again once the space is unlocked
|
||||
cpArrayPush(space->rousedBodies, body);
|
||||
if(!cpArrayContains(space->rousedBodies, body)) cpArrayPush(space->rousedBodies, body);
|
||||
} else {
|
||||
cpArrayPush(space->bodies, body);
|
||||
|
||||
@@ -52,12 +54,19 @@ cpSpaceActivateBody(cpSpace *space, cpBody *body)
|
||||
memcpy(arb->contacts, contacts, numContacts*sizeof(cpContact));
|
||||
cpSpacePushContacts(space, numContacts);
|
||||
|
||||
// Reinsert the arbiter into the arbiter cache
|
||||
cpShape *a = arb->a, *b = arb->b;
|
||||
cpShape *shape_pair[] = {a, b};
|
||||
cpHashValue arbHashID = CP_HASH_PAIR((size_t)a, (size_t)b);
|
||||
cpHashSetInsert(space->cachedArbiters, arbHashID, shape_pair, arb, NULL);
|
||||
cpArrayPush(space->arbiters, arb);
|
||||
|
||||
// Update the arbiter's state
|
||||
arb->stamp = space->stamp;
|
||||
arb->handler = cpSpaceLookupHandler(space, a->collision_type, b->collision_type);
|
||||
cpArrayPush(space->arbiters, arb);
|
||||
|
||||
// TODO pre-step callbacks for freshly awoken bodies need to be done somewhere.
|
||||
// Probably not here?
|
||||
|
||||
cpfree(contacts);
|
||||
}
|
||||
@@ -73,6 +82,8 @@ cpSpaceActivateBody(cpSpace *space, cpBody *body)
|
||||
static void
|
||||
cpSpaceDeactivateBody(cpSpace *space, cpBody *body)
|
||||
{
|
||||
cpAssert(!cpBodyIsRogue(body), "Internal error: Attempting to deactivate a rouge body.");
|
||||
|
||||
cpArrayDeleteObj(space->bodies, body);
|
||||
|
||||
CP_BODY_FOREACH_SHAPE(body, shape){
|
||||
@@ -293,12 +304,13 @@ cpBodySleepWithGroup(cpBody *body, cpBody *group){
|
||||
}
|
||||
|
||||
static void
|
||||
activateTouchingHelper(cpShape *shape, cpContactPointSet *points, cpArray **bodies){
|
||||
activateTouchingHelper(cpShape *shape, cpContactPointSet *points, void *unused){
|
||||
cpBodyActivate(shape->body);
|
||||
}
|
||||
|
||||
void
|
||||
cpSpaceActivateShapesTouchingShape(cpSpace *space, cpShape *shape){
|
||||
cpArray *bodies = NULL;
|
||||
cpSpaceShapeQuery(space, shape, (cpSpaceShapeQueryFunc)activateTouchingHelper, &bodies);
|
||||
if(space->sleepTimeThreshold != INFINITY){
|
||||
cpSpaceShapeQuery(space, shape, (cpSpaceShapeQueryFunc)activateTouchingHelper, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,13 +217,6 @@ cpSpaceArbiterSetTrans(cpShape **shapes, cpSpace *space)
|
||||
return cpArbiterInit((cpArbiter *)cpArrayPop(space->pooledArbiters), shapes[0], shapes[1]);
|
||||
}
|
||||
|
||||
static inline cpCollisionHandler *
|
||||
lookupCollisionHandler(cpSpace *space, cpCollisionType a, cpCollisionType b)
|
||||
{
|
||||
cpCollisionType types[] = {a, b};
|
||||
return (cpCollisionHandler *)cpHashSetFind(space->collisionHandlers, CP_HASH_PAIR(a, b), types);
|
||||
}
|
||||
|
||||
static inline cpBool
|
||||
queryReject(cpShape *a, cpShape *b)
|
||||
{
|
||||
@@ -246,7 +239,7 @@ collideShapes(cpShape *a, cpShape *b, cpSpace *space)
|
||||
// Reject any of the simple cases
|
||||
if(queryReject(a,b)) return;
|
||||
|
||||
cpCollisionHandler *handler = lookupCollisionHandler(space, a->collision_type, b->collision_type);
|
||||
cpCollisionHandler *handler = cpSpaceLookupHandler(space, a->collision_type, b->collision_type);
|
||||
|
||||
cpBool sensor = a->sensor || b->sensor;
|
||||
if(sensor && handler == &cpDefaultCollisionHandler) return;
|
||||
@@ -319,7 +312,7 @@ cpSpaceArbiterSetFilter(cpArbiter *arb, cpSpace *space)
|
||||
// Arbiter was used last frame, but not this one
|
||||
if(ticks >= 1 && arb->state != cpArbiterStateCached){
|
||||
// The handler needs to be looked up again as the handler cached on the arbiter may have been deleted since the last step.
|
||||
cpCollisionHandler *handler = lookupCollisionHandler(space, arb->a->collision_type, arb->b->collision_type);
|
||||
cpCollisionHandler *handler = cpSpaceLookupHandler(space, arb->a->collision_type, arb->b->collision_type);
|
||||
handler->separate(arb, space, handler->data);
|
||||
arb->state = cpArbiterStateCached;
|
||||
}
|
||||
|
||||
@@ -217,9 +217,9 @@ void cEETest::OnFontLoaded( cResourceLoader * ObjLoaded ) {
|
||||
Map.Font( FF );
|
||||
|
||||
Con.Create( FF, true );
|
||||
Con.IgnoreCharOnPrompt( 186 ); // '<EFBFBD>'
|
||||
Con.IgnoreCharOnPrompt( 186 ); // 'º'
|
||||
|
||||
mBuda = String::FromUtf8( "El mono ve el pez en el agua y sufre. Piensa que su mundo es el <EFBFBD>nico que existe, el mejor, el real. Sufre porque es bueno y tiene compasi<EFBFBD>n, lo ve y piensa: \"Pobre se est<EFBFBD> ahogando no puede respirar\". Y lo saca, lo saca y se queda tranquilo, por fin lo salv<EFBFBD>. Pero el pez se retuerce de dolor y muere. Por eso te mostr<EFBFBD> el sue<EFBFBD>o, es imposible meter el mar en tu cabeza, que es un balde." );
|
||||
mBuda = String::FromUtf8( "El mono ve el pez en el agua y sufre. Piensa que su mundo es el único que existe, el mejor, el real. Sufre porque es bueno y tiene compasión, lo ve y piensa: \"Pobre se está ahogando no puede respirar\". Y lo saca, lo saca y se queda tranquilo, por fin lo salvé. Pero el pez se retuerce de dolor y muere. Por eso te mostré el sueño, es imposible meter el mar en tu cabeza, que es un balde." );
|
||||
|
||||
CreateUI();
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ class EE_API cUIMenu : public cUIComplexControl {
|
||||
cUIComplexControl::CreateParams(),
|
||||
RowHeight( 0 ),
|
||||
PaddingContainer(),
|
||||
MinWidth( 0 ),
|
||||
MinSpaceForIcons( 0 ),
|
||||
MinRightMargin( 0 ),
|
||||
Font( NULL ),
|
||||
FontColor( 0, 0, 0, 255 ),
|
||||
FontOverColor( 0, 0, 0, 255 ),
|
||||
FontSelectedColor( 0, 0, 0, 255 ),
|
||||
MinWidth( 0 ),
|
||||
MinSpaceForIcons( 0 ),
|
||||
MinRightMargin( 0 )
|
||||
FontSelectedColor( 0, 0, 0, 255 )
|
||||
{
|
||||
cUITheme * Theme = cUIThemeManager::instance()->DefaultTheme();
|
||||
|
||||
@@ -43,14 +43,14 @@ class EE_API cUIMenu : public cUIComplexControl {
|
||||
|
||||
Uint32 RowHeight;
|
||||
eeRecti PaddingContainer;
|
||||
Uint32 MinWidth;
|
||||
Uint32 MinSpaceForIcons;
|
||||
Uint32 MinRightMargin;
|
||||
cFont * Font;
|
||||
eeColorA FontColor;
|
||||
eeColorA FontShadowColor;
|
||||
eeColorA FontOverColor;
|
||||
eeColorA FontSelectedColor;
|
||||
Uint32 MinWidth;
|
||||
Uint32 MinSpaceForIcons;
|
||||
Uint32 MinRightMargin;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -11,10 +11,11 @@ class EE_API cUISpinBox : public cUIComplexControl {
|
||||
class CreateParams : public cUITextInput::CreateParams {
|
||||
public:
|
||||
inline CreateParams() :
|
||||
cUITextInput::CreateParams()
|
||||
cUITextInput::CreateParams(),
|
||||
DefaultValue( 0.f ),
|
||||
AllowDotsInNumbers( true )
|
||||
{
|
||||
MaxLenght = 24;
|
||||
DefaultValue = 0.f;
|
||||
}
|
||||
|
||||
inline ~CreateParams() {}
|
||||
|
||||
@@ -11,6 +11,16 @@
|
||||
#include "cuipopupmenu.hpp"
|
||||
#include "cuiprogressbar.hpp"
|
||||
#include "cuipushbutton.hpp"
|
||||
#include "cuiradiobutton.hpp"
|
||||
#include "cuiscrollbar.hpp"
|
||||
#include "cuislider.hpp"
|
||||
#include "cuispinbox.hpp"
|
||||
#include "cuitextbox.hpp"
|
||||
#include "cuitextedit.hpp"
|
||||
#include "cuitextinput.hpp"
|
||||
#include "cuitooltip.hpp"
|
||||
#include "cuiwindow.hpp"
|
||||
#include "cuiwinmenu.hpp"
|
||||
|
||||
namespace EE { namespace UI {
|
||||
|
||||
@@ -338,7 +348,7 @@ void cUITheme::PostInit() {
|
||||
}
|
||||
|
||||
cUICheckBox * cUITheme::CreateCheckBox( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags ) {
|
||||
cUITextBox::CreateParams CheckBoxParams;
|
||||
cUICheckBox::CreateParams CheckBoxParams;
|
||||
CheckBoxParams.Parent( Parent );
|
||||
CheckBoxParams.PosSet( Pos );
|
||||
CheckBoxParams.SizeSet( Size );
|
||||
@@ -346,6 +356,88 @@ cUICheckBox * cUITheme::CreateCheckBox( cUIControl * Parent, const eeSize& Size,
|
||||
return eeNew( cUICheckBox, ( CheckBoxParams ) );
|
||||
}
|
||||
|
||||
cUIRadioButton * cUITheme::CreateRadioButton( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags ) {
|
||||
cUIRadioButton::CreateParams RadioButtonParams;
|
||||
RadioButtonParams.Parent( Parent );
|
||||
RadioButtonParams.PosSet( Pos );
|
||||
RadioButtonParams.SizeSet( Size );
|
||||
RadioButtonParams.Flags = Flags;
|
||||
return eeNew( cUIRadioButton, ( RadioButtonParams ) );
|
||||
}
|
||||
|
||||
cUITextBox * cUITheme::CreateTextBox( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags ) {
|
||||
cUITextBox::CreateParams TextBoxParams;
|
||||
TextBoxParams.Parent( Parent );
|
||||
TextBoxParams.PosSet( Pos );
|
||||
TextBoxParams.SizeSet( Size );
|
||||
TextBoxParams.Flags = Flags;
|
||||
return eeNew( cUITextBox, ( TextBoxParams ) );
|
||||
}
|
||||
|
||||
cUITooltip * cUITheme::CreateTooltip( cUIControl * TooltipOf, cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags ) {
|
||||
cUITooltip::CreateParams TooltipParams;
|
||||
TooltipParams.Parent( Parent );
|
||||
TooltipParams.PosSet( Pos );
|
||||
TooltipParams.SizeSet( Size );
|
||||
TooltipParams.Flags = Flags;
|
||||
return eeNew( cUITooltip, ( TooltipParams, TooltipOf ) );
|
||||
}
|
||||
|
||||
cUITextEdit * cUITheme::CreateTextEdit( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, UI_SCROLLBAR_MODE HScrollBar, UI_SCROLLBAR_MODE VScrollBar, bool WordWrap ) {
|
||||
cUITextEdit::CreateParams TextEditParams;
|
||||
TextEditParams.Parent( Parent );
|
||||
TextEditParams.PosSet( Pos );
|
||||
TextEditParams.SizeSet( Size );
|
||||
TextEditParams.Flags = Flags;
|
||||
TextEditParams.HScrollBar = HScrollBar;
|
||||
TextEditParams.VScrollBar = VScrollBar;
|
||||
TextEditParams.WordWrap = WordWrap;
|
||||
return eeNew( cUITextEdit, ( TextEditParams ) );
|
||||
}
|
||||
|
||||
cUITextInput * cUITheme::CreateTextInput( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, bool SupportFreeEditing, Uint32 MaxLenght ) {
|
||||
cUITextInput::CreateParams TextInputParams;
|
||||
TextInputParams.Parent( Parent );
|
||||
TextInputParams.PosSet( Pos );
|
||||
TextInputParams.SizeSet( Size );
|
||||
TextInputParams.Flags = Flags;
|
||||
TextInputParams.SupportFreeEditing = SupportFreeEditing;
|
||||
TextInputParams.MaxLenght = MaxLenght;
|
||||
return eeNew( cUITextInput, ( TextInputParams ) );
|
||||
}
|
||||
|
||||
cUISpinBox * cUITheme::CreateSpinBox( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, eeFloat DefaultValue, bool AllowDotsInNumbers ) {
|
||||
cUISpinBox::CreateParams SpinBoxParams;
|
||||
SpinBoxParams.Parent( Parent );
|
||||
SpinBoxParams.PosSet( Pos );
|
||||
SpinBoxParams.SizeSet( Size );
|
||||
SpinBoxParams.Flags = Flags;
|
||||
SpinBoxParams.DefaultValue = DefaultValue;
|
||||
SpinBoxParams.AllowDotsInNumbers = AllowDotsInNumbers;
|
||||
return eeNew( cUISpinBox, ( SpinBoxParams ) );
|
||||
}
|
||||
|
||||
cUIScrollBar * cUITheme::CreateScrollBar( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, bool VerticalScrollBar ) {
|
||||
cUIScrollBar::CreateParams ScrollBarParams;
|
||||
ScrollBarParams.Parent( Parent );
|
||||
ScrollBarParams.PosSet( Pos );
|
||||
ScrollBarParams.SizeSet( Size );
|
||||
ScrollBarParams.Flags = Flags;
|
||||
return eeNew( cUIScrollBar, ( ScrollBarParams ) );
|
||||
}
|
||||
|
||||
cUISlider * cUITheme::CreateSlider( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, bool VerticalSlider, bool AllowHalfSliderOut, bool ExpandBackground ) {
|
||||
cUISlider::CreateParams SliderParams;
|
||||
SliderParams.Parent( Parent );
|
||||
SliderParams.PosSet( Pos );
|
||||
SliderParams.SizeSet( Size );
|
||||
SliderParams.Flags = Flags;
|
||||
SliderParams.VerticalSlider = VerticalSlider;
|
||||
SliderParams.AllowHalfSliderOut = AllowHalfSliderOut;
|
||||
SliderParams.ExpandBackground = ExpandBackground;
|
||||
return eeNew( cUISlider, ( SliderParams ) );
|
||||
}
|
||||
|
||||
cUIComboBox * cUITheme::CreateComboBox( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, Uint32 MinNumVisibleItems, bool PopUpToMainControl, cUIListBox * ListBox ) {
|
||||
cUIComboBox::CreateParams ComboParams;
|
||||
ComboParams.Parent( Parent );
|
||||
@@ -384,12 +476,17 @@ cUIListBox * cUITheme::CreateListBox( cUIControl * Parent, const eeSize& Size, c
|
||||
return eeNew( cUIListBox, ( LBParams ) );
|
||||
}
|
||||
|
||||
cUIPopUpMenu * cUITheme::CreatePopUpMenu( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags ) {
|
||||
cUIPopUpMenu * cUITheme::CreatePopUpMenu( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, Uint32 RowHeight, eeRecti PaddingContainer, Uint32 MinWidth, Uint32 MinSpaceForIcons, Uint32 MinRightMargin ) {
|
||||
cUIPopUpMenu::CreateParams MenuParams;
|
||||
MenuParams.Parent( Parent );
|
||||
MenuParams.PosSet( Pos );
|
||||
MenuParams.SizeSet( Size );
|
||||
MenuParams.Flags = Flags;
|
||||
MenuParams.RowHeight = RowHeight;
|
||||
MenuParams.PaddingContainer = PaddingContainer;
|
||||
MenuParams.MinWidth = MinWidth;
|
||||
MenuParams.MinSpaceForIcons = MinSpaceForIcons;
|
||||
MenuParams.MinRightMargin = MinRightMargin;
|
||||
|
||||
/** Aqua Theme Stuff *//**
|
||||
MenuParams.MinWidth = 100;
|
||||
@@ -399,22 +496,32 @@ cUIPopUpMenu * cUITheme::CreatePopUpMenu( cUIControl * Parent, const eeSize& Siz
|
||||
return eeNew( cUIPopUpMenu, ( MenuParams ) );
|
||||
}
|
||||
|
||||
cUIProgressBar * cUITheme::CreateProgressBar( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, bool DisplayPercent ) {
|
||||
cUIProgressBar * cUITheme::CreateProgressBar( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, bool DisplayPercent, bool VerticalExpand, eeVector2f MovementSpeed, eeRectf FillerMargin ) {
|
||||
cUIProgressBar::CreateParams PBParams;
|
||||
PBParams.Parent( Parent );
|
||||
PBParams.PosSet( Pos );
|
||||
PBParams.SizeSet( Size );
|
||||
PBParams.Flags = Flags;
|
||||
PBParams.DisplayPercent = DisplayPercent;
|
||||
PBParams.VerticalExpand = VerticalExpand;
|
||||
PBParams.MovementSpeed = MovementSpeed;
|
||||
PBParams.FillerMargin = FillerMargin;
|
||||
|
||||
/** Aqua Theme Stuff *//**
|
||||
PBParams.DisplayPercent = true
|
||||
*/
|
||||
return eeNew( cUIProgressBar, ( PBParams ) );
|
||||
}
|
||||
|
||||
cUIPushButton * cUITheme::CreatePushButton( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, cShape * Icon ) {
|
||||
cUIPushButton * cUITheme::CreatePushButton( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, cShape * Icon, Int32 IconHorizontalMargin, bool IconAutoMargin ) {
|
||||
cUIPushButton::CreateParams ButtonParams;
|
||||
ButtonParams.Parent( Parent );
|
||||
ButtonParams.PosSet( Pos );
|
||||
ButtonParams.SizeSet( Size );
|
||||
ButtonParams.Flags = Flags;
|
||||
ButtonParams.Icon = Icon;
|
||||
ButtonParams.IconHorizontalMargin = IconHorizontalMargin;
|
||||
ButtonParams.IconAutoMargin = IconAutoMargin;
|
||||
|
||||
if ( NULL != Icon )
|
||||
ButtonParams.SetIcon( Icon );
|
||||
|
||||
@@ -17,6 +17,16 @@ class cUIListBox;
|
||||
class cUIPopUpMenu;
|
||||
class cUIProgressBar;
|
||||
class cUIPushButton;
|
||||
class cUIRadioButton;
|
||||
class cUIScrollBar;
|
||||
class cUISlider;
|
||||
class cUISpinBox;
|
||||
class cUITextBox;
|
||||
class cUITextEdit;
|
||||
class cUITextInput;
|
||||
class cUITooltip;
|
||||
class cUIWindow;
|
||||
class cUIWinMenu;
|
||||
|
||||
class EE_API cUITheme : public tResourceManager<cUISkin> {
|
||||
public:
|
||||
@@ -62,17 +72,33 @@ class EE_API cUITheme : public tResourceManager<cUISkin> {
|
||||
|
||||
virtual cUICheckBox * CreateCheckBox( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT );
|
||||
|
||||
virtual cUIRadioButton * CreateRadioButton( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT );
|
||||
|
||||
virtual cUITextBox * CreateTextBox( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_HALIGN_LEFT | UI_VALIGN_CENTER );
|
||||
|
||||
virtual cUITextEdit * CreateTextEdit( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_HALIGN_LEFT | UI_VALIGN_CENTER | UI_AUTO_PADDING | UI_CLIP_ENABLE, UI_SCROLLBAR_MODE HScrollBar = UI_SCROLLBAR_AUTO, UI_SCROLLBAR_MODE VScrollBar = UI_SCROLLBAR_AUTO, bool WordWrap = true );
|
||||
|
||||
virtual cUITextInput * CreateTextInput( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_HALIGN_LEFT | UI_VALIGN_CENTER | UI_CLIP_ENABLE | UI_AUTO_PADDING, bool SupportFreeEditing = true, Uint32 MaxLenght = 256 );
|
||||
|
||||
virtual cUITooltip * CreateTooltip( cUIControl * TooltipOf, cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_AUTO_PADDING | UI_AUTO_SIZE );
|
||||
|
||||
virtual cUIScrollBar * CreateScrollBar( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_AUTO_SIZE, bool VerticalScrollBar = false );
|
||||
|
||||
virtual cUISlider * CreateSlider( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT, bool VerticalSlider = false, bool AllowHalfSliderOut = true, bool ExpandBackground = false );
|
||||
|
||||
virtual cUISpinBox * CreateSpinBox( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_CLIP_ENABLE, eeFloat DefaultValue = 0.f, bool AllowDotsInNumbers = true );
|
||||
|
||||
virtual cUIComboBox * CreateComboBox( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT, Uint32 MinNumVisibleItems = 6, bool PopUpToMainControl = false, cUIListBox * ListBox = NULL );
|
||||
|
||||
virtual cUIDropDownList * CreateDropDownList( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT, Uint32 MinNumVisibleItems = 6, bool PopUpToMainControl = false, cUIListBox * ListBox = NULL );
|
||||
|
||||
virtual cUIListBox * CreateListBox( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING, bool SmoothScroll = true, Uint32 RowHeight = 0, UI_SCROLLBAR_MODE VScrollMode = UI_SCROLLBAR_AUTO, UI_SCROLLBAR_MODE HScrollMode = UI_SCROLLBAR_AUTO, eeRecti PaddingContainer = eeRecti() );
|
||||
|
||||
virtual cUIPopUpMenu * CreatePopUpMenu( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_AUTO_SIZE | UI_AUTO_PADDING );
|
||||
virtual cUIPopUpMenu * CreatePopUpMenu( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_AUTO_SIZE | UI_AUTO_PADDING, Uint32 RowHeight = 0, eeRecti PaddingContainer = eeRecti(), Uint32 MinWidth = 0, Uint32 MinSpaceForIcons = 0, Uint32 MinRightMargin = 0 );
|
||||
|
||||
virtual cUIProgressBar * CreateProgressBar( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_HALIGN_LEFT | UI_VALIGN_CENTER, bool DisplayPercent = true );
|
||||
virtual cUIProgressBar * CreateProgressBar( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_HALIGN_LEFT | UI_VALIGN_CENTER, bool DisplayPercent = false, bool VerticalExpand = false, eeVector2f MovementSpeed = eeVector2f( 64, 0 ), eeRectf FillerMargin = eeRectf() );
|
||||
|
||||
virtual cUIPushButton * CreatePushButton( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_VALIGN_CENTER | UI_HALIGN_CENTER, cShape * Icon = NULL );
|
||||
virtual cUIPushButton * CreatePushButton( cUIControl * Parent, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_VALIGN_CENTER | UI_HALIGN_CENTER, cShape * Icon = NULL, Int32 IconHorizontalMargin = 0, bool IconAutoMargin = true );
|
||||
protected:
|
||||
std::string mName;
|
||||
Uint32 mNameHash;
|
||||
@@ -82,7 +108,7 @@ class EE_API cUITheme : public tResourceManager<cUISkin> {
|
||||
eeColorA mFontShadowColor;
|
||||
eeColorA mFontOverColor;
|
||||
eeColorA mFontSelectedColor;
|
||||
private:
|
||||
|
||||
static bool SearchFilesOfElement( cShapeGroup * SG, const std::string& Path, std::string Element, Uint32& IsComplex, const std::string ImgExt );
|
||||
|
||||
static bool SearchFilesInGroup( cShapeGroup * SG, std::string Element, Uint32& IsComplex );
|
||||
|
||||
@@ -12,7 +12,7 @@ cUITooltip::cUITooltip( cUITooltip::CreateParams& Params, cUIControl * TooltipOf
|
||||
mTooltipTime( 0.f ),
|
||||
mTooltipOf( TooltipOf )
|
||||
{
|
||||
mType |= UI_TYPE_TOOLTIP;
|
||||
mType = UI_TYPE_TOOLTIP;
|
||||
|
||||
mTextCache = eeNew( cTextCache, () );
|
||||
mTextCache->Font( Params.Font );
|
||||
|
||||
Reference in New Issue
Block a user