jfs's mac patches applied

Originally committed to SVN as r1560.
This commit is contained in:
Rodrigo Braz Monteiro 2007-09-11 23:22:26 +00:00
parent 7463ee0d7a
commit 489abd6663
131 changed files with 408 additions and 94 deletions

View File

@ -40,6 +40,7 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
//////////////

View File

@ -40,6 +40,8 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
#include <wx/window.h>
#include <list>

View File

@ -40,6 +40,9 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/arrstr.h>
#include <list>
#include <map>

View File

@ -39,6 +39,8 @@
#include <list>
#include <fstream>
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include "ass_file.h"
#include "ass_dialogue.h"
#include "ass_style.h"
@ -1030,3 +1032,4 @@ bool AssFile::Popping;
bool AssFile::StackModified;

View File

@ -39,6 +39,7 @@
#include "ass_dialogue.h"
#include "ass_override.h"
#include <wx/tokenzr.h>
#include <wx/log.h>
////////////////////// AssOverrideParameter //////////////////////

View File

@ -36,6 +36,7 @@
////////////
// Includes
#include <wx/tokenzr.h>
#include <wx/intl.h>
#include "ass_style.h"
#include "utils.h"
#include <ctype.h>

View File

@ -38,6 +38,7 @@
///////////
// Headers
#include <wx/colour.h>
#include "ass_entry.h"

View File

@ -41,6 +41,7 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/arrstr.h>
#include <list>

View File

@ -40,6 +40,7 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
/////////////////////////////

View File

@ -50,9 +50,9 @@
#include "hotkeys.h"
#include "tooltip_manager.h"
#ifdef __WXMAC__
#include "bevelButton.h"
#endif
//#ifdef __WXMAC__
//#include "bevelButton.h"
//#endif
///////////////
// Constructor
@ -200,12 +200,12 @@ wxPanel(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL|wxBORDER_RAISE
KaraokeButton = new wxToggleButton(this,Audio_Button_Karaoke,_("Karaoke"),wxDefaultPosition,wxSize(-1,-1));
KaraokeButton->SetToolTip(_("Toggle karaoke mode"));
karaokeSizer->Add(KaraokeButton,0,wxRIGHT|wxEXPAND,0);
#ifndef __WXMAC__
//#ifndef __WXMAC__
JoinButton = new wxButton(this,Audio_Button_Join,_T(""),wxDefaultPosition,wxSize(-1,10));
#else
//#else
// we use this custom class to match the button style of toggle buttons in wxMac
JoinButton = new wxBevelButton(this,Audio_Button_Join,_T(""),wxDefaultPosition,wxSize(-1,-1));
#endif
// JoinButton = new wxBevelButton(this,Audio_Button_Join,_T(""),wxDefaultPosition,wxSize(-1,-1));
//#endif
karaokeSizer->Add(JoinButton,0,wxRIGHT|wxEXPAND,0);
SplitButton = new wxButton(this,Audio_Button_Split,_T(""),wxDefaultPosition,wxSize(-1,-1));
karaokeSizer->Add(SplitButton,0,wxRIGHT|wxEXPAND,5);
@ -669,3 +669,4 @@ void FocusEvent::OnSetFocus(wxFocusEvent &event) {
if (previous) previous->SetFocus();
}

View File

@ -41,7 +41,16 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
#include <wx/panel.h>
#include <wx/menu.h>
#include <wx/scrolbar.h>
#include <wx/button.h>
#include <wx/bmpbuttn.h>
#include <wx/sashwin.h>
#include <wx/slider.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
//////////////

View File

@ -41,6 +41,8 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/window.h>
#include <wx/bitmap.h>
#include <stdint.h>
#include "audio_provider.h"
#include "audio_player.h"

View File

@ -36,12 +36,16 @@
///////////
// Headers
#include <wx/tokenzr.h>
#include "audio_karaoke.h"
#include "audio_display.h"
#include "audio_box.h"
#include "ass_dialogue.h"
#include "ass_override.h"
#include <wx/tokenzr.h>
#include <wx/menu.h>
#include <wx/log.h>
#include <wx/dcclient.h>
#include <wx/settings.h>
#include <algorithm>
@ -859,3 +863,4 @@ void AudioKaraokeTagMenu::OnSelectItem(wxCommandEvent &event) {
kara->SetSelection(firstsel, lastsel);
}

View File

@ -41,6 +41,9 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/window.h>
#include <wx/log.h>
#include <wx/menu.h>
#include <vector>
#include "ass_karaoke.h"

View File

@ -40,6 +40,9 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/event.h>
#include <wx/timer.h>
#include <wx/thread.h>
#include <stdint.h>
#include "factory.h"
@ -47,8 +50,6 @@
//////////////
// Prototypes
class AudioProvider;
class wxTimer;
class wxMutex;
///////////////////////////
@ -110,3 +111,4 @@ public:
// Event
DECLARE_EVENT_TYPE(wxEVT_STOP_AUDIO, -1)

View File

@ -44,8 +44,13 @@
#include "frame_main.h"
#include "audio_player.h"
#include "options.h"
#ifdef __APPLE__
#include <OpenAL/AL.h>
#include <OpenAL/ALC.h>
#else
#include <al.h>
#include <alc.h>
#endif
// Auto-link to OpenAL lib for MSVC
@ -391,3 +396,4 @@ int64_t OpenALPlayer::GetCurrentPosition()
}

View File

@ -37,6 +37,7 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/thread.h>
#include "audio_provider_ram.h"
#include "audio_provider_hd.h"
#include "audio_provider_pcm.h"

