initial Mac port; bumped version to 1.2.1.5

* fixes C++11 bug #221; patch by Roger Leigh
This commit is contained in:
Gerald Schmidt 2018-09-20 09:21:05 +02:00
parent 61ebd9c313
commit 25ab7a3604
24 changed files with 499 additions and 300 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.DS_Store
*.dmg
*.app
*.bz2

2
README
View File

@ -1,2 +0,0 @@

4
README.md Normal file
View File

@ -0,0 +1,4 @@
XML Copy Editor
===============
Fast, free, validating XML editor. As of version 1.2.1.5 available for Linux, Windows and Mac.

BIN
mac/Applications.lnk Executable file

Binary file not shown.

30
mac/Info.plist Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>xmlcopyeditor</string>
<key>CFBundleIconFile</key>
<string>xmlcopyeditor.icns</string>
<key>CFBundleIdentifier</key>
<string>net.sourceforge.xml-copy-editor</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>xmlc</string>
<key>CFBundleVersion</key>
<string>1.2.1.4</string>
<key>CFBundleShortVersionString</key>
<string>1.2.1</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleDisplayName</key>
<string>XML Copy Editor</string>
</dict>
</plist>

2
mac/InfoPlist.strings Normal file
View File

@ -0,0 +1,2 @@
"CFBundleDisplayName" = "XML Copy Editor";
"CFBundleName" = "XML Copy Editor";

35
mac/Makefile Normal file
View File

@ -0,0 +1,35 @@
build:
`wx-config --cxx --cxxflags --libs all` -I /usr/include -I /usr/local/include -I /usr/include/libxml2 -I ../src -lxml2 -lxslt -laspell.15 -lxerces-c -lpcre -o xmlcopyeditor ../src/*.cpp
bundle: Info.plist xmlcopyeditor version.plist InfoPlist.strings xmlcopyeditor.icns
SetFile -t APPL xmlcopyeditor
-mkdir xmlcopyeditor.app
-mkdir xmlcopyeditor.app/Contents
-mkdir xmlcopyeditor.app/Contents/MacOS
-mkdir xmlcopyeditor.app/Contents/Resources
-mkdir xmlcopyeditor.app/Contents/Resources/English.lproj
-mkdir xmlcopyeditor.app/Contents/SharedSupport
-mkdir xmlcopyeditor.app/Contents/Frameworks
cp Info.plist xmlcopyeditor.app/Contents/
cp version.plist xmlcopyeditor.app/Contents/
cp InfoPlist.strings xmlcopyeditor.app/Contents/Resources/English.lproj/
echo -n 'APPLxmlc' > xmlcopyeditor.app/Contents/PkgInfo
cp xmlcopyeditor xmlcopyeditor.app/Contents/MacOS/xmlcopyeditor
cp -R ../src/png xmlcopyeditor.app/Contents/SharedSupport/
cp -R ../src/catalog xmlcopyeditor.app/Contents/SharedSupport/
cp -R ../src/dtd xmlcopyeditor.app/Contents/SharedSupport/
cp -R ../src/help xmlcopyeditor.app/Contents/SharedSupport/
cp -R ../src/ico xmlcopyeditor.app/Contents/SharedSupport/
cp -R ../src/rng xmlcopyeditor.app/Contents/SharedSupport/
cp -R ../src/rulesets xmlcopyeditor.app/Contents/SharedSupport/
cp -R ../src/templates xmlcopyeditor.app/Contents/SharedSupport/
cp -R ../src/xpm xmlcopyeditor.app/Contents/SharedSupport/
cp -R ../src/xsl xmlcopyeditor.app/Contents/SharedSupport/
cp xmlcopyeditor.icns xmlcopyeditor.app/Contents/Resources/
for DYLIB in lib/libxml2.2 lib/libxslt.1 lib/libpcre.0 local/lib/libaspell.15 local/lib/libxerces-c-3.1; do BASENAME=`basename /usr/$${DYLIB}.dylib`; echo "relinking $${BASENAME}"; cp /usr/$${DYLIB}.dylib xmlcopyeditor.app/Contents/Frameworks/; install_name_tool -change /usr/$${DYLIB}.dylib @executable_path/../Frameworks/$${BASENAME} xmlcopyeditor.app/Contents/MacOS/xmlcopyeditor; done
dmg:
make -f Makefile.diskimage
clean:
rm -f xmlcopyeditor
rm -rf xmlcopyeditor.app/
make -f Makefile.diskimage clean
all: clean build bundle dmg

76
mac/Makefile.diskimage Normal file
View File

@ -0,0 +1,76 @@
#
# Build file for creating DMG files.
#
# The DMG packager looks for a template.dmg.bz2 for using as its
# DMG template. If it doesn't find one, it generates a clean one.
#
# If you create a DMG template, you should make one containing all
# the files listed in $(SOURCE_FILES) below, and arrange everything to suit
# your style. The contents of the files themselves does not matter, so
# they can be empty (they will be overwritten later).
#
# Remko Tronçon
# https://el-tramo.be
# Licensed under the MIT License. See COPYING for details.
################################################################################
# Customizable variables
################################################################################
NAME ?= xmlcopyeditor
VERSION ?= 1.2.1.5
SOURCE_DIR ?= .
SOURCE_FILES ?= xmlcopyeditor.app Applications.lnk
TEMPLATE_DMG ?= xmlcopyeditor.dmg
TEMPLATE_SIZE ?= 40m
################################################################################
# DMG building. No editing should be needed beyond this point.
################################################################################
MASTER_DMG=$(NAME)-$(VERSION).dmg
WC_DMG=wc.dmg
WC_DIR=wc
.PHONY: all
all: $(MASTER_DMG)
$(TEMPLATE_DMG): $(TEMPLATE_DMG).bz2
bunzip2 -k $<
$(TEMPLATE_DMG).bz2:
@echo
@echo --------------------- Generating empty template --------------------
mkdir template
hdiutil create -fs HFSX -layout SPUD -size $(TEMPLATE_SIZE) "$(TEMPLATE_DMG)" -srcfolder template -format UDRW -volname "$(NAME)" -quiet
rmdir template
bzip2 "$(TEMPLATE_DMG)"
@echo
$(WC_DMG): $(TEMPLATE_DMG)
cp $< $@
$(MASTER_DMG): $(WC_DMG) $(addprefix $(SOURCE_DIR)/,$(SOURCE_FILES))
@echo
@echo --------------------- Creating Disk Image --------------------
mkdir -p $(WC_DIR)
hdiutil attach "$(WC_DMG)" -noautoopen -quiet -mountpoint "$(WC_DIR)"
for i in $(SOURCE_FILES); do \
rm -rf "$(WC_DIR)/$$i"; \
ditto -rsrc "$(SOURCE_DIR)/$$i" "$(WC_DIR)/$$i"; \
done
#rm -f "$@"
#hdiutil create -srcfolder "$(WC_DIR)" -format UDZO -imagekey zlib-level=9 "$@" -volname "$(NAME) $(VERSION)" -scrub -quiet
WC_DEV=`hdiutil info | grep "$(WC_DIR)" | grep "Apple_HFS" | awk '{print $$1}'` && \
hdiutil detach $$WC_DEV -quiet -force
rm -f "$(MASTER_DMG)"
hdiutil convert "$(WC_DMG)" -quiet -format UDZO -imagekey zlib-level=9 -o "$@"
rm -rf $(WC_DIR)
@echo
.PHONY: clean
clean:
-rm -rf $(TEMPLATE_DMG) $(MASTER_DMG) $(WC_DMG) *.bz2 *.dmg

16
mac/version.plist Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildVersion</key>
<string>1</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>ProductBuildVersion</key>
<string>1.0</string>
<key>ProjectName</key>
<string>XML Copy Editor</string>
<key>SourceVersion</key>
<string>1000</string>
</dict>
</plist>

BIN
mac/xmlcopyeditor.icns Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -1,256 +1,256 @@
/* /*
* Copyright 2005-2007 Gerald Schmidt. * Copyright 2005-2007 Gerald Schmidt.
* *
* This file is part of Xml Copy Editor. * This file is part of Xml Copy Editor.
* *
* Xml Copy Editor is free software; you can redistribute it and/or * Xml Copy Editor is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* Xml Copy Editor is distributed in the hope that it will be useful, * Xml Copy Editor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Xml Copy Editor; if not, write to the Free Software * along with Xml Copy Editor; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "myipc.h" #include "myipc.h"
#include "xmlcopyeditor.h" #include "xmlcopyeditor.h"
#include "pathresolver.h" #include "pathresolver.h"
#ifdef HAVE_GTK2 #ifdef HAVE_GTK2
#include <gtk/gtk.h> #include <gtk/gtk.h>
guint32 XTimeNow() guint32 XTimeNow()
{ {
struct timespec ts; struct timespec ts;
clock_gettime ( CLOCK_MONOTONIC, &ts ); clock_gettime ( CLOCK_MONOTONIC, &ts );
return ts.tv_sec * 1000 + ts.tv_nsec / 1000000; return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
} }
#endif // HAVE_GTK2 #endif // HAVE_GTK2
MyServerConnection *server_connection = 0; MyServerConnection *server_connection = 0;
MyClientConnection *client_connection = 0; MyClientConnection *client_connection = 0;
wxConnectionBase *MyServer::OnAcceptConnection ( const wxString& topic ) wxConnectionBase *MyServer::OnAcceptConnection ( const wxString& topic )
{ {
if ( topic == IPC_TOPIC ) if ( topic == IPC_TOPIC )
return new MyServerConnection(); return new MyServerConnection();
// unknown topic // unknown topic
return NULL; return NULL;
} }
MyServerConnection::MyServerConnection() MyServerConnection::MyServerConnection()
: wxConnection() : wxConnection()
, mFrameWnd ( ( wxIntPtr ) NULL ) , mFrameWnd ( 0 )
{ {
server_connection = this; server_connection = this;
} }
MyServerConnection::~MyServerConnection() MyServerConnection::~MyServerConnection()
{ {
if ( server_connection ) if ( server_connection )
{ {
server_connection = NULL; server_connection = NULL;
} }
} }
bool MyServerConnection::OnPoke ( bool MyServerConnection::OnPoke (
const wxString& WXUNUSED ( topic ) const wxString& WXUNUSED ( topic )
, const wxString& item , const wxString& item
, IPCData *data , IPCData *data
, IPCSize_t size , IPCSize_t size
, wxIPCFormat WXUNUSED ( format ) , wxIPCFormat WXUNUSED ( format )
) )
{ {
if ( !wxTheApp ) if ( !wxTheApp )
return false; return false;
MyFrame *frame; MyFrame *frame;
frame = ( MyFrame * ) wxTheApp->GetTopWindow(); frame = ( MyFrame * ) wxTheApp->GetTopWindow();
if ( !frame ) if ( !frame )
return false; return false;
if ( item == ( wxString ) IPC_NO_FILE ) if ( item == ( wxString ) IPC_NO_FILE )
{ {
; ;
} }
else if ( frame->isOpen ( item ) ) else if ( frame->isOpen ( item ) )
{ {
if ( frame->activateTab ( item ) ) if ( frame->activateTab ( item ) )
frame->reloadTab(); frame->reloadTab();
} }
else else
{ {
#if wxCHECK_VERSION(2,9,0) #if wxCHECK_VERSION(2,9,0)
wxCommandEvent event ( wxEVT_MENU, wxID_OPEN ); wxCommandEvent event ( wxEVT_MENU, wxID_OPEN );
#else #else
wxCommandEvent event ( wxEVT_COMMAND_MENU_SELECTED, wxID_OPEN ); wxCommandEvent event ( wxEVT_COMMAND_MENU_SELECTED, wxID_OPEN );
#endif #endif
event.SetString ( item ); event.SetString ( item );
wxPostEvent ( frame->GetEventHandler(), event ); wxPostEvent ( frame->GetEventHandler(), event );
//frame->addToFileQueue ( ( wxString& ) item ); // prevent event loop problems //frame->addToFileQueue ( ( wxString& ) item ); // prevent event loop problems
} }
#ifndef __WXMSW__ #ifndef __WXMSW__
#ifdef HAVE_GTK2 #ifdef HAVE_GTK2
// Processes mostly cannot raise their own windows. // Processes mostly cannot raise their own windows.
// http://osdir.com/ml/gnome.gaim.devel/2004-12/msg00077.html // http://osdir.com/ml/gnome.gaim.devel/2004-12/msg00077.html
GtkWidget *widget = frame->GetHandle(); GtkWidget *widget = frame->GetHandle();
GdkWindow *window = gtk_widget_get_window ( widget ); GdkWindow *window = gtk_widget_get_window ( widget );
gdk_x11_window_set_user_time ( window, gdk_x11_window_set_user_time ( window,
//XTimeNow() ); // This works too. //XTimeNow() ); // This works too.
gdk_x11_get_server_time ( window ) ); gdk_x11_get_server_time ( window ) );
//gdk_window_show ( window ); //gdk_window_show ( window );
//gdk_window_raise ( window ); //gdk_window_raise ( window );
//gtk_window_present ( GTK_WINDOW ( widget ) ); //gtk_window_present ( GTK_WINDOW ( widget ) );
#endif // HAVE_GTK2 #endif // HAVE_GTK2
frame->Show(); frame->Show();
frame->Raise(); frame->Raise();
#endif // __WXMSW__ #endif // __WXMSW__
return true; return true;
} }
IPCData *MyServerConnection::OnRequest IPCData *MyServerConnection::OnRequest
( const wxString& WXUNUSED ( topic ) ( const wxString& WXUNUSED ( topic )
, const wxString& item , const wxString& item
, IPCSize_t *size , IPCSize_t *size
, wxIPCFormat WXUNUSED ( format ) /*= wxIPC_PRIVATE */ , wxIPCFormat WXUNUSED ( format ) /*= wxIPC_PRIVATE */
) )
{ {
if ( size == NULL ) if ( size == NULL )
return NULL; return NULL;
if ( item == IPC_FRAME_WND ) if ( item == IPC_FRAME_WND )
{ {
if ( !mFrameWnd ) if ( !mFrameWnd )
{ {
wxWindow *window = wxTheApp->GetTopWindow(); wxWindow *window = wxTheApp->GetTopWindow();
if ( window ) if ( window )
{ {
#ifdef HAVE_GTK2 #ifdef HAVE_GTK2
GtkWidget *wnd = window->GetHandle(); GtkWidget *wnd = window->GetHandle();
if ( wnd ) if ( wnd )
{ {
GdkWindow *gwnd = gtk_widget_get_window ( wnd ); GdkWindow *gwnd = gtk_widget_get_window ( wnd );
if ( gwnd ) if ( gwnd )
mFrameWnd = GDK_WINDOW_XID ( gwnd ); mFrameWnd = GDK_WINDOW_XID ( gwnd );
} }
#else #else
mFrameWnd = window->GetHandle(); mFrameWnd = window->GetHandle();
#endif #endif
} }
} }
*size = sizeof mFrameWnd; *size = sizeof mFrameWnd;
return ( IPCData * ) &mFrameWnd; return ( IPCData * ) &mFrameWnd;
} }
*size = 0; *size = 0;
return NULL; return NULL;
} }
bool MyServerConnection::OnStartAdvise ( const wxString& WXUNUSED ( topic ), bool MyServerConnection::OnStartAdvise ( const wxString& WXUNUSED ( topic ),
const wxString& WXUNUSED ( item ) ) const wxString& WXUNUSED ( item ) )
{ {
return true; return true;
} }
MyClientConnection::MyClientConnection() MyClientConnection::MyClientConnection()
{ {
} }
wxConnectionBase *MyClient::OnMakeConnection() wxConnectionBase *MyClient::OnMakeConnection()
{ {
return new MyClientConnection; return new MyClientConnection;
} }
bool MyClientConnection::OnAdvise ( bool MyClientConnection::OnAdvise (
const wxString& WXUNUSED ( topic ) const wxString& WXUNUSED ( topic )
, const wxString& WXUNUSED ( item ) , const wxString& WXUNUSED ( item )
, IPCData * WXUNUSED ( data ) , IPCData * WXUNUSED ( data )
, IPCSize_t WXUNUSED ( size ) , IPCSize_t WXUNUSED ( size )
, wxIPCFormat WXUNUSED ( format ) , wxIPCFormat WXUNUSED ( format )
) )
{ {
return true; return true;
} }
bool MyClientConnection::OnDisconnect() bool MyClientConnection::OnDisconnect()
{ {
client_connection = NULL; client_connection = NULL;
return wxConnection::OnDisconnect(); return wxConnection::OnDisconnect();
} }
MyServer::MyServer() MyServer::MyServer()
{ {
} }
MyClient::MyClient() MyClient::MyClient()
{ {
} }
bool MyClient::talkToServer ( int argc, const wxChar * const *argv ) bool MyClient::talkToServer ( int argc, const wxChar * const *argv )
{ {
MyClientConnection *connection = ( MyClientConnection * ) MyClientConnection *connection = ( MyClientConnection * )
MakeConnection ( _T ( "localhost" ), IPC_SERVICE, IPC_TOPIC ); MakeConnection ( _T ( "localhost" ), IPC_SERVICE, IPC_TOPIC );
if ( !connection || !connection->StartAdvise ( IPC_ADVISE_NAME ) ) if ( !connection || !connection->StartAdvise ( IPC_ADVISE_NAME ) )
return false; return false;
// Grab what we need before the server is too busy to response // Grab what we need before the server is too busy to response
IPCSize_t size; IPCSize_t size;
const void *data = connection->Request ( IPC_FRAME_WND, &size ); const void *data = connection->Request ( IPC_FRAME_WND, &size );
wxString argument; wxString argument;
// wxConnectionBase::Poke expects something other than NULL in debug // wxConnectionBase::Poke expects something other than NULL in debug
// version // version
static wxChar whatBuffer[] = _T ( "Data" ); static wxChar whatBuffer[] = _T ( "Data" );
const static size_t bufSize = sizeof ( whatBuffer ) - sizeof ( wxChar ); const static size_t bufSize = sizeof ( whatBuffer ) - sizeof ( wxChar );
if ( argc <= 1 ) if ( argc <= 1 )
{ {
connection->Poke ( IPC_NO_FILE, whatBuffer, bufSize ); connection->Poke ( IPC_NO_FILE, whatBuffer, bufSize );
} }
else for ( int i = 1; i < argc; i++ ) else for ( int i = 1; i < argc; i++ )
{ {
argument = argv[i]; argument = argv[i];
argument = PathResolver::run ( argument ); argument = PathResolver::run ( argument );
if ( ! connection->Poke ( argument, whatBuffer, bufSize ) ) if ( ! connection->Poke ( argument, whatBuffer, bufSize ) )
break; break;
} }
if ( !data ) if ( !data )
return false; return false;
// Bring the window to front // Bring the window to front
#ifdef __WXMSW__ #ifdef __WXMSW__
if ( size == sizeof ( HWND ) ) if ( size == sizeof ( HWND ) )
{ {
HWND hwnd = * ( const HWND * )data; HWND hwnd = * ( const HWND * )data;
if ( ::IsIconic ( hwnd ) ) if ( ::IsIconic ( hwnd ) )
::ShowWindow ( hwnd, SW_RESTORE ); ::ShowWindow ( hwnd, SW_RESTORE );
else else
::SetForegroundWindow ( hwnd ); ::SetForegroundWindow ( hwnd );
} }
#elif defined ( __WXGTK__x ) // It doesn't work #elif defined ( __WXGTK__x ) // It doesn't work
if ( size == sizeof ( GdkNativeWindow ) ) if ( size == sizeof ( GdkNativeWindow ) )
{ {
GdkNativeWindow xWnd = * ( GdkNativeWindow * ) data; GdkNativeWindow xWnd = * ( GdkNativeWindow * ) data;
GdkWindow *window = gdk_window_foreign_new ( xWnd ); GdkWindow *window = gdk_window_foreign_new ( xWnd );
if ( window ) if ( window )
{ {
gdk_x11_window_set_user_time ( window, gdk_x11_window_set_user_time ( window,
XTimeNow() ); XTimeNow() );
//gdk_x11_get_server_time ( window ) ); //gdk_x11_get_server_time ( window ) );
gdk_window_show ( window ); gdk_window_show ( window );
gdk_window_raise ( window ); gdk_window_raise ( window );
gdk_window_unref ( window ); gdk_window_unref ( window );
//GtkWidget *widget; //GtkWidget *widget;
//gdk_window_get_user_data(window, (void**)&widget); //gdk_window_get_user_data(window, (void**)&widget);
//printf ("widget: %p\n",widget); //printf ("widget: %p\n",widget);
//gtk_window_present ( GTK_WINDOW ( widget ) ); //gtk_window_present ( GTK_WINDOW ( widget ) );
} }
} }
#endif // __WXMSW__ #endif // __WXMSW__
return true; return true;
} }

