From 489abd666334e8adb8df8770a41d221a9794f254 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Tue, 11 Sep 2007 23:22:26 +0000 Subject: [PATCH] jfs's mac patches applied Originally committed to SVN as r1560. --- aegisub/ass_entry.h | 1 + aegisub/ass_export_filter.h | 2 ++ aegisub/ass_exporter.h | 3 +++ aegisub/ass_file.cpp | 3 +++ aegisub/ass_override.cpp | 1 + aegisub/ass_style.cpp | 1 + aegisub/ass_style.h | 1 + aegisub/ass_style_storage.h | 1 + aegisub/ass_time.h | 1 + aegisub/audio_box.cpp | 15 ++++++------ aegisub/audio_box.h | 9 +++++++ aegisub/audio_display.h | 2 ++ aegisub/audio_karaoke.cpp | 7 +++++- aegisub/audio_karaoke.h | 3 +++ aegisub/audio_player.h | 6 +++-- aegisub/audio_player_openal.cpp | 6 +++++ aegisub/audio_provider.cpp | 1 + aegisub/audio_provider_pcm.h | 2 ++ aegisub/audio_spectrum.cpp | 4 ++- aegisub/auto4_base.cpp | 4 +++ aegisub/auto4_base.h | 6 +++++ aegisub/bitmaps/genxpm.sh | 5 ++-- aegisub/browse_button.cpp | 11 +++++++-- aegisub/browse_button.h | 2 ++ aegisub/colour_button.cpp | 1 + aegisub/dialog_about.cpp | 7 ++++-- aegisub/dialog_about.h | 1 + aegisub/dialog_associations.cpp | 4 ++- aegisub/dialog_associations.h | 3 +++ aegisub/dialog_attachments.cpp | 2 ++ aegisub/dialog_automation.cpp | 2 ++ aegisub/dialog_colorpicker.cpp | 6 ++++- aegisub/dialog_detached_video.cpp | 2 +- aegisub/dialog_detached_video.h | 3 +++ aegisub/dialog_dummy_video.cpp | 1 + aegisub/dialog_dummy_video.h | 1 + aegisub/dialog_export.cpp | 4 +++ aegisub/dialog_export.h | 7 ++++++ aegisub/dialog_jumpto.cpp | 5 ++++ aegisub/dialog_kanji_timer.h | 2 ++ aegisub/dialog_options.h | 1 + aegisub/dialog_paste_over.cpp | 3 +++ aegisub/dialog_paste_over.h | 2 ++ aegisub/dialog_progress.cpp | 2 ++ aegisub/dialog_progress.h | 3 +++ aegisub/dialog_properties.cpp | 4 +++ aegisub/dialog_properties.h | 3 +++ aegisub/dialog_resample.h | 4 +++ aegisub/dialog_search_replace.cpp | 1 + aegisub/dialog_search_replace.h | 6 +++++ aegisub/dialog_selection.cpp | 1 + aegisub/dialog_selection.h | 5 ++++ aegisub/dialog_shift_times.h | 4 +++ aegisub/dialog_spellchecker.h | 4 +++ aegisub/dialog_splash.cpp | 1 + aegisub/dialog_splash.h | 2 ++ aegisub/dialog_style_editor.h | 3 +++ aegisub/dialog_style_manager.cpp | 8 +++--- aegisub/dialog_style_manager.h | 4 +++ aegisub/dialog_styling_assistant.h | 5 ++++ aegisub/dialog_text_import.cpp | 3 ++- aegisub/dialog_text_import.h | 1 + aegisub/dialog_timing_processor.h | 7 ++++++ aegisub/dialog_tip.cpp | 2 ++ aegisub/dialog_version_check.cpp | 1 + aegisub/dialog_version_check.h | 3 +++ aegisub/dialog_video_details.cpp | 4 +-- aegisub/export_framerate.h | 6 +++++ aegisub/float_spin.cpp | 1 + aegisub/float_spin.h | 3 +++ aegisub/font_file_lister.cpp | 2 +- aegisub/font_file_lister.h | 4 ++- aegisub/font_file_lister_freetype.cpp | 12 ++++++++- aegisub/frame_main.cpp | 15 +++++++++++- aegisub/frame_main.h | 7 ++++++ aegisub/frame_main_events.cpp | 9 +++++-- aegisub/gl_text.cpp | 2 ++ aegisub/gl_text.h | 4 ++- aegisub/gl_wrap.cpp | 35 ++++++++++++--------------- aegisub/gl_wrap.h | 22 ++++++++++++----- aegisub/help_button.cpp | 2 ++ aegisub/help_button.h | 1 + aegisub/hilimod_textctrl.h | 1 + aegisub/hotkeys.h | 2 ++ aegisub/idle_field_event.h | 2 ++ aegisub/kana_table.h | 1 + aegisub/keyframe.cpp | 1 + aegisub/main.h | 1 + aegisub/options.cpp | 12 ++++----- aegisub/spline.h | 1 + aegisub/static_bmp.cpp | 1 + aegisub/static_bmp.h | 2 ++ aegisub/subs_edit_ctrl.cpp | 4 +-- aegisub/subs_preview.cpp | 6 ++--- aegisub/subs_preview.h | 2 ++ aegisub/subtitle_format.cpp | 2 ++ aegisub/subtitle_format.h | 2 ++ aegisub/text_file_reader.h | 2 ++ aegisub/text_file_writer.h | 1 + aegisub/thesaurus.h | 2 ++ aegisub/timeedit_ctrl.cpp | 2 ++ aegisub/timeedit_ctrl.h | 1 + aegisub/toggle_bitmap.cpp | 2 ++ aegisub/toggle_bitmap.h | 1 + aegisub/tooltip_manager.h | 3 +++ aegisub/utils.cpp | 7 +++++- aegisub/utils.h | 1 + aegisub/validators.cpp | 1 + aegisub/validators.h | 1 + aegisub/variable_data.h | 1 + aegisub/version.cpp | 4 +++ aegisub/vfr.h | 1 + aegisub/video_box.cpp | 2 ++ aegisub/video_box.h | 4 +++ aegisub/video_context.cpp | 15 +++++++++++- aegisub/video_context.h | 6 +++-- aegisub/video_display.cpp | 10 +++++++- aegisub/video_display.h | 2 ++ aegisub/video_frame.h | 1 + aegisub/video_provider.h | 1 + aegisub/video_slider.h | 1 + aegisub/visual_tool.cpp | 7 +++++- aegisub/visual_tool.h | 2 ++ aegisub/visual_tool_clip.cpp | 3 --- aegisub/visual_tool_cross.cpp | 3 --- aegisub/visual_tool_drag.cpp | 3 --- aegisub/visual_tool_drag.h | 2 ++ aegisub/visual_tool_rotatexy.cpp | 3 --- aegisub/visual_tool_rotatez.cpp | 3 --- aegisub/visual_tool_scale.cpp | 3 --- aegisub/visual_tool_vector_clip.h | 1 + 131 files changed, 408 insertions(+), 94 deletions(-) diff --git a/aegisub/ass_entry.h b/aegisub/ass_entry.h index 7d7efbe59..a8d693477 100644 --- a/aegisub/ass_entry.h +++ b/aegisub/ass_entry.h @@ -40,6 +40,7 @@ /////////// // Headers #include +#include ////////////// diff --git a/aegisub/ass_export_filter.h b/aegisub/ass_export_filter.h index b5d014b3f..78ecd8219 100644 --- a/aegisub/ass_export_filter.h +++ b/aegisub/ass_export_filter.h @@ -40,6 +40,8 @@ /////////// // Headers #include +#include +#include #include diff --git a/aegisub/ass_exporter.h b/aegisub/ass_exporter.h index e4714ebc5..a5207b8d3 100644 --- a/aegisub/ass_exporter.h +++ b/aegisub/ass_exporter.h @@ -40,6 +40,9 @@ /////////// // Headers #include +#include +#include +#include #include #include diff --git a/aegisub/ass_file.cpp b/aegisub/ass_file.cpp index 3e0b4a595..d74baed61 100644 --- a/aegisub/ass_file.cpp +++ b/aegisub/ass_file.cpp @@ -39,6 +39,8 @@ #include #include #include +#include +#include #include "ass_file.h" #include "ass_dialogue.h" #include "ass_style.h" @@ -1030,3 +1032,4 @@ bool AssFile::Popping; bool AssFile::StackModified; + diff --git a/aegisub/ass_override.cpp b/aegisub/ass_override.cpp index 20a9e0240..d481f8a2a 100644 --- a/aegisub/ass_override.cpp +++ b/aegisub/ass_override.cpp @@ -39,6 +39,7 @@ #include "ass_dialogue.h" #include "ass_override.h" #include +#include ////////////////////// AssOverrideParameter ////////////////////// diff --git a/aegisub/ass_style.cpp b/aegisub/ass_style.cpp index 8c767101d..73aced2d7 100644 --- a/aegisub/ass_style.cpp +++ b/aegisub/ass_style.cpp @@ -36,6 +36,7 @@ //////////// // Includes #include +#include #include "ass_style.h" #include "utils.h" #include diff --git a/aegisub/ass_style.h b/aegisub/ass_style.h index dc1ed1ae4..e0235e9a6 100644 --- a/aegisub/ass_style.h +++ b/aegisub/ass_style.h @@ -38,6 +38,7 @@ /////////// // Headers +#include #include "ass_entry.h" diff --git a/aegisub/ass_style_storage.h b/aegisub/ass_style_storage.h index a696ee1d2..7f4c87090 100644 --- a/aegisub/ass_style_storage.h +++ b/aegisub/ass_style_storage.h @@ -41,6 +41,7 @@ //////////// // Includes #include +#include #include diff --git a/aegisub/ass_time.h b/aegisub/ass_time.h index 85882a1e8..baaa82a82 100644 --- a/aegisub/ass_time.h +++ b/aegisub/ass_time.h @@ -40,6 +40,7 @@ /////////// // Headers #include +#include ///////////////////////////// diff --git a/aegisub/audio_box.cpp b/aegisub/audio_box.cpp index 986221558..bf629489a 100644 --- a/aegisub/audio_box.cpp +++ b/aegisub/audio_box.cpp @@ -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(); } + diff --git a/aegisub/audio_box.h b/aegisub/audio_box.h index 950f6d7a8..f0b4a540d 100644 --- a/aegisub/audio_box.h +++ b/aegisub/audio_box.h @@ -41,7 +41,16 @@ /////////// // Headers #include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include ////////////// diff --git a/aegisub/audio_display.h b/aegisub/audio_display.h index 7bc148ad4..65cf8eb83 100644 --- a/aegisub/audio_display.h +++ b/aegisub/audio_display.h @@ -41,6 +41,8 @@ /////////// // Headers #include +#include +#include #include #include "audio_provider.h" #include "audio_player.h" diff --git a/aegisub/audio_karaoke.cpp b/aegisub/audio_karaoke.cpp index 7e8f5259d..4b2c22a3f 100644 --- a/aegisub/audio_karaoke.cpp +++ b/aegisub/audio_karaoke.cpp @@ -36,12 +36,16 @@ /////////// // Headers -#include #include "audio_karaoke.h" #include "audio_display.h" #include "audio_box.h" #include "ass_dialogue.h" #include "ass_override.h" +#include +#include +#include +#include +#include #include @@ -859,3 +863,4 @@ void AudioKaraokeTagMenu::OnSelectItem(wxCommandEvent &event) { kara->SetSelection(firstsel, lastsel); } + diff --git a/aegisub/audio_karaoke.h b/aegisub/audio_karaoke.h index 0e6b14f50..0688b6e93 100644 --- a/aegisub/audio_karaoke.h +++ b/aegisub/audio_karaoke.h @@ -41,6 +41,9 @@ /////////// // Headers #include +#include +#include +#include #include #include "ass_karaoke.h" diff --git a/aegisub/audio_player.h b/aegisub/audio_player.h index 7cbe65b9b..b16b25532 100644 --- a/aegisub/audio_player.h +++ b/aegisub/audio_player.h @@ -40,6 +40,9 @@ /////////// // Headers #include +#include +#include +#include #include #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) + diff --git a/aegisub/audio_player_openal.cpp b/aegisub/audio_player_openal.cpp index 48bfef116..4402c5b79 100644 --- a/aegisub/audio_player_openal.cpp +++ b/aegisub/audio_player_openal.cpp @@ -44,8 +44,13 @@ #include "frame_main.h" #include "audio_player.h" #include "options.h" +#ifdef __APPLE__ +#include +#include +#else #include #include +#endif // Auto-link to OpenAL lib for MSVC @@ -391,3 +396,4 @@ int64_t OpenALPlayer::GetCurrentPosition() } + diff --git a/aegisub/audio_provider.cpp b/aegisub/audio_provider.cpp index b3d0224ac..9811cd6fd 100644 --- a/aegisub/audio_provider.cpp +++ b/aegisub/audio_provider.cpp @@ -37,6 +37,7 @@ /////////// // Headers #include +#include #include "audio_provider_ram.h" #include "audio_provider_hd.h" #include "audio_provider_pcm.h" diff --git a/aegisub/audio_provider_pcm.h b/aegisub/audio_provider_pcm.h index ca7db0922..b62e1ec5b 100644 --- a/aegisub/audio_provider_pcm.h +++ b/aegisub/audio_provider_pcm.h @@ -41,6 +41,7 @@ // Headers #include "audio_provider.h" #include +#include #include @@ -71,3 +72,4 @@ public: // Construct the right PCM audio provider (if any) for the file AudioProvider *CreatePCMAudioProvider(const wxString &filename); + diff --git a/aegisub/audio_spectrum.cpp b/aegisub/audio_spectrum.cpp index a23d1f6b3..dde06484c 100644 --- a/aegisub/audio_spectrum.cpp +++ b/aegisub/audio_spectrum.cpp @@ -44,6 +44,7 @@ #include "colorspace.h" #include "options.h" #include "utils.h" +#include // 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 CacheAgeList; @@ -550,3 +551,4 @@ void AudioSpectrum::SetScaling(float _power_scale) power_scale = _power_scale; } + diff --git a/aegisub/auto4_base.cpp b/aegisub/auto4_base.cpp index 7c51e2001..5398ba29f 100644 --- a/aegisub/auto4_base.cpp +++ b/aegisub/auto4_base.cpp @@ -49,6 +49,10 @@ #include #include #include +#include +#include +#include + #ifdef WIN32 #include diff --git a/aegisub/auto4_base.h b/aegisub/auto4_base.h index e144d6fc2..ec09ca78a 100644 --- a/aegisub/auto4_base.h +++ b/aegisub/auto4_base.h @@ -39,6 +39,12 @@ #define _AUTO4_BASE_H #include +#include +#include +#include +#include +#include +#include #include #include "ass_export_filter.h" diff --git a/aegisub/bitmaps/genxpm.sh b/aegisub/bitmaps/genxpm.sh index 8d62532e0..9921f2d90 100644 --- a/aegisub/bitmaps/genxpm.sh +++ b/aegisub/bitmaps/genxpm.sh @@ -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" + diff --git a/aegisub/browse_button.cpp b/aegisub/browse_button.cpp index d21fa2be8..c572a439e 100644 --- a/aegisub/browse_button.cpp +++ b/aegisub/browse_button.cpp @@ -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) { } } + diff --git a/aegisub/browse_button.h b/aegisub/browse_button.h index bddb586e4..21a386cd8 100644 --- a/aegisub/browse_button.h +++ b/aegisub/browse_button.h @@ -40,6 +40,8 @@ //////////// // Includes #include +#include +#include /////////////// diff --git a/aegisub/colour_button.cpp b/aegisub/colour_button.cpp index 8cdb19114..1cb1e2781 100644 --- a/aegisub/colour_button.cpp +++ b/aegisub/colour_button.cpp @@ -36,6 +36,7 @@ //////////// // Includes +#include #include "colour_button.h" #include "dialog_colorpicker.h" diff --git a/aegisub/dialog_about.cpp b/aegisub/dialog_about.cpp index 4be498040..eb2f1443e 100644 --- a/aegisub/dialog_about.cpp +++ b/aegisub/dialog_about.cpp @@ -37,6 +37,9 @@ //////////// // Includes #include +#include +#include +#include #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); diff --git a/aegisub/dialog_about.h b/aegisub/dialog_about.h index 6d9ed6e2b..49dddcbff 100644 --- a/aegisub/dialog_about.h +++ b/aegisub/dialog_about.h @@ -40,6 +40,7 @@ //////////// // Includes #include +#include #include "static_bmp.h" diff --git a/aegisub/dialog_associations.cpp b/aegisub/dialog_associations.cpp index c2f7185c6..52ef732a5 100644 --- a/aegisub/dialog_associations.cpp +++ b/aegisub/dialog_associations.cpp @@ -36,8 +36,10 @@ /////////// // Headers -#include "dialog_associations.h" +#include +#include #include +#include "dialog_associations.h" /////////////// diff --git a/aegisub/dialog_associations.h b/aegisub/dialog_associations.h index 4d5064bfe..77ea69c65 100644 --- a/aegisub/dialog_associations.h +++ b/aegisub/dialog_associations.h @@ -40,6 +40,9 @@ /////////// // Headers #include +#include +#include +#include ////////////////////////////////// diff --git a/aegisub/dialog_attachments.cpp b/aegisub/dialog_attachments.cpp index bb5b2b988..dc948ce56 100644 --- a/aegisub/dialog_attachments.cpp +++ b/aegisub/dialog_attachments.cpp @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include "dialog_attachments.h" #include "ass_file.h" #include "ass_attachment.h" diff --git a/aegisub/dialog_automation.cpp b/aegisub/dialog_automation.cpp index a6b8cbf2c..b1680a786 100644 --- a/aegisub/dialog_automation.cpp +++ b/aegisub/dialog_automation.cpp @@ -40,6 +40,8 @@ #include "utils.h" #include #include +#include +#include DialogAutomation::DialogAutomation(wxWindow *parent, Automation4::ScriptManager *_local_manager) diff --git a/aegisub/dialog_colorpicker.cpp b/aegisub/dialog_colorpicker.cpp index e43fe43e3..948a01d10 100644 --- a/aegisub/dialog_colorpicker.cpp +++ b/aegisub/dialog_colorpicker.cpp @@ -40,6 +40,10 @@ #include #include #include +#include +#include +#include +#include #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; \ No newline at end of file +int DialogColorPicker::lasty = -1; diff --git a/aegisub/dialog_detached_video.cpp b/aegisub/dialog_detached_video.cpp index 993619ff4..2425e1e5d 100644 --- a/aegisub/dialog_detached_video.cpp +++ b/aegisub/dialog_detached_video.cpp @@ -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); diff --git a/aegisub/dialog_detached_video.h b/aegisub/dialog_detached_video.h index ba6a106c6..1dcaf2e2a 100644 --- a/aegisub/dialog_detached_video.h +++ b/aegisub/dialog_detached_video.h @@ -37,6 +37,9 @@ #pragma once +#include + + ////////////// // Prototypes class VideoBox; diff --git a/aegisub/dialog_dummy_video.cpp b/aegisub/dialog_dummy_video.cpp index 91a4bd27f..0414bd906 100644 --- a/aegisub/dialog_dummy_video.cpp +++ b/aegisub/dialog_dummy_video.cpp @@ -37,6 +37,7 @@ #include "dialog_dummy_video.h" #include #include +#include #include "options.h" diff --git a/aegisub/dialog_dummy_video.h b/aegisub/dialog_dummy_video.h index 029437979..d53e77405 100644 --- a/aegisub/dialog_dummy_video.h +++ b/aegisub/dialog_dummy_video.h @@ -41,6 +41,7 @@ #include #include #include +#include #include "video_provider_dummy.h" #include "colour_button.h" diff --git a/aegisub/dialog_export.cpp b/aegisub/dialog_export.cpp index 497fb5071..d93a30109 100644 --- a/aegisub/dialog_export.cpp +++ b/aegisub/dialog_export.cpp @@ -37,6 +37,10 @@ /////////// // Headers #include +#include +#include +#include +#include #include "dialog_export.h" #include "ass_file.h" #include "ass_exporter.h" diff --git a/aegisub/dialog_export.h b/aegisub/dialog_export.h index ac52692e8..a859becce 100644 --- a/aegisub/dialog_export.h +++ b/aegisub/dialog_export.h @@ -40,6 +40,13 @@ /////////// // Headers #include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/aegisub/dialog_jumpto.cpp b/aegisub/dialog_jumpto.cpp index 4fd583474..d64ba49a1 100644 --- a/aegisub/dialog_jumpto.cpp +++ b/aegisub/dialog_jumpto.cpp @@ -36,6 +36,11 @@ /////////// // Headers +#include +#include +#include +#include +#include #include "dialog_jumpto.h" #include "vfr.h" #include "video_context.h" diff --git a/aegisub/dialog_kanji_timer.h b/aegisub/dialog_kanji_timer.h index 6f8323dbf..8c580a849 100644 --- a/aegisub/dialog_kanji_timer.h +++ b/aegisub/dialog_kanji_timer.h @@ -44,6 +44,8 @@ #include #include #include +#include +#include #include #include "options.h" #include "kana_table.h" diff --git a/aegisub/dialog_options.h b/aegisub/dialog_options.h index 55c04920f..3b0932d98 100644 --- a/aegisub/dialog_options.h +++ b/aegisub/dialog_options.h @@ -40,6 +40,7 @@ //////////// // Includes #include +#include #include #include #include diff --git a/aegisub/dialog_paste_over.cpp b/aegisub/dialog_paste_over.cpp index 140b46f86..5ac618219 100644 --- a/aegisub/dialog_paste_over.cpp +++ b/aegisub/dialog_paste_over.cpp @@ -37,6 +37,9 @@ /////////// // Headers #include +#include +#include +#include #include "dialog_paste_over.h" #include "options.h" diff --git a/aegisub/dialog_paste_over.h b/aegisub/dialog_paste_over.h index 65eb7dc07..e5614c20a 100644 --- a/aegisub/dialog_paste_over.h +++ b/aegisub/dialog_paste_over.h @@ -40,6 +40,8 @@ /////////// // Headers #include +#include +#include ////////////////////////////////// diff --git a/aegisub/dialog_progress.cpp b/aegisub/dialog_progress.cpp index f14db601a..6986dc059 100644 --- a/aegisub/dialog_progress.cpp +++ b/aegisub/dialog_progress.cpp @@ -36,6 +36,8 @@ /////////// // Headers +#include +#include #include "dialog_progress.h" diff --git a/aegisub/dialog_progress.h b/aegisub/dialog_progress.h index c0950a808..4d7cc9c14 100644 --- a/aegisub/dialog_progress.h +++ b/aegisub/dialog_progress.h @@ -41,6 +41,9 @@ /////////// // Headers #include +#include +#include +#include ///////////////////////// diff --git a/aegisub/dialog_properties.cpp b/aegisub/dialog_properties.cpp index cfd33fa74..2c258fa3c 100644 --- a/aegisub/dialog_properties.cpp +++ b/aegisub/dialog_properties.cpp @@ -36,6 +36,10 @@ /////////// // Headers +#include +#include +#include +#include #include "dialog_properties.h" #include "options.h" #include "ass_file.h" diff --git a/aegisub/dialog_properties.h b/aegisub/dialog_properties.h index 7c468215c..f811a66c0 100644 --- a/aegisub/dialog_properties.h +++ b/aegisub/dialog_properties.h @@ -40,6 +40,9 @@ /////////// // Headers #include +#include +#include +#include //////////////////// diff --git a/aegisub/dialog_resample.h b/aegisub/dialog_resample.h index 49c34e0fa..deb4b0a4b 100644 --- a/aegisub/dialog_resample.h +++ b/aegisub/dialog_resample.h @@ -41,6 +41,10 @@ /////////// // Headers #include +#include +#include +#include +#include ////////////// diff --git a/aegisub/dialog_search_replace.cpp b/aegisub/dialog_search_replace.cpp index c7ba0668e..ba2c9a7f3 100644 --- a/aegisub/dialog_search_replace.cpp +++ b/aegisub/dialog_search_replace.cpp @@ -37,6 +37,7 @@ /////////// // Headers #include +#include #include #include "dialog_search_replace.h" #include "ass_file.h" diff --git a/aegisub/dialog_search_replace.h b/aegisub/dialog_search_replace.h index 508aeb9ad..85f5134bf 100644 --- a/aegisub/dialog_search_replace.h +++ b/aegisub/dialog_search_replace.h @@ -40,6 +40,12 @@ /////////// // Headers #include +#include +#include +#include +#include +#include +#include ////////////// diff --git a/aegisub/dialog_selection.cpp b/aegisub/dialog_selection.cpp index 8c508da1f..964abab78 100644 --- a/aegisub/dialog_selection.cpp +++ b/aegisub/dialog_selection.cpp @@ -37,6 +37,7 @@ /////////// // Headers #include +#include #include #include "dialog_selection.h" #include "subs_grid.h" diff --git a/aegisub/dialog_selection.h b/aegisub/dialog_selection.h index d4cdbed11..c84cbd0a3 100644 --- a/aegisub/dialog_selection.h +++ b/aegisub/dialog_selection.h @@ -41,6 +41,11 @@ /////////// // Headers #include +#include +#include +#include +#include +#include ////////////// diff --git a/aegisub/dialog_shift_times.h b/aegisub/dialog_shift_times.h index f4b03025b..999a6dfac 100644 --- a/aegisub/dialog_shift_times.h +++ b/aegisub/dialog_shift_times.h @@ -40,6 +40,10 @@ /////////// // Headers +#include +#include +#include +#include #include "timeedit_ctrl.h" diff --git a/aegisub/dialog_spellchecker.h b/aegisub/dialog_spellchecker.h index bd80b7146..20f818ee0 100644 --- a/aegisub/dialog_spellchecker.h +++ b/aegisub/dialog_spellchecker.h @@ -38,6 +38,10 @@ /////////// // Headers #include +#include +#include +#include +#include #include diff --git a/aegisub/dialog_splash.cpp b/aegisub/dialog_splash.cpp index cbe6f6f61..d8e2c0012 100644 --- a/aegisub/dialog_splash.cpp +++ b/aegisub/dialog_splash.cpp @@ -38,6 +38,7 @@ // Includes #include #include +#include #include "dialog_splash.h" #include "options.h" #include "dialog_tip.h" diff --git a/aegisub/dialog_splash.h b/aegisub/dialog_splash.h index fd097f9ea..c721a7eeb 100644 --- a/aegisub/dialog_splash.h +++ b/aegisub/dialog_splash.h @@ -41,6 +41,8 @@ //////////// // Includes #include +#include +#include /////////////////////// diff --git a/aegisub/dialog_style_editor.h b/aegisub/dialog_style_editor.h index f355d3920..220c449ce 100644 --- a/aegisub/dialog_style_editor.h +++ b/aegisub/dialog_style_editor.h @@ -42,6 +42,9 @@ // Includes #include #include +#include +#include +#include #include "colour_button.h" diff --git a/aegisub/dialog_style_manager.cpp b/aegisub/dialog_style_manager.cpp index 3c7cc3ab1..3a8b5353a 100644 --- a/aegisub/dialog_style_manager.cpp +++ b/aegisub/dialog_style_manager.cpp @@ -39,6 +39,9 @@ #include #include #include +#include +#include +#include #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) { } + diff --git a/aegisub/dialog_style_manager.h b/aegisub/dialog_style_manager.h index 8063db04f..73e617fff 100644 --- a/aegisub/dialog_style_manager.h +++ b/aegisub/dialog_style_manager.h @@ -41,6 +41,10 @@ //////////// // Includes #include +#include +#include +#include +#include #include #include "ass_style_storage.h" diff --git a/aegisub/dialog_styling_assistant.h b/aegisub/dialog_styling_assistant.h index 6b12bb148..82e39033d 100644 --- a/aegisub/dialog_styling_assistant.h +++ b/aegisub/dialog_styling_assistant.h @@ -41,6 +41,11 @@ /////////// // Headers #include +#include +#include +#include +#include +#include ////////////// diff --git a/aegisub/dialog_text_import.cpp b/aegisub/dialog_text_import.cpp index 1a809fdef..2f0e4fcb4 100644 --- a/aegisub/dialog_text_import.cpp +++ b/aegisub/dialog_text_import.cpp @@ -37,6 +37,8 @@ /////////// // Headers #include "dialog_text_import.h" +#include +#include #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"))); diff --git a/aegisub/dialog_text_import.h b/aegisub/dialog_text_import.h index 908a0acef..f89609211 100644 --- a/aegisub/dialog_text_import.h +++ b/aegisub/dialog_text_import.h @@ -39,6 +39,7 @@ /////////// // Headers #include +#include class DialogTextImport : public wxDialog { diff --git a/aegisub/dialog_timing_processor.h b/aegisub/dialog_timing_processor.h index d8c0a7c4f..acba58155 100644 --- a/aegisub/dialog_timing_processor.h +++ b/aegisub/dialog_timing_processor.h @@ -40,6 +40,13 @@ /////////// // Headers #include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/aegisub/dialog_tip.cpp b/aegisub/dialog_tip.cpp index 9556f8b22..f330c2dd2 100644 --- a/aegisub/dialog_tip.cpp +++ b/aegisub/dialog_tip.cpp @@ -37,6 +37,8 @@ /////////// // Headers #include +#include +#include #include "dialog_tip.h" #include "options.h" diff --git a/aegisub/dialog_version_check.cpp b/aegisub/dialog_version_check.cpp index 3d0212010..202358460 100644 --- a/aegisub/dialog_version_check.cpp +++ b/aegisub/dialog_version_check.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "dialog_version_check.h" #include "version.h" diff --git a/aegisub/dialog_version_check.h b/aegisub/dialog_version_check.h index 59a5dc9d6..db0eb3268 100644 --- a/aegisub/dialog_version_check.h +++ b/aegisub/dialog_version_check.h @@ -40,6 +40,9 @@ /////////// // Headers #include +#include +#include +#include ////////////// diff --git a/aegisub/dialog_video_details.cpp b/aegisub/dialog_video_details.cpp index 2410eefc5..8d099a186 100644 --- a/aegisub/dialog_video_details.cpp +++ b/aegisub/dialog_video_details.cpp @@ -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); diff --git a/aegisub/export_framerate.h b/aegisub/export_framerate.h index 2cbd22206..b8138fc79 100644 --- a/aegisub/export_framerate.h +++ b/aegisub/export_framerate.h @@ -39,6 +39,12 @@ /////////// // Headers +#include +#include +#include +#include +#include +#include #include "ass_export_filter.h" #include "vfr.h" diff --git a/aegisub/float_spin.cpp b/aegisub/float_spin.cpp index 9484f198f..61e17005b 100644 --- a/aegisub/float_spin.cpp +++ b/aegisub/float_spin.cpp @@ -37,6 +37,7 @@ /////////// // Headers #include +#include #include "float_spin.h" #include "utils.h" #include "validators.h" diff --git a/aegisub/float_spin.h b/aegisub/float_spin.h index 4ba5d0689..586514677 100644 --- a/aegisub/float_spin.h +++ b/aegisub/float_spin.h @@ -40,6 +40,9 @@ /////////// // Headers #include +#include +#include +#include ////////////// diff --git a/aegisub/font_file_lister.cpp b/aegisub/font_file_lister.cpp index 24b297da1..e8755435e 100644 --- a/aegisub/font_file_lister.cpp +++ b/aegisub/font_file_lister.cpp @@ -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 diff --git a/aegisub/font_file_lister.h b/aegisub/font_file_lister.h index 65ee31394..5c5cd5acb 100644 --- a/aegisub/font_file_lister.h +++ b/aegisub/font_file_lister.h @@ -40,12 +40,14 @@ //////////// // Includes #include +#include +#include #include //////////// // Typedefs -#ifdef WIN32 +#if defined(WIN32) || defined(__APPLE__) typedef struct FT_LibraryRec_ *FT_Library; #endif typedef std::map FontMap; diff --git a/aegisub/font_file_lister_freetype.cpp b/aegisub/font_file_lister_freetype.cpp index bcfc29beb..63d20671f 100644 --- a/aegisub/font_file_lister_freetype.cpp +++ b/aegisub/font_file_lister_freetype.cpp @@ -41,7 +41,9 @@ #include FT_FREETYPE_H #include FT_GLYPH_H #include FT_SFNT_NAMES_H -#include +#ifdef WIN32 +# include +#endif #include @@ -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; diff --git a/aegisub/frame_main.cpp b/aegisub/frame_main.cpp index dfd0e1250..fa773dceb 100644 --- a/aegisub/frame_main.cpp +++ b/aegisub/frame_main.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #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")); diff --git a/aegisub/frame_main.h b/aegisub/frame_main.h index 387cb7d16..6a37901bc 100644 --- a/aegisub/frame_main.h +++ b/aegisub/frame_main.h @@ -41,6 +41,13 @@ /////////////////// // Include headers #include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/aegisub/frame_main_events.cpp b/aegisub/frame_main_events.cpp index 93746f4a0..16eead0fe 100644 --- a/aegisub/frame_main_events.cpp +++ b/aegisub/frame_main_events.cpp @@ -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); + } } diff --git a/aegisub/gl_text.cpp b/aegisub/gl_text.cpp index 7af73c49e..177580429 100644 --- a/aegisub/gl_text.cpp +++ b/aegisub/gl_text.cpp @@ -36,6 +36,8 @@ /////////// // Headers +#include +#include #include "gl_text.h" #include "utils.h" diff --git a/aegisub/gl_text.h b/aegisub/gl_text.h index 4537cdaa6..040f2185a 100644 --- a/aegisub/gl_text.h +++ b/aegisub/gl_text.h @@ -38,7 +38,9 @@ /////////// // Headers #include -#ifdef HAVE_APPLE_OPENGL_FRAMEWORK +#include +#include +#ifdef __APPLE__ #include #else #include diff --git a/aegisub/gl_wrap.cpp b/aegisub/gl_wrap.cpp index 23388304e..7c3e36b37 100644 --- a/aegisub/gl_wrap.cpp +++ b/aegisub/gl_wrap.cpp @@ -37,7 +37,8 @@ /////////// // Headers #include -#ifdef HAVE_APPLE_OPENGL_FRAMEWORK +#include +#ifdef __APPLE__ #include #include #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 diff --git a/aegisub/gl_wrap.h b/aegisub/gl_wrap.h index 27ad5b854..eb0201d2e 100644 --- a/aegisub/gl_wrap.h +++ b/aegisub/gl_wrap.h @@ -35,6 +35,16 @@ #pragma once +#ifdef __APPLE__ +#include +#include +#else +#include +#include +typedef GLuint GLhandleARB; +#endif +#include +#include ////////////////// @@ -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); }; diff --git a/aegisub/help_button.cpp b/aegisub/help_button.cpp index 2f0ef1d95..bbbd32013 100644 --- a/aegisub/help_button.cpp +++ b/aegisub/help_button.cpp @@ -38,6 +38,7 @@ // Headers #include #include +#include #include "help_button.h" #include "utils.h" #include "standard_paths.h" @@ -70,3 +71,4 @@ void HelpButton::OnPressed(wxCommandEvent &event) { } } + diff --git a/aegisub/help_button.h b/aegisub/help_button.h index 4269aa43f..94b559c9f 100644 --- a/aegisub/help_button.h +++ b/aegisub/help_button.h @@ -40,6 +40,7 @@ //////////// // Includes #include +#include /////////////////////// diff --git a/aegisub/hilimod_textctrl.h b/aegisub/hilimod_textctrl.h index c0e2c1b56..45cf45c55 100644 --- a/aegisub/hilimod_textctrl.h +++ b/aegisub/hilimod_textctrl.h @@ -41,6 +41,7 @@ //////////// // Includes #include +#include ////////////// diff --git a/aegisub/hotkeys.h b/aegisub/hotkeys.h index eff32bb68..cbdbdfaff 100644 --- a/aegisub/hotkeys.h +++ b/aegisub/hotkeys.h @@ -41,6 +41,8 @@ /////////// // Headers #include +#include +#include #include diff --git a/aegisub/idle_field_event.h b/aegisub/idle_field_event.h index a44c176d6..c0fc74dd5 100644 --- a/aegisub/idle_field_event.h +++ b/aegisub/idle_field_event.h @@ -40,6 +40,8 @@ /////////// // Headers #include +#include +#include ///////// diff --git a/aegisub/kana_table.h b/aegisub/kana_table.h index eb0c44abf..a4afd5b2a 100644 --- a/aegisub/kana_table.h +++ b/aegisub/kana_table.h @@ -38,6 +38,7 @@ // Headers #include #include +#include /////////////////////////// diff --git a/aegisub/keyframe.cpp b/aegisub/keyframe.cpp index 5760b55b1..716665417 100644 --- a/aegisub/keyframe.cpp +++ b/aegisub/keyframe.cpp @@ -35,6 +35,7 @@ /////////// // Headers +#include #include "video_context.h" #include "keyframe.h" #include "text_file_reader.h" diff --git a/aegisub/main.h b/aegisub/main.h index 0aafc6421..fbcdf966a 100644 --- a/aegisub/main.h +++ b/aegisub/main.h @@ -41,6 +41,7 @@ /////////////////// // Include headers #include +#include #include #include #include "aegisublocale.h" diff --git a/aegisub/options.cpp b/aegisub/options.cpp index 73756be77..4d3f942c1 100644 --- a/aegisub/options.cpp +++ b/aegisub/options.cpp @@ -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"); } diff --git a/aegisub/spline.h b/aegisub/spline.h index a497fc22c..247b6f504 100644 --- a/aegisub/spline.h +++ b/aegisub/spline.h @@ -40,6 +40,7 @@ /////////// // Headers #include +#include #include #include #include "spline_curve.h" diff --git a/aegisub/static_bmp.cpp b/aegisub/static_bmp.cpp index 0d9fd1eb5..9ec3997e8 100644 --- a/aegisub/static_bmp.cpp +++ b/aegisub/static_bmp.cpp @@ -36,6 +36,7 @@ //////////// // Includes +#include #include "static_bmp.h" diff --git a/aegisub/static_bmp.h b/aegisub/static_bmp.h index 0b391da89..66bbb79ef 100644 --- a/aegisub/static_bmp.h +++ b/aegisub/static_bmp.h @@ -40,6 +40,8 @@ //////////// // Includes #include +#include +#include ///////////////////// diff --git a/aegisub/subs_edit_ctrl.cpp b/aegisub/subs_edit_ctrl.cpp index d00f9b39f..e4c49ef81 100644 --- a/aegisub/subs_edit_ctrl.cpp +++ b/aegisub/subs_edit_ctrl.cpp @@ -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")); diff --git a/aegisub/subs_preview.cpp b/aegisub/subs_preview.cpp index 87bdce21a..1e3f4cf16 100644 --- a/aegisub/subs_preview.cpp +++ b/aegisub/subs_preview.cpp @@ -34,11 +34,11 @@ // -#pragma once - - //////////// // Includes +#include +#include +#include #include "ass_style.h" #include "subs_preview.h" #include "video_provider_dummy.h" diff --git a/aegisub/subs_preview.h b/aegisub/subs_preview.h index 5ec340d16..a2dfb9dc3 100644 --- a/aegisub/subs_preview.h +++ b/aegisub/subs_preview.h @@ -40,6 +40,8 @@ //////////// // Includes #include +#include +#include ////////////// diff --git a/aegisub/subtitle_format.cpp b/aegisub/subtitle_format.cpp index 164b21209..e2a39f229 100644 --- a/aegisub/subtitle_format.cpp +++ b/aegisub/subtitle_format.cpp @@ -36,6 +36,8 @@ /////////// // Headers +#include +#include #include "subtitle_format.h" #include "subtitle_format_ass.h" #include "subtitle_format_srt.h" diff --git a/aegisub/subtitle_format.h b/aegisub/subtitle_format.h index f6914c885..381a4f440 100644 --- a/aegisub/subtitle_format.h +++ b/aegisub/subtitle_format.h @@ -40,6 +40,8 @@ /////////// // Headers #include +#include +#include #include diff --git a/aegisub/text_file_reader.h b/aegisub/text_file_reader.h index 189b0cfba..111b10a38 100644 --- a/aegisub/text_file_reader.h +++ b/aegisub/text_file_reader.h @@ -41,6 +41,7 @@ // Headers #include #include +#include #include #ifdef TEXT_READER_USE_STDIO #include @@ -81,3 +82,4 @@ public: static wxString GetEncoding(const wxString filename); }; + diff --git a/aegisub/text_file_writer.h b/aegisub/text_file_writer.h index 1ca6d1e40..4e6a3c488 100644 --- a/aegisub/text_file_writer.h +++ b/aegisub/text_file_writer.h @@ -41,6 +41,7 @@ /////////// // Headers #include +#include #include diff --git a/aegisub/thesaurus.h b/aegisub/thesaurus.h index d152123a0..55b197617 100644 --- a/aegisub/thesaurus.h +++ b/aegisub/thesaurus.h @@ -40,6 +40,8 @@ /////////// // Headers #include +#include +#include #include diff --git a/aegisub/timeedit_ctrl.cpp b/aegisub/timeedit_ctrl.cpp index 5321b0e45..fe70fb78b 100644 --- a/aegisub/timeedit_ctrl.cpp +++ b/aegisub/timeedit_ctrl.cpp @@ -37,6 +37,8 @@ //////////// // Includes #include +#include +#include #include "timeedit_ctrl.h" #include "ass_time.h" #include "vfr.h" diff --git a/aegisub/timeedit_ctrl.h b/aegisub/timeedit_ctrl.h index e32352fd7..f1079f278 100644 --- a/aegisub/timeedit_ctrl.h +++ b/aegisub/timeedit_ctrl.h @@ -40,6 +40,7 @@ //////////// // Includes #include +#include #include "ass_time.h" diff --git a/aegisub/toggle_bitmap.cpp b/aegisub/toggle_bitmap.cpp index 4b2d677b1..380a30600 100644 --- a/aegisub/toggle_bitmap.cpp +++ b/aegisub/toggle_bitmap.cpp @@ -39,6 +39,8 @@ #include "toggle_bitmap.h" #include #include +#include +#include /////////////// diff --git a/aegisub/toggle_bitmap.h b/aegisub/toggle_bitmap.h index 54fbc974d..fc16ebc77 100644 --- a/aegisub/toggle_bitmap.h +++ b/aegisub/toggle_bitmap.h @@ -41,6 +41,7 @@ /////////// // Headers #include +#include ///////// diff --git a/aegisub/tooltip_manager.h b/aegisub/tooltip_manager.h index 6d11bbaa8..4894937f9 100644 --- a/aegisub/tooltip_manager.h +++ b/aegisub/tooltip_manager.h @@ -40,6 +40,9 @@ /////////// // Headers #include +#include +#include +#include #include diff --git a/aegisub/utils.cpp b/aegisub/utils.cpp index 4f940126e..09baf800e 100644 --- a/aegisub/utils.cpp +++ b/aegisub/utils.cpp @@ -38,6 +38,8 @@ // Headers #include #include +#include +#include #include "utils.h" #ifdef __UNIX__ #include @@ -184,7 +186,10 @@ wxString PrettySize(int bytes) { // Append a menu item with bitmap wxMenuItem* AppendBitmapMenuItem (wxMenu* parentMenu,int id,wxString text,wxString help,wxBitmap bmp,int pos) { wxMenuItem *cur = new wxMenuItem(parentMenu,id,text,help); + // Mac software does not use icons in menus so we shouldn't either +#ifndef __APPLE__ cur->SetBitmap(bmp); +#endif if (pos == -1) parentMenu->Append(cur); else parentMenu->Insert(pos,cur); return cur; @@ -218,7 +223,7 @@ void GetWordBoundaries(const wxString text,IntPairVector &results,int start,int bool isDelim; // Delimiters - wxString delim = _T(" .,;:!?-(){}[]\"/\\"); + wxString delim(_T(" .,;:!?-(){}[]\"\\/")); wxChar temp = 0xBF; delim += temp; temp = 0xA1; diff --git a/aegisub/utils.h b/aegisub/utils.h index ec6f193bf..6e759f437 100644 --- a/aegisub/utils.h +++ b/aegisub/utils.h @@ -39,6 +39,7 @@ /////////// // Headers +#include #include #include #include diff --git a/aegisub/validators.cpp b/aegisub/validators.cpp index cb9ae355d..b8bd82fcd 100644 --- a/aegisub/validators.cpp +++ b/aegisub/validators.cpp @@ -36,6 +36,7 @@ /////////// // Headers +#include #include "validators.h" #include "utils.h" diff --git a/aegisub/validators.h b/aegisub/validators.h index fe7cf497a..9875283a0 100644 --- a/aegisub/validators.h +++ b/aegisub/validators.h @@ -41,6 +41,7 @@ /////////// // Headers #include +#include ///////////////////// diff --git a/aegisub/variable_data.h b/aegisub/variable_data.h index 2dc0db204..8d09cb6b0 100644 --- a/aegisub/variable_data.h +++ b/aegisub/variable_data.h @@ -40,6 +40,7 @@ /////////// // Headers #include +#include ///////////////// diff --git a/aegisub/version.cpp b/aegisub/version.cpp index 65af0ea28..b2635f977 100644 --- a/aegisub/version.cpp +++ b/aegisub/version.cpp @@ -92,7 +92,11 @@ struct VersionInfoStruct { #else BuildTime = BUILD_TIMESTAMP; #endif +#ifdef BUILD_CREDIT BuildCredit = _T_rec(BUILD_CREDIT); +#else + BuildCredit = _T("anonymous"); +#endif if (SvnRev > 0) { SCMStr = wxString::Format(_T("SVN r%d"), SvnRev); diff --git a/aegisub/vfr.h b/aegisub/vfr.h index 195aee2b6..83172a9f1 100644 --- a/aegisub/vfr.h +++ b/aegisub/vfr.h @@ -46,6 +46,7 @@ #include #include #include +#include /////////////////////// diff --git a/aegisub/video_box.cpp b/aegisub/video_box.cpp index 83ba5cff4..3f9e8906b 100644 --- a/aegisub/video_box.cpp +++ b/aegisub/video_box.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "video_box.h" #include "video_display.h" @@ -217,3 +218,4 @@ void VideoBox::OnToggleRealtime(wxCommandEvent &event) { Options.Save(); } + diff --git a/aegisub/video_box.h b/aegisub/video_box.h index 4691fd06f..3c0cfea85 100644 --- a/aegisub/video_box.h +++ b/aegisub/video_box.h @@ -40,7 +40,11 @@ /////////// // Headers #include +#include #include +#include +#include +#include ////////////// diff --git a/aegisub/video_context.cpp b/aegisub/video_context.cpp index c88670f3b..dc1136039 100644 --- a/aegisub/video_context.cpp +++ b/aegisub/video_context.cpp @@ -36,7 +36,7 @@ //////////// // Includes -#ifdef HAVE_APPLE_OPENGL_FRAMEWORK +#ifdef __APPLE__ #include #include #else @@ -290,7 +290,11 @@ void VideoContext::SetVideo(const wxString &filename) { #endif // Set GL context +#ifdef __WXMAC__ + GetGLContext(displayList.front())->SetCurrent(); +#else GetGLContext(displayList.front())->SetCurrent(*displayList.front()); +#endif // Choose a provider provider = VideoProviderFactory::GetProvider(filename,overFps); @@ -456,7 +460,12 @@ void VideoContext::JumpToTime(int ms,bool exact) { ////////////////// // Get GL context wxGLContext *VideoContext::GetGLContext(wxGLCanvas *canvas) { +#ifdef __WXMAC__ + // This is probably wrong... + if (!glContext) glContext = new wxGLContext(0, canvas, wxPalette(), 0); +#else if (!glContext) glContext = new wxGLContext(canvas); +#endif return glContext; } @@ -499,7 +508,11 @@ GLuint VideoContext::GetFrameAsTexture(int n) { lastFrame = n; // Set context +#ifdef __APPLE__ + GetGLContext(displayList.front())->SetCurrent(); +#else GetGLContext(displayList.front())->SetCurrent(*displayList.front()); +#endif glEnable(GL_TEXTURE_2D); if (glGetError() != 0) throw _T("Error enabling texture."); diff --git a/aegisub/video_context.h b/aegisub/video_context.h index 1a68b8e25..2a51e2ca8 100644 --- a/aegisub/video_context.h +++ b/aegisub/video_context.h @@ -42,16 +42,18 @@ #include #include #include +#include #ifndef wxUSE_GLCANVAS #error "Aegisub requires wxWidgets to be compiled with OpenGL support." #endif #include -#ifdef HAVE_APPLE_OPENGL_FRAMEWORK +#ifdef __APPLE__ #include #include #else #include #include +typedef GLuint GLhandleARB; #endif #include "video_frame.h" @@ -80,7 +82,7 @@ private: std::list displayList; GLuint lastTex; - GLuint yv12shader; + GLhandleARB yv12shader; int lastFrame; wxGLContext *glContext; VideoFrameFormat vidFormat; diff --git a/aegisub/video_display.cpp b/aegisub/video_display.cpp index fc01e4f31..9adedf55d 100644 --- a/aegisub/video_display.cpp +++ b/aegisub/video_display.cpp @@ -37,7 +37,7 @@ //////////// // Includes #include -#ifdef HAVE_APPLE_OPENGL_FRAMEWORK +#ifdef __APPLE__ #include #include #else @@ -112,7 +112,11 @@ int attribList[] = { WX_GL_RGBA , WX_GL_DOUBLEBUFFER, WX_GL_STENCIL_SIZE, 8, 0 } /////////////// // Constructor VideoDisplay::VideoDisplay(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) +#ifdef __WXMAC__ +: wxGLCanvas (parent, id, pos, size, style, name, attribList) +#else : wxGLCanvas (parent, id, attribList, pos, size, style, name) +#endif { // Set options box = NULL; @@ -173,7 +177,11 @@ void VideoDisplay::Render() { // Set GL context wxMutexLocker glLock(OpenGLWrapper::glMutex); +#ifdef __WXMAC__ + SetCurrent(); +#else SetCurrent(*context->GetGLContext(this)); +#endif // Get sizes int w,h,sw,sh,pw,ph; diff --git a/aegisub/video_display.h b/aegisub/video_display.h index 5e068d7d0..7cf2e7585 100644 --- a/aegisub/video_display.h +++ b/aegisub/video_display.h @@ -45,6 +45,7 @@ #endif #include #include +#include #include "video_context.h" @@ -119,3 +120,4 @@ public: DECLARE_EVENT_TABLE() }; + diff --git a/aegisub/video_frame.h b/aegisub/video_frame.h index 111ff2f6c..20971db1e 100644 --- a/aegisub/video_frame.h +++ b/aegisub/video_frame.h @@ -35,6 +35,7 @@ #pragma once +#include ////////////////////// diff --git a/aegisub/video_provider.h b/aegisub/video_provider.h index e0fe44def..66387df12 100644 --- a/aegisub/video_provider.h +++ b/aegisub/video_provider.h @@ -40,6 +40,7 @@ ////////// // Headers #include +#include #include "video_frame.h" #include "factory.h" diff --git a/aegisub/video_slider.h b/aegisub/video_slider.h index 83134103b..d9a5018d0 100644 --- a/aegisub/video_slider.h +++ b/aegisub/video_slider.h @@ -40,6 +40,7 @@ //////////// // Includes #include +#include //////////////////// diff --git a/aegisub/visual_tool.cpp b/aegisub/visual_tool.cpp index 2a92fb9ae..ef4c1c14a 100644 --- a/aegisub/visual_tool.cpp +++ b/aegisub/visual_tool.cpp @@ -37,7 +37,11 @@ ////////////// // Headers #include -#include +#ifdef __APPLE__ +#include +#else +#include +#endif #include #include "visual_tool.h" #include "video_display.h" @@ -671,3 +675,4 @@ void VisualToolEvent::OnButton(wxCommandEvent &event) { tool->OnButton(event); } + diff --git a/aegisub/visual_tool.h b/aegisub/visual_tool.h index 620704586..eeeb1d588 100644 --- a/aegisub/visual_tool.h +++ b/aegisub/visual_tool.h @@ -40,6 +40,7 @@ /////////// // Headers #include +#include #include "video_display.h" #include "gl_wrap.h" #include "visual_feature.h" @@ -149,3 +150,4 @@ public: virtual ~VisualTool(); }; + diff --git a/aegisub/visual_tool_clip.cpp b/aegisub/visual_tool_clip.cpp index 2ba7de1ed..de3f4bb1a 100644 --- a/aegisub/visual_tool_clip.cpp +++ b/aegisub/visual_tool_clip.cpp @@ -34,9 +34,6 @@ // -#pragma once - - /////////// // Headers #include "visual_tool_clip.h" diff --git a/aegisub/visual_tool_cross.cpp b/aegisub/visual_tool_cross.cpp index 0c305c4b5..8cf835ee3 100644 --- a/aegisub/visual_tool_cross.cpp +++ b/aegisub/visual_tool_cross.cpp @@ -34,9 +34,6 @@ // -#pragma once - - /////////// // Headers #include "visual_tool_cross.h" diff --git a/aegisub/visual_tool_drag.cpp b/aegisub/visual_tool_drag.cpp index 12b24a804..1b29254cf 100644 --- a/aegisub/visual_tool_drag.cpp +++ b/aegisub/visual_tool_drag.cpp @@ -34,9 +34,6 @@ // -#pragma once - - /////////// // Headers #include "visual_tool_drag.h" diff --git a/aegisub/visual_tool_drag.h b/aegisub/visual_tool_drag.h index 22512ba5c..488e15c50 100644 --- a/aegisub/visual_tool_drag.h +++ b/aegisub/visual_tool_drag.h @@ -39,6 +39,8 @@ /////////// // Headers +#include +#include #include "visual_tool.h" diff --git a/aegisub/visual_tool_rotatexy.cpp b/aegisub/visual_tool_rotatexy.cpp index ef5c7c17b..b2ecadd1b 100644 --- a/aegisub/visual_tool_rotatexy.cpp +++ b/aegisub/visual_tool_rotatexy.cpp @@ -34,9 +34,6 @@ // -#pragma once - - /////////// // Headers #include "visual_tool_rotatexy.h" diff --git a/aegisub/visual_tool_rotatez.cpp b/aegisub/visual_tool_rotatez.cpp index dd3b91157..43c97245a 100644 --- a/aegisub/visual_tool_rotatez.cpp +++ b/aegisub/visual_tool_rotatez.cpp @@ -34,9 +34,6 @@ // -#pragma once - - /////////// // Headers #include "visual_tool_rotatez.h" diff --git a/aegisub/visual_tool_scale.cpp b/aegisub/visual_tool_scale.cpp index 9f38260e2..20c0c9999 100644 --- a/aegisub/visual_tool_scale.cpp +++ b/aegisub/visual_tool_scale.cpp @@ -34,9 +34,6 @@ // -#pragma once - - /////////// // Headers #include "visual_tool_scale.h" diff --git a/aegisub/visual_tool_vector_clip.h b/aegisub/visual_tool_vector_clip.h index 9ba4cae2d..4ab82ddc2 100644 --- a/aegisub/visual_tool_vector_clip.h +++ b/aegisub/visual_tool_vector_clip.h @@ -39,6 +39,7 @@ /////////// // Headers +#include #include "visual_tool.h" #include "spline.h"