Author Topic: Unicode conversion (attention all devs)  (Read 85929 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Unicode conversion (attention all devs)
« on: August 04, 2005, 11:24:31 pm »
Attention all developers:

After RC1 was released, there have been lots of complains asking for the installation of Code::Blocks in Linux. And we all agree that we need to get Code::Blocks to compile with unicode support.

Therefore, in absence of the project administrator, i've taken the decision to halt current development and get Code::Blocks branch VERSION_1_0 to work with unicode.

The solution is easy: All operations with wxStrings (not char*'s) should have _("string") for strings to be displayed to the user, and _T("string") for strings used internally.

UPDATE: Please refer to http://www.wxwidgets.org/manuals/2.4.2/wx458.htm#unicode for more info. We need to watch out for char's (change to wxChar), too!

I've made a dir listing - the sdk and src subdirectories have about 100 .cpp files that we need to modify. 200 if we include the plugins.

The currently available co-developers with (at least partial) CVS access are:
byo, Ceniza, cyberkoa, mispunt, and me.

Since I don't have administrator access, I can't know which directories you guys have access to. So guys, those with write access to the SDK please modify the SDK. Those with access to plugins, modify their plugins accordingly.

I'M SETTING A DEADLINE OF 10 DAYS. (This means the conversion work should be completed before August 15)

After those 10 days, we will continue development as normally. Maybe later we'll do another conversion cycle and finish this off.

Those WITHOUT CVS access, please mail their patched files (zipped, please) to me (NOT thru sourceforge, that'd make an awful mess!)

So, before we start working, I need anyone willing to help to say which files he is to modify (non-cvs access people will work on the SDK).

I'll divide the conversion in the following groups of files:

group 0 - all files in the src/src subdirectory.
group 1 - from audodetectcompilers to cbeditorprintout
group 2 - cbproject to cbworkspace
group 3 - compileoptionsbase to compiletarget base
group 4 - configmanager to customvars
group 5 - devcpploader to editarraystringdlg
group 6 - editorbase to editormanager
group 7 - editpathdlg to findreplacebase
group 8 - globals to licenses
group 9 - macrosmanager to menuitemsmanager
group 10 - messagelog to messagemanager
group 11 - mscvc* - zieQ, you handle this one Edit: Oh, already did it, but you better check it.
group 12 - multiselectdlg to personalitymanager
group 13 - pipedprocess to printing_types
group 14 - project*
group 15 - replacedlg to simpletextlog
group 16 - templatemanager to xtra_res
plugins    - the plugins conform a group each (i.e. astyle, compiler, etc).

Before modifying any of the files (download them via CVS, either anonymous or standard), please post which group you're modifying.

So, let's get to work guys, we have one week!
« Last Edit: August 08, 2005, 12:50:48 am by rickg22 »

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: UNICODE: ATTENTION ALL DEVS
« Reply #1 on: August 04, 2005, 11:40:22 pm »
I will try to do something to group 0 when I am awake again.
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: UNICODE: ATTENTION ALL DEVS
« Reply #2 on: August 05, 2005, 12:45:19 am »
OK i will do groups 1 ...5 (autodetectcompilers ... editarraystringdlg)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: UNICODE: ATTENTION ALL DEVS
« Reply #3 on: August 05, 2005, 01:19:58 am »
Thanks! Don't forget to:

a) Compile to make sure everything works
b) mail me (or commit) the changes when you're done with each group.

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: UNICODE: ATTENTION ALL DEVS
« Reply #4 on: August 05, 2005, 02:23:38 am »
As main developer of wxSmith I'll take care of it ;). It won't be released before final C::B 1.0 but I think it's time to unicode wxSmith also.

I can additionally do groups 6-8 - will send them to rickg22 when done.


Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: UNICODE: ATTENTION ALL DEVS
« Reply #5 on: August 05, 2005, 03:07:37 am »
What do I do?! What do I do?!

Oh, nevermind, I'll convert the help_plugin :)

I should take care of the AStyle plugin too but I think I don't have write access there.

Anyway, I'll inform you this weekend.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: UNICODE: ATTENTION ALL DEVS
« Reply #6 on: August 05, 2005, 03:09:38 am »
Ceniza: You don't need write access, mail the changes to me :)

Anyway, I'll start with 9 and 10, followed by 12 and 13.

Update: Done.  :shock: wow, that was fast. Took me 2 hours and 10 minutes. Now I'm compiling and testing.
« Last Edit: August 05, 2005, 05:10:40 am by rickg22 »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: UNICODE: ATTENTION ALL DEVS
« Reply #7 on: August 05, 2005, 03:42:27 am »
Any doubts please post in this thread.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: UNICODE: ATTENTION ALL DEVS
« Reply #8 on: August 05, 2005, 04:07:31 am »
IMPORTANT!!!

XRCID and XRCCTRL macros must _NOT_ be converted! They're pre-converted already!

Quote
WRONG:   XRCCTRL(*this, _T("lblLabel"), wxStaticText)->SetLabel(label);

Quote
RIGHT:   XRCCTRL(*this, "lblLabel", wxStaticText)->SetLabel(label);

Also, be careful. Some of the strings already converted in C::B, use _( when they should be _T(.

Example:

Quote
WRONG: wxXmlResource::Get()->LoadDialog(this, parent, _("dlgGenericMultiSelect"));
dlgGenericMultiSelect is a reference to a resource. Therefore it must use _T instead.
Quote
RIGHT: wxXmlResource::Get()->LoadDialog(this, parent, _T("dlgGenericMultiSelect"));

And don't forget to test for single characters, too!

Quote
'c'

and
Quote
char

Hints: Use the search dialog  :roll: should be obvious by now. Search for "  and '  (single-file) and char (whole word, search in open files).

After replacing the strings in the file, make sure you search again and double-check <- THIS IS VERY IMPORTANT.
« Last Edit: August 05, 2005, 05:12:59 am by rickg22 »

Offline me22

  • Official tester
  • Multiple posting newcomer
  • ***
  • Posts: 53
    • TA Universe
Re: UNICODE: ATTENTION ALL DEVS
« Reply #9 on: August 05, 2005, 06:20:04 am »
Note: TinyXML needs to NOT be put in Unicode mode.  Use the wxString facilities for getting a wxString to a UTF-8 encoded char*.  Perhaps we can have some typedefs and parallel defines somewhere to make this easier?  perhaps wxString_from_tinyString function and tinyString_from_wxString inlines and a tiny_() and tiny_T() macro?

Something like the following in a global include, perhaps?
#define tinyxml_T(m) m
#define wxString_from_tinyXMLstring( s ) ( wxString( (s), wxConvUTF8 ) )
#define tinyXMLstring_from_wxString( s ) ( (s).mb_str(wxConvUTF8) )

[edit] Ok, I should have read closer before posting, the above was true as of 1.0-beta6, but perhaps less neccesary now? :|  I'll try and help out this weekend.
« Last Edit: August 05, 2005, 06:26:04 am by me22 »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: UNICODE: ATTENTION ALL DEVS
« Reply #10 on: August 05, 2005, 07:10:16 am »
Files which include tinyxml.h (or have "tixml" in them) and need to be modified VERY CAREFULLY:

editorlexerloader.* (group 6)
ibaseloader.* (group7)
projectlayoutloader.*  (i'm handling this one, and all group14 files)
projecttemplateloader.*
projectloader.*
msv7loader.* ( careful, zieQ!)
workspaceloader.* (group 16)
« Last Edit: August 05, 2005, 07:24:14 am by rickg22 »

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: UNICODE: ATTENTION ALL DEVS
« Reply #11 on: August 05, 2005, 08:10:13 am »
... get Code::Blocks branch VERSION_1_0 to work with unicode

You should TAG the current VERSION_1_0 branch in cvs before committing any unicode updates.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: UNICODE: ATTENTION ALL DEVS
« Reply #12 on: August 05, 2005, 11:22:41 am »
And don't forget to test for single characters, too!

have you changed all
Code
char
to
Code
wxChar
???

or how did you proceed with the char's ?

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: UNICODE: ATTENTION ALL DEVS
« Reply #13 on: August 05, 2005, 11:49:03 am »
Update, I can't do anything (sorry) I am going away this afternoon, and I don't have my official development pc here at home. So I need to compile wxWidgets first which take a lot of time, and then I have to get the cvs version of C::B. Sorry, but I can't do anything.
Next week I have my own computer again, but I don't have internet connection. I will try to do download the cvs version of codeblock and take it with me to that pc, but I doubt if I could find the time to do something...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: UNICODE: ATTENTION ALL DEVS
« Reply #14 on: August 05, 2005, 03:47:40 pm »
Nah, it's ok.

Oh yes, I searched the source code ant it appears there are no "char" types defined in the project, all are wxChar's (that's a good thing :) ).

Anyway, how are you guys doing in your progress?