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.
This commit is contained in:
Niels Martin Hansen 2006-12-28 20:56:28 +00:00
parent 36ea067861
commit 064f6b7b9b
25 changed files with 34 additions and 613 deletions

View File

@ -2,6 +2,7 @@
// All rights reserved but the aegisub project is allowed to use it. // All rights reserved but the aegisub project is allowed to use it.
#include <math.h> #include <math.h>
#include "StdAfx.h"
#include "FexGenericFilter_Include.h" #include "FexGenericFilter_Include.h"
FexFilter::FexFilter() FexFilter::FexFilter()

View File

@ -1,9 +1,7 @@
// This file is part of FexGenericFilter and (C) 2006 by Hajo Krabbenhöft (tentacle) // 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. // All rights reserved but the aegisub project is allowed to use it.
#include "stdio.h" #include "StdAfx.h"
#include "math.h"
#include "memory.h"
#include "FexGenericFilter_Include.h" #include "FexGenericFilter_Include.h"

View File

@ -4,6 +4,9 @@
// FexTracker.cpp : Defines the entry point for the DLL application. // FexTracker.cpp : Defines the entry point for the DLL application.
// //
#include "StdAfx.h"
#include "stdio.h"
#ifndef MIN #ifndef MIN
#define MIN(a,b) ((a)<(b))?(a):(b) #define MIN(a,b) ((a)<(b))?(a):(b)
#endif #endif
@ -12,9 +15,6 @@
#define MAX(a,b) ((a)>(b))?(a):(b) #define MAX(a,b) ((a)>(b))?(a):(b)
#endif #endif
#include "StdAfx.h"
#include "stdio.h"
FexTracker::FexTracker( int sx, int sy, int inFeatures ) FexTracker::FexTracker( int sx, int sy, int inFeatures )
{ {
printf( "[ using FexTracker (c)2006 Hajo Krabbenhoft ]\n" ); printf( "[ using FexTracker (c)2006 Hajo Krabbenhoft ]\n" );

View File

@ -20,6 +20,7 @@
#include <windows.h> #include <windows.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <memory.h>
#include <assert.h> #include <assert.h>
#include "FexTracker.h" #include "FexTracker.h"

View File

@ -168,7 +168,6 @@ void AudioDisplay::UpdateImage(bool weak) {
// Draw image to be displayed // Draw image to be displayed
wxMemoryDC dc; wxMemoryDC dc;
dc.SelectObject(*origImage); dc.SelectObject(*origImage);
dc.BeginDrawing();
// Black background // Black background
dc.SetPen(*wxTRANSPARENT_PEN); dc.SetPen(*wxTRANSPARENT_PEN);
@ -436,8 +435,6 @@ void AudioDisplay::UpdateImage(bool weak) {
} }
// Done // Done
dc.EndDrawing();
Refresh(false); Refresh(false);
} }
@ -1266,9 +1263,7 @@ void AudioDisplay::OnPaint(wxPaintEvent& event) {
if (w == 0 || h == 0) return; if (w == 0 || h == 0) return;
wxPaintDC dc(this); wxPaintDC dc(this);
dc.BeginDrawing();
dc.DrawBitmap(*origImage,0,0); dc.DrawBitmap(*origImage,0,0);
dc.EndDrawing();
} }
@ -1446,7 +1441,6 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
if (!player->IsPlaying()) { if (!player->IsPlaying()) {
// Draw bg // Draw bg
wxClientDC dc(this); wxClientDC dc(this);
dc.BeginDrawing();
dc.DrawBitmap(*origImage,0,0); dc.DrawBitmap(*origImage,0,0);
if (inside) { if (inside) {
@ -1486,9 +1480,6 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
dc.SetTextForeground(wxColour(255,255,255)); dc.SetTextForeground(wxColour(255,255,255));
dc.DrawText(text,dx,dy); dc.DrawText(text,dx,dy);
} }
// End drawing
dc.EndDrawing();
} }
// Scale dragging // Scale dragging
@ -1797,7 +1788,6 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) {
// Get DCs // Get DCs
//wxMutexGuiEnter(); //wxMutexGuiEnter();
wxClientDC dc(this); wxClientDC dc(this);
dc.BeginDrawing();
// Draw cursor // Draw cursor
int curpos = -1; int curpos = -1;
@ -1863,10 +1853,6 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) {
dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0); dc.Blit(oldCurPos,0,1,h,&src,oldCurPos,0);
} }
oldCurPos = curpos; oldCurPos = curpos;
// Done
dc.EndDrawing();
//wxMutexGuiLeave();
} }

View File

@ -298,7 +298,6 @@ void AudioKaraoke::OnPaint(wxPaintEvent &event) {
// Start Paint // Start Paint
wxPaintDC dc(this); wxPaintDC dc(this);
dc.BeginDrawing();
// Draw background // Draw background
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE))); dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
@ -386,8 +385,6 @@ void AudioKaraoke::OnPaint(wxPaintEvent &event) {
} }
} }
// End paint
dc.EndDrawing();
event.Skip(); event.Skip();
} }

View File

@ -293,9 +293,7 @@ void BaseGrid::OnPaint (wxPaintEvent &event) {
bool direct = false; bool direct = false;
if (direct) { if (direct) {
dc.BeginDrawing();
DrawImage(dc); DrawImage(dc);
dc.EndDrawing();
} }
else { else {
@ -325,8 +323,6 @@ void BaseGrid::OnPaint (wxPaintEvent &event) {
////////////// //////////////
// Draw image // Draw image
void BaseGrid::DrawImage(wxDC &dc) { void BaseGrid::DrawImage(wxDC &dc) {
dc.BeginDrawing();
// Get size and pos // Get size and pos
int w = 0; int w = 0;
int h = 0; int h = 0;
@ -536,9 +532,6 @@ void BaseGrid::DrawImage(wxDC &dc) {
dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.SetBrush(*wxTRANSPARENT_BRUSH);
dy = (editBox->linen+1-yPos) * lineHeight; dy = (editBox->linen+1-yPos) * lineHeight;
dc.DrawRectangle(0,dy,w,lineHeight+1); dc.DrawRectangle(0,dy,w,lineHeight+1);
// Done
dc.EndDrawing();
} }

View File

@ -85,7 +85,6 @@ void ColorPickerSpectrum::OnPaint(wxPaintEvent &evt)
if (!background) return; if (!background) return;
wxPaintDC dc(this); wxPaintDC dc(this);
dc.BeginDrawing();
wxMemoryDC memdc; wxMemoryDC memdc;
memdc.SelectObject(*background); memdc.SelectObject(*background);
@ -113,8 +112,6 @@ void ColorPickerSpectrum::OnPaint(wxPaintEvent &evt)
dc.DrawLine(0, y, GetClientSize().x, y); dc.DrawLine(0, y, GetClientSize().x, y);
break; break;
} }
dc.EndDrawing();
} }
void ColorPickerSpectrum::OnMouse(wxMouseEvent &evt) void ColorPickerSpectrum::OnMouse(wxMouseEvent &evt)
@ -231,7 +228,6 @@ void ColorPickerRecent::OnPaint(wxPaintEvent &evt)
int i = 0; int i = 0;
dc.SetPen(*wxTRANSPARENT_PEN); dc.SetPen(*wxTRANSPARENT_PEN);
dc.BeginDrawing();
for (int cy = 0; cy < rows; cy++) { for (int cy = 0; cy < rows; cy++) {
for (int cx = 0; cx < cols; cx++) { for (int cx = 0; cx < cols; cx++) {
@ -245,8 +241,6 @@ void ColorPickerRecent::OnPaint(wxPaintEvent &evt)
i++; i++;
} }
} }
dc.EndDrawing();
} }
void ColorPickerRecent::OnSize(wxSizeEvent &evt) void ColorPickerRecent::OnSize(wxSizeEvent &evt)

View File

@ -68,9 +68,7 @@ SplashScreen::SplashScreen(wxWindow *parent)
// Prepare // Prepare
wxClientDC dc(this); wxClientDC dc(this);
dc.BeginDrawing();
dc.DrawBitmap(splash,0,0); dc.DrawBitmap(splash,0,0);
dc.EndDrawing();
autoClose = new wxTimer(this,5000); autoClose = new wxTimer(this,5000);
autoClose->Start(5000,true); autoClose->Start(5000,true);
@ -98,9 +96,7 @@ END_EVENT_TABLE()
// OnPaint // OnPaint
void SplashScreen::OnPaint(wxPaintEvent& event) { void SplashScreen::OnPaint(wxPaintEvent& event) {
wxPaintDC dc(this); wxPaintDC dc(this);
dc.BeginDrawing();
dc.DrawBitmap(splash,0,0); dc.DrawBitmap(splash,0,0);
dc.EndDrawing();
} }

