Icon-O-Matic: Remove dead homebrew translation system
Icon-O-Matic uses Locale.h now. Change-Id: I9722ee76fda47821bf27e6195f8f6ec3d3e1b43e Reviewed-on: https://review.haiku-os.org/c/haiku/+/6700 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -78,14 +78,3 @@ Command::CombineWithPrevious(const Command* previous)
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// _GetString
|
|
||||||
const char*
|
|
||||||
Command::_GetString(uint32 key, const char* defaultString) const
|
|
||||||
{
|
|
||||||
// if (LanguageManager* manager = LanguageManager::Default())
|
|
||||||
// return manager->GetString(key, defaultString);
|
|
||||||
// else
|
|
||||||
return defaultString;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ class Command {
|
|||||||
virtual bool CombineWithPrevious(const Command* previous);
|
virtual bool CombineWithPrevious(const Command* previous);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const char* _GetString(uint32 key,
|
|
||||||
const char* defaultString) const;
|
|
||||||
|
|
||||||
bigtime_t fTimeStamp;
|
bigtime_t fTimeStamp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -92,5 +92,5 @@ CompoundCommand::Redo()
|
|||||||
void
|
void
|
||||||
CompoundCommand::GetName(BString& name)
|
CompoundCommand::GetName(BString& name)
|
||||||
{
|
{
|
||||||
name << _GetString(fNameIndex, fName.String());
|
name << fName.String();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ NudgePointsCommand::NudgePointsCommand(VectorPath* path,
|
|||||||
1.0,
|
1.0,
|
||||||
1.0,
|
1.0,
|
||||||
count > 1 ? B_TRANSLATE("Nudge Control Points") :
|
count > 1 ? B_TRANSLATE("Nudge Control Points") :
|
||||||
B_TRANSLATE("Nudge Control Point"),
|
B_TRANSLATE("Nudge Control Point")),
|
||||||
// count > 1 ? NUDGE_CONTROL_POINTS : NUDGE_CONTROL_POINT),
|
|
||||||
-1),
|
|
||||||
fPath(path),
|
fPath(path),
|
||||||
fIndices(NULL),
|
fIndices(NULL),
|
||||||
fPoints(NULL),
|
fPoints(NULL),
|
||||||
|
|||||||
@@ -31,15 +31,13 @@ TransformPointsCommand::TransformPointsCommand(
|
|||||||
double xScale,
|
double xScale,
|
||||||
double yScale,
|
double yScale,
|
||||||
|
|
||||||
const char* name,
|
const char* name)
|
||||||
int32 nameIndex)
|
|
||||||
: TransformCommand(pivot,
|
: TransformCommand(pivot,
|
||||||
translation,
|
translation,
|
||||||
rotation,
|
rotation,
|
||||||
xScale,
|
xScale,
|
||||||
yScale,
|
yScale,
|
||||||
name,
|
name),
|
||||||
nameIndex),
|
|
||||||
fTransformBox(box),
|
fTransformBox(box),
|
||||||
fPath(path),
|
fPath(path),
|
||||||
fIndices(indices && count > 0 ?
|
fIndices(indices && count > 0 ?
|
||||||
|
|||||||
@@ -40,8 +40,7 @@ class TransformPointsCommand : public TransformCommand,
|
|||||||
double xScale,
|
double xScale,
|
||||||
double yScale,
|
double yScale,
|
||||||
|
|
||||||
const char* name,
|
const char* name);
|
||||||
int32 nameIndex);
|
|
||||||
virtual ~TransformPointsCommand();
|
virtual ~TransformPointsCommand();
|
||||||
|
|
||||||
// Command interface
|
// Command interface
|
||||||
|
|||||||
@@ -160,8 +160,7 @@ TransformBox::MouseDown(BPoint where)
|
|||||||
fCurrentState->SetOrigin(where);
|
fCurrentState->SetOrigin(where);
|
||||||
|
|
||||||
delete fCurrentCommand;
|
delete fCurrentCommand;
|
||||||
fCurrentCommand = MakeCommand(fCurrentState->ActionName(),
|
fCurrentCommand = MakeCommand(fCurrentState->ActionName());
|
||||||
fCurrentState->ActionNameIndex());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -302,7 +301,7 @@ TransformBox::HandleKeyDown(uint32 key, uint32 modifiers, Command** _command)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!fCurrentCommand) {
|
if (!fCurrentCommand) {
|
||||||
fCurrentCommand = MakeCommand("Translate", -1);
|
fCurrentCommand = MakeCommand("Translate");
|
||||||
}
|
}
|
||||||
|
|
||||||
TranslateBy(translation);
|
TranslateBy(translation);
|
||||||
@@ -431,7 +430,7 @@ void
|
|||||||
TransformBox::NudgeBy(BPoint offset)
|
TransformBox::NudgeBy(BPoint offset)
|
||||||
{
|
{
|
||||||
if (!fNudging && !fCurrentCommand) {
|
if (!fNudging && !fCurrentCommand) {
|
||||||
fCurrentCommand = MakeCommand("Move", 0/*MOVE*/);
|
fCurrentCommand = MakeCommand("Move");
|
||||||
fNudging = true;
|
fNudging = true;
|
||||||
}
|
}
|
||||||
if (fNudging) {
|
if (fNudging) {
|
||||||
|
|||||||
@@ -80,8 +80,7 @@ class TransformBox : public ChannelTransform,
|
|||||||
virtual float ZoomLevel() const;
|
virtual float ZoomLevel() const;
|
||||||
|
|
||||||
|
|
||||||
virtual TransformCommand* MakeCommand(const char* actionName,
|
virtual TransformCommand* MakeCommand(const char* actionName) = 0;
|
||||||
uint32 nameIndex) = 0;
|
|
||||||
|
|
||||||
bool IsRotating() const
|
bool IsRotating() const
|
||||||
{ return fCurrentState == fRotateState; }
|
{ return fCurrentState == fRotateState; }
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2009, Haiku.
|
* Copyright 2006-2009, 2023, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Stephan Aßmus <[email protected]>
|
* Stephan Aßmus <[email protected]>
|
||||||
|
* Zardshard
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "TransformBoxStates.h"
|
#include "TransformBoxStates.h"
|
||||||
@@ -27,7 +28,6 @@
|
|||||||
#define B_TRANSLATION_CONTEXT "Icon-O-Matic-TransformationBoxStates"
|
#define B_TRANSLATION_CONTEXT "Icon-O-Matic-TransformationBoxStates"
|
||||||
|
|
||||||
|
|
||||||
// constructor
|
|
||||||
DragState::DragState(TransformBox* parent)
|
DragState::DragState(TransformBox* parent)
|
||||||
:
|
:
|
||||||
fOrigin(0.0, 0.0),
|
fOrigin(0.0, 0.0),
|
||||||
@@ -36,7 +36,6 @@ DragState::DragState(TransformBox* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// SetOrigin
|
|
||||||
void
|
void
|
||||||
DragState::SetOrigin(BPoint origin)
|
DragState::SetOrigin(BPoint origin)
|
||||||
{
|
{
|
||||||
@@ -44,7 +43,6 @@ DragState::SetOrigin(BPoint origin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionName
|
|
||||||
const char*
|
const char*
|
||||||
DragState::ActionName() const
|
DragState::ActionName() const
|
||||||
{
|
{
|
||||||
@@ -52,15 +50,6 @@ DragState::ActionName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionNameIndex
|
|
||||||
uint32
|
|
||||||
DragState::ActionNameIndex() const
|
|
||||||
{
|
|
||||||
return TRANSFORMATION;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// _SetViewCursor
|
|
||||||
void
|
void
|
||||||
DragState::_SetViewCursor(BView* view, const uchar* cursorData) const
|
DragState::_SetViewCursor(BView* view, const uchar* cursorData) const
|
||||||
{
|
{
|
||||||
@@ -72,7 +61,6 @@ DragState::_SetViewCursor(BView* view, const uchar* cursorData) const
|
|||||||
// #pragma mark - DragCornerState
|
// #pragma mark - DragCornerState
|
||||||
|
|
||||||
|
|
||||||
// constructor
|
|
||||||
DragCornerState::DragCornerState(TransformBox* parent, uint32 corner)
|
DragCornerState::DragCornerState(TransformBox* parent, uint32 corner)
|
||||||
:
|
:
|
||||||
DragState(parent),
|
DragState(parent),
|
||||||
@@ -81,7 +69,6 @@ DragCornerState::DragCornerState(TransformBox* parent, uint32 corner)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// SetOrigin
|
|
||||||
void
|
void
|
||||||
DragCornerState::SetOrigin(BPoint origin)
|
DragCornerState::SetOrigin(BPoint origin)
|
||||||
{
|
{
|
||||||
@@ -93,8 +80,7 @@ DragCornerState::SetOrigin(BPoint origin)
|
|||||||
// copy the matrix at the start of the drag procedure
|
// copy the matrix at the start of the drag procedure
|
||||||
fMatrix.reset();
|
fMatrix.reset();
|
||||||
fMatrix.multiply(agg::trans_affine_scaling(fOldXScale, fOldYScale));
|
fMatrix.multiply(agg::trans_affine_scaling(fOldXScale, fOldYScale));
|
||||||
fMatrix.multiply(agg::trans_affine_rotation(fParent->LocalRotation()
|
fMatrix.multiply(agg::trans_affine_rotation(fParent->LocalRotation() * M_PI / 180.0));
|
||||||
* M_PI / 180.0));
|
|
||||||
fMatrix.multiply(agg::trans_affine_translation(fParent->Translation().x,
|
fMatrix.multiply(agg::trans_affine_translation(fParent->Translation().x,
|
||||||
fParent->Translation().y));
|
fParent->Translation().y));
|
||||||
|
|
||||||
@@ -143,7 +129,6 @@ DragCornerState::SetOrigin(BPoint origin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// DragTo
|
|
||||||
void
|
void
|
||||||
DragCornerState::DragTo(BPoint current, uint32 modifiers)
|
DragCornerState::DragTo(BPoint current, uint32 modifiers)
|
||||||
{
|
{
|
||||||
@@ -182,12 +167,10 @@ DragCornerState::DragTo(BPoint current, uint32 modifiers)
|
|||||||
translation.x = x;
|
translation.x = x;
|
||||||
translation.y = y;
|
translation.y = y;
|
||||||
|
|
||||||
fParent->SetTranslationAndScale(translation, xScale * fOldXScale,
|
fParent->SetTranslationAndScale(translation, xScale * fOldXScale, yScale * fOldYScale);
|
||||||
yScale * fOldYScale);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UpdateViewCursor
|
|
||||||
void
|
void
|
||||||
DragCornerState::UpdateViewCursor(BView* view, BPoint current) const
|
DragCornerState::UpdateViewCursor(BView* view, BPoint current) const
|
||||||
{
|
{
|
||||||
@@ -290,7 +273,6 @@ DragCornerState::UpdateViewCursor(BView* view, BPoint current) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionName
|
|
||||||
const char*
|
const char*
|
||||||
DragCornerState::ActionName() const
|
DragCornerState::ActionName() const
|
||||||
{
|
{
|
||||||
@@ -298,14 +280,6 @@ DragCornerState::ActionName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionNameIndex
|
|
||||||
uint32
|
|
||||||
DragCornerState::ActionNameIndex() const
|
|
||||||
{
|
|
||||||
return SCALE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - DragSideState
|
// #pragma mark - DragSideState
|
||||||
|
|
||||||
|
|
||||||
@@ -317,7 +291,6 @@ DragSideState::DragSideState(TransformBox* parent, uint32 side)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// SetOrigin
|
|
||||||
void
|
void
|
||||||
DragSideState::SetOrigin(BPoint origin)
|
DragSideState::SetOrigin(BPoint origin)
|
||||||
{
|
{
|
||||||
@@ -329,8 +302,7 @@ DragSideState::SetOrigin(BPoint origin)
|
|||||||
// copy the matrix at the start of the drag procedure
|
// copy the matrix at the start of the drag procedure
|
||||||
fMatrix.reset();
|
fMatrix.reset();
|
||||||
fMatrix.multiply(agg::trans_affine_scaling(fOldXScale, fOldYScale));
|
fMatrix.multiply(agg::trans_affine_scaling(fOldXScale, fOldYScale));
|
||||||
fMatrix.multiply(agg::trans_affine_rotation(fParent->LocalRotation()
|
fMatrix.multiply(agg::trans_affine_rotation(fParent->LocalRotation() * M_PI / 180.0));
|
||||||
* M_PI / 180.0));
|
|
||||||
fMatrix.multiply(agg::trans_affine_translation(fParent->Translation().x,
|
fMatrix.multiply(agg::trans_affine_translation(fParent->Translation().x,
|
||||||
fParent->Translation().y));
|
fParent->Translation().y));
|
||||||
|
|
||||||
@@ -367,7 +339,6 @@ DragSideState::SetOrigin(BPoint origin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// DragTo
|
|
||||||
void
|
void
|
||||||
DragSideState::DragTo(BPoint current, uint32 modifiers)
|
DragSideState::DragTo(BPoint current, uint32 modifiers)
|
||||||
{
|
{
|
||||||
@@ -400,12 +371,10 @@ DragSideState::DragTo(BPoint current, uint32 modifiers)
|
|||||||
translation.x = x;
|
translation.x = x;
|
||||||
translation.y = y;
|
translation.y = y;
|
||||||
|
|
||||||
fParent->SetTranslationAndScale(translation, xScale * fOldXScale,
|
fParent->SetTranslationAndScale(translation, xScale * fOldXScale, yScale * fOldYScale);
|
||||||
yScale * fOldYScale);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UpdateViewCursor
|
|
||||||
void
|
void
|
||||||
DragSideState::UpdateViewCursor(BView* view, BPoint current) const
|
DragSideState::UpdateViewCursor(BView* view, BPoint current) const
|
||||||
{
|
{
|
||||||
@@ -458,7 +427,6 @@ DragSideState::UpdateViewCursor(BView* view, BPoint current) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionName
|
|
||||||
const char*
|
const char*
|
||||||
DragSideState::ActionName() const
|
DragSideState::ActionName() const
|
||||||
{
|
{
|
||||||
@@ -466,18 +434,9 @@ DragSideState::ActionName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionNameIndex
|
|
||||||
uint32
|
|
||||||
DragSideState::ActionNameIndex() const
|
|
||||||
{
|
|
||||||
return SCALE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - DragBoxState
|
// #pragma mark - DragBoxState
|
||||||
|
|
||||||
|
|
||||||
// SetOrigin
|
|
||||||
void
|
void
|
||||||
DragBoxState::SetOrigin(BPoint origin)
|
DragBoxState::SetOrigin(BPoint origin)
|
||||||
{
|
{
|
||||||
@@ -486,7 +445,6 @@ DragBoxState::SetOrigin(BPoint origin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// DragTo
|
|
||||||
void
|
void
|
||||||
DragBoxState::DragTo(BPoint current, uint32 modifiers)
|
DragBoxState::DragTo(BPoint current, uint32 modifiers)
|
||||||
{
|
{
|
||||||
@@ -502,7 +460,6 @@ DragBoxState::DragTo(BPoint current, uint32 modifiers)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UpdateViewCursor
|
|
||||||
void
|
void
|
||||||
DragBoxState::UpdateViewCursor(BView* view, BPoint current) const
|
DragBoxState::UpdateViewCursor(BView* view, BPoint current) const
|
||||||
{
|
{
|
||||||
@@ -510,7 +467,6 @@ DragBoxState::UpdateViewCursor(BView* view, BPoint current) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionName
|
|
||||||
const char*
|
const char*
|
||||||
DragBoxState::ActionName() const
|
DragBoxState::ActionName() const
|
||||||
{
|
{
|
||||||
@@ -518,18 +474,9 @@ DragBoxState::ActionName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionNameIndex
|
|
||||||
uint32
|
|
||||||
DragBoxState::ActionNameIndex() const
|
|
||||||
{
|
|
||||||
return MOVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - RotateBoxState
|
// #pragma mark - RotateBoxState
|
||||||
|
|
||||||
|
|
||||||
// constructor
|
|
||||||
RotateBoxState::RotateBoxState(TransformBox* parent)
|
RotateBoxState::RotateBoxState(TransformBox* parent)
|
||||||
:
|
:
|
||||||
DragState(parent),
|
DragState(parent),
|
||||||
@@ -538,7 +485,6 @@ RotateBoxState::RotateBoxState(TransformBox* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// SetOrigin
|
|
||||||
void
|
void
|
||||||
RotateBoxState::SetOrigin(BPoint origin)
|
RotateBoxState::SetOrigin(BPoint origin)
|
||||||
{
|
{
|
||||||
@@ -547,7 +493,6 @@ RotateBoxState::SetOrigin(BPoint origin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// DragTo
|
|
||||||
void
|
void
|
||||||
RotateBoxState::DragTo(BPoint current, uint32 modifiers)
|
RotateBoxState::DragTo(BPoint current, uint32 modifiers)
|
||||||
{
|
{
|
||||||
@@ -567,7 +512,6 @@ RotateBoxState::DragTo(BPoint current, uint32 modifiers)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UpdateViewCursor
|
|
||||||
void
|
void
|
||||||
RotateBoxState::UpdateViewCursor(BView* view, BPoint current) const
|
RotateBoxState::UpdateViewCursor(BView* view, BPoint current) const
|
||||||
{
|
{
|
||||||
@@ -599,7 +543,6 @@ RotateBoxState::UpdateViewCursor(BView* view, BPoint current) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionName
|
|
||||||
const char*
|
const char*
|
||||||
RotateBoxState::ActionName() const
|
RotateBoxState::ActionName() const
|
||||||
{
|
{
|
||||||
@@ -607,18 +550,9 @@ RotateBoxState::ActionName() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionNameIndex
|
|
||||||
uint32
|
|
||||||
RotateBoxState::ActionNameIndex() const
|
|
||||||
{
|
|
||||||
return ROTATE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - OffsetCenterState
|
// #pragma mark - OffsetCenterState
|
||||||
|
|
||||||
|
|
||||||
// SetOrigin
|
|
||||||
void
|
void
|
||||||
OffsetCenterState::SetOrigin(BPoint origin)
|
OffsetCenterState::SetOrigin(BPoint origin)
|
||||||
{
|
{
|
||||||
@@ -627,7 +561,6 @@ OffsetCenterState::SetOrigin(BPoint origin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// DragTo
|
|
||||||
void
|
void
|
||||||
OffsetCenterState::DragTo(BPoint current, uint32 modifiers)
|
OffsetCenterState::DragTo(BPoint current, uint32 modifiers)
|
||||||
{
|
{
|
||||||
@@ -637,7 +570,6 @@ OffsetCenterState::DragTo(BPoint current, uint32 modifiers)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UpdateViewCursor
|
|
||||||
void
|
void
|
||||||
OffsetCenterState::UpdateViewCursor(BView* view, BPoint current) const
|
OffsetCenterState::UpdateViewCursor(BView* view, BPoint current) const
|
||||||
{
|
{
|
||||||
@@ -645,17 +577,8 @@ OffsetCenterState::UpdateViewCursor(BView* view, BPoint current) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionName
|
|
||||||
const char*
|
const char*
|
||||||
OffsetCenterState::ActionName() const
|
OffsetCenterState::ActionName() const
|
||||||
{
|
{
|
||||||
return B_TRANSLATE("Move Pivot");
|
return B_TRANSLATE("Move Pivot");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ActionNameIndex
|
|
||||||
uint32
|
|
||||||
OffsetCenterState::ActionNameIndex() const
|
|
||||||
{
|
|
||||||
return MOVE_PIVOT;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006, Haiku.
|
* Copyright 2006, 2023, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Stephan Aßmus <superstippi@gmx.de>
|
* Stephan Aßmus <superstippi@gmx.de>
|
||||||
|
* Zardshard
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TRANSFORM_BOX_STATES_H
|
#ifndef TRANSFORM_BOX_STATES_H
|
||||||
@@ -16,15 +17,6 @@
|
|||||||
class BView;
|
class BView;
|
||||||
class TransformBox;
|
class TransformBox;
|
||||||
|
|
||||||
// TODO: remove and replace with translation string indices once multiple
|
|
||||||
// languages are supported
|
|
||||||
#define TRANSFORMATION 0
|
|
||||||
#define ROTATE 0
|
|
||||||
#define MOVE 0
|
|
||||||
#define SCALE 0
|
|
||||||
#define MOVE_PIVOT 0
|
|
||||||
//
|
|
||||||
|
|
||||||
// base class
|
// base class
|
||||||
class DragState {
|
class DragState {
|
||||||
public:
|
public:
|
||||||
@@ -36,11 +28,9 @@ class DragState {
|
|||||||
virtual void UpdateViewCursor(BView* view, BPoint current) const = 0;
|
virtual void UpdateViewCursor(BView* view, BPoint current) const = 0;
|
||||||
|
|
||||||
virtual const char* ActionName() const;
|
virtual const char* ActionName() const;
|
||||||
virtual uint32 ActionNameIndex() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _SetViewCursor(BView* view,
|
void _SetViewCursor(BView* view, const uchar* cursorData) const;
|
||||||
const uchar* cursorData) const;
|
|
||||||
|
|
||||||
BPoint fOrigin;
|
BPoint fOrigin;
|
||||||
TransformBox* fParent;
|
TransformBox* fParent;
|
||||||
@@ -55,8 +45,7 @@ class DragCornerState : public DragState {
|
|||||||
LEFT_BOTTOM_CORNER,
|
LEFT_BOTTOM_CORNER,
|
||||||
RIGHT_BOTTOM_CORNER,
|
RIGHT_BOTTOM_CORNER,
|
||||||
};
|
};
|
||||||
DragCornerState(TransformBox* parent,
|
DragCornerState(TransformBox* parent, uint32 corner);
|
||||||
uint32 corner);
|
|
||||||
virtual ~DragCornerState() {}
|
virtual ~DragCornerState() {}
|
||||||
|
|
||||||
virtual void SetOrigin(BPoint origin);
|
virtual void SetOrigin(BPoint origin);
|
||||||
@@ -64,7 +53,6 @@ class DragCornerState : public DragState {
|
|||||||
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
||||||
|
|
||||||
virtual const char* ActionName() const;
|
virtual const char* ActionName() const;
|
||||||
virtual uint32 ActionNameIndex() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 fCorner;
|
uint32 fCorner;
|
||||||
@@ -87,8 +75,7 @@ class DragSideState : public DragState {
|
|||||||
RIGHT_SIDE,
|
RIGHT_SIDE,
|
||||||
BOTTOM_SIDE,
|
BOTTOM_SIDE,
|
||||||
};
|
};
|
||||||
DragSideState(TransformBox* parent,
|
DragSideState(TransformBox* parent, uint32 side);
|
||||||
uint32 side);
|
|
||||||
virtual ~DragSideState() {}
|
virtual ~DragSideState() {}
|
||||||
|
|
||||||
virtual void SetOrigin(BPoint origin);
|
virtual void SetOrigin(BPoint origin);
|
||||||
@@ -96,7 +83,6 @@ class DragSideState : public DragState {
|
|||||||
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
||||||
|
|
||||||
virtual const char* ActionName() const;
|
virtual const char* ActionName() const;
|
||||||
virtual uint32 ActionNameIndex() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 fSide;
|
uint32 fSide;
|
||||||
@@ -121,7 +107,6 @@ class DragBoxState : public DragState {
|
|||||||
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
||||||
|
|
||||||
virtual const char* ActionName() const;
|
virtual const char* ActionName() const;
|
||||||
virtual uint32 ActionNameIndex() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BPoint fOldTranslation;
|
BPoint fOldTranslation;
|
||||||
@@ -138,7 +123,6 @@ class RotateBoxState : public DragState {
|
|||||||
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
||||||
|
|
||||||
virtual const char* ActionName() const;
|
virtual const char* ActionName() const;
|
||||||
virtual uint32 ActionNameIndex() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double fOldAngle;
|
double fOldAngle;
|
||||||
@@ -156,8 +140,6 @@ class OffsetCenterState : public DragState {
|
|||||||
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
virtual void UpdateViewCursor(BView* view, BPoint current) const;
|
||||||
|
|
||||||
virtual const char* ActionName() const;
|
virtual const char* ActionName() const;
|
||||||
virtual uint32 ActionNameIndex() const;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TRANSFORM_BOX_STATES_H
|
#endif // TRANSFORM_BOX_STATES_H
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ TransformCommand::TransformCommand(BPoint pivot,
|
|||||||
double rotation,
|
double rotation,
|
||||||
double xScale,
|
double xScale,
|
||||||
double yScale,
|
double yScale,
|
||||||
const char* actionName,
|
const char* actionName)
|
||||||
uint32 nameIndex)
|
|
||||||
: Command(),
|
: Command(),
|
||||||
fOldPivot(pivot),
|
fOldPivot(pivot),
|
||||||
fOldTranslation(translation),
|
fOldTranslation(translation),
|
||||||
@@ -31,14 +30,12 @@ TransformCommand::TransformCommand(BPoint pivot,
|
|||||||
fNewXScale(xScale),
|
fNewXScale(xScale),
|
||||||
fNewYScale(yScale),
|
fNewYScale(yScale),
|
||||||
|
|
||||||
fName(actionName),
|
fName(actionName)
|
||||||
fNameIndex(nameIndex)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
TransformCommand::TransformCommand(const char* actionName,
|
TransformCommand::TransformCommand(const char* actionName)
|
||||||
uint32 nameIndex)
|
|
||||||
: Command(),
|
: Command(),
|
||||||
fOldPivot(B_ORIGIN),
|
fOldPivot(B_ORIGIN),
|
||||||
fOldTranslation(B_ORIGIN),
|
fOldTranslation(B_ORIGIN),
|
||||||
@@ -52,8 +49,7 @@ TransformCommand::TransformCommand(const char* actionName,
|
|||||||
fNewXScale(1.0),
|
fNewXScale(1.0),
|
||||||
fNewYScale(1.0),
|
fNewYScale(1.0),
|
||||||
|
|
||||||
fName(actionName),
|
fName(actionName)
|
||||||
fNameIndex(nameIndex)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +108,7 @@ TransformCommand::Redo()
|
|||||||
void
|
void
|
||||||
TransformCommand::GetName(BString& name)
|
TransformCommand::GetName(BString& name)
|
||||||
{
|
{
|
||||||
name << _GetString(fNameIndex, fName.String());
|
name << fName.String();
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetNewTransformation
|
// SetNewTransformation
|
||||||
@@ -140,9 +136,7 @@ TransformCommand::SetNewTranslation(BPoint translation)
|
|||||||
|
|
||||||
// SetName
|
// SetName
|
||||||
void
|
void
|
||||||
TransformCommand::SetName(const char* actionName, uint32 nameIndex)
|
TransformCommand::SetName(const char* actionName)
|
||||||
{
|
{
|
||||||
fName.SetTo(actionName);
|
fName.SetTo(actionName);
|
||||||
fNameIndex = nameIndex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,9 @@ class TransformCommand : public Command {
|
|||||||
double xScale,
|
double xScale,
|
||||||
double yScale,
|
double yScale,
|
||||||
|
|
||||||
const char* actionName,
|
const char* actionName);
|
||||||
uint32 nameIndex);
|
|
||||||
|
|
||||||
TransformCommand(const char* actionName,
|
TransformCommand(const char* actionName);
|
||||||
uint32 nameIndex);
|
|
||||||
|
|
||||||
virtual ~TransformCommand();
|
virtual ~TransformCommand();
|
||||||
|
|
||||||
@@ -49,8 +47,7 @@ class TransformCommand : public Command {
|
|||||||
void SetNewTranslation(BPoint translation);
|
void SetNewTranslation(BPoint translation);
|
||||||
// convinience for "nudging"
|
// convinience for "nudging"
|
||||||
|
|
||||||
void SetName(const char* actionName,
|
void SetName(const char* actionName);
|
||||||
uint32 nameIndex);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual status_t _SetTransformation(BPoint pivot,
|
virtual status_t _SetTransformation(BPoint pivot,
|
||||||
@@ -72,7 +69,6 @@ class TransformCommand : public Command {
|
|||||||
double fNewYScale;
|
double fNewYScale;
|
||||||
|
|
||||||
BString fName;
|
BString fName;
|
||||||
uint32 fNameIndex;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TRANSFORM_COMMAND_H
|
#endif // TRANSFORM_COMMAND_H
|
||||||
|
|||||||
@@ -178,10 +178,10 @@ TransformGradientBox::ViewSpaceRotation() const
|
|||||||
|
|
||||||
// MakeCommand
|
// MakeCommand
|
||||||
TransformCommand*
|
TransformCommand*
|
||||||
TransformGradientBox::MakeCommand(const char* commandName, uint32 nameIndex)
|
TransformGradientBox::MakeCommand(const char* commandName)
|
||||||
{
|
{
|
||||||
return new TransformGradientCommand(this, fGradient, Pivot(),
|
return new TransformGradientCommand(this, fGradient, Pivot(),
|
||||||
Translation(), LocalRotation(), LocalXScale(), LocalYScale(),
|
Translation(), LocalRotation(), LocalXScale(), LocalYScale(),
|
||||||
commandName, nameIndex);
|
commandName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ class TransformGradientBox : public TransformBox {
|
|||||||
virtual float ZoomLevel() const;
|
virtual float ZoomLevel() const;
|
||||||
virtual double ViewSpaceRotation() const;
|
virtual double ViewSpaceRotation() const;
|
||||||
|
|
||||||
virtual TransformCommand* MakeCommand(const char* actionName,
|
virtual TransformCommand* MakeCommand(const char* actionName);
|
||||||
uint32 nameIndex);
|
|
||||||
|
|
||||||
// TransformGradientBox
|
// TransformGradientBox
|
||||||
Command* Perform();
|
Command* Perform();
|
||||||
|
|||||||
@@ -17,10 +17,9 @@ using std::nothrow;
|
|||||||
|
|
||||||
TransformGradientCommand::TransformGradientCommand(TransformBox* box,
|
TransformGradientCommand::TransformGradientCommand(TransformBox* box,
|
||||||
Gradient* gradient, BPoint pivot, BPoint translation, double rotation,
|
Gradient* gradient, BPoint pivot, BPoint translation, double rotation,
|
||||||
double xScale, double yScale, const char* name, int32 nameIndex)
|
double xScale, double yScale, const char* name)
|
||||||
:
|
:
|
||||||
TransformCommand(pivot, translation, rotation, xScale, yScale, name,
|
TransformCommand(pivot, translation, rotation, xScale, yScale, name),
|
||||||
nameIndex),
|
|
||||||
fTransformBox(box),
|
fTransformBox(box),
|
||||||
fGradient(gradient)
|
fGradient(gradient)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ public:
|
|||||||
TransformBox* box, Gradient* gradient,
|
TransformBox* box, Gradient* gradient,
|
||||||
BPoint pivot, BPoint translation,
|
BPoint pivot, BPoint translation,
|
||||||
double rotation, double xScale,
|
double rotation, double xScale,
|
||||||
double yScale, const char* name,
|
double yScale, const char* name);
|
||||||
int32 nameIndex);
|
|
||||||
virtual ~TransformGradientCommand();
|
virtual ~TransformGradientCommand();
|
||||||
|
|
||||||
// Command interface
|
// Command interface
|
||||||
|
|||||||
@@ -28,15 +28,13 @@ TransformObjectsCommand::TransformObjectsCommand(
|
|||||||
double xScale,
|
double xScale,
|
||||||
double yScale,
|
double yScale,
|
||||||
|
|
||||||
const char* name,
|
const char* name)
|
||||||
int32 nameIndex)
|
|
||||||
: TransformCommand(pivot,
|
: TransformCommand(pivot,
|
||||||
translation,
|
translation,
|
||||||
rotation,
|
rotation,
|
||||||
xScale,
|
xScale,
|
||||||
yScale,
|
yScale,
|
||||||
name,
|
name),
|
||||||
nameIndex),
|
|
||||||
fTransformBox(box),
|
fTransformBox(box),
|
||||||
fObjects(objects && count > 0 ?
|
fObjects(objects && count > 0 ?
|
||||||
new (nothrow) Transformable*[count] : NULL),
|
new (nothrow) Transformable*[count] : NULL),
|
||||||
|
|||||||
@@ -36,8 +36,7 @@ class TransformObjectsCommand : public TransformCommand,
|
|||||||
double xScale,
|
double xScale,
|
||||||
double yScale,
|
double yScale,
|
||||||
|
|
||||||
const char* name,
|
const char* name);
|
||||||
int32 nameIndex);
|
|
||||||
virtual ~TransformObjectsCommand();
|
virtual ~TransformObjectsCommand();
|
||||||
|
|
||||||
// Command interface
|
// Command interface
|
||||||
|
|||||||
@@ -117,8 +117,7 @@ TransformPointsBox::Update(bool deep)
|
|||||||
|
|
||||||
// MakeCommand
|
// MakeCommand
|
||||||
TransformCommand*
|
TransformCommand*
|
||||||
TransformPointsBox::MakeCommand(const char* commandName,
|
TransformPointsBox::MakeCommand(const char* commandName)
|
||||||
uint32 nameIndex)
|
|
||||||
{
|
{
|
||||||
return new TransformPointsCommand(this, fPath,
|
return new TransformPointsCommand(this, fPath,
|
||||||
|
|
||||||
@@ -132,8 +131,7 @@ TransformPointsBox::MakeCommand(const char* commandName,
|
|||||||
LocalXScale(),
|
LocalXScale(),
|
||||||
LocalYScale(),
|
LocalYScale(),
|
||||||
|
|
||||||
commandName,
|
commandName);
|
||||||
nameIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|||||||
@@ -40,8 +40,7 @@ class TransformPointsBox : public CanvasTransformBox {
|
|||||||
// TransformBox interface
|
// TransformBox interface
|
||||||
virtual void Update(bool deep = true);
|
virtual void Update(bool deep = true);
|
||||||
|
|
||||||
virtual TransformCommand* MakeCommand(const char* commandName,
|
virtual TransformCommand* MakeCommand(const char* commandName);
|
||||||
uint32 nameIndex);
|
|
||||||
|
|
||||||
// TransformPointsBox
|
// TransformPointsBox
|
||||||
void Cancel();
|
void Cancel();
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ TransformShapesBox::ObjectChanged(const Observable* object)
|
|||||||
|
|
||||||
// MakeCommand
|
// MakeCommand
|
||||||
TransformCommand*
|
TransformCommand*
|
||||||
TransformShapesBox::MakeCommand(const char* commandName, uint32 nameIndex)
|
TransformShapesBox::MakeCommand(const char* commandName)
|
||||||
{
|
{
|
||||||
Transformable* objects[fCount];
|
Transformable* objects[fCount];
|
||||||
for (int32 i = 0; i < fCount; i++)
|
for (int32 i = 0; i < fCount; i++)
|
||||||
@@ -143,7 +143,6 @@ TransformShapesBox::MakeCommand(const char* commandName, uint32 nameIndex)
|
|||||||
LocalXScale(),
|
LocalXScale(),
|
||||||
LocalYScale(),
|
LocalYScale(),
|
||||||
|
|
||||||
commandName,
|
commandName);
|
||||||
nameIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ class TransformShapesBox : public CanvasTransformBox {
|
|||||||
// TransformBox interface
|
// TransformBox interface
|
||||||
virtual void Update(bool deep = true);
|
virtual void Update(bool deep = true);
|
||||||
|
|
||||||
virtual TransformCommand* MakeCommand(const char* actionName,
|
virtual TransformCommand* MakeCommand(const char* actionName);
|
||||||
uint32 nameIndex);
|
|
||||||
|
|
||||||
// TransformShapesBox
|
// TransformShapesBox
|
||||||
Shape** Shapes() const
|
Shape** Shapes() const
|
||||||
|
|||||||
Reference in New Issue
Block a user