spline/
work/
.qmake.stash
+ref/*
+changes.txt
make && make install
[*NOTE: make install doesn't do anything ATM]
-
rel=`git log -1 --pretty=format:%ci | cut -d ' ' -f 1 | tr -d -`
#echo ${TARGET}.exe
cd release && upx -9v ${TARGET}.exe && zip -9v ${TARGET}-${rel}.zip ${TARGET}.exe
-
#include "about.h"
//testing... #include "structs.h"
-
AboutWindow::AboutWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog)
{
setWindowTitle(tr("About Architektonas..."));
layout->addWidget(text);
}
-
void AboutWindow::keyPressEvent(QKeyEvent * e)
{
if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return)
hide();
}
-
#include "baseunittab.h"
-
BaseUnitTab::BaseUnitTab(QWidget * parent/*= 0*/): QWidget(parent)
{
unitInch = new QRadioButton(tr("Inches"));
setLayout(layout);
}
-
BaseUnitTab::~BaseUnitTab()
{
}
-
-// layeritemwidget.cpp: Layer item widget
+//
+// blockitemwidget.cpp: Block item widget
//
// Part of the Architektonas Project
// (C) 2011 Underground Software
#include "blockitemwidget.h"
-
BlockItemWidget::BlockItemWidget(QString s, QPixmap * i/*=0*/):
QWidget(),
name(new QLabel(s)),
printf("BlockItemWidget: size. w=%i, h=%i\n", size.width(), size.height());
}
-
BlockItemWidget::~BlockItemWidget()
{
}
-
+//
// blockwidget.cpp: Block add/remove/use widget
//
// Part of the Architektonas Project
#include "blockwidget.h"
#include "blockitemwidget.h"
-
BlockWidget::BlockWidget(void): QWidget()
{
BlockItemWidget * biw1 = new BlockItemWidget("2x4");
setLayout(mainLayout);
}
-
BlockWidget::~BlockWidget()
{
}
-
#include "connection.h"
-
Connection::Connection(Object * o/*= NULL*/, double param/*= 0*/)
{
object = o;
t = param;
}
-
Connection::~Connection()
{
}
-
// Check for equality
bool Connection::operator==(Connection const c)
{
return (object == c.object) && (t == c.t);
}
-
// Check for inequality
bool Connection::operator!=(Connection const c)
{
return (object != c.object) || (t != c.t);
}
-
+//
// container.cpp: Container object
//
// Part of the Architektonas Project
#include "dimension.h"
#include "painter.h"
-
Container::Container(Vector p1, Object * p/*= NULL*/): Object(p1, p),
isTopLevelContainer(false),
dragging(false), draggingHandle1(false), draggingHandle2(false),
state = OSInactive;
}
-
// Copy constructor
Container::Container(const Container & copy): Object(copy.position, copy.parent)
{
state = OSInactive;
}
-
Container::~Container()
{
Clear();
}
-
// Assignment operator
Container & Container::operator=(const Container & from)
{
return *this;
}
-
/*virtual*/ void Container::Draw(Painter * painter)
{
QRectF boundary;
}
}
-
/*virtual*/ Vector Container::Center(void)
{
return position;
}
-
/*
We need at least *three* handles for this object:
- one for moving
Also: should put the snap logic into the Object base class (as a static method)...
*/
-
// Need to add checking here for clicking on a member of a group (Container),
// and checking for if it's a top level container (the DrawingView's document).
/*
return (lastObjectHovered == NULL ? false : true);
}
-
/*virtual*/ void Container::PointerReleased(void)
{
if (!isTopLevelContainer)
(*i)->PointerReleased();
}
-
/*virtual*/ bool Container::NeedsUpdate(void)
{
// If this is *not* a top level container, then we treat it as an
return false;
}
-
/*virtual*/ void Container::Add(Object * object)
{
objects.push_back(object);
printf("Container: Added object (=$%X). size = %li\n", object, objects.size());
}
-
/*virtual*/ QRectF Container::Extents(void)
{
QRectF bounds;
return bounds;
}
-
void Container::Delete(Object * objectToDelete)
{
std::vector<Object *>::iterator i = objects.begin();
}
}
-
void Container::DeleteSelectedItems(void)
{
std::vector<Object *>::iterator i = objects.begin();
}
}
-
void Container::Clear(void)
{
std::vector<Object *>::iterator i = objects.begin();
}
}
-
void Container::SelectAll(void)
{
for(unsigned int i=0; i<objects.size(); i++)
objects[i]->state = OSSelected;
}
-
void Container::DeselectAll(void)
{
for(unsigned int i=0; i<objects.size(); i++)
objects[i]->state = OSInactive;
}
-
int Container::ItemsSelected(void)
{
int selected = 0;
return selected;
}
-
Object * Container::SelectedItem(unsigned int index)
{
unsigned int selectedIndex = 0;
return NULL;
}
-
void Container::MoveContentsTo(Container * newContainer)
{
// Sanity check
objects.clear();
}
-
void Container::CopyContentsTo(Container * newContainer)
{
// Sanity check
newContainer->Add((*i)->Copy());
}
-
void Container::MoveSelectedContentsTo(Container * newContainer)
{
// Sanity check
}
}
-
void Container::CopySelectedContentsTo(Container * newContainer)
{
// Sanity check
}
}
-
void Container::ResizeAllDimensions(double newSize)
{
for(std::vector<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)
}
}
-
/*virtual*/ void Container::Enumerate(FILE * file)
{
// Only put "CONTAINER" markers if *not* the top level container
fprintf(file, "ENDCONTAINER\n");
}
-
/*virtual*/ Object * Container::Copy(void)
{
#warning "!!! This doesn't take care of attached Dimensions !!!"
return c;
}
-
/*virtual*/ void Container::Rotate(Point point, double angle)
{
for(std::vector<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)
(*i)->Rotate(point, angle);
}
-
/*virtual*/ void Container::RotateSelected(Point point, double angle)
{
for(std::vector<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)
}
}
-
/*virtual*/ void Container::Mirror(Point p1, Point p2)
{
for(std::vector<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)
(*i)->Mirror(p1, p2);
}
-
/*virtual*/ void Container::MirrorSelected(Point p1, Point p2)
{
for(std::vector<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)
}
}
-
/*virtual*/ void Container::Save(void)
{
Object::Save();
(*i)->Save();
}
-
/*virtual*/ void Container::Restore(void)
{
Object::Restore();
for(std::vector<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)
(*i)->Restore();
}
-
Doing that, with the Line and a parameter "t", if t == 0 we have endpoint 1.
if t == 1, then we have endpoint 2. With a Circle, the parameter is a number
-between 0 and 1 (scaled to 0 to 2π). With an Arc, the parameter goes from 0 to
+between 0 and 1 (scaled to 0 to tau). With an Arc, the parameter goes from 0 to
1, 0 being enpoint 1 and 1 being endpoint 2.
How does this work for moving objects that are connected? Again, with the Line
// OTFDimension, OTFPolygon, OTFText, OTFImage, OTFBlock, OTFEndOfFile };
enum ObjectTypeFile { OTFContainer, OTFContainerEnd, OTFObject, OTFEndOfFile };
-
// Instantiate class variables
/*static*/ int FileIO::objectFileType = OTFObject;
-
/*static*/ bool FileIO::SaveAtnsFile(FILE * file, Container * c)
{
/* Approach: loop through the container, doing a depth-first traversal. Any
return true;
}
-
/*static*/ bool FileIO::LoadAtnsFile(FILE * file, Container * drawing)
{
float version;
return false;
}
-
/*static*/ void FileIO::ResetLayerVectors(void)
{
// Set up layer vectors
Global::activeLayer = 0;
}
-
/*static*/ bool FileIO::LoadVersion1_0(FILE * file, Container * drawing)
{
// Approach: read each object in the file, one by one. If the object is a
return false;
}
-
/*static*/ bool FileIO::LoadVersion1_1(FILE * file, Container * drawing)
{
// Approach: read each object in the file, one by one. If the object is a
return false;
}
-
/*static*/ bool FileIO::LoadVersion1_2(FILE * file, Container * drawing)
{
int hidden, locked;
return false;
}
-
/*static*/ Object * FileIO::GetObjectFromFile(FILE * file, bool extended/*= false*/, bool ext2/*= false*/)
{
char buffer[256];
return obj;
}
-
/*static*/ bool FileIO::WriteObjectToFile(FILE * file, Object * obj)
{
// Sanity check
return true;
}
-
};
#endif // __FILEIO_H__
-
#include "generaltab.h"
-
GeneralTab::GeneralTab(QWidget * parent/*= 0*/): QWidget(parent)
{
antialiasChk = new QCheckBox(tr("Use Qt's built-in antialiasing"));
setLayout(layout);
}
-
GeneralTab::~GeneralTab()
{
}
};
#endif // __GLOBALS_H__
-
+//
// layeritemwidget.cpp: Layer item widget
//
// Part of the Architektonas Project
#include "layeritemwidget.h"
-
LayerItemWidget::LayerItemWidget(QString s, bool i/*=false*/, bool l/*=false*/, QListWidgetItem * p/*=null*/):
QWidget(),
name(new QLabel(s)),
connect(locked, SIGNAL(clicked(bool)), this, SLOT(HandleLockToggle(bool)));
}
-
LayerItemWidget::~LayerItemWidget()
{
}
-
void LayerItemWidget::HandleHideToggle(bool state)
{
// printf("Eye is: %s\n", !state ? "OPEN" : "closed");
emit HideToggled(parent, state);
}
-
void LayerItemWidget::HandleLockToggle(bool state)
{
// printf("Lock is: %s\n", !state ? "OPEN" : "closed");
emit LockToggled(parent, state);
}
-
+//
// layerwidget.cpp: Layer add/remove/use widget
//
// Part of the Architektonas Project
#include "global.h"
#include "layeritemwidget.h"
-
LayerWidget::LayerWidget(void): QWidget(),
addLayer(new QToolButton), removeLayer(new QToolButton),
editLayer(new QToolButton), layerUp(new QToolButton),
Global::layerName.push_back("Background");
}
-
LayerWidget::~LayerWidget()
{
}
-
void LayerWidget::Reload(void)
{
list->clear();
SetButtonStates();
}
-
void LayerWidget::HandleLayerSelected(int currentRow)
{
// If LayerWidget is empty, bail out
SetButtonStates();
}
-
//
// What happens here is that for every QListWidgetItem we make, we connect it
// to these handlers. But we only have to worry about that when adding and
emit LayerToggled();
}
-
void LayerWidget::HandleLockToggle(QListWidgetItem * qlwi, bool state)
{
int currentRow = list->row(qlwi);
// printf("Item #%i, new lock state is %s\n", list->row(qlwi), (state ? "ON" : "off"));
}
-
void LayerWidget::HandleDblClick(QListWidgetItem * /*qlwi*/)
{
EditLayer();
}
-
void LayerWidget::AddLayer(void)
{
// We always stick the newest layer at the top of the list (visually, the
Global::numLayers++;
}
-
void LayerWidget::DeleteLayer(void)
{
int numItems = list->count();
Global::activeLayer--;
}
-
void LayerWidget::EditLayer(void)
{
// Get the LayerItemWidget so we can edit it (its name, anyway)...
}
}
-
void LayerWidget::MoveLayerUp(void)
{
// Get information out of the LayerItemWidget (& get it from the list!)
emit LayersSwapped(layer, layer + 1);
}
-
void LayerWidget::MoveLayerDown(void)
{
// Get information out of the LayerItemWidget (& get it from the list!)
emit LayersSwapped(layer, layer - 1);
}
-
//
// Set button states in this widget to sane values
//
layerUp->setEnabled(currentRow == 0 ? false : true);
removeLayer->setEnabled(numItems == 1 ? false : true);
}
-
};
#endif // __LAYERWIDGET_H__
-
mainWindow->show();
}
-
// Here's the main application loop--short and simple...
int main(int argc, char * argv[])
{
+//
// Mathematical Constants used by Architektonas
//
// Part of the Architektonas Project
#define HALF_TAU (TAU_2QTR)
#define QTR_TAU (TAU_1QTR)
#define THREE_QTR_TAU (TAU_3QTR)
-
+//
// objectwidget.cpp: Object tweaking widget
//
// Part of the Architektonas Project
#include "objectwidget.h"
#include "mathconstants.h"
-
ObjectWidget::ObjectWidget(void): QWidget()
{
label = new QLabel;
setLayout(mainLayout);
}
-
ObjectWidget::~ObjectWidget()
{
}
-
void ObjectWidget::ShowInfo(Object * obj)
{
// Sanity check
label->setText(s);
}
-
#include <QtWidgets>
#include "structs.h"
-
class ObjectWidget: public QWidget
{
Q_OBJECT
};
#endif // __OBJECTWIDGET_H__
-
+//
// penwidget.cpp: Pen tweaking widget
//
// Part of the Architektonas Project
#include "baseunittab.h"
#include "generaltab.h"
-
SettingsDialog::SettingsDialog(QWidget * parent/*= 0*/): QDialog(parent)
{
tabWidget = new QTabWidget;
setWindowTitle(tr("Architektonas Settings"));
}
-
SettingsDialog::~SettingsDialog()
{
}
-
+//
// utils.cpp: Stuff that's useful to have kicking around, in one spot
//
// Part of the Architektonas Project