View File

@ -58,7 +58,7 @@
#include "version.h" #include "version.h"
#include "dialog_splash.h" #include "dialog_splash.h"
#include "dialog_tip.h" #include "dialog_tip.h"
#include "automation_filter.h" //#include "automation_filter.h"
#include "audio_box.h" #include "audio_box.h"
#include "video_box.h" #include "video_box.h"
#include "drop.h" #include "drop.h"
@ -584,10 +584,10 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) {
wxMessageBox(wxString(err), _T("Error"), wxOK | wxICON_ERROR, NULL); wxMessageBox(wxString(err), _T("Error"), wxOK | wxICON_ERROR, NULL);
return; return;
} }
catch (AutomationError &err) { // catch (AutomationError &err) {
wxMessageBox(wxString(_T("Automation exception: ")) + err.message, _T("Error"), wxOK | wxICON_ERROR, NULL); // wxMessageBox(wxString(_T("Automation exception: ")) + err.message, _T("Error"), wxOK | wxICON_ERROR, NULL);
return; // return;
} // }
catch (...) { catch (...) {
wxMessageBox(_T("Unknown error"), _T("Error"), wxOK | wxICON_ERROR, NULL); wxMessageBox(_T("Unknown error"), _T("Error"), wxOK | wxICON_ERROR, NULL);
return; return;
@ -796,15 +796,15 @@ void FrameMain::SynchronizeProject(bool fromSubs) {
long videoAr = 0; long videoAr = 0;
double videoArValue = 0.0; double videoArValue = 0.0;
long videoZoom = 0; long videoZoom = 0;
{ // {
std::list<AssAutomationFilter*>::const_iterator next = AssAutomationFilter::GetFilterList().begin(), f; // std::list<AssAutomationFilter*>::const_iterator next = AssAutomationFilter::GetFilterList().begin(), f;
while (next != AssAutomationFilter::GetFilterList().end()) { // while (next != AssAutomationFilter::GetFilterList().end()) {
f = next++; // f = next++;
AutomationScript *s = (*f)->GetScript(); // AutomationScript *s = (*f)->GetScript();
delete (*f); // delete (*f);
delete s; // delete s;
} // }
} // }
// Get AR // Get AR
wxString arString = subs->GetScriptInfo(_T("Video Aspect Ratio")); wxString arString = subs->GetScriptInfo(_T("Video Aspect Ratio"));
@ -825,7 +825,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) {
wxString AutoScriptString = subs->GetScriptInfo(_T("Automation Scripts")); wxString AutoScriptString = subs->GetScriptInfo(_T("Automation Scripts"));
// Automation script // Automation script
if (AutoScriptString != _T("")) { /* if (AutoScriptString != _T("")) {
wxStringTokenizer toker(AutoScriptString, _T("|"), wxTOKEN_STRTOK); wxStringTokenizer toker(AutoScriptString, _T("|"), wxTOKEN_STRTOK);
wxFileName AssFileName(subs->filename); wxFileName AssFileName(subs->filename);
while (toker.HasMoreTokens()) { while (toker.HasMoreTokens()) {
@ -852,7 +852,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) {
continue; continue;
} }
} }
} }*/
// Check if there is anything to change // Check if there is anything to change
int autoLoadMode = Options.AsInt(_T("Autoload linked files")); 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)); subs->SetScriptInfo(_T("Keyframes File"),MakeRelativePath(videoBox->videoDisplay->GetKeyFramesName(),AssFile::top->filename));
// Create list of Automation scripts // Create list of Automation scripts
wxString scripts; /* wxString scripts;
std::list<AssAutomationFilter*>::const_iterator f = AssAutomationFilter::GetFilterList().begin(); std::list<AssAutomationFilter*>::const_iterator f = AssAutomationFilter::GetFilterList().begin();
wxFileName AssFileName(subs->filename); wxFileName AssFileName(subs->filename);
for (;f != AssAutomationFilter::GetFilterList().end(); ++f) { for (;f != AssAutomationFilter::GetFilterList().end(); ++f) {
@ -941,7 +941,7 @@ void FrameMain::SynchronizeProject(bool fromSubs) {
if (!scripts.empty()) { if (!scripts.empty()) {
scripts.RemoveLast(); scripts.RemoveLast();
subs->SetScriptInfo(_T("Automation Scripts"), scripts); subs->SetScriptInfo(_T("Automation Scripts"), scripts);
} }*/
} }
} }