View File

@ -66,6 +66,7 @@
#include <wx/wupdlock.h> #include <wx/wupdlock.h>
#include "dtd2schema.h" #include "dtd2schema.h"
#include "myipc.h" #include "myipc.h"
#include <wx/debug.h>
#ifdef NEWFINDREPLACE #ifdef NEWFINDREPLACE
#include "findreplacepanel.h" #include "findreplacepanel.h"
@ -225,6 +226,8 @@ MyApp::MyApp()
, config ( new wxFileConfig ( _T ( "xmlcopyeditor" ) ) ) , config ( new wxFileConfig ( _T ( "xmlcopyeditor" ) ) )
#endif #endif
{ {
wxDisableAsserts();
#if defined ( __WXGTK__ ) && !defined ( __WXDEBUG__ ) #if defined ( __WXGTK__ ) && !defined ( __WXDEBUG__ )
int fdnull = open ( "/dev/null", O_WRONLY, 0 ); int fdnull = open ( "/dev/null", O_WRONLY, 0 );
dup2 ( fdnull, STDERR_FILENO ); dup2 ( fdnull, STDERR_FILENO );
@ -657,9 +660,11 @@ MyFrame::MyFrame (
wxEmptyString, wxEmptyString,
this ) ), this ) ),
findDialog ( 0 ), findDialog ( 0 ),
#ifndef __WXMSW__ helpController ( new wxHtmlHelpController (
helpController ( new wxHtmlHelpController() ), #ifdef __WXOSX__
wxHF_CONTENTS | wxHF_INDEX | wxHF_SEARCH | wxHF_BOOKMARKS | wxHF_PRINT
#endif #endif
) ),
menuBar ( 0 ), menuBar ( 0 ),
toolBar ( 0 ), toolBar ( 0 ),
xmlMenu ( 0 ), xmlMenu ( 0 ),
@ -881,7 +886,7 @@ MyFrame::MyFrame (
// Initialize Xerces-C++ // Initialize Xerces-C++
WrapXerces::Init ( libxmlNetAccess ); WrapXerces::Init ( libxmlNetAccess );
#if _XERCES_VERSION >= 30100 #if _XERCES_VERSION >= 30100 && wxDEBUG_LEVEL > 0
if ( XMLPlatformUtils::fgSSE2ok if ( XMLPlatformUtils::fgSSE2ok
&& xercescSSE2Warning && xercescSSE2Warning
&& wxTheApp->argc == 1 ) && wxTheApp->argc == 1 )
@ -940,7 +945,13 @@ MyFrame::MyFrame (
stylePosition = aboutPosition = wxDefaultPosition; stylePosition = aboutPosition = wxDefaultPosition;
styleSize = wxSize ( 720, 540 ); styleSize = wxSize ( 720, 540 );
showTopBars ( toolbarVisible ); showTopBars (
#ifndef __WXOSX__
toolbarVisible
#else
false
#endif
);
long style = wxAUI_NB_TOP | long style = wxAUI_NB_TOP |
wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_SPLIT |
@ -5073,9 +5084,11 @@ wxMenuBar *MyFrame::getMenuBar()
_ ( "S&how Current Element Pane" ), _ ( "S&how Current Element Pane" ),
_ ( "Show Current Element Pane" ) ); _ ( "Show Current Element Pane" ) );
viewMenu->Check ( ID_LOCATION_PANE_VISIBLE, false ); viewMenu->Check ( ID_LOCATION_PANE_VISIBLE, false );
#ifndef __WXOSX__
viewMenu->AppendCheckItem ( viewMenu->AppendCheckItem (
ID_TOOLBAR_VISIBLE, _ ( "Sh&ow Toolbar" ), _ ( "Show Toolbar" ) ); ID_TOOLBAR_VISIBLE, _ ( "Sh&ow Toolbar" ), _ ( "Show Toolbar" ) );
viewMenu->Check ( ID_TOOLBAR_VISIBLE, toolbarVisible ); viewMenu->Check ( ID_TOOLBAR_VISIBLE, toolbarVisible );
#endif
viewMenu->Append ( ID_CLOSE_MESSAGE_PANE, viewMenu->Append ( ID_CLOSE_MESSAGE_PANE,
_ ( "C&lose Message Pane\tAlt+C" ), _ ( "Close Message Pane" ) ); _ ( "C&lose Message Pane\tAlt+C" ), _ ( "Close Message Pane" ) );
viewMenu->Append ( ID_CLOSE_FIND_REPLACE_PANE, viewMenu->Append ( ID_CLOSE_FIND_REPLACE_PANE,
@ -5429,6 +5442,7 @@ wxToolBar *MyFrame::getToolBar()
wxNullBitmap, wxNullBitmap,
wxITEM_NORMAL, wxITEM_NORMAL,
_ ( "Save" ) ); _ ( "Save" ) );
#ifndef __WXOSX__
toolBar->AddTool ( toolBar->AddTool (
ID_PRINT, ID_PRINT,
_ ( "Print" ), _ ( "Print" ),
@ -5464,7 +5478,6 @@ wxToolBar *MyFrame::getToolBar()
wxNullBitmap, wxNullBitmap,
wxITEM_NORMAL, wxITEM_NORMAL,
_ ( "Spelling" ) ); _ ( "Spelling" ) );
toolBar->AddCheckTool ( toolBar->AddCheckTool (
ID_PROTECT_TAGS, ID_PROTECT_TAGS,
_ ( "Lock Tags" ), _ ( "Lock Tags" ),
@ -5473,6 +5486,7 @@ wxToolBar *MyFrame::getToolBar()
_ ( "Lock Tags" ) ); _ ( "Lock Tags" ) );
toolBar->ToggleTool ( toolBar->ToggleTool (
ID_PROTECT_TAGS, protectTags ); ID_PROTECT_TAGS, protectTags );
#endif
toolBar->Realize(); toolBar->Realize();
return toolBar; return toolBar;
@ -5684,44 +5698,33 @@ void MyFrame::encodingMessage()
void MyFrame::updatePaths() void MyFrame::updatePaths()
{ {
ruleSetDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "rulesets" ); wxString sep = wxFileName::GetPathSeparator();
filterDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "filters" ); ruleSetDir = applicationDir + sep + _T ( "rulesets" );
templateDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "templates" ) + filterDir = applicationDir + sep + _T ( "filters" );
wxFileName::GetPathSeparator(); templateDir = applicationDir + sep + _T ( "templates" ) + sep;
binDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "bin" ) + binDir = applicationDir + sep + _T ( "bin" ) + sep;
wxFileName::GetPathSeparator(); helpDir = applicationDir + sep + _T ( "help" ) + sep;
helpDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "help" ) + rngDir = applicationDir + sep + _T ( "rng" ) + sep;
wxFileName::GetPathSeparator(); htmlDir = applicationDir + sep + _T ( "html" ) + sep;
rngDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "rng" ) + pngDir = applicationDir + sep + _T ( "png" ) + sep;
wxFileName::GetPathSeparator(); xpmDir = applicationDir + sep + _T ( "xpm" ) + sep;
htmlDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "html" ) + daisyDir = applicationDir + sep + _T ( "daisy" ) + sep;
wxFileName::GetPathSeparator();
pngDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "png" ) +
wxFileName::GetPathSeparator();
daisyDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "daisy" ) +
wxFileName::GetPathSeparator();
catalogPath = catalogPath =
applicationDir + wxFileName::GetPathSeparator() + _T ( "catalog" ) + applicationDir + sep + _T ( "catalog" ) + sep + _T ( "catalog" );
wxFileName::GetPathSeparator() + _T ( "catalog" );
xslDtdPath = xslDtdPath =
applicationDir + wxFileName::GetPathSeparator() + _T ( "dtd" ) + applicationDir + sep + _T ( "dtd" ) + sep + _T ( "xslt10.dtd" );
wxFileName::GetPathSeparator() + _T ( "xslt10.dtd" );
rssDtdPath = rssDtdPath =
applicationDir + wxFileName::GetPathSeparator() + _T ( "dtd" ) + applicationDir + sep + _T ( "dtd" ) + sep + _T ( "rss2.dtd" );
wxFileName::GetPathSeparator() + _T ( "rss2.dtd" );
xtmDtdPath = xtmDtdPath =
applicationDir + wxFileName::GetPathSeparator() + _T ( "dtd" ) + applicationDir + sep + _T ( "dtd" ) + sep + _T ( "xtm1.dtd" );
wxFileName::GetPathSeparator() + _T ( "xtm1.dtd" );
lzxDtdPath = lzxDtdPath =
applicationDir + wxFileName::GetPathSeparator() + _T ( "dtd" ) + applicationDir + sep + _T ( "dtd" ) + sep + _T ( "lzx.dtd" );
wxFileName::GetPathSeparator() + _T ( "lzx.dtd" );
xliffDtdPath = xliffDtdPath =
applicationDir + wxFileName::GetPathSeparator() + _T ( "dtd" ) + applicationDir + sep + _T ( "dtd" ) + sep + _T ( "xliff.dtd" );
wxFileName::GetPathSeparator() + _T ( "xliff.dtd" ); aspellDataPath = applicationDir + sep +
aspellDataPath = applicationDir + wxFileName::GetPathSeparator() + _T ( "aspell" ) + sep + _T ( "data" );
_T ( "aspell" ) + wxFileName::GetPathSeparator() + _T ( "data" ); aspellDictPath = applicationDir + sep +
aspellDictPath = applicationDir + wxFileName::GetPathSeparator() + _T ( "aspell" ) + sep + _T ( "dict" );
_T ( "aspell" ) + wxFileName::GetPathSeparator() + _T ( "dict" );
} }
void MyFrame::OnAssociate ( wxCommandEvent& event ) void MyFrame::OnAssociate ( wxCommandEvent& event )
@ -5966,11 +5969,34 @@ void MyFrame::loadBitmaps()
findBitmap = wxBITMAP ( stock_search_16 ); findBitmap = wxBITMAP ( stock_search_16 );
spelling16Bitmap = wxBITMAP ( stock_spellcheck_16 ); spelling16Bitmap = wxBITMAP ( stock_spellcheck_16 );
helpBitmap = wxBITMAP ( stock_help_16 ); helpBitmap = wxBITMAP ( stock_help_16 );
/*
#elif __WXOSX__
// toolbar icons
newBitmap.LoadFile ( xpmDir + _T ( "stock_new.xpm" ), wxBITMAP_TYPE_XPM );
openBitmap.LoadFile ( xpmDir + _T ( "stock_open.xpm" ), wxBITMAP_TYPE_XPM );
saveBitmap.LoadFile ( xpmDir + _T ( "stock_save.xpm" ), wxBITMAP_TYPE_XPM );
// menu icons
new16Bitmap = wxNullBitmap;
open16Bitmap = wxNullBitmap;
save16Bitmap = wxNullBitmap;
printPreviewBitmap = wxNullBitmap;
print16Bitmap = wxNullBitmap;
undo16Bitmap = wxNullBitmap;
redo16Bitmap = wxNullBitmap;
cutBitmap = wxNullBitmap;
copyBitmap = wxNullBitmap;
pasteBitmap = wxNullBitmap;
findBitmap = wxNullBitmap;
spelling16Bitmap = wxNullBitmap;
helpBitmap = wxNullBitmap;
*/
#else #else
// toolbar icons // toolbar icons
newBitmap = wxArtProvider::GetBitmap ( wxART_NEW, wxART_TOOLBAR ); newBitmap = wxArtProvider::GetBitmap ( wxART_NEW, wxART_TOOLBAR );
openBitmap = wxArtProvider::GetBitmap ( wxART_FILE_OPEN, wxART_TOOLBAR ); openBitmap = wxArtProvider::GetBitmap ( wxART_FILE_OPEN, wxART_TOOLBAR );
saveBitmap = wxArtProvider::GetBitmap ( wxART_FILE_SAVE, wxART_TOOLBAR ); saveBitmap = wxArtProvider::GetBitmap ( wxART_FILE_SAVE, wxART_TOOLBAR );
#ifndef __WXOSX__
printBitmap = wxArtProvider::GetBitmap ( wxART_PRINT, wxART_TOOLBAR ); printBitmap = wxArtProvider::GetBitmap ( wxART_PRINT, wxART_TOOLBAR );
spellingBitmap = wxArtProvider::GetBitmap ( _T ( "gtk-spell-check" ), wxART_TOOLBAR ); spellingBitmap = wxArtProvider::GetBitmap ( _T ( "gtk-spell-check" ), wxART_TOOLBAR );
@ -5979,6 +6005,7 @@ void MyFrame::loadBitmaps()
hyperlinkBitmap.LoadFile ( pngDir + _T ( "stock_hyperlink.png" ), wxBITMAP_TYPE_PNG ); hyperlinkBitmap.LoadFile ( pngDir + _T ( "stock_hyperlink.png" ), wxBITMAP_TYPE_PNG );
checkWellformedBitmap.LoadFile ( pngDir + _T ( "stock_calc-accept.png" ), wxBITMAP_TYPE_PNG ); checkWellformedBitmap.LoadFile ( pngDir + _T ( "stock_calc-accept.png" ), wxBITMAP_TYPE_PNG );
checkValidBitmap.LoadFile ( pngDir + _T ( "stock_calc-accept-green.png" ), wxBITMAP_TYPE_PNG ); checkValidBitmap.LoadFile ( pngDir + _T ( "stock_calc-accept-green.png" ), wxBITMAP_TYPE_PNG );
#endif
// menu icons // menu icons
new16Bitmap = wxNullBitmap; new16Bitmap = wxNullBitmap;