View File

@ -41,6 +41,7 @@
// Headers
#include "audio_provider.h"
#include <wx/file.h>
#include <wx/thread.h>
#include <vector>
@ -71,3 +72,4 @@ public:
// Construct the right PCM audio provider (if any) for the file
AudioProvider *CreatePCMAudioProvider(const wxString &filename);

View File

@ -44,6 +44,7 @@
#include "colorspace.h"
#include "options.h"
#include "utils.h"
#include <wx/log.h>
// Audio spectrum FFT data cache
@ -60,7 +61,7 @@ public:
CacheAccessTime access_time;
unsigned long first_line;
unsigned long num_lines; // includes overlap-lines
bool operator< (const CacheAgeData& second) { return access_time < second.access_time; }
bool operator< (const CacheAgeData& second) const { return access_time < second.access_time; }
CacheAgeData(CacheAccessTime t, unsigned long first, unsigned long num) : access_time(t), first_line(first), num_lines(num) { }
};
typedef std::vector<CacheAgeData> CacheAgeList;
@ -550,3 +551,4 @@ void AudioSpectrum::SetScaling(float _power_scale)
power_scale = _power_scale;
}

View File

@ -49,6 +49,10 @@
#include <wx/sizer.h>
#include <wx/filefn.h>
#include <wx/tokenzr.h>
#include <wx/dcmemory.h>
#include <wx/msgdlg.h>
#include <wx/log.h>
#ifdef WIN32
#include <windows.h>

View File

@ -39,6 +39,12 @@
#define _AUTO4_BASE_H
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/gauge.h>
#include <wx/timer.h>
#include <wx/stattext.h>
#include <wx/dialog.h>
#include <wx/textctrl.h>
#include <vector>
#include "ass_export_filter.h"

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
RESFILE="$1"
SRCDIR="$2"
@ -22,7 +22,7 @@ XPMNAMES=""
for I in *.bmp
do
DNAME="`grep "bitmaps/$I" $RESFILE | cut -d ' ' -f 1`"
/bin/echo -e "${DNAME}_xpm.xpm: \$(srcdir)/$I
echo -e "${DNAME}_xpm.xpm: \$(srcdir)/$I
\t\$(CONVERT) -transparent \\#c0c0c0 \$(srcdir)/$I ${DNAME}_xpm.xpm
"
XPMNAMES="${XPMNAMES} ${DNAME}_xpm.xpm"
@ -30,3 +30,4 @@ done
echo "bmp2xpm: $XPMNAMES"

View File

@ -68,9 +68,15 @@ void BrowseButton::Bind(wxTextCtrl *control,int pos) {
void BrowseButton::OnPressed(wxCommandEvent &event) {
// Folder
if (type == BROWSE_FOLDER) {
// For some reason I can't make this work on Mac... -jfs
#ifndef __WXMAC__
wxString def = DecodeRelativePath(ctrl[0]->GetValue(),StandardPaths::DecodePath(_T("?user/")));
wxString dir = MakeRelativePath(wxDirSelector(_("Please choose the folder:"),def),StandardPaths::DecodePath(_T("?user/")));
if (dir != _T("")) ctrl[0]->SetValue(dir);
wxDirDialog dlg(0, _("Please choose the folder:"), def);
if (dlg.ShowModal() == wxID_OK) {
wxString dir = MakeRelativePath(dlg.GetPath(),StandardPaths::DecodePath(_T("?user/")));
if (dir != _T("")) ctrl[0]->SetValue(dir);
}
#endif
}
// File
@ -92,3 +98,4 @@ void BrowseButton::OnPressed(wxCommandEvent &event) {
}
}

View File

@ -40,6 +40,8 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/button.h>
#include <wx/textctrl.h>
///////////////

View File

@ -36,6 +36,7 @@
////////////
// Includes
#include <wx/dcmemory.h>
#include "colour_button.h"
#include "dialog_colorpicker.h"

View File

@ -37,6 +37,9 @@
////////////
// Includes
#include <wx/statline.h>
#include <wx/stattext.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include "dialog_about.h"
#include "version.h"
#include "options.h"
@ -60,7 +63,7 @@ AboutScreen::AboutScreen(wxWindow *parent)
wxString libString = _("This build of Aegisub uses the following C/C++ libraries:\n");
libString += _T("wxWidgets - Copyright (c) 1998-2006 Julian Smart, Robert Roebling et al;\n");
libString += _T("wxStyledTextCtrl - Copyright (c) 2004 wxCode;\n");
libString += _T("Lua - Copyright (c) 1994-2006 Lua.org, PUC-Rio;\n");
libString += _T("Lua - Copyright (c) 1994-2007 Lua.org, PUC-Rio;\n");
libString += _T("Hunspell - Copyright (c) Kevin Hendricks;\n");
libString += _T("PortAudio - Copyright (c) 1999-2000 Ross Bencina, Phil Burk;\n");
libString += _T("FFmpeg - Copyright (c) 2001 Fabrice Bellard,;\n");
@ -101,7 +104,7 @@ AboutScreen::AboutScreen(wxWindow *parent)
wxPanel *buttonPanel = new wxPanel(this,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL);
wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL);
ButtonSizer->AddStretchSpacer(1);
#ifndef __WXMAC__
#ifndef __APPLE__
ButtonSizer->Add(new wxButton(buttonPanel,wxID_OK),0,wxALIGN_RIGHT | wxALL,7);
#else
wxButton *okButton = new wxButton(buttonPanel,wxID_OK);

View File

@ -40,6 +40,7 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include "static_bmp.h"

View File

@ -36,8 +36,10 @@
///////////
// Headers
#include "dialog_associations.h"
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/config.h>
#include "dialog_associations.h"
///////////////

View File

@ -40,6 +40,9 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/checklst.h>
#include <wx/slider.h>
//////////////////////////////////

View File

@ -40,6 +40,8 @@
#include <wx/dirdlg.h>
#include <wx/filedlg.h>
#include <wx/filename.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include "dialog_attachments.h"
#include "ass_file.h"
#include "ass_attachment.h"

View File

@ -40,6 +40,8 @@
#include "utils.h"
#include <wx/filename.h>
#include <wx/filedlg.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
DialogAutomation::DialogAutomation(wxWindow *parent, Automation4::ScriptManager *_local_manager)

View File

@ -40,6 +40,10 @@
#include <wx/gbsizer.h>
#include <wx/event.h>
#include <wx/tokenzr.h>
#include <wx/dcclient.h>
#include <wx/dcmemory.h>
#include <wx/dcscreen.h>
#include <wx/settings.h>
#include "dialog_colorpicker.h"
#include "colorspace.h"
#include "ass_style.h"
@ -1181,4 +1185,4 @@ void DialogColorPicker::OnDropperMouse(wxMouseEvent &evt)
// Static values for last position of the dialog in this Aegisub session
int DialogColorPicker::lastx = -1;
int DialogColorPicker::lasty = -1;
int DialogColorPicker::lasty = -1;

View File

@ -56,7 +56,7 @@ DialogDetachedVideo::DialogDetachedVideo(FrameMain *par)
// Set title
wxFileName fn(VideoContext::Get()->videoName);
SetTitle(wxString::Format(_("Video: %s"),fn.GetFullName()));
SetTitle(wxString::Format(_("Video: %s"),fn.GetFullName().c_str()));
// Set a background panel
wxPanel *panel = new wxPanel(this,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL | wxCLIP_CHILDREN);

View File

@ -37,6 +37,9 @@
#pragma once
#include <wx/dialog.h>
//////////////
// Prototypes
class VideoBox;

View File

@ -37,6 +37,7 @@
#include "dialog_dummy_video.h"
#include <wx/datetime.h>
#include <wx/sizer.h>
#include <wx/log.h>
#include "options.h"

View File

@ -41,6 +41,7 @@
#include <wx/stattext.h>
#include <wx/spinctrl.h>
#include <wx/combobox.h>
#include <wx/checkbox.h>
#include "video_provider_dummy.h"
#include "colour_button.h"

View File

@ -37,6 +37,10 @@
///////////
// Headers
#include <wx/tokenzr.h>
#include <wx/button.h>
#include <wx/stattext.h>
#include <wx/filedlg.h>
#include <wx/msgdlg.h>
#include "dialog_export.h"
#include "ass_file.h"
#include "ass_exporter.h"

View File

@ -40,6 +40,13 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/sizer.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include <wx/checklst.h>
#include <wx/choice.h>
#include <wx/panel.h>
#include <map>

View File

@ -36,6 +36,11 @@
///////////
// Headers
#include <wx/dialog.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include "dialog_jumpto.h"
#include "vfr.h"
#include "video_context.h"

View File

@ -44,6 +44,8 @@
#include <wx/listctrl.h>
#include <wx/regex.h>
#include <wx/checkbox.h>
#include <wx/dialog.h>
#include <wx/combobox.h>
#include <vector>
#include "options.h"
#include "kana_table.h"

View File

@ -40,6 +40,7 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/listctrl.h>
#include <vector>
#include <map>

View File

@ -37,6 +37,9 @@
///////////
// Headers
#include <wx/config.h>
#include <wx/stattext.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include "dialog_paste_over.h"
#include "options.h"

View File

@ -40,6 +40,8 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/checklst.h>
//////////////////////////////////

View File

@ -36,6 +36,8 @@
///////////
// Headers
#include <wx/button.h>
#include <wx/sizer.h>
#include "dialog_progress.h"

View File

@ -41,6 +41,9 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/gauge.h>
#include <wx/stattext.h>
/////////////////////////

View File

@ -36,6 +36,10 @@
///////////
// Headers
#include <wx/dialog.h>
#include <wx/stattext.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include "dialog_properties.h"
#include "options.h"
#include "ass_file.h"

View File

@ -40,6 +40,9 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/textctrl.h>
#include <wx/combobox.h>
#include <wx/checkbox.h>
////////////////////

View File

@ -41,6 +41,10 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
//////////////

View File

@ -37,6 +37,7 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
#include <wx/regex.h>
#include "dialog_search_replace.h"
#include "ass_file.h"

View File

@ -40,6 +40,12 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/string.h>
#include <wx/combobox.h>
#include <wx/checkbox.h>
#include <wx/textctrl.h>
#include <wx/radiobox.h>
//////////////

View File

@ -37,6 +37,7 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
#include <wx/regex.h>
#include "dialog_selection.h"
#include "subs_grid.h"

View File

@ -41,6 +41,11 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/radiobut.h>
#include <wx/radiobox.h>
//////////////

View File

@ -40,6 +40,10 @@
///////////
// Headers
#include <wx/dialog.h>
#include <wx/radiobut.h>
#include <wx/radiobox.h>
#include <wx/listbox.h>
#include "timeedit_ctrl.h"

View File

@ -38,6 +38,10 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/textctrl.h>
#include <wx/listbox.h>
#include <wx/combobox.h>
#include <map>

View File

@ -38,6 +38,7 @@
// Includes
#include <wx/wxprec.h>
#include <wx/display.h>
#include <wx/dcclient.h>
#include "dialog_splash.h"
#include "options.h"
#include "dialog_tip.h"

View File

@ -41,6 +41,8 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/frame.h>
#include <wx/timer.h>
///////////////////////

View File

@ -42,6 +42,9 @@
// Includes
#include <wx/wxprec.h>
#include <wx/spinctrl.h>
#include <wx/combobox.h>
#include <wx/checkbox.h>
#include <wx/radiobox.h>
#include "colour_button.h"

View File

@ -39,6 +39,9 @@
#include <wx/filename.h>
#include <wx/filedlg.h>
#include <wx/choicdlg.h>
#include <wx/intl.h>
#include <wx/clipbrd.h>
#include <wx/tokenzr.h>
#include "dialog_style_manager.h"
#include "dialog_style_editor.h"
#include "ass_style.h"
@ -457,9 +460,7 @@ void DialogStyleManager::OnCatalogDelete (wxCommandEvent &event) {
int sel = CatalogList->GetSelection();
if (sel != wxNOT_FOUND) {
wxString name = CatalogList->GetString(sel);
wxString message = _("Are you sure you want to delete the storage \"");
message += name;
message += _("\" from the catalog?");
wxString message = wxString::Format(_("Are you sure you want to delete the storage \"%s\" from the catalog?"), name.c_str());
int option = wxMessageBox(message, _("Confirm delete"), wxYES_NO | wxICON_EXCLAMATION , this);
if (option == wxYES) {
wxRemoveFile(StandardPaths::DecodePath(_T("?user/catalog/") + name + _T(".sty")));
@ -1197,3 +1198,4 @@ void DialogStyleManagerEvent::OnKeyDown(wxKeyEvent &event) {
}

View File

@ -41,6 +41,10 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/combobox.h>
#include <wx/listbox.h>
#include <wx/button.h>
#include <vector>
#include "ass_style_storage.h"

View File

@ -41,6 +41,11 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/colour.h>
#include <wx/textctrl.h>
#include <wx/listbox.h>
#include <wx/checkbox.h>
//////////////

View File

@ -37,6 +37,8 @@
///////////
// Headers
#include "dialog_text_import.h"
#include <wx/sizer.h>
#include <wx/stattext.h>
#include "options.h"
@ -48,7 +50,6 @@ DialogTextImport::DialogTextImport()
// Main controls
wxFlexGridSizer *fg = new wxFlexGridSizer(2, 5, 5);
wxBoxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
wxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL);
edit_separator = new wxTextCtrl(this, EDIT_ACTOR_SEPARATOR, Options.AsText(_T("text actor separator")));
edit_comment = new wxTextCtrl(this, EDIT_COMMENT_STARTER, Options.AsText(_T("text comment starter")));

View File

@ -39,6 +39,7 @@
///////////
// Headers
#include <wx/dialog.h>
#include <wx/textctrl.h>
class DialogTextImport : public wxDialog {

View File

@ -40,6 +40,13 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/sizer.h>
#include <wx/checkbox.h>
#include <wx/textctrl.h>
#include <wx/slider.h>
#include <wx/checklst.h>
#include <wx/button.h>
#include <vector>

View File

@ -37,6 +37,8 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/window.h>
#include <wx/msgdlg.h>
#include "dialog_tip.h"
#include "options.h"

View File

@ -40,6 +40,7 @@
#include <wx/fs_inet.h>
#include <wx/txtstrm.h>
#include <wx/tokenzr.h>
#include <wx/button.h>
#include <wx/event.h>
#include "dialog_version_check.h"
#include "version.h"

View File

@ -40,6 +40,9 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/dialog.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
//////////////

View File

@ -62,8 +62,8 @@ DialogVideoDetails::DialogVideoDetails(wxWindow *parent)
wxTextCtrl *fname_text = new wxTextCtrl(this, -1, VideoContext::Get()->videoName, wxDefaultPosition, wxSize(300,-1), wxTE_READONLY);
wxTextCtrl *fps_text = new wxTextCtrl(this, -1, wxString::Format(_T("%.3f"), fps), wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxTextCtrl *resolution_text = new wxTextCtrl(this, -1, wxString::Format(_T("%dx%d (%s)"), width, height, PrettyAR(width, height)), wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxTextCtrl *length_text = new wxTextCtrl(this, -1, wxString::Format(_T("%d frames (%s)"), framecount, PrettyTimeStamp(framecount, fps)), wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxTextCtrl *resolution_text = new wxTextCtrl(this, -1, wxString::Format(_T("%dx%d (%s)"), width, height, PrettyAR(width, height).c_str()), wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxTextCtrl *length_text = new wxTextCtrl(this, -1, wxString::Format(_T("%d frames (%s)"), framecount, PrettyTimeStamp(framecount, fps).c_str()), wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxTextCtrl *decoder_text = new wxTextCtrl(this, -1, vprovider->GetDecoderName(), wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
fg->Add(new wxStaticText(this, -1, _("File name:")), 0, wxALIGN_CENTRE_VERTICAL | wxEXPAND);

View File

@ -39,6 +39,12 @@
///////////
// Headers
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/radiobut.h>
#include <wx/button.h>
#include <wx/panel.h>
#include <wx/stattext.h>
#include "ass_export_filter.h"
#include "vfr.h"

View File

@ -37,6 +37,7 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/sizer.h>
#include "float_spin.h"
#include "utils.h"
#include "validators.h"

View File

@ -40,6 +40,9 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/textctrl.h>
#include <wx/panel.h>
#include <wx/spinbutt.h>
//////////////

View File

@ -41,7 +41,7 @@
#include "text_file_writer.h"
#include "text_file_reader.h"
#include "standard_paths.h"
#ifdef WIN32
#if defined(WIN32) || defined(__APPLE__)
#include "font_file_lister_freetype.h"
#define FontListerClass FreetypeFontFileLister
#else

View File

@ -40,12 +40,14 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/string.h>
#include <wx/arrstr.h>
#include <map>
////////////
// Typedefs
#ifdef WIN32
#if defined(WIN32) || defined(__APPLE__)
typedef struct FT_LibraryRec_ *FT_Library;
#endif
typedef std::map<wxString,wxArrayString> FontMap;

View File

@ -41,7 +41,9 @@
#include FT_FREETYPE_H
#include FT_GLYPH_H
#include FT_SFNT_NAMES_H
#include <shlobj.h>
#ifdef WIN32
# include <shlobj.h>
#endif
#include <wx/dir.h>
@ -67,12 +69,20 @@ void FreetypeFontFileLister::DoInitialize() {
// Get fonts folder
wxString source;
#ifdef WIN32
TCHAR szPath[MAX_PATH];
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_FONTS,NULL,0,szPath))) {
source = wxString(szPath);
}
else source = wxGetOSDirectory() + _T("\\fonts");
source += _T("\\");
#else
# ifdef __APPLE__
// XXXHACK: Is this always a correct assumption?
// Fonts might be instaled in more places, I think...
source = _T("/Library/Fonts/");
# endif
#endif
// Get the list of fonts in the fonts folder
wxArrayString fontfiles;

View File

@ -42,6 +42,7 @@
#include <wx/filename.h>
#include <wx/tokenzr.h>
#include <wx/image.h>
#include <wx/statline.h>
#include "subs_grid.h"
#include "frame_main.h"
#include "avisynth_wrap.h"
@ -81,7 +82,7 @@ FrameMain::FrameMain (wxArrayString args)
#ifdef __WXGTK__
/* XXX HACK XXX
* Gtk just got initialized. And if we're using the SCIM IME,
* it just did a setlocale(LC_ALL, ""). so, BOOM. "§!$)(!"§$.
* it just did a setlocale(LC_ALL, ""). so, BOOM.
*/
setlocale(LC_ALL, "");
setlocale(LC_CTYPE, "C");
@ -280,7 +281,9 @@ void FrameMain::InitMenu() {
AppendBitmapMenuItem(fileMenu,Menu_File_Save_Subtitles_As, _("Save Subtitles as..."), _("Saves subtitles with another name"), wxBITMAP(save_as_toolbutton));
AppendBitmapMenuItem(fileMenu,Menu_File_Export_Subtitles, _("Export Subtitles..."), _("Saves a copy of subtitles with processing applied to it."), wxBITMAP(blank_button));
wxMenuItem *RecentParent = new wxMenuItem(fileMenu, Menu_File_Recent_Subs_Parent, _("Recent"), _T(""), wxITEM_NORMAL, RecentSubs);
#ifndef __APPLE__
RecentParent->SetBitmap(wxBITMAP(blank_button));
#endif
fileMenu->Append(RecentParent);
fileMenu->AppendSeparator();
AppendBitmapMenuItem (fileMenu,Menu_Tools_Properties, _("&Properties..."), _("Open script properties window"),wxBITMAP(properties_toolbutton));
@ -310,7 +313,9 @@ void FrameMain::InitMenu() {
subtitlesMenu = new wxMenu();
wxMenu *InsertMenu = new wxMenu;
wxMenuItem *InsertParent = new wxMenuItem(subtitlesMenu,Menu_Subtitles_Insert,_("&Insert Lines"),_T(""),wxITEM_NORMAL,InsertMenu);
#ifndef __APPLE__
InsertParent->SetBitmap(wxBITMAP(blank_button));
#endif
AppendBitmapMenuItem(InsertMenu,MENU_INSERT_BEFORE,_("&Before Current"),_("Inserts a line before current"),wxBITMAP(blank_button));
AppendBitmapMenuItem(InsertMenu,MENU_INSERT_AFTER,_("&After Current"),_("Inserts a line after current"),wxBITMAP(blank_button));
AppendBitmapMenuItem(InsertMenu,MENU_INSERT_BEFORE_VIDEO,_("Before Current, at Video Time"),_("Inserts a line before current, starting at video time"),wxBITMAP(blank_button));
@ -322,7 +327,9 @@ void FrameMain::InitMenu() {
subtitlesMenu->AppendSeparator();
wxMenu *JoinMenu = new wxMenu;
wxMenuItem *JoinParent = new wxMenuItem(subtitlesMenu,Menu_Subtitles_Join,_("Join Lines"),_T(""),wxITEM_NORMAL,JoinMenu);
#ifndef __APPLE__
JoinParent->SetBitmap(wxBITMAP(blank_button));
#endif
AppendBitmapMenuItem(JoinMenu,MENU_JOIN_CONCAT,_("&Concatenate"),_("Joins selected lines in a single one, concatenating text together"),wxBITMAP(blank_button));
AppendBitmapMenuItem(JoinMenu,MENU_JOIN_REPLACE,_("Keep &First"),_("Joins selected lines in a single one, keeping text of first and discarding remaining"),wxBITMAP(blank_button));
AppendBitmapMenuItem(JoinMenu,MENU_JOIN_AS_KARAOKE,_("As &Karaoke"),_("Joins selected lines in a single one, as karaoke"),wxBITMAP(blank_button));
@ -355,7 +362,9 @@ void FrameMain::InitMenu() {
timingMenu->AppendSeparator();
wxMenu *ContinuousMenu = new wxMenu;
wxMenuItem *ContinuousParent = new wxMenuItem(subtitlesMenu,-1,_("Make Times Continuous"),_T(""),wxITEM_NORMAL,ContinuousMenu);
#ifndef __APPLE__
ContinuousParent->SetBitmap(wxBITMAP(blank_button));
#endif
AppendBitmapMenuItem(ContinuousMenu,MENU_ADJOIN,_("Change &Start"),_("Changes times of subs so start times begin on previous's end time"),wxBITMAP(blank_button));
AppendBitmapMenuItem(ContinuousMenu,MENU_ADJOIN2,_("Change &End"),_("Changes times of subs so end times begin on next's start time"),wxBITMAP(blank_button));
timingMenu->Append(ContinuousParent);
@ -384,14 +393,18 @@ void FrameMain::InitMenu() {
videoMenu->Append(Menu_Video_Detach, _("Detach Video"), _("Detach video, displaying it in a separate Window."));
wxMenu *ZoomMenu = new wxMenu;
wxMenuItem *ZoomParent = new wxMenuItem(subtitlesMenu,Menu_View_Zoom,_("Set Zoom"),_T(""),wxITEM_NORMAL,ZoomMenu);
#ifndef __APPLE__
ZoomParent->SetBitmap(wxBITMAP(blank_button));
#endif
ZoomMenu->Append(Menu_View_Zoom_50, MakeHotkeyText(_T("&50%"), _T("Zoom 50%")), _("Set zoom to 50%"));
ZoomMenu->Append(Menu_View_Zoom_100, MakeHotkeyText(_T("&100%"), _T("Zoom 100%")), _("Set zoom to 100%"));
ZoomMenu->Append(Menu_View_Zoom_200, MakeHotkeyText(_T("&200%"), _T("Zoom 200%")), _("Set zoom to 200%"));
videoMenu->Append(ZoomParent);
wxMenu *AspectMenu = new wxMenu;
wxMenuItem *AspectParent = new wxMenuItem(subtitlesMenu,Menu_Video_AR,_("Override Aspect Ratio"),_T(""),wxITEM_NORMAL,AspectMenu);
#ifndef __APPLE__
AspectParent->SetBitmap(wxBITMAP(blank_button));
#endif
AspectMenu->AppendCheckItem(Menu_Video_AR_Default, _("&Default"), _("Leave video on original aspect ratio"));
AspectMenu->AppendCheckItem(Menu_Video_AR_Full, _("&Fullscreen (4:3)"), _("Forces video to 4:3 aspect ratio"));
AspectMenu->AppendCheckItem(Menu_Video_AR_Wide, _("&Widescreen (16:9)"), _("Forces video to 16:9 aspect ratio"));

View File

@ -41,6 +41,13 @@
///////////////////
// Include headers
#include <wx/wxprec.h>
#include <wx/frame.h>
#include <wx/menu.h>
#include <wx/log.h>
#include <wx/timer.h>
#include <wx/combobox.h>
#include <wx/sizer.h>
#include <wx/panel.h>
#include <vector>

View File

@ -986,8 +986,13 @@ void FrameMain::OnOpenKanjiTimer (wxCommandEvent &event) {
///////////////////////
// Open Options dialog
void FrameMain::OnOpenOptions (wxCommandEvent &event) {
DialogOptions options(this);
options.ShowModal();
try {
DialogOptions options(this);
options.ShowModal();
}
catch (const wxChar *e) {
wxLogError(e);
}
}

View File

@ -36,6 +36,8 @@
///////////
// Headers
#include <wx/dcmemory.h>
#include <wx/image.h>
#include "gl_text.h"
#include "utils.h"

View File

@ -38,7 +38,9 @@
///////////
// Headers
#include <wx/wxprec.h>
#ifdef HAVE_APPLE_OPENGL_FRAMEWORK
#include <wx/bitmap.h>
#include <wx/font.h>
#ifdef __APPLE__
#include <OpenGL/GL.h>
#else
#include <GL/gl.h>

View File

@ -37,7 +37,8 @@
///////////
// Headers
#include <wx/wxprec.h>
#ifdef HAVE_APPLE_OPENGL_FRAMEWORK
#include <wx/msgdlg.h>
#ifdef __APPLE__
#include <OpenGL/GL.h>
#include <OpenGL/glext.h>
#else
@ -53,20 +54,14 @@
#ifdef __WIN32__
void* glGetProc(const char *str) { return wglGetProcAddress(str); }
#else
#ifdef __WXMAC_OSX__
#ifndef HAVE_APPLE_OPENGL_FRAMEWORK
void* glGetProc(const char *str) { return aglGetProcAddress(str); }
#endif
#else
//void* glGetProc(const char *str) { return glXGetProcAddress((const GLubyte *)str); }
#define glGetProc(a) glXGetProcAddress((const GLubyte *)(a))
#endif
#endif
//////////////////////////////////////
// OpenGL extension function pointers
#ifndef __WXMAC_OSX__
#ifndef __APPLE__
PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL;
PFNGLDELETEOBJECTARBPROC glDeleteObjectARB = NULL;
PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = NULL;
@ -366,7 +361,7 @@ void OpenGLWrapper::Initialize() {
//////////////////////
// Set current shader
void OpenGLWrapper::SetShader(GLuint i) {
void OpenGLWrapper::SetShader(GLhandleARB i) {
if (UseShaders()) {
Initialize();
glUseProgramObjectARB(i);
@ -377,7 +372,7 @@ void OpenGLWrapper::SetShader(GLuint i) {
//////////////////////////
// Destroy shader program
void OpenGLWrapper::DestroyShaderProgram(GLuint i) {
void OpenGLWrapper::DestroyShaderProgram(GLhandleARB i) {
if (UseShaders()) {
Initialize();
SetShader(0);
@ -389,10 +384,10 @@ void OpenGLWrapper::DestroyShaderProgram(GLuint i) {
////////////////////////////////////////////////////////
// Create shader program from vertex and pixel shaders
GLuint OpenGLWrapper::CreateShaderProgram(GLuint vertex,GLuint pixel) {
GLhandleARB OpenGLWrapper::CreateShaderProgram(GLhandleARB vertex,GLhandleARB pixel) {
// Create instance
Initialize();
GLuint program = glCreateProgramObjectARB();
GLhandleARB program = glCreateProgramObjectARB();
if (glGetError()) throw _T("Error creating shader program.");
// Attach shaders
@ -412,10 +407,10 @@ GLuint OpenGLWrapper::CreateShaderProgram(GLuint vertex,GLuint pixel) {
/////////////////////////////////
// Create standard Vertex shader
GLuint OpenGLWrapper::CreateStandardVertexShader() {
GLhandleARB OpenGLWrapper::CreateStandardVertexShader() {
// Create instance
Initialize();
GLuint shader = glCreateShaderObjectARB(GL_VERTEX_SHADER);
GLhandleARB shader = glCreateShaderObjectARB(GL_VERTEX_SHADER);
if (glGetError()) throw _T("Error generating vertex shader.");
// Read source
@ -439,10 +434,10 @@ GLuint OpenGLWrapper::CreateStandardVertexShader() {
///////////////////////////////////
// Create YV12->RGB32 Pixel Shader
GLuint OpenGLWrapper::CreateYV12PixelShader() {
GLhandleARB OpenGLWrapper::CreateYV12PixelShader() {
// Create instance
Initialize();
GLuint shader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER);
GLhandleARB shader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER);
if (glGetError()) throw _T("Error generating pixel shader.");
// Read source
@ -481,17 +476,17 @@ GLuint OpenGLWrapper::CreateYV12PixelShader() {
/////////////////////////////////////
// Create YV12->RGB32 Shader Program
GLuint OpenGLWrapper::CreateYV12Shader(float tw,float th,float tws) {
GLhandleARB OpenGLWrapper::CreateYV12Shader(float tw,float th,float tws) {
// Create vertex shader
GLuint ver = OpenGLWrapper::CreateStandardVertexShader();
GLhandleARB ver = OpenGLWrapper::CreateStandardVertexShader();
if (glGetError() != 0) throw _T("Error creating generic vertex shader");
// Create pixel shader
GLuint pix = OpenGLWrapper::CreateYV12PixelShader();
GLhandleARB pix = OpenGLWrapper::CreateYV12PixelShader();
if (glGetError() != 0) throw _T("Error creating YV12 pixel shader");
// Create program
GLuint program = OpenGLWrapper::CreateShaderProgram(ver,pix);
GLhandleARB program = OpenGLWrapper::CreateShaderProgram(ver,pix);
if (glGetError() != 0) throw _T("Error creating shader program");
// Set shader

View File

@ -35,6 +35,16 @@
#pragma once
#ifdef __APPLE__
#include <OpenGL/GL.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
typedef GLuint GLhandleARB;
#endif
#include <wx/thread.h>
#include <wx/colour.h>
//////////////////
@ -46,9 +56,9 @@ private:
int lw;
static void Initialize();
static GLuint CreateStandardVertexShader();
static GLuint CreateYV12PixelShader();
static GLuint CreateShaderProgram(GLuint vertex,GLuint pixel);
static GLhandleARB CreateStandardVertexShader();
static GLhandleARB CreateYV12PixelShader();
static GLhandleARB CreateShaderProgram(GLhandleARB vertex,GLhandleARB pixel);
public:
OpenGLWrapper();
@ -70,7 +80,7 @@ public:
static bool UseShaders();
static bool IsExtensionSupported(const char *ext);
static bool ShadersAvailable();
static void SetShader(GLuint i);
static void DestroyShaderProgram(GLuint i);
static GLuint CreateYV12Shader(float tw,float th,float tws);
static void SetShader(GLhandleARB i);
static void DestroyShaderProgram(GLhandleARB i);
static GLhandleARB CreateYV12Shader(float tw,float th,float tws);
};

View File

@ -38,6 +38,7 @@
// Headers
#include <wx/wxprec.h>
#include <wx/mimetype.h>
#include <wx/log.h>
#include "help_button.h"
#include "utils.h"
#include "standard_paths.h"
@ -70,3 +71,4 @@ void HelpButton::OnPressed(wxCommandEvent &event) {
}
}

View File

@ -40,6 +40,7 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/button.h>
///////////////////////

View File

@ -41,6 +41,7 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/textctrl.h>
//////////////

View File

@ -41,6 +41,8 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
#include <wx/accel.h>
#include <map>

View File

@ -40,6 +40,8 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/event.h>
#include <wx/combobox.h>
/////////

View File

@ -38,6 +38,7 @@
// Headers
#include <list>
#include <wx/wxprec.h>
#include <wx/string.h>
///////////////////////////

View File

@ -35,6 +35,7 @@
///////////
// Headers
#include <wx/msgdlg.h>
#include "video_context.h"
#include "keyframe.h"
#include "text_file_reader.h"

View File

@ -41,6 +41,7 @@
///////////////////
// Include headers
#include <wx/wxprec.h>
#include <wx/app.h>
#include <wx/stackwalk.h>
#include <fstream>
#include "aegisublocale.h"

View File

@ -182,7 +182,7 @@ void OptionsManager::LoadDefaults(bool onlyDefaults) {
#if defined(__WINDOWS__)
SetText(_T("Audio Player"),_T("dsound"));
#elif defined(__APPLE__)
SetText(_T("Autio Player"), _T("openal"));
SetText(_T("Audio Player"), _T("openal"));
#else
SetText(_T("Audio Player"),_T("portaudio")); // FIXME: should this be something else? perhaps alsa on linux and portaudio on everything else?
#endif
@ -496,7 +496,7 @@ int OptionsManager::AsInt(wxString key) {
if (cur != opt.end()) {
return (*cur).second.AsInt();
}
else throw _T("Internal error: Attempted getting undefined configuration setting");
else throw key.c_str();//_T("Internal error: Attempted getting undefined configuration setting");
}
@ -508,7 +508,7 @@ bool OptionsManager::AsBool(wxString key) {
if (cur != opt.end()) {
return (*cur).second.AsBool();
}
else throw _T("Internal error: Attempted getting undefined configuration setting");
else throw key.c_str();//_T("Internal error: Attempted getting undefined configuration setting");
}
@ -520,7 +520,7 @@ double OptionsManager::AsFloat(wxString key) {
if (cur != opt.end()) {
return (*cur).second.AsFloat();
}
else throw _T("Internal error: Attempted getting undefined configuration setting");
else throw key.c_str();//_T("Internal error: Attempted getting undefined configuration setting");
}
@ -532,7 +532,7 @@ wxString OptionsManager::AsText(wxString key) {
if (cur != opt.end()) {
return (*cur).second.AsText();
}
else throw _T("Internal error: Attempted getting undefined configuration setting");
else throw key.c_str();//_T("Internal error: Attempted getting undefined configuration setting");
}
@ -544,7 +544,7 @@ wxColour OptionsManager::AsColour(wxString key) {
if (cur != opt.end()) {
return (*cur).second.AsColour();
}
else throw _T("Internal error: Attempted getting undefined configuration setting");
else throw key.c_str();//_T("Internal error: Attempted getting undefined configuration setting");
}

View File

@ -40,6 +40,7 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/gdicmn.h>
#include <list>
#include <vector>
#include "spline_curve.h"

View File

@ -36,6 +36,7 @@
////////////
// Includes
#include <wx/dcclient.h>
#include "static_bmp.h"

View File

@ -40,6 +40,8 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/bitmap.h>
#include <wx/window.h>
/////////////////////

View File

@ -237,7 +237,7 @@ void SubsTextEditCtrl::UpdateStyle(int start, int _length) {
// Check if it's a template line
AssDialogue *diag = control->grid->GetDialogue(control->linen);
bool templateLine = diag && diag->Comment && diag->Effect.Lower().StartsWith(_T("template"));
bool templateCodeLine = diag && diag->Comment && diag->Effect.Lower().StartsWith(_T("code"));
//bool templateCodeLine = diag && diag->Comment && diag->Effect.Lower().StartsWith(_T("code"));
// Template code lines get Lua highlighting instead of ASS highlighting
// This is broken and needs some extra work
@ -702,7 +702,7 @@ void SubsTextEditCtrl::SetTextTo(const wxString _text) {
Freeze();
wxString text = _text;
text.Replace(_T("\r\n"),_T("\\N"));
text.Replace(_T("\n\r"),_T("\\N"));
//text.Replace(_T("\n\r"),_T("\\N")); // never a valid linebreak
text.Replace(_T("\r"),_T("\\N"));
text.Replace(_T("\n"),_T("\\N"));

View File

@ -34,11 +34,11 @@
//
#pragma once
////////////
// Includes
#include <wx/msgdlg.h>
#include <wx/dcclient.h>
#include <wx/dcmemory.h>
#include "ass_style.h"
#include "subs_preview.h"
#include "video_provider_dummy.h"

View File

@ -40,6 +40,8 @@
////////////
// Includes
#include <wx/wxprec.h>
#include <wx/window.h>
#include <wx/bitmap.h>
//////////////

View File

@ -36,6 +36,8 @@
///////////
// Headers
#include <wx/intl.h>
#include <wx/choicdlg.h>
#include "subtitle_format.h"
#include "subtitle_format_ass.h"
#include "subtitle_format_srt.h"

View File

@ -40,6 +40,8 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
#include <wx/arrstr.h>
#include <list>

View File

@ -41,6 +41,7 @@
// Headers
#include <wx/wxprec.h>
#include <wx/dynarray.h>
#include <wx/string.h>
#include <fstream>
#ifdef TEXT_READER_USE_STDIO
#include <stdio.h>
@ -81,3 +82,4 @@ public:
static wxString GetEncoding(const wxString filename);
};

View File

@ -41,6 +41,7 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
#include <fstream>

View File

@ -40,6 +40,8 @@
///////////
// Headers
#include <wx/wxprec.h>
#include <wx/string.h>
#include <wx/arrstr.h>
#include <vector>

Some files were not shown because too many files have changed in this diff Show More