View File

@ -49,6 +49,7 @@
#include "video_zoom.h" #include "video_zoom.h"
#include "video_box.h" #include "video_box.h"
#include "ass_file.h" #include "ass_file.h"
#include "ass_dialogue.h"
#include "dialog_style_manager.h" #include "dialog_style_manager.h"
#include "dialog_translation.h" #include "dialog_translation.h"
#include "dialog_jumpto.h" #include "dialog_jumpto.h"
@ -62,7 +63,7 @@
#include "main.h" #include "main.h"
#include "dialog_fonts_collector.h" #include "dialog_fonts_collector.h"
#include "dialog_about.h" #include "dialog_about.h"
#include "automation_gui.h" //#include "automation_gui.h"
#include "dialog_export.h" #include "dialog_export.h"
#include "audio_box.h" #include "audio_box.h"
#include "dialog_selection.h" #include "dialog_selection.h"
@ -916,9 +917,9 @@ void FrameMain::OnOpenOptions (wxCommandEvent &event) {
// Open Automation // Open Automation
void FrameMain::OnOpenAutomation (wxCommandEvent &event) { void FrameMain::OnOpenAutomation (wxCommandEvent &event) {
videoBox->videoDisplay->Stop(); videoBox->videoDisplay->Stop();
DialogAutomationManager *automan = new DialogAutomationManager(this, SubsBox); // DialogAutomationManager *automan = new DialogAutomationManager(this, SubsBox);
automan->ShowModal(); // automan->ShowModal();
delete automan; // delete automan;
} }

View File

@ -142,20 +142,11 @@
/////// ///////
// Lua // Lua
#ifdef __WXDEBUG__ //#ifdef __WXDEBUG__
#pragma comment(lib,"lua503d.lib") //#pragma comment(lib,"lua503d.lib")
#else //#else
#pragma comment(lib,"lua503.lib") //#pragma comment(lib,"lua503.lib")
#endif //#endif
//////////////
// FreeType 2
#ifdef __WXDEBUG__
#pragma comment(lib,"freetype2110MT_D.lib")
#else
#pragma comment(lib,"freetype2110MT.lib")
#endif
//////////// ////////////

View File

@ -60,7 +60,5 @@ END_EVENT_TABLE()
// OnPaint // OnPaint
void BitmapControl::OnPaint(wxPaintEvent& event) { void BitmapControl::OnPaint(wxPaintEvent& event) {
wxPaintDC dc(this); wxPaintDC dc(this);
dc.BeginDrawing();
dc.DrawBitmap(bmp,0,0); dc.DrawBitmap(bmp,0,0);
dc.EndDrawing();
} }

View File

@ -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 <ctype.h>
// 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<AssDrawingPoint> &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);
}

View File

@ -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 <vector>
#include <pair>
#include <wx/string.h>
enum AssDrawingSegmentType {
SEGMENT_MOVE, // m <x> <y>
SEGMENT_MOVE_NOCLOSE, // n <x> <y>
SEGMENT_LINE, // l <x> <y>
SEGMENT_BEZIER, // b <x1> <y1> <x2> <y2> <x3> <y3>
SEGMENT_BSPLINE, // s <x1> <y2> <x2> <y2> <x3> <y3> [... <xN> <yN>]
SEGMENT_BSPLINE_EXTEND, // p <x> <y>
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<AssDrawingPoint> points;
};
struct AssDrawing {
int scale;
std::vector<AssDrawingSegment> 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

View File

@ -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 <wx/window.h>
class AssDrawingControl : public wxWindow {
};

View File

@ -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 <wx/app.h>
#include <wx/frame.h>
#include <wx/button.h>
#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)
{
}
};

View File

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="shift_jis"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="p-designer"
ProjectGUID="{4FB7425E-8EDF-4107-87BE-3BB05A3B78B5}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;UNICODE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/p-designer-debug.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/p-designer.pdb"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="1">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
RuntimeLibrary="4"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="../bin/p-designer.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\ass_drawing.cpp">
</File>
<File
RelativePath=".\p-designer.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\ass_drawing.h">
</File>
<File
RelativePath=".\ass_drawing_control.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<File
RelativePath=".\readme.txt">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -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?