[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Oldlibs transitions, and some old packages.



On Sat, Dec 29, 2007 at 11:41:24AM -0500, Barry deFreese wrote:
>>> <snip>
>>> - jugglemaster, first ever upload last month (!?)

>> He says this one needs several hours of work.


> Attached is a dpatch patch to build jugglemaster with wxgtk2.6.  
> Unfortunately it segfaults immediately for me.  I'm having some struggles 
> debugging it.  It may be something as stupid as I am wrapping a wxT() 
> somewhere I shouldn't be.

> I am CC'ing the games team and the Jugglemaster maintainer in case anyone 
> could provide some insight/assistance.

Attached is a revised patch that fixes two issues with the preceding:

- the segfault appears to be due to linking the binary wrongly - I don't
  know what wx-config --ld is supposed to be good for, but it's not good for
  specifying a linker command for applications, and once the app is linked
  with g++ instead of "g++ -shared -fPIC", it seems to run better
- wxString::Printf() expects the target of %s to be a wxChar* (i.e.,
  wchar_t*), not char*; so ascii strings need to be converted lest they be
  displayed as garbage.

I'm not sure why it's worthwhile to have both wxWidgets and Qt builds of
such an application as this anyway, but if someone really wants it, there
you are.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org
#! /bin/sh /usr/share/dpatch/dpatch-run
## 010_wx26_trans.dpatch by  <bdefreese@bddebian1>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Build with wx2.6

@DPATCH@
diff -urNad jugglemaster-0.4~/src/jmdlx/Makefile jugglemaster-0.4/src/jmdlx/Makefile
--- jugglemaster-0.4~/src/jmdlx/Makefile	2004-09-01 20:48:19.000000000 -0400
+++ jugglemaster-0.4/src/jmdlx/Makefile	2007-12-29 06:17:48.000000000 -0500
@@ -2,7 +2,6 @@
 
 CXXFLAGS+=-Wall -fsigned-char `wx-config --cppflags`
 # -ansi -pedantic cause warnings from some compilers [wx uses long long]
-LDFLAGS+=`wx-config --ldflags`
 # STATICFLAGS=-Wl,-Bstatic
 STATICFLAGS=-static
 LIBS+=`wx-config --libs`
diff -urNad jugglemaster-0.4~/src/jmdlx/advsite.cpp jugglemaster-0.4/src/jmdlx/advsite.cpp
--- jugglemaster-0.4~/src/jmdlx/advsite.cpp	2004-09-01 20:48:19.000000000 -0400
+++ jugglemaster-0.4/src/jmdlx/advsite.cpp	2007-12-29 06:17:48.000000000 -0500
@@ -25,7 +25,7 @@
 END_EVENT_TABLE()
 
 AdvancedSiteSwap::AdvancedSiteSwap(wxWindow *p, JMLib *j)
-	: wxDialog(p, -1, "New SiteSwap",
+	: wxDialog(p, -1, wxT("New SiteSwap"),
 			wxDefaultPosition, wxDefaultSize,
 			wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {
 
@@ -35,8 +35,8 @@
   int i;
  // SiteSwap
   wxBoxSizer *siteswapsizer = new wxBoxSizer(wxHORIZONTAL);
-  newsiteswap = new wxTextCtrl(this,-1,jmlib->getSite());
-  siteswapsizer->Add(new wxStaticText(this, 0, "Enter New Siteswap"),
+  newsiteswap = new wxTextCtrl(this,-1,wxString(jmlib->getSite(), wxConvUTF8));
+  siteswapsizer->Add(new wxStaticText(this, 0, wxT("Enter New Siteswap")),
 					0,
 					wxALIGN_CENTER_VERTICAL|wxALL,
 					5);
@@ -53,12 +53,12 @@
   newstyle = new wxChoice ( this,-1,wxDefaultPosition, wxDefaultSize);
 
   for(i=0;i<jmlib->numStyles();i++) {
-        newstyle->Append(style_list[i]);
+        newstyle->Append(wxString(style_list[i], wxConvUTF8));
   }
   
   newstyle->SetSelection(0);
 
-  stylesizer->Add(new wxStaticText(this, 0, "Style"),
+  stylesizer->Add(new wxStaticText(this, 0, wxT("Style")),
 					0,
 					wxALIGN_CENTER_VERTICAL|wxALL,
 					5);
@@ -80,7 +80,7 @@
 					(int)(HR_MIN * 100.0F),
 					(int)(HR_MAX * 100.0F),
 					(int)(jmlib->getHR() * 100.0F));
-  hrdrsizer->Add(new wxStaticText(this, 0, "Height Ratio %"),
+  hrdrsizer->Add(new wxStaticText(this, 0, wxT("Height Ratio %")),
 				1,
 				wxALIGN_RIGHT|wxALL,
 				5);
@@ -99,7 +99,7 @@
 					(int)(DR_MIN*100.0F),
 					(int)(DR_MAX*100.0F),
 					(int)(jmlib->getDR() * 100.0F));
-  hrdrsizer->Add(new wxStaticText(this, 0, "Dwell Ratio %"),
+  hrdrsizer->Add(new wxStaticText(this, 0, wxT("Dwell Ratio %")),
 				1,
 				wxALIGN_CENTRE|wxALL,
 				5);
@@ -110,9 +110,9 @@
 
  // Buttons
 
-  wxButton *ok = new wxButton(this, wxID_OK, "OK");
-  wxButton *apply = new wxButton(this, wxID_APPLY, "Apply");
-  wxButton *cancel = new wxButton(this, wxID_CANCEL, "Cancel");
+  wxButton *ok = new wxButton(this, wxID_OK, wxT("OK"));
+  wxButton *apply = new wxButton(this, wxID_APPLY, wxT("Apply"));
+  wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("Cancel"));
   wxBoxSizer *buttonsizer = new wxBoxSizer(wxHORIZONTAL);
   buttonsizer->Add(ok, 1, wxALIGN_CENTRE|wxALL, 5);
   buttonsizer->Add(apply, 1, wxALIGN_CENTRE|wxALL, 5);
@@ -141,14 +141,14 @@
   JML_FLOAT dr = (JML_FLOAT)drspinner->GetValue()/100.0F;
 
   jmlib->stopJuggle();
-  jmlib->setPattern("Something",(JML_CHAR *)(const char *)newpattern, hr, dr);
-  jmlib->setStyle((JML_CHAR *)(const char *)style);
+  jmlib->setPattern("Something",(JML_CHAR *)(const char *)newpattern.mb_str(wxConvUTF8), hr, dr);
+  jmlib->setStyle((JML_CHAR *)(const char *)style.mb_str(wxConvUTF8));
   jmlib->startJuggle();
   haschanged=0;
 }
 
 void AdvancedSiteSwap::OnApply(wxCommandEvent &WXUNUSED(event)) {
-	if(haschanged || newstyle->GetStringSelection()=="Random") {
+	if(haschanged || newstyle->GetStringSelection()==wxT("Random")) {
 		ApplySettings();
 	}
 }
diff -urNad jugglemaster-0.4~/src/jmdlx/choosepatt.cpp jugglemaster-0.4/src/jmdlx/choosepatt.cpp
--- jugglemaster-0.4~/src/jmdlx/choosepatt.cpp	2004-09-01 20:48:19.000000000 -0400
+++ jugglemaster-0.4/src/jmdlx/choosepatt.cpp	2007-12-29 06:17:48.000000000 -0500
@@ -25,7 +25,7 @@
 END_EVENT_TABLE()
 
 ChoosePatt::ChoosePatt(wxWindow *parent, JMLib *j, PatternLoader *p)
-	: wxDialog(parent, -1, "Choose Pattern",
+	: wxDialog(parent, -1, wxT("Choose Pattern"),
 			wxDefaultPosition, wxDefaultSize,
 			wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {
 
@@ -43,7 +43,7 @@
                                 wxDefaultSize);
   const char *curr_sect;
   for(curr_sect = patterns->GetFirstSection(); curr_sect ; curr_sect=patterns->GetNextSection()) {
-        sectionChoice->Append(curr_sect);
+        sectionChoice->Append(wxString(curr_sect, wxConvUTF8));
   }
   sectionChoice->SetSelection(0);
 
@@ -66,34 +66,34 @@
   choicesizer->Add(patternListBox,1,wxALIGN_CENTER|wxEXPAND|wxALL,5);
 
   wxBoxSizer *showSitesizer = new wxBoxSizer(wxHORIZONTAL);
-  showSitesizer->Add(new wxStaticText(this, 0, "Site"),
+  showSitesizer->Add(new wxStaticText(this, 0, wxT("Site")),
                                         0,
                                         wxALIGN_CENTER_VERTICAL|wxALL,
                                         3);
 
   showSite = new wxTextCtrl(this, -1,
-				jmlib->getSite(),
+				wxString(jmlib->getSite(), wxConvUTF8),
 				wxDefaultPosition,
 				wxDefaultSize,
 				wxTE_READONLY);
   showSitesizer->Add(showSite, 1, wxALIGN_CENTRE|wxEXPAND|wxALL, 3);
 
   wxBoxSizer *showStylesizer = new wxBoxSizer(wxHORIZONTAL);
-  showStylesizer->Add(new wxStaticText(this, 0, "Style"),
+  showStylesizer->Add(new wxStaticText(this, 0, wxT("Style")),
                                         0,
                                         wxALIGN_CENTER_VERTICAL|wxALL,
                                         3);
   showStyle = new wxTextCtrl(this, -1,
-				jmlib->getStyle(),
+				wxString(jmlib->getStyle(), wxConvUTF8),
 				wxDefaultPosition,
 				wxDefaultSize,
 				wxTE_READONLY);
   showStylesizer->Add(showStyle, 1, wxALIGN_CENTRE|wxEXPAND|wxALL, 3);
 
 
-  wxButton *ok = new wxButton(this, wxID_OK, "OK");
-  wxButton *apply = new wxButton(this, wxID_APPLY, "Apply");
-  wxButton *cancel = new wxButton(this, wxID_CANCEL, "Cancel");
+  wxButton *ok = new wxButton(this, wxID_OK, wxT("OK"));
+  wxButton *apply = new wxButton(this, wxID_APPLY, wxT("Apply"));
+  wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("Cancel"));
   wxBoxSizer *buttonsizer = new wxBoxSizer(wxHORIZONTAL);
   buttonsizer->Add(ok, 1, wxALIGN_CENTRE|wxALL, 5);
   buttonsizer->Add(apply, 1, wxALIGN_CENTRE|wxALL, 5);
@@ -127,7 +127,7 @@
 	if(!newSection || !newPattern) {
 		return;
 	}
-	patt = patterns->GetPattern((const char *)newSection,(const char *)newPattern);
+	patt = patterns->GetPattern((const char *)newSection.mb_str(wxConvUTF8),(const char *)newPattern.mb_str(wxConvUTF8));
 	jmlib->stopJuggle();
 	jmlib->setPattern((JML_CHAR *)Patt_GetName(patt),(JML_CHAR *)Patt_GetData(patt), Patt_GetHR(patt), Patt_GetDR(patt));
 	JML_UINT8 style_length = patterns->GetStyleLength(Patt_GetStyle(patt));
@@ -148,10 +148,10 @@
 
 	newPattern = patternListBox->GetStringSelection();
 	newSection = sectionChoice->GetStringSelection();
-	patt = patterns->GetPattern((const char *)newSection,(const char *)newPattern);
+	patt = patterns->GetPattern((const char *)newSection.mb_str(wxConvUTF8),(const char *)newPattern.mb_str(wxConvUTF8));
 
-	showStyle->SetValue(Patt_GetStyle(patt));
-	showSite->SetValue(Patt_GetData(patt));
+	showStyle->SetValue(wxString(Patt_GetStyle(patt), wxConvUTF8));
+	showSite->SetValue(wxString(Patt_GetData(patt), wxConvUTF8));
 }
 
 void ChoosePatt::OnApply(wxCommandEvent &WXUNUSED(event)) {
@@ -184,11 +184,11 @@
 
 void ChoosePatt::SectionChange() {
 	wxString newSection=sectionChoice->GetStringSelection();
-	patterns->SetSection((const char *)newSection);
+	patterns->SetSection((const char *)newSection.mb_str(wxConvUTF8));
 	patternListBox->Clear();
 	const char *curr_patt;
 	while ((curr_patt = patterns->GetNextPatternName())) {
-		patternListBox->Append(curr_patt);
+		patternListBox->Append(wxString(curr_patt, wxConvUTF8));
 	}
 	haschanged=1;
 }
diff -urNad jugglemaster-0.4~/src/jmdlx/choosestyle.cpp jugglemaster-0.4/src/jmdlx/choosestyle.cpp
--- jugglemaster-0.4~/src/jmdlx/choosestyle.cpp	2004-09-01 20:48:19.000000000 -0400
+++ jugglemaster-0.4/src/jmdlx/choosestyle.cpp	2007-12-29 06:17:48.000000000 -0500
@@ -22,7 +22,7 @@
 END_EVENT_TABLE()
 
 ChooseStyle::ChooseStyle(wxWindow *parent, JMLib *j)
-	: wxDialog(parent, -1, "Change Style",
+	: wxDialog(parent, -1, wxT("Change Style"),
 			wxDefaultPosition, wxDefaultSize,
 			wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {
 
@@ -35,16 +35,16 @@
   stylechoice = new wxChoice ( this,-1,wxDefaultPosition, wxDefaultSize);
 
   for(i=0;i<jmlib->numStyles();i++) {
-	stylechoice->Append(style_list[i]);
+	stylechoice->Append(wxString(style_list[i], wxConvUTF8));
   }
 
   stylechoice->SetSelection(0);
 
  // Buttons
 
-  wxButton *ok = new wxButton(this, wxID_OK, "OK");
-  wxButton *apply = new wxButton(this, wxID_APPLY, "Apply");
-  wxButton *cancel = new wxButton(this, wxID_CANCEL, "Cancel");
+  wxButton *ok = new wxButton(this, wxID_OK, wxT("OK"));
+  wxButton *apply = new wxButton(this, wxID_APPLY, wxT("Apply"));
+  wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("Cancel"));
   wxBoxSizer *buttonsizer = new wxBoxSizer(wxHORIZONTAL);
   buttonsizer->Add(ok, 1, wxALIGN_CENTRE|wxALL, 5);
   buttonsizer->Add(apply, 1, wxALIGN_CENTRE|wxALL, 5);
@@ -67,7 +67,7 @@
 void ChooseStyle::ApplySettings() {
   JML_CHAR *newstyle;
 
-  newstyle = (JML_CHAR *)(const char *)stylechoice->GetStringSelection();
+  newstyle = (JML_CHAR *)(const char *)stylechoice->GetStringSelection().mb_str(wxConvUTF8);
   jmlib->setStyle(newstyle);
 }
 
diff -urNad jugglemaster-0.4~/src/jmdlx/choosestyle.h jugglemaster-0.4/src/jmdlx/choosestyle.h
--- jugglemaster-0.4~/src/jmdlx/choosestyle.h	2004-09-01 20:48:19.000000000 -0400
+++ jugglemaster-0.4/src/jmdlx/choosestyle.h	2007-12-29 06:17:48.000000000 -0500
@@ -21,12 +21,12 @@
 #include "../jmlib/jmlib.h"
 #include "jmdlx.h"
 
-const wxString possible_styles[] = {   "Normal",
-                              "Mills Mess",
-                              "Windmill",
-                              "Reverse",
-                              "Shower",
-                              "Center"
+const wxString possible_styles[] = {   wxT("Normal"),
+                              wxT("Mills Mess"),
+                              wxT("Windmill"),
+                              wxT("Reverse"),
+                              wxT("Shower"),
+                              wxT("Center")
                                 };
 
 
diff -urNad jugglemaster-0.4~/src/jmdlx/jmdlx.cpp jugglemaster-0.4/src/jmdlx/jmdlx.cpp
--- jugglemaster-0.4~/src/jmdlx/jmdlx.cpp	2004-09-01 20:48:19.000000000 -0400
+++ jugglemaster-0.4/src/jmdlx/jmdlx.cpp	2007-12-29 06:17:48.000000000 -0500
@@ -26,7 +26,7 @@
   windowx = min(480,wxGetDisplaySize().x);
   windowy = min(400,wxGetDisplaySize().y);
 
-	frame = new JMFrame(NULL, -1, "JuggleMaster Deluxe", wxDefaultPosition, wxSize(windowx,windowy));
+	frame = new JMFrame(NULL, -1, wxT("JuggleMaster Deluxe"), wxDefaultPosition, wxSize(windowx,windowy));
 
   // Set the frame as the top window (this ensures that the application is closed
   // when the frame is closed
@@ -34,28 +34,28 @@
 
 
   wxCmdLineParser cmdline(cmdLineDesc, argc, argv);
-  cmdline.SetLogo("JuggleMaster Deluxe");
+  cmdline.SetLogo(wxT("JuggleMaster Deluxe"));
   
   if(cmdline.Parse() == -1) {
 	exit(0);
   }
   wxString initialsiteswap,initialstyle,named_pattern,semaphore;
 
-  if(cmdline.Found("help")) {
+  if(cmdline.Found(wxT("help"))) {
 	cmdline.Usage();
 	printf("\n Style can be anything in the \"Change Style\" menu, eg \"Mills Mess\"\n");
 	exit(0);
   }
-  if(cmdline.Found("style",&initialstyle)) {
+  if(cmdline.Found(wxT("style"),&initialstyle)) {
 	frame->setStyle(&initialstyle);
   }
-  if(cmdline.Found("pattern",&named_pattern)) {
+  if(cmdline.Found(wxT("pattern"),&named_pattern)) {
 	/* FIXME */
-	printf("Named Pattern: %s\n",(const char *)named_pattern);
+	printf("Named Pattern: %s\n",(const char *)named_pattern.mb_str(wxConvUTF8));
   }
-  if(cmdline.Found("semaphore",&semaphore)) {
+  if(cmdline.Found(wxT("semaphore"),&semaphore)) {
 	/* FIXME */
-	printf("Semaphore Requested: %s\n",(const char *)semaphore);
+	printf("Semaphore Requested: %s\n",(const char *)semaphore.mb_str(wxConvUTF8));
   }
   if (cmdline.GetParamCount() > 0) {
     initialsiteswap = cmdline.GetParam(0);
@@ -114,43 +114,43 @@
 JMFrame::JMFrame(wxWindow* parent, wxWindowID id, const wxString& title,
                        const wxPoint& pos, const wxSize& size) :
                        wxFrame(parent,id,title,pos,size) {
-	SetIcon(wxIcon("IDI_WIZICON"));
+	SetIcon(wxIcon(wxT("IDI_WIZICON")));
 
   fileMenu = new wxMenu();
   optionsMenu = new wxMenu();
   helpMenu = new wxMenu();
   speedMenu = new wxMenu();
 
-  fileMenu->Append(CHANGE_SITESWAP_S, "Change &SiteSwap (Simple)");
-  fileMenu->Append(CHANGE_SITESWAP_A, "Change SiteSwap (Advanced)");
+  fileMenu->Append(CHANGE_SITESWAP_S, wxT("Change &SiteSwap (Simple)"));
+  fileMenu->Append(CHANGE_SITESWAP_A, wxT("Change SiteSwap (Advanced)"));
   fileMenu->AppendSeparator();
-  fileMenu->Append(CHANGE_STYLE_S, "Change S&tyle");
+  fileMenu->Append(CHANGE_STYLE_S, wxT("Change S&tyle"));
   fileMenu->AppendSeparator();
-  fileMenu->Append(CHOOSE_PATTERN, "Choose P&attern");
-  fileMenu->Append(CHOOSE_SEMAPHORE, "Show Se&maphore");
+  fileMenu->Append(CHOOSE_PATTERN, wxT("Choose P&attern"));
+  fileMenu->Append(CHOOSE_SEMAPHORE, wxT("Show Se&maphore"));
   fileMenu->AppendSeparator();
-  fileMenu->Append(PRINT_PS, "&Print...");
+  fileMenu->Append(PRINT_PS, wxT("&Print..."));
   fileMenu->AppendSeparator();
-  fileMenu->Append(ID_EXIT, "E&xit");
+  fileMenu->Append(ID_EXIT, wxT("E&xit"));
 
-  optionsMenu->AppendCheckItem(OPTION_MIRROR, "&Mirror");
-  optionsMenu->AppendCheckItem(OPTION_PAUSE, "&Pause");
-  optionsMenu->AppendCheckItem(OPTION_COLORBALLS, "&Color Balls");
-  optionsMenu->Append(OPTION_REDOWNLOAD, "Re&Download Patterns");
+  optionsMenu->AppendCheckItem(OPTION_MIRROR, wxT("&Mirror"));
+  optionsMenu->AppendCheckItem(OPTION_PAUSE, wxT("&Pause"));
+  optionsMenu->AppendCheckItem(OPTION_COLORBALLS, wxT("&Color Balls"));
+  optionsMenu->Append(OPTION_REDOWNLOAD, wxT("Re&Download Patterns"));
 
-  speedMenu->Append(SPEED_UP,"&Up");
-  speedMenu->Append(SPEED_DOWN,"&Down");
-  speedMenu->Append(SPEED_RESET,"&Reset");
+  speedMenu->Append(SPEED_UP,wxT("&Up"));
+  speedMenu->Append(SPEED_DOWN,wxT("&Down"));
+  speedMenu->Append(SPEED_RESET,wxT("&Reset"));
 
-  helpMenu->Append(ID_ABOUT, "&About");
+  helpMenu->Append(ID_ABOUT, wxT("&About"));
 
   // The menu bar
   wxMenuBar* menuBar = new wxMenuBar();
 
-  menuBar->Append(fileMenu, "&File");
-  menuBar->Append(optionsMenu, "&Options");
-  menuBar->Append(speedMenu, "&Speed");
-  menuBar->Append(helpMenu, "&Help");
+  menuBar->Append(fileMenu, wxT("&File"));
+  menuBar->Append(optionsMenu, wxT("&Options"));
+  menuBar->Append(speedMenu, wxT("&Speed"));
+  menuBar->Append(helpMenu, wxT("&Help"));
   SetMenuBar(menuBar);
 
   // Initialize jmlib
@@ -180,7 +180,7 @@
 }
 
 void JMFrame::OnAbout(wxCommandEvent &WXUNUSED(event)) {
-	wxMessageBox("(C) Ken Matsuoka 1995-6, Per Johan Groland 2002, Gary Briggs 2003", "About JMDeluxe", wxOK, this);
+	wxMessageBox(wxT("(C) Ken Matsuoka 1995-6, Per Johan Groland 2002, Gary Briggs 2003"), wxT("About JMDeluxe"), wxOK, this);
 }
 
 void JMFrame::changeMirror(wxCommandEvent& WXUNUSED(event)) {
@@ -208,25 +208,25 @@
 }
 
 void JMFrame::setSiteSwap(wxString *newsite) {
-  jmlib->setPattern("Something",(JML_CHAR *)(const char *)*newsite,HR_DEF, DR_DEF);
+  jmlib->setPattern("Something",(JML_CHAR *)(const char *)*newsite->mb_str(wxConvUTF8),HR_DEF, DR_DEF);
 }
 
 void JMFrame::setStyle(wxString *newstyle) {
-  jmlib->setStyle((JML_CHAR *)(const char *)*newstyle);
+  jmlib->setStyle((JML_CHAR *)(const char *)*newstyle->mb_str(wxConvUTF8));
 }
 
 void JMFrame::changeSiteSwap(wxCommandEvent& WXUNUSED(event))
 {
   JML_CHAR *newpattern;
   wxTextEntryDialog dialog(this,
-                           "Change SiteSwap",
-                           "Please Enter SiteSwap Here",
-			   jmlib->getSite(),
+                           _("Change SiteSwap"),
+                           _("Please Enter SiteSwap Here"),
+			   wxString(jmlib->getSite(), wxConvUTF8),
                            wxOK | wxCANCEL | wxCENTRE);
 
   if (dialog.ShowModal() == wxID_OK)
   {
-	newpattern = (JML_CHAR *)(const char *)dialog.GetValue();
+	newpattern = (JML_CHAR *)(const char *)dialog.GetValue().mb_str(wxConvUTF8);
         jmlib->stopJuggle();
 	jmlib->setPattern("Something",newpattern,HR_DEF, DR_DEF);
         jmlib->setStyleDefault();
@@ -248,7 +248,7 @@
 		return;
 	}
   }
-  wxMessageDialog *popup = new wxMessageDialog(this, "No Patterns Loaded!", "Error", wxOK|wxICON_ERROR);
+  wxMessageDialog *popup = new wxMessageDialog(this, wxT("No Patterns Loaded!"), wxT("Error"), wxOK|wxICON_ERROR);
   popup->ShowModal();
 }
 
@@ -260,7 +260,7 @@
 		return;
 	}
   }
-  wxMessageDialog *popup = new wxMessageDialog(this, "No Semaphores Loaded!", "Error", wxOK|wxICON_ERROR);
+  wxMessageDialog *popup = new wxMessageDialog(this, wxT("No Semaphores Loaded!"), wxT("Error"), wxOK|wxICON_ERROR);
   popup->ShowModal();
 }
 
@@ -292,8 +292,8 @@
 void JMFrame::ErrorCallBack(void *aUData, JML_CHAR *aErrMsg) {
   /* Massive thanks go to Colin Bayer for his teaching me how this works */
   wxString error_message;
-  error_message = aErrMsg;
-  wxMessageDialog *message = new wxMessageDialog((JMFrame *)aUData, error_message, "Error", wxOK|wxICON_ERROR);
+  error_message = wxString(aErrMsg, wxConvUTF8);
+  wxMessageDialog *message = new wxMessageDialog((JMFrame *)aUData, error_message, wxT("Error"), wxOK|wxICON_ERROR);
   message->ShowModal();
 }
 
@@ -376,7 +376,9 @@
     dc.DrawEllipse(jmlib->b[i].gx, jmlib->b[i].gy, diam, diam);
   }
   wxString balltext;
-  balltext.Printf("Site: %s    Style: %s    Balls: %i",jmlib->getSite(),jmlib->getStyle(),jmlib->balln);
+  balltext.Printf(wxT("Site: %s    Style: %s    Balls: %i"),
+                  wxString(jmlib->getSite(),wxConvUTF8).c_str(),
+                  wxString(jmlib->getStyle(),wxConvUTF8).c_str(),jmlib->balln);
   dc.DrawText(balltext, 10, 10);
 
   // flip
diff -urNad jugglemaster-0.4~/src/jmdlx/jmdlx.h jugglemaster-0.4/src/jmdlx/jmdlx.h
--- jugglemaster-0.4~/src/jmdlx/jmdlx.h	2004-09-01 20:48:19.000000000 -0400
+++ jugglemaster-0.4/src/jmdlx/jmdlx.h	2007-12-29 06:17:48.000000000 -0500
@@ -92,11 +92,11 @@
 
 static const wxCmdLineEntryDesc cmdLineDesc[] =
 {
-    { wxCMD_LINE_SWITCH, "h", "help", "help" },
-    { wxCMD_LINE_OPTION, "p", "pattern", "named pattern", wxCMD_LINE_VAL_STRING},
-    { wxCMD_LINE_OPTION, "s", "style", "style", wxCMD_LINE_VAL_STRING },
-    { wxCMD_LINE_OPTION, "m", "semaphore", "semaphore", wxCMD_LINE_VAL_STRING },
-    { wxCMD_LINE_PARAM,  NULL, NULL, "siteswap", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL},
+    { wxCMD_LINE_SWITCH, wxT("h"), wxT("help"), wxT("help") },
+    { wxCMD_LINE_OPTION, wxT("p"), wxT("pattern"), wxT("named pattern"), wxCMD_LINE_VAL_STRING},
+    { wxCMD_LINE_OPTION, wxT("s"), wxT("style"), wxT("style"), wxCMD_LINE_VAL_STRING },
+    { wxCMD_LINE_OPTION, wxT("m"), wxT("semaphore"), wxT("semaphore"), wxCMD_LINE_VAL_STRING },
+    { wxCMD_LINE_PARAM,  NULL, NULL, wxT("siteswap"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL},
     { wxCMD_LINE_NONE }
 };
 
diff -urNad jugglemaster-0.4~/src/jmdlx/newsemaphore.cpp jugglemaster-0.4/src/jmdlx/newsemaphore.cpp
--- jugglemaster-0.4~/src/jmdlx/newsemaphore.cpp	2007-12-29 06:16:15.000000000 -0500
+++ jugglemaster-0.4/src/jmdlx/newsemaphore.cpp	2007-12-29 06:17:48.000000000 -0500
@@ -22,18 +22,18 @@
 END_EVENT_TABLE()
 
 ChooseSemaphore::ChooseSemaphore(wxWindow *parent, JMLib *j, PatternLoader *s)
-	: wxDialog(parent, -1, "Show Semaphore",
+	: wxDialog(parent, -1, wxT("Show Semaphore"),
 			wxDefaultPosition, wxDefaultSize,
 			wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {
 
   jmlib = j;
   semaphores = s;
 
-  newsemaphore = new wxTextCtrl(this,-1,jmlib->getStyle(),wxDefaultPosition,wxDefaultSize);
+  newsemaphore = new wxTextCtrl(this,-1,wxString(jmlib->getStyle(), wxConvUTF8),wxDefaultPosition,wxDefaultSize);
 
-  wxButton *ok = new wxButton(this, wxID_OK, "OK");
-  wxButton *apply = new wxButton(this, wxID_APPLY, "Apply");
-  wxButton *cancel = new wxButton(this, wxID_CANCEL, "Cancel");
+  wxButton *ok = new wxButton(this, wxID_OK, wxT("OK"));
+  wxButton *apply = new wxButton(this, wxID_APPLY, wxT("Apply"));
+  wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("Cancel"));
   wxBoxSizer *buttonsizer = new wxBoxSizer(wxHORIZONTAL);
   buttonsizer->Add(ok, 1, wxALIGN_CENTRE|wxALL, 5);
   buttonsizer->Add(apply, 1, wxALIGN_CENTRE|wxALL, 5);
@@ -62,14 +62,14 @@
 	newvalue = newsemaphore->GetValue();
 	newvalue.MakeLower();
 	if(newvalue.Last() != ' ') {
-		newvalue.Append(" ");
+		newvalue.Append(wxT(" "));
 	}
 
 	for(unsigned int i=0; i < newvalue.Length(); i++) {
 		current_letter = newvalue.Mid(i,1);
 		// current_style_length  =  semaphores->GetStyleLength(current_letter);
-		if(current_letter == " ") {
-			current_letter="break";
+		if(current_letter == wxT(" ")) {
+			current_letter=wxT("break");
 		} else if (current_letter.IsNumber()) {
 			current_index = style_len;
 			style_len += semaphores->GetStyleLength("numeral");
@@ -83,51 +83,51 @@
 			ascii stuff isn't safe in unicode or similar. */
 			switch((int)value) {
 				case 1:
-					current_letter="a";
+					current_letter=wxT("a");
 					break;
 				case 2:
-					current_letter="b";
+					current_letter=wxT("b");
 					break;
 				case 3:
-					current_letter="c";
+					current_letter=wxT("c");
 					break;
 				case 4:
-					current_letter="d";
+					current_letter=wxT("d");
 					break;
 				case 5:
-					current_letter="e";
+					current_letter=wxT("e");
 					break;
 				case 6:
-					current_letter="f";
+					current_letter=wxT("f");
 					break;
 				case 7:
-					current_letter="g";
+					current_letter=wxT("g");
 					break;
 				case 8:
-					current_letter="h";
+					current_letter=wxT("h");
 					break;
 				case 9:
-					current_letter="i";
+					current_letter=wxT("i");
 					break;
 				case 0:
-					current_letter="j";
+					current_letter=wxT("j");
 					break;
 				default:
-					current_letter="break";
+					current_letter=wxT("break");
 					break;
 			}
 		}
 		current_index = style_len;
-		style_len += semaphores->GetStyleLength(current_letter);
+		style_len += semaphores->GetStyleLength(current_letter.mb_str(wxConvUTF8));
 		current_style = (JML_INT8 *)realloc((void *)current_style,(size_t)sizeof(JML_INT8)*style_len);
-		memcpy((void *)(current_style+current_index),(void *)semaphores->GetStyle(current_letter),semaphores->GetStyleLength(current_letter)*sizeof(JML_INT8));
+		memcpy((void *)(current_style+current_index),(void *)semaphores->GetStyle(current_letter.mb_str(wxConvUTF8)),semaphores->GetStyleLength(current_letter.mb_str(wxConvUTF8))*sizeof(JML_INT8));
 	}
 
 	newvalue = newsemaphore->GetValue();
 	if(current_style) {
 		jmlib->stopJuggle();
 		jmlib->setPattern((JML_CHAR *)"Semaphore","(2,2)",HR_DEF,DR_DEF);
-		jmlib->setStyle((JML_CHAR *)(const char *)newvalue,style_len/4,current_style);
+		jmlib->setStyle((JML_CHAR *)(const char *)newvalue.mb_str(wxConvUTF8),style_len/4,current_style);
 		jmlib->startJuggle();
 	}
 	free(current_style);
diff -urNad jugglemaster-0.4~/src/jmdlx/patt.cpp jugglemaster-0.4/src/jmdlx/patt.cpp
--- jugglemaster-0.4~/src/jmdlx/patt.cpp	2007-12-29 06:16:15.000000000 -0500
+++ jugglemaster-0.4/src/jmdlx/patt.cpp	2007-12-29 06:17:48.000000000 -0500
@@ -75,41 +75,41 @@
 	snprintf(usr_filename, 255, "/usr/share/jugglemaster/%s", filename);
 
 	if(targetfilename.Len() > 0) {
-		targetfilename += "/.jugglemaster/";
+		targetfilename += wxT("/.jugglemaster/");
 		if(!wxDirExists(targetfilename)) {
 			if(!wxMkdir(targetfilename,0755)) {
-				targetfilename = "";
+				targetfilename = wxT("");
 			}
 		}
-		targetfilename += filename;
+		targetfilename += wxString(filename, wxConvUTF8);
 	} else {
-		targetfilename = filename;
+		targetfilename = wxString(filename, wxConvUTF8);
 	}
 
-	if(stat((const char *)targetfilename,&buf) != -1 && !redownload) {
-		patternfile = fopen((const char *)targetfilename,"r");
+	if(stat((const char *)targetfilename.mb_str(wxConvUTF8),&buf) != -1 && !redownload) {
+		patternfile = fopen((const char *)(targetfilename.mb_str(wxConvUTF8)),"r");
 		return(patternfile != NULL);
 	} else if(stat(filename,&buf) != -1 && !redownload) {
-		wxCopyFile(filename,targetfilename);
-		patternfile = fopen((const char *)targetfilename,"r");
+		wxCopyFile(wxString(filename, wxConvUTF8),targetfilename);
+		patternfile = fopen((const char *)(targetfilename.mb_str(wxConvUTF8)),"r");
 		return(patternfile != NULL);
 	} else if(stat(usr_filename, &buf) != -1 && !redownload) {
 		patternfile = fopen(usr_filename, "r");
 		return (patternfile != NULL);
 	} else {
-		wxString fullurl(WEB_PREFIX);
+		wxString fullurl(WEB_PREFIX, wxConvUTF8);
 		wxString proxy;
 		wxString message;
-		fullurl.Append(filename);
-		message.Printf("Downloading File: %s\n",(const char *)fullurl);
+		fullurl.Append(wxString(filename, wxConvUTF8));
+		message.Printf(wxT("Downloading File: %s\n"),(const char *)fullurl.c_str());
 		unsigned int current_progress = 0;
 		char buffer[1024];
 
 		wxURL url(fullurl);
 
-		if(wxGetEnv("http_proxy",&proxy)) {
-			if(proxy.Find("//") > -1) {
-				proxy = proxy.Mid(proxy.Find("//")+2);
+		if(wxGetEnv(wxT("http_proxy"),&proxy)) {
+			if(proxy.Find(wxT("//")) > -1) {
+				proxy = proxy.Mid(proxy.Find(wxT("//"))+2);
 			}
 			url.SetProxy(proxy);
 		}
@@ -119,7 +119,7 @@
 		// wxInputStream *data = url.GetInputStream(fullurl);
 
 		if ( data ) {
-			wxProgressDialog progress("Progress",message,(int)data->GetSize());
+			wxProgressDialog progress(wxT("Progress"),message,(int)data->GetSize());
 			wxFileOutputStream outputfile(targetfilename);
 			while(!data->Eof() && current_progress!=data->GetSize()) {
 				data->Read((void *)buffer,1024);
@@ -131,10 +131,10 @@
 			// printf("Downloading Done\n");
 			delete data;
 		} else {
-			wxMessageDialog errordlg(parent,"An error occured while downloading","Error",wxOK|wxICON_ERROR);
+			wxMessageDialog errordlg(parent,wxT("An error occured while downloading"),wxT("Error"),wxOK|wxICON_ERROR);
 			errordlg.ShowModal();
 		}
-		patternfile = fopen((const char *)targetfilename,"r");
+		patternfile = fopen((const char *)targetfilename.mb_str(wxConvUTF8),"r");
 		return(patternfile != NULL);
 	}
 }
diff -urNad jugglemaster-0.4~/src/jmdlx/print.cpp jugglemaster-0.4/src/jmdlx/print.cpp
--- jugglemaster-0.4~/src/jmdlx/print.cpp	2004-09-01 20:48:19.000000000 -0400
+++ jugglemaster-0.4/src/jmdlx/print.cpp	2007-12-29 06:17:48.000000000 -0500
@@ -34,7 +34,7 @@
 END_EVENT_TABLE()
 
 Print::Print(wxWindow *parent, JMLib *j)
-	: wxDialog(parent, -1, "Print",
+	: wxDialog(parent, -1, wxT("Print"),
 			wxDefaultPosition, wxDefaultSize,
 			wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {
 
@@ -44,8 +44,8 @@
 
   // Filename
 	wxBoxSizer *filenamesizer = new wxBoxSizer(wxHORIZONTAL);
-	filename = new wxTextCtrl(this,-1,jmlib->getPattName());
-	filenamesizer->Add(new wxStaticText(this, 0, "Filename"),
+	filename = new wxTextCtrl(this,-1,wxString(jmlib->getPattName(), wxConvUTF8));
+	filenamesizer->Add(new wxStaticText(this, 0, wxT("Filename")),
                                         0,
                                         wxALIGN_CENTER_VERTICAL|wxALL,
                                         5);
@@ -54,7 +54,7 @@
                         wxALIGN_CENTRE_VERTICAL|wxALL,
                         5);
 
-	filenamesizer->Add(new wxButton(this, CHOOSEFILE, "Choose File"),
+	filenamesizer->Add(new wxButton(this, CHOOSEFILE, wxT("Choose File")),
                         1,
                         wxALIGN_CENTRE_VERTICAL|wxALL,
                         5);
@@ -62,16 +62,16 @@
   // Output Type
 	wxBoxSizer *typesizer = new wxBoxSizer(wxHORIZONTAL);
 	output_type = new wxChoice(this,-1);
-	output_type->Append("Image");
-	output_type->Append("PostScript");
-	output_type->SetStringSelection("PostScript");
+	output_type->Append(wxT("Image"));
+	output_type->Append(wxT("PostScript"));
+	output_type->SetStringSelection(wxT("PostScript"));
 
 #ifdef HAVE_AVCODEC_H
 	output_type->Append("MPEG");
 	output_type->SetStringSelection("MPEG");
 #endif
 
-	typesizer->Add(new wxStaticText(this, 0, "Output Type"),
+	typesizer->Add(new wxStaticText(this, 0, wxT("Output Type")),
                                         0,
                                         wxALIGN_CENTER_VERTICAL|wxALL,
                                         5);
@@ -123,26 +123,26 @@
 				10000,
 				1000);
 
-	whdm->Add(new wxStaticText(this, 0, "Output Width"),
+	whdm->Add(new wxStaticText(this, 0, wxT("Output Width")),
 				1, wxALIGN_RIGHT|wxALL, 5);
 	whdm->Add(output_width,
 				1, wxALIGN_CENTRE|wxALL, 5);
-	whdm->Add(new wxStaticText(this, 0, "Output Height"),
+	whdm->Add(new wxStaticText(this, 0, wxT("Output Height")),
 				1, wxALIGN_RIGHT|wxALL, 5);
 	whdm->Add(output_height,
 				1, wxALIGN_CENTRE|wxALL, 5);
-	whdm->Add(new wxStaticText(this, 0, "Delay"),
+	whdm->Add(new wxStaticText(this, 0, wxT("Delay")),
 				1, wxALIGN_RIGHT|wxALL, 5);
 	whdm->Add(delay,
 				1, wxALIGN_CENTRE|wxALL, 5);
-	whdm->Add(new wxStaticText(this, 0, "Max Iterations"),
+	whdm->Add(new wxStaticText(this, 0, wxT("Max Iterations")),
 				1, wxALIGN_RIGHT|wxALL, 5);
 	whdm->Add(max_iterations,
 				1, wxALIGN_CENTRE|wxALL, 5);
 
   // Width, Height, Delay, Max Frames
-	wxButton *ok = new wxButton(this, wxID_OK, "OK");
-	wxButton *cancel = new wxButton(this, wxID_CANCEL, "Cancel");
+	wxButton *ok = new wxButton(this, wxID_OK, wxT("OK"));
+	wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("Cancel"));
 	wxBoxSizer *buttonsizer = new wxBoxSizer(wxHORIZONTAL);
 	buttonsizer->Add(ok, 1, wxALIGN_CENTRE|wxALL, 5);
 	buttonsizer->Add(cancel, 1, wxALIGN_CENTRE|wxALL, 5);
@@ -173,10 +173,10 @@
 	struct stat buf; /* for stat */
 	wxMessageDialog* message;
 
-	if(stat((const char *)filename->GetValue(),&buf) != -1) {
+	if(stat((const char *)filename->GetValue().mb_str(wxConvUTF8),&buf) != -1) {
 		message = new wxMessageDialog(this,
-			"File Already Exists! Overwrite?",
-			"Overwrite?",
+			wxT("File Already Exists! Overwrite?"),
+			wxT("Overwrite?"),
 			wxYES_NO|wxICON_EXCLAMATION);
 		if(message->ShowModal() != wxID_YES) {
 			delete outputfile;
@@ -197,23 +197,23 @@
 		for (i=0; i<400; i++) jmlib->doJuggle();
 	}
 
-	if (output_type->GetStringSelection() == "Image") {
+	if (output_type->GetStringSelection() == wxT("Image")) {
 		print_success = printImage();
 	}
 
-	if (output_type->GetStringSelection() == "PostScript") {
+	if (output_type->GetStringSelection() == wxT("PostScript")) {
 		print_success = printPS();
 	}
 
 #ifdef HAVE_AVCODEC_H
-	if (output_type->GetStringSelection() == "MPEG") {
+	if (output_type->GetStringSelection() == wxT("MPEG")) {
 		print_success = printMPEG();
 	}
 #endif
 
 	if(print_success != 0) {
 		wxMessageDialog message(this,
-				"Printing Aborted!", "Aborted",
+				wxT("Printing Aborted!"), wxT("Aborted"),
 				wxOK|wxICON_EXCLAMATION);
 		message.ShowModal();
 		wxRemoveFile(filename->GetValue());
@@ -233,8 +233,8 @@
 
 void Print::OnChooseFile(wxCommandEvent &WXUNUSED(event)) {
 	wxFileDialog filedialog(this, _("Choose a File to Print to"),
-		lastpath, "",
-		"All Files|*",
+		lastpath, wxT(""),
+		wxT("All Files|*"),
 		wxSAVE);
 
 	if(filedialog.ShowModal() != wxID_OK) return;
@@ -250,7 +250,7 @@
 
 
 int Print::printImage() {
-	wxDialog formatchooser(this, -1, "Choose Format",
+	wxDialog formatchooser(this, -1, wxT("Choose Format"),
 			wxDefaultPosition, wxDefaultSize,
 			wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER);
 
@@ -273,11 +273,11 @@
 		extn = handler->GetExtension();
 		/* Don't append if wx doesn't support writing */
 		if(extn.Len() > 0 &&
-			extn != "cur" && /* Silly format */
-			extn != "ico" && /* Silly format */
-			extn != "iff" && /* wx Doesn't support writing */
-			extn != "gif" && /* wx Doesn't support writing */
-			extn != "ani" /* wx Doesn't support writing */
+			extn != wxT("cur") && /* Silly format */
+			extn != wxT("ico") && /* Silly format */
+			extn != wxT("iff") && /* wx Doesn't support writing */
+			extn != wxT("gif") && /* wx Doesn't support writing */
+			extn != wxT("ani") /* wx Doesn't support writing */
 			) {
 			formatchoice->Append(handler->GetExtension(), (void *)handler);
 			if(extn == fileextn) {
@@ -289,14 +289,14 @@
 	}
 
 	if(formatfound == 0) {
-		int png_pos = formatchoice->FindString("png");
+		int png_pos = formatchoice->FindString(wxT("png"));
 		if(-1 != png_pos) formatchoice->SetSelection(png_pos);
 		else formatchoice->SetSelection(0);
 	}
 
 
-	wxButton *ok = new wxButton(&formatchooser, wxID_OK, "OK");
-	wxButton *cancel = new wxButton(&formatchooser, wxID_CANCEL, "Cancel");
+	wxButton *ok = new wxButton(&formatchooser, wxID_OK, wxT("OK"));
+	wxButton *cancel = new wxButton(&formatchooser, wxID_CANCEL, wxT("Cancel"));
 	wxBoxSizer *buttonsizer = new wxBoxSizer(wxHORIZONTAL);
 	buttonsizer->Add(ok, 1, wxALIGN_CENTRE|wxALL, 5);
 	buttonsizer->Add(cancel, 1, wxALIGN_CENTRE|wxALL, 5);
@@ -347,7 +347,7 @@
 				balls were when we started, and check
 				against it */
 
-	wxProgressDialog progress("Progress","Creating PostScript",
+	wxProgressDialog progress(wxT("Progress"),wxT("Creating PostScript"),
 		max_iterations->GetValue(), this,
 		wxPD_APP_MODAL|wxPD_CAN_ABORT);
 
@@ -362,7 +362,7 @@
 	ball* lhand = &(jmlib->lhand);
 	hand* handp = &(jmlib->handpoly);
 
-	outputfile = fopen((const char *)filename->GetValue(),"w");
+	outputfile = fopen((const char *)filename->GetValue().mb_str(wxConvUTF8),"w");
 	if(outputfile == NULL) return 1;
 
 	/* Some PS guff */
@@ -732,7 +732,7 @@
 		dc->DrawEllipse(j->b[i].gx, j->b[i].gy, diam, diam);
 	}
 	wxString balltext;
-	balltext.Printf("Site: %s    Style: %s    Balls: %i",j->getSite(),j->getStyle(),j->balln);
+	balltext.Printf(wxT("Site: %s    Style: %s    Balls: %i"),j->getSite(),j->getStyle(),j->balln);
 	dc->DrawText(balltext, 10, 10);
 
 }

Reply to: