1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898
|
Author: Barry deFreese <bddebian@comcast.net>
Description: Build with wx2.6
Forwarded: Chunky Kibbles <chunky@icculus.org>, Per Johan Groland <per@jugglemaster.net>
Last-Update: 2014-05-27
Index: jugglemaster-0.4/src/jmdlx/Makefile
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/Makefile 2004-09-02 02:48:19.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/Makefile 2014-05-27 21:17:33.000000000 +0200
@@ -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`
Index: jugglemaster-0.4/src/jmdlx/advsite.cpp
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/advsite.cpp 2004-09-02 02:48:19.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/advsite.cpp 2014-05-27 21:03:56.000000000 +0200
@@ -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();
}
}
Index: jugglemaster-0.4/src/jmdlx/choosepatt.cpp
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/choosepatt.cpp 2004-09-02 02:48:19.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/choosepatt.cpp 2014-05-27 21:03:56.000000000 +0200
@@ -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;
}
Index: jugglemaster-0.4/src/jmdlx/choosestyle.cpp
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/choosestyle.cpp 2004-09-02 02:48:19.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/choosestyle.cpp 2014-05-27 21:19:38.000000000 +0200
@@ -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);
@@ -65,10 +65,8 @@
}
void ChooseStyle::ApplySettings() {
- JML_CHAR *newstyle;
-
- newstyle = (JML_CHAR *)(const char *)stylechoice->GetStringSelection();
- jmlib->setStyle(newstyle);
+ wxString newstyle(stylechoice->GetStringSelection());
+ jmlib->setStyle((JML_CHAR *)(const char*)newstyle.mb_str(wxConvUTF8));
}
void ChooseStyle::OnApply(wxCommandEvent &WXUNUSED(event)) {
Index: jugglemaster-0.4/src/jmdlx/choosestyle.h
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/choosestyle.h 2004-09-02 02:48:19.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/choosestyle.h 2014-05-27 21:03:56.000000000 +0200
@@ -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")
};
Index: jugglemaster-0.4/src/jmdlx/jmdlx.cpp
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/jmdlx.cpp 2004-09-02 02:48:19.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/jmdlx.cpp 2014-05-27 21:17:28.000000000 +0200
@@ -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");
-
- speedMenu->Append(SPEED_UP,"&Up");
- speedMenu->Append(SPEED_DOWN,"&Down");
- speedMenu->Append(SPEED_RESET,"&Reset");
+ 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,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,26 @@
}
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();
+ wxWX2MBbuf newpatternwx = dialog.GetValue().mb_str(wxConvUTF8);
+ newpattern = (JML_CHAR *)(const char*)newpatternwx;
jmlib->stopJuggle();
jmlib->setPattern("Something",newpattern,HR_DEF, DR_DEF);
jmlib->setStyleDefault();
@@ -248,7 +249,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 +261,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 +293,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 +377,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
Index: jugglemaster-0.4/src/jmdlx/jmdlx.h
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/jmdlx.h 2004-09-02 02:48:19.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/jmdlx.h 2014-05-27 21:17:31.000000000 +0200
@@ -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 }
};
Index: jugglemaster-0.4/src/jmdlx/newsemaphore.cpp
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/newsemaphore.cpp 2014-05-27 21:03:56.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/newsemaphore.cpp 2014-05-27 21:03:56.000000000 +0200
@@ -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);
Index: jugglemaster-0.4/src/jmdlx/patt.cpp
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/patt.cpp 2014-05-27 21:03:56.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/patt.cpp 2014-05-27 21:03:56.000000000 +0200
@@ -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);
}
}
Index: jugglemaster-0.4/src/jmdlx/print.cpp
===================================================================
--- jugglemaster-0.4.orig/src/jmdlx/print.cpp 2004-09-02 02:48:19.000000000 +0200
+++ jugglemaster-0.4/src/jmdlx/print.cpp 2014-05-27 21:17:33.000000000 +0200
@@ -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);
}
|