// Copyright (C) 2015 Foam Kernow // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "window.h" #include #include using namespace std; using namespace spiralcore; #ifndef M_PI #define M_PI 3.141592653589 #endif window::window() : m_current_type(RECTANGLE) { } void window::clear() { for (vector::iterator i=m_windows.begin(); i!=m_windows.end(); ++i) { delete *i; } m_windows.clear(); } void window::init(u32 size) { clear(); for (u32 i=0; iget_length()); for (u32 n=0; n(&s); if (pos!=NULL) { u32 size=0; // get the size from the first window if (b.m_windows.size()>0) { size=b.m_windows[0]->get_length(); } s||size; } else { u32 size=0; s||size; // reinit using size if we are reading in b.init(size); } return s; }