From 064f6b7b9bf37112053e105c8cdf4ac786ef5741 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Thu, 28 Dec 2006 20:56:28 +0000 Subject: [PATCH] Removed Automation 3 support (will be replaced with Automation 4 soon) Removed stale p-designer project Updated FexTracker to work with pre-compiled headers Removed deprecated dc.BeginPaint()/EndPaint() calls causing warnings Originally committed to SVN as r642. --- FexTrackerSource/FexGenericFilter.cpp | 1 + .../FexGenericFilter_BaseFloatImage.cpp | 4 +- FexTrackerSource/FexTracker.cpp | 6 +- FexTrackerSource/StdAfx.h | 1 + core/audio_display.cpp | 14 -- core/audio_karaoke.cpp | 3 - core/{ => auto3}/automation.cpp | 0 core/{ => auto3}/automation.h | 0 core/{ => auto3}/automation_filter.cpp | 0 core/{ => auto3}/automation_filter.h | 0 core/{ => auto3}/automation_gui.cpp | 0 core/{ => auto3}/automation_gui.h | 0 core/base_grid.cpp | 7 - core/dialog_colorpicker.cpp | 6 - core/dialog_splash.cpp | 4 - core/frame_main.cpp | 36 ++-- core/frame_main_events.cpp | 9 +- core/setup.cpp | 19 +- core/static_bmp.cpp | 2 - p-designer/ass_drawing.cpp | 194 ------------------ p-designer/ass_drawing.h | 77 ------- p-designer/ass_drawing_control.h | 32 --- p-designer/p-designer.cpp | 58 ------ p-designer/p-designer.vcproj | 144 ------------- p-designer/readme.txt | 30 --- 25 files changed, 34 insertions(+), 613 deletions(-) rename core/{ => auto3}/automation.cpp (100%) rename core/{ => auto3}/automation.h (100%) rename core/{ => auto3}/automation_filter.cpp (100%) rename core/{ => auto3}/automation_filter.h (100%) rename core/{ => auto3}/automation_gui.cpp (100%) rename core/{ => auto3}/automation_gui.h (100%) delete mode 100644 p-designer/ass_drawing.cpp delete mode 100644 p-designer/ass_drawing.h delete mode 100644 p-designer/ass_drawing_control.h delete mode 100644 p-designer/p-designer.cpp delete mode 100644 p-designer/p-designer.vcproj delete mode 100644 p-designer/readme.txt diff --git a/FexTrackerSource/FexGenericFilter.cpp b/FexTrackerSource/FexGenericFilter.cpp index 51c428838..7e264c952 100644 --- a/FexTrackerSource/FexGenericFilter.cpp +++ b/FexTrackerSource/FexGenericFilter.cpp @@ -2,6 +2,7 @@ // All rights reserved but the aegisub project is allowed to use it. #include +#include "StdAfx.h" #include "FexGenericFilter_Include.h" FexFilter::FexFilter() diff --git a/FexTrackerSource/FexGenericFilter_BaseFloatImage.cpp b/FexTrackerSource/FexGenericFilter_BaseFloatImage.cpp index df8cef3f1..fe7fdacb7 100644 --- a/FexTrackerSource/FexGenericFilter_BaseFloatImage.cpp +++ b/FexTrackerSource/FexGenericFilter_BaseFloatImage.cpp @@ -1,9 +1,7 @@ // This file is part of FexGenericFilter and (C) 2006 by Hajo Krabbenhöft (tentacle) // All rights reserved but the aegisub project is allowed to use it. -#include "stdio.h" -#include "math.h" -#include "memory.h" +#include "StdAfx.h" #include "FexGenericFilter_Include.h" diff --git a/FexTrackerSource/FexTracker.cpp b/FexTrackerSource/FexTracker.cpp index f6b338686..2c1d70750 100644 --- a/FexTrackerSource/FexTracker.cpp +++ b/FexTrackerSource/FexTracker.cpp @@ -4,6 +4,9 @@ // FexTracker.cpp : Defines the entry point for the DLL application. // +#include "StdAfx.h" +#include "stdio.h" + #ifndef MIN #define MIN(a,b) ((a)<(b))?(a):(b) #endif @@ -12,9 +15,6 @@ #define MAX(a,b) ((a)>(b))?(a):(b) #endif -#include "StdAfx.h" -#include "stdio.h" - FexTracker::FexTracker( int sx, int sy, int inFeatures ) { printf( "[ using FexTracker (c)2006 Hajo Krabbenhoft ]\n" ); diff --git a/FexTrackerSource/StdAfx.h b/FexTrackerSource/StdAfx.h index eb4b89e52..6e3d2c664 100644 --- a/FexTrackerSource/StdAfx.h +++ b/FexTrackerSource/StdAfx.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "FexTracker.h" diff --git a/core/audio_display.cpp b/core/audio_display.cpp index 0653210b6..485af6561 100644 --- a/core/audio_display.cpp +++ b/core/audio_display.cpp @@ -168,7 +168,6 @@ void AudioDisplay::UpdateImage(bool weak) { // Draw image to be displayed wxMemoryDC dc; dc.SelectObject(*origImage); - dc.BeginDrawing(); // Black background dc.SetPen(*wxTRANSPARENT_PEN); @@ -436,8 +435,6 @@ void AudioDisplay::UpdateImage(bool weak) { } // Done - dc.EndDrawing(); - Refresh(false); } @@ -1266,9 +1263,7 @@ void AudioDisplay::OnPaint(wxPaintEvent& event) { if (w == 0 || h == 0) return; wxPaintDC dc(this); - dc.BeginDrawing(); dc.DrawBitmap(*origImage,0,0); - dc.EndDrawing(); } @@ -1446,7 +1441,6 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) { if (!player->IsPlaying()) { // Draw bg wxClientDC dc(this); - dc.BeginDrawing(); dc.DrawBitmap(*origImage,0,0); if (inside) { @@ -1486,9 +1480,6 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) { dc.SetTextForeground(wxColour(255,255,255)); dc.DrawText(text,dx,dy); } - - // End drawing - dc.EndDrawing(); } // Scale dragging @@ -1797,7 +1788,6 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) { // Get DCs //wxMutexGuiEnter(); wxClientDC dc(this); - dc.BeginDrawing(); // Draw cursor int curpos = -1; @@ -1863,10 +1853,6 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) { dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0); } oldCurPos = curpos; - - // Done - dc.EndDrawing(); - //wxMutexGuiLeave(); } diff --git a/core/audio_karaoke.cpp b/core/audio_karaoke.cpp index 5bec1db3d..c19009702 100644 --- a/core/audio_karaoke.cpp +++ b/core/audio_karaoke.cpp @@ -298,7 +298,6 @@ void AudioKaraoke::OnPaint(wxPaintEvent &event) { // Start Paint wxPaintDC dc(this); - dc.BeginDrawing(); // Draw background dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE))); @@ -386,8 +385,6 @@ void AudioKaraoke::OnPaint(wxPaintEvent &event) { } } - // End paint - dc.EndDrawing(); event.Skip(); } diff --git a/core/automation.cpp b/core/auto3/automation.cpp similarity index 100% rename from core/automation.cpp rename to core/auto3/automation.cpp diff --git a/core/automation.h b/core/auto3/automation.h similarity index 100% rename from core/automation.h rename to core/auto3/automation.h diff --git a/core/automation_filter.cpp b/core/auto3/automation_filter.cpp similarity index 100% rename from core/automation_filter.cpp rename to core/auto3/automation_filter.cpp diff --git a/core/automation_filter.h b/core/auto3/automation_filter.h similarity index 100% rename from core/automation_filter.h rename to core/auto3/automation_filter.h diff --git a/core/automation_gui.cpp b/core/auto3/automation_gui.cpp similarity index 100% rename from core/automation_gui.cpp rename to core/auto3/automation_gui.cpp diff --git a/core/automation_gui.h b/core/auto3/automation_gui.h similarity index 100% rename from core/automation_gui.h rename to core/auto3/automation_gui.h diff --git a/core/base_grid.cpp b/core/base_grid.cpp index 44998e020..575ef8630 100644 --- a/core/base_grid.cpp +++ b/core/base_grid.cpp @@ -293,9 +293,7 @@ void BaseGrid::OnPaint (wxPaintEvent &event) { bool direct = false; if (direct) { - dc.BeginDrawing(); DrawImage(dc); - dc.EndDrawing(); } else { @@ -325,8 +323,6 @@ void BaseGrid::OnPaint (wxPaintEvent &event) { ////////////// // Draw image void BaseGrid::DrawImage(wxDC &dc) { - dc.BeginDrawing(); - // Get size and pos int w = 0; int h = 0; @@ -536,9 +532,6 @@ void BaseGrid::DrawImage(wxDC &dc) { dc.SetBrush(*wxTRANSPARENT_BRUSH); dy = (editBox->linen+1-yPos) * lineHeight; dc.DrawRectangle(0,dy,w,lineHeight+1); - - // Done - dc.EndDrawing(); } diff --git a/core/dialog_colorpicker.cpp b/core/dialog_colorpicker.cpp index 72cf779d9..ddbb6a675 100644 --- a/core/dialog_colorpicker.cpp +++ b/core/dialog_colorpicker.cpp @@ -85,7 +85,6 @@ void ColorPickerSpectrum::OnPaint(wxPaintEvent &evt) if (!background) return; wxPaintDC dc(this); - dc.BeginDrawing(); wxMemoryDC memdc; memdc.SelectObject(*background); @@ -113,8 +112,6 @@ void ColorPickerSpectrum::OnPaint(wxPaintEvent &evt) dc.DrawLine(0, y, GetClientSize().x, y); break; } - - dc.EndDrawing(); } void ColorPickerSpectrum::OnMouse(wxMouseEvent &evt) @@ -231,7 +228,6 @@ void ColorPickerRecent::OnPaint(wxPaintEvent &evt) int i = 0; dc.SetPen(*wxTRANSPARENT_PEN); - dc.BeginDrawing(); for (int cy = 0; cy < rows; cy++) { for (int cx = 0; cx < cols; cx++) { @@ -245,8 +241,6 @@ void ColorPickerRecent::OnPaint(wxPaintEvent &evt) i++; } } - - dc.EndDrawing(); } void ColorPickerRecent::OnSize(wxSizeEvent &evt) diff --git a/core/dialog_splash.cpp b/core/dialog_splash.cpp index d912ab10f..a8afa617a 100644 --- a/core/dialog_splash.cpp +++ b/core/dialog_splash.cpp @@ -68,9 +68,7 @@ SplashScreen::SplashScreen(wxWindow *parent) // Prepare wxClientDC dc(this); - dc.BeginDrawing(); dc.DrawBitmap(splash,0,0); - dc.EndDrawing(); autoClose = new wxTimer(this,5000); autoClose->Start(5000,true); @@ -98,9 +96,7 @@ END_EVENT_TABLE() // OnPaint void SplashScreen::OnPaint(wxPaintEvent& event) { wxPaintDC dc(this); - dc.BeginDrawing(); dc.DrawBitmap(splash,0,0); - dc.EndDrawing(); } diff --git a/core/frame_main.cpp b/core/frame_main.cpp index 270126362..5c2e48975 100644 --- a/core/frame_main.cpp +++ b/core/frame_main.cpp @@ -58,7 +58,7 @@ #include "version.h" #include "dialog_splash.h" #include "dialog_tip.h" -#include "automation_filter.h" +//#include "automation_filter.h" #include "audio_box.h" #include "video_box.h" #include "drop.h" @@ -584,10 +584,10 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) { wxMessageBox(wxString(err), _T("Error"), wxOK | wxICON_ERROR, NULL); return; } - catch (AutomationError &err) { - wxMessageBox(wxString(_T("Automation exception: ")) + err.message, _T("Error"), wxOK | wxICON_ERROR, NULL); - return; - } +// catch (AutomationError &err) { +// wxMessageBox(wxString(_T("Automation exception: ")) + err.message, _T("Error"), wxOK | wxICON_ERROR, NULL); +// return; +// } catch (...) { wxMessageBox(_T("Unknown error"), _T("Error"), wxOK | wxICON_ERROR, NULL); return; @@ -796,15 +796,15 @@ void FrameMain::SynchronizeProject(bool fromSubs) { long videoAr = 0; double videoArValue = 0.0; long videoZoom = 0; - { - std::list::const_iterator next = AssAutomationFilter::GetFilterList().begin(), f; - while (next != AssAutomationFilter::GetFilterList().end()) { - f = next++; - AutomationScript *s = (*f)->GetScript(); - delete (*f); - delete s; - } - } +// { +// std::list::const_iterator next = AssAutomationFilter::GetFilterList().begin(), f; +// while (next != AssAutomationFilter::GetFilterList().end()) { +// f = next++; +// AutomationScript *s = (*f)->GetScript(); +// delete (*f); +// delete s; +// } +// } // Get AR wxString arString = subs->GetScriptInfo(_T("Video Aspect Ratio")); @@ -825,7 +825,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) { wxString AutoScriptString = subs->GetScriptInfo(_T("Automation Scripts")); // Automation script - if (AutoScriptString != _T("")) { +/* if (AutoScriptString != _T("")) { wxStringTokenizer toker(AutoScriptString, _T("|"), wxTOKEN_STRTOK); wxFileName AssFileName(subs->filename); while (toker.HasMoreTokens()) { @@ -852,7 +852,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) { continue; } } - } + }*/ // Check if there is anything to change int autoLoadMode = Options.AsInt(_T("Autoload linked files")); @@ -928,7 +928,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) { subs->SetScriptInfo(_T("Keyframes File"),MakeRelativePath(videoBox->videoDisplay->GetKeyFramesName(),AssFile::top->filename)); // Create list of Automation scripts - wxString scripts; +/* wxString scripts; std::list::const_iterator f = AssAutomationFilter::GetFilterList().begin(); wxFileName AssFileName(subs->filename); for (;f != AssAutomationFilter::GetFilterList().end(); ++f) { @@ -941,7 +941,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) { if (!scripts.empty()) { scripts.RemoveLast(); subs->SetScriptInfo(_T("Automation Scripts"), scripts); - } + }*/ } } diff --git a/core/frame_main_events.cpp b/core/frame_main_events.cpp index dafae853c..0d6b12f63 100644 --- a/core/frame_main_events.cpp +++ b/core/frame_main_events.cpp @@ -49,6 +49,7 @@ #include "video_zoom.h" #include "video_box.h" #include "ass_file.h" +#include "ass_dialogue.h" #include "dialog_style_manager.h" #include "dialog_translation.h" #include "dialog_jumpto.h" @@ -62,7 +63,7 @@ #include "main.h" #include "dialog_fonts_collector.h" #include "dialog_about.h" -#include "automation_gui.h" +//#include "automation_gui.h" #include "dialog_export.h" #include "audio_box.h" #include "dialog_selection.h" @@ -916,9 +917,9 @@ void FrameMain::OnOpenOptions (wxCommandEvent &event) { // Open Automation void FrameMain::OnOpenAutomation (wxCommandEvent &event) { videoBox->videoDisplay->Stop(); - DialogAutomationManager *automan = new DialogAutomationManager(this, SubsBox); - automan->ShowModal(); - delete automan; +// DialogAutomationManager *automan = new DialogAutomationManager(this, SubsBox); +// automan->ShowModal(); +// delete automan; } diff --git a/core/setup.cpp b/core/setup.cpp index 9313f0a72..115a4fcdd 100644 --- a/core/setup.cpp +++ b/core/setup.cpp @@ -142,20 +142,11 @@ /////// // Lua -#ifdef __WXDEBUG__ -#pragma comment(lib,"lua503d.lib") -#else -#pragma comment(lib,"lua503.lib") -#endif - - -////////////// -// FreeType 2 -#ifdef __WXDEBUG__ -#pragma comment(lib,"freetype2110MT_D.lib") -#else -#pragma comment(lib,"freetype2110MT.lib") -#endif +//#ifdef __WXDEBUG__ +//#pragma comment(lib,"lua503d.lib") +//#else +//#pragma comment(lib,"lua503.lib") +//#endif //////////// diff --git a/core/static_bmp.cpp b/core/static_bmp.cpp index 5ef8893e7..0d9fd1eb5 100644 --- a/core/static_bmp.cpp +++ b/core/static_bmp.cpp @@ -60,7 +60,5 @@ END_EVENT_TABLE() // OnPaint void BitmapControl::OnPaint(wxPaintEvent& event) { wxPaintDC dc(this); - dc.BeginDrawing(); dc.DrawBitmap(bmp,0,0); - dc.EndDrawing(); } diff --git a/p-designer/ass_drawing.cpp b/p-designer/ass_drawing.cpp deleted file mode 100644 index 1f9901e7d..000000000 --- a/p-designer/ass_drawing.cpp +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) 2006, Niels Martin Hansen -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// * Neither the name of the Aegisub Group nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -#include "ass_drawing.h" -#include - - -// Point Four on the roadmap: code the ToString function - -wxString AssDrawing::ToString() -{ - return wxString(_T("")); -} - - -// Point Two on the roadmap: code the FromString function -// "Steal" some ideas from RTS.cpp :P - -// Attempt to read a point from string src. -// On success: Add point to target, "eat" point from src, increase where by chars eaten, return true. -// Assume first char is a non-space -static bool ReadPoint(wxString &src, int &where, std::vector &target) -{ - AssDrawingPoint p; - - int i = 0; - bool isneg = false; - - // Check for negativity - if (src[i] == '+') isneg = false, i++; - if (src[i] == '-') isneg = true, i++; - - // Faster exit for non-digit things - if (!isdigit(src[i])) return false; - - // This loop should terminate even if it hits end of string, since isdigit('\0')==false - while (isdigit(src[i])) i++; - p.x = src.Mid(0, i).ToLong(); - if (isneg) p.x = -p.x; - - // Error checking - if (!isspace(src[i])) return false; - - // Find start of next number - while (isspace(src[i])) i++; - - // Get second number - int j = i; - isneg = false; - if (src[j] == '+') isneg = false, j++; - if (src[j] == '-') isneg = true, j++; - while (isdigit(src[j])) j++; - p.y = src.Mid(j, j-i).ToLong(); - if (isneg) p.y = -p.y; - if (!isspace(src[j])) return false; - while (isspace(src[j])) j++; - - // Finish off - src = src.Mid(j); - target.push_back(p); - where += j; - return true; -} - -int AssDrawing::FromString(wxString src) -{ - data.clear(); - - // Counter for number of chars eaten - int where = 0; - - src.Trim(false); - - while (src.Len() > 0) { - AssDrawingSegment seg; - int i = 0; - - // Next character should be a letter, read it - switch (src[i]) { - case 'm': - seg.type = SEGMENT_MOVE; - break; - case 'n': - seg.type = SEGMENT_MOVE_NOCLOSE; - break; - case 'l': - seg.type = SEGMENT_LINE; - break; - case 'b': - seg.type = SEGMENT_BEZIER; - break; - case 's': - seg.type = SEGMENT_BSPLINE; - break; - case 'p': - seg.type = SEGMENT_BSPLINE_EXTEND; - break; - case 'c': - seg.type = SEGMENT_BSPLINE_CLOSE; - goto skippoints; - default: - // something unknown, stop parsing - return where+1; - } - where++, i++; - while (isspace(src[i])) where++, i++; - src = src.Mid(i); - while (ReadPoint(src, where, seg.points); -skippoints: - data.push_back(seg); - } - - return 0; -} - - -// These might be a bit redundant... save them for last - -void AssDrawing::Collapse() -{ - // TODO -} - -void AssDrawing::Expand() -{ - // TODO -} - - -// I suppose Rescale is just a matter of calculating the new scale, calling Stretch and setting the scale field - -void AssDrawing::Rescale(int new_scale) -{ - // TODO -} - -void AssDrawing::Stretch(float factor) -{ - // TODO -} - - -// A note on the following functions: -// According to VSFilter (last time I checked), the width and height of a drawing are calculated just by looking -// at the min and max X and Y values that appear in the drawing string. This is technically wrong (because of -// splines, those do funny things) but better do as the Romans do. - -AssDrawingPoint AssDrawing::GetMinXY() -{ - // TODO - return AssDrawingPoint(0, 0); -} - -AssDrawingPoint AssDrawing::GetMaxXY() -{ - // TODO - return AssDrawingPoint(0, 0); -} - -AssDrawingPoint AssDrawing::GetExtents() -{ - // TODO - return AssDrawingPoint(0, 0); -} - -AssDrawingPoint AssDrawing::GetCenterXY() -{ - // TODO - return AssDrawingPoint(0, 0); -} diff --git a/p-designer/ass_drawing.h b/p-designer/ass_drawing.h deleted file mode 100644 index 91acc984e..000000000 --- a/p-designer/ass_drawing.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2006, Niels Martin Hansen -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// * Neither the name of the Aegisub Group nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -#pragma once - -#ifndef _ASS_DRAWING_H -#define _ASS_DRAWING_H - -#include -#include -#include - -enum AssDrawingSegmentType { - SEGMENT_MOVE, // m - SEGMENT_MOVE_NOCLOSE, // n - SEGMENT_LINE, // l - SEGMENT_BEZIER, // b - SEGMENT_BSPLINE, // s [... ] - SEGMENT_BSPLINE_EXTEND, // p - SEGMENT_BSPLINE_CLOSE, // c - // thought: maybe join the three last into one? (gabest doesn't) -}; - -struct AssDrawingPoint { - int x, y; - AssDrawingPoint(int _x, int _y) { x = _x; y = _y; } -}; - -struct AssDrawingSegment { - AssDrawingSegmentType type; - std::vector points; -}; - -struct AssDrawing { - int scale; - std::vector data; - - wxString ToString(); // stupid conversion to string, doesn't try to shorten things out - int FromString(wxString src); // returns 0 on success, index+1 of offending character on fail - - void Collapse(); // try to join as many segments together as possible, without affecting the actual shape (eg. join "l 1 2 l 3 4" into "l 1 2 3 4") - void Expand(); // split into as many segments as possible, without creating any meaningless ones, such as null-moves (ie. expand "l 1 2 3 4" into "l 1 2 l 3 4") - - void Rescale(int new_scale); // change the scale value, stretching the drawing to match the new one - void Stretch(float factor); // up/down scale the drawing by a factor - - AssDrawingPoint GetMinXY(); // get the lowest x and y coordinates present - AssDrawingPoint GetMaxXY(); // get the highest x and y coordinates present - AssDrawingPoint GetExtents(); // get the extents of the drawing as seen by VSFilter - AssDrawingPoint GetCenterXY(); // get the "center" of the drawing (as seen by VSFilter) -}; - -#endif diff --git a/p-designer/ass_drawing_control.h b/p-designer/ass_drawing_control.h deleted file mode 100644 index 5c6ed5062..000000000 --- a/p-designer/ass_drawing_control.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2006, Niels Martin Hansen -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// * Neither the name of the Aegisub Group nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -#include - - -class AssDrawingControl : public wxWindow { -}; \ No newline at end of file diff --git a/p-designer/p-designer.cpp b/p-designer/p-designer.cpp deleted file mode 100644 index b4d7bbc9d..000000000 --- a/p-designer/p-designer.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2006, Niels Martin Hansen -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// * Neither the name of the Aegisub Group nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - -#include "ass_drawing_control.h" - - -class PDesignerMain; - -class PDesignerApp : public wxApp { -public: - bool OnInit() - { - SetAppName(_T("P-Designer")); - (new PDesignerMain())->Show(); - return true; - } -}; -IMPLEMENT_APP(PDesignerApp) - - -class PDesignerMain : public wxFrame { -private: - AssDrawingControl drawing; - -public: - PDesignerMain() - : wxFrame(0, -1, _T("P-Designer"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE) - { - } -}; diff --git a/p-designer/p-designer.vcproj b/p-designer/p-designer.vcproj deleted file mode 100644 index 5d68d2de4..000000000 --- a/p-designer/p-designer.vcproj +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/p-designer/readme.txt b/p-designer/readme.txt deleted file mode 100644 index 231729075..000000000 --- a/p-designer/readme.txt +++ /dev/null @@ -1,30 +0,0 @@ -This is a drawing designer, or is intended to become one. -The name p-designer obviously comes from the tag, \p. - -Intended roadmap: - -1. Create datastructures to store drawing in -2. Write something to parse \p strings into those datastructures -3. Render some kind of basic outline of the figure in a way - (is easy in Win32 and probably also wx) -4. Generate \p strings from the datastructures -5. Add draggable handles to the preview display -6. Add something to add further segments to a drawing -7. ??? - -Other stuff / wishlist: -* It should be possible to somehow split a segment into two, eg. click - somewhere on a bezier and split it into two there. Same for lines etc. -* How about moves? ('m' command) - - Maybe render as a dotted or dashed line between points -* Zoom ability -* Feature to convert between scales (number after \p) -* Stretch? -* Integrate into Aegisub video preview -* Maybe import outlines of one or more characters from a font to modify? - (At least is possible with Win32 and Freetype2.) -* Convert segments between different types -* Binary operations with other shapes - -Things to check: -* What happens when a drawing doesn't start with an 'm' command?