View File

@ -21,6 +21,12 @@
#ifndef XMLCOPYEDITOR_H #ifndef XMLCOPYEDITOR_H
#define XMLCOPYEDITOR_H #define XMLCOPYEDITOR_H
#define wxDEBUG_LEVEL 0
#ifdef __WXOSX__
#define wxMAC_USE_NATIVE_TOOLBAR 1
#endif
#define NEWFINDREPLACE 1 #define NEWFINDREPLACE 1
#include <wx/wx.h> #include <wx/wx.h>
@ -432,6 +438,7 @@ class MyFrame : public wxFrame
rngDir, rngDir,
htmlDir, htmlDir,
pngDir, pngDir,
xpmDir,
daisyDir, daisyDir,
xpathExpression, xpathExpression,
lastDtdPublic, lastDtdPublic,

View File

@ -175,8 +175,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,2,1,4 FILEVERSION 1,2,1,5
PRODUCTVERSION 1,2,1,4 PRODUCTVERSION 1,2,1,5
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -195,7 +195,7 @@ BEGIN
VALUE "FileDescription", "XML Copy Editor is a fast, free, validating XML editor" VALUE "FileDescription", "XML Copy Editor is a fast, free, validating XML editor"
VALUE "FileVersion", "" VALUE "FileVersion", ""
VALUE "InternalName", "xmlcopyeditor.exe" VALUE "InternalName", "xmlcopyeditor.exe"
VALUE "LegalCopyright", "Copyright (c) 2014 Gerald Schmidt" VALUE "LegalCopyright", "Copyright (c) 2018 Gerald Schmidt"
VALUE "OriginalFilename", "XmlCopyEditor.exe" VALUE "OriginalFilename", "XmlCopyEditor.exe"
VALUE "ProductName", "XML Copy Editor" VALUE "ProductName", "XML Copy Editor"
VALUE "ProductVersion", "" VALUE "ProductVersion", ""

View File

@ -24,7 +24,7 @@
#else #else
#define FILE_FILTER _("All files (*)|*|XML (*.xml)|*.xml|XHTML (*.html)|*.html|DTD (*.dtd)|*.dtd|XML Schema (*.xsd)|*.xsd|RELAX NG grammar (*.rng)|*.rng|XSL (*.xsl)|*.xsl") #define FILE_FILTER _("All files (*)|*|XML (*.xml)|*.xml|XHTML (*.html)|*.html|DTD (*.dtd)|*.dtd|XML Schema (*.xsd)|*.xsd|RELAX NG grammar (*.rng)|*.rng|XSL (*.xsl)|*.xsl")
#endif #endif
#define ABOUT_COPYRIGHT _("Copyright © 2005-2009 Gerald Schmidt <gnschmidt@users.sourceforge.net>") #define ABOUT_COPYRIGHT _("Copyright © 2005-2018 Gerald Schmidt <gnschmidt@users.sourceforge.net>")
#define ABOUT_DESCRIPTION _("\nXML Copy Editor is free software released under the GNU\nGeneral Public License.\n\nMany thanks are due to ") #define ABOUT_DESCRIPTION _("\nXML Copy Editor is free software released under the GNU\nGeneral Public License.\n\nMany thanks are due to ")
#define ABOUT_CONTRIBUTORS _T(\ #define ABOUT_CONTRIBUTORS _T(\
"Tim van Niekerk, Matt Smigielski,\n"\ "Tim van Niekerk, Matt Smigielski,\n"\
@ -52,7 +52,7 @@
"License along with this program; if not, write to the Free\n"\ "License along with this program; if not, write to the Free\n"\
"Software Foundation, Inc., 59 Temple Place, Suite 330,\n"\ "Software Foundation, Inc., 59 Temple Place, Suite 330,\n"\
"Boston, MA 02111-1307 USA.") "Boston, MA 02111-1307 USA.")
#define ABOUT_VERSION _T("1.2.1.4") #define ABOUT_VERSION _T("1.2.1.5")
#define XMLCE_VAR _T("XMLCE_VAR") #define XMLCE_VAR _T("XMLCE_VAR")
#ifdef __WXMSW__ #ifdef __WXMSW__