Closed Bug 66020 Opened 25 years ago Closed 24 years ago

add CJK/intl support to GtkEmbed

Categories

(Core :: Internationalization, defect)

All
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: bstell, Assigned: bstell)

References

Details

Attachments

(8 files)

we need someway to support non-latin1 display and non-latin1 applications in GtkEmbed. - need converters to convert CJK, etc. to Unicode - need ability to set default encoding (ie: a menu item) - need ability to set override encoding (ie: a menu item) - need abilit to set the font for a particular language
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.8
Depends on: 66584
missing i18n libs: libchardet.so required for meta-charset to work libucvcn.so required for Chinese libucvibm.so required for IBM encodings libucvja.so required for Japanese libucvko.so required for Korean libucvtw.so required for Chinese libucvtw2.so required for Chinese
these i18n libs need to be copied/symlinked into the mozilla/dist/Embed/components dir.
is there some way to select the converters we need (at build time? perhaps a built flag?) rather than dropping all of them in. gtkEmbed is a lightweight example of embedding and if clients use it to do any sizing info, it would be good if it didn't include extra libs.
The changes to Makefile.in, basebrowser-unix, and the new file basebrowserintl-unix allows a developer to control the installation of the intl converter libs. The change to nsEmbedAPI.cpp starts/stops the metacharset detection service.
what exactly does the metacharset service do?
it seems to me that the parser would know when to fire up the meta charset stuff; no?
the windows equivlant of this bug is http://bugzilla.mozilla.org/show_bug.cgi?id=66030
there is a long (not always technical) history to the design. a per document redesign would be nice.
I think there may be a better way to init this service. investigating.
in mozilla the metacharset service gets called at startup: Here is the stack when the metacharset gets started: main (nsAppRunner.cpp#1198) calls main1 at nsAppRunner.cpp#1272 main1 (nsAppRunner.cpp#811) calls nsAppShellService::Initialize at nsAppRunner.cpp#933 nsAppShellService::Initialize (nsAppShellService.cpp#123) calls NS_WITH_SERVICE(nsIMetaCharsetService,... at nsAppShellService.cpp#139
understood. doug and I are suggesting that this model is wrong though. isn't there some lower level event that occurs that would be a more appropriate tie in?
Isn't this bug is about: "a feature that works in mozilla does not work in embedding" If we want to request a redesign of how it gets done in mozilla shouldn't we open a separate bug?
bstell's right, this has morphed. I've opened up seperate bugs for the bigger problem: http://bugzilla.mozilla.org/show_bug.cgi?id=67576 http://bugzilla.mozilla.org/show_bug.cgi?id=67578
Depends on: 67576
I've made 67576 a blocker of this one. the changes in nsEmbedAPI.cpp put build time dependencies on low level services. embedAPI is for high level, app specific, necessities.
Target Milestone: mozilla0.8 → mozilla0.9
Depends on: 60117
No longer depends on: 60117
Changed QA Contact to andreasb@netscape.com for now.
QA Contact: teruko → andreasb
why 67576 is blocking this one ? IS this a meta tracking bug ? Can we do 67576 after moz 0.9 and finish other thing in this bug first ?
67576 blocks this because that needs to be done in order for observer registration to occur implicitly. The mods to nsEmbedAPI.cpp are invalid. You can't add random components to startup like this. 67576 could be removed as a blocker of this, if the charset service used our new (almost checked in) startup category. It's up to i18n which route they want to take, either 68720 blocks this, or 67576 blocks this.
Jud: Can you explain what the new startup category (2001-03-01 13:07) is? I am finishing up the blocker 67576; but I am not sure if I am covering your new stuff. Bug 67576 is simply to convert CharDet to use NS_GETMODULE(). Please let us know. :)
Got more info about thenew startup category. See http://lxr.mozilla.org/seamonkey/search?string=APPSTARTUP_CATEG
Above patch includes the patch for the blocker 67576. I am waiting for /sr= for 67576. If you like to see what the patch for this bug, here it is. (only few changes in nsCharDetModule.cpp and nsMetaCharsetObserver.cpp) This works great. I tested in winEmbed. Now it automatically registers the MetaCharsetDetector and it can display the www.netscape.com/ja correctly. ================ nsCharDetModule.cpp ======================================= +#include "nsIAppStartupNotifier.h" +#include "nsICategoryManager.h" +static NS_METHOD nsMetaCharsetObserverRegistrationProc(nsIComponentManager *aCompMgr, + nsIFile *aPath, + const char *registryLocation, + const char *componentType, + const nsModuleComponentInfo *info) +{ + nsresult rv; + nsCOMPtr<nsICategoryManager> + categoryManager(do_GetService("@mozilla.org/categorymanager;1", &rv)); + if (NS_SUCCEEDED(rv)) { + rv = categoryManager->AddCategoryEntry(APPSTARTUP_CATEGORY, "Meta Charset", + "service," NS_META_CHARSET_CONTRACTID, + PR_TRUE, PR_TRUE, + nsnull); + } + return rv; +} // Component Table static nsModuleComponentInfo components[] = { { "Meta Charset", NS_META_CHARSET_CID, NS_META_CHARSET_CONTRACTID, nsMetaCharsetObserverConstructor, - NULL, NULL}, + nsMetaCharsetObserverRegistrationProc, NULL}, { "Document Charset Info", NS_DOCUMENTCHARSETINFO_CID, NS_DOCUMENTCHARSETINFO_CONTRACTID, nsDocumentCharsetInfoConstructor, ======== nsMetaCharsetObserver.cpp =========================== NS_IMETHODIMP nsMetaCharsetObserver::Observe(nsISupports*, const PRUnichar*, const PRUnichar*) { - return NS_ERROR_NOT_IMPLEMENTED; + // "app_startup" category calles nsIObserver::Observe method when app/embed enumerates the members + return Start(); }
Could someone review the code? The patch for this bug only is fine with me. :) [ie. above changes in nsCharDetModule.cpp and nsMetaCharsetObserver.cpp] Valeski? Alecf?
thanks for switching to generic modules! my only request is that you use nsCOMPtrs instead of raw pointers, and remove uses of ReleaseService() as it's deprecated (and equivalent to NS_RELEASE())
Blocks: 67578
alecf: Thank you for your valuable comment. I've checked in the bug 67576 which includes your suggestions. (ie. use of nsCOMPtrs instead of raw pointers and remove ReleaseService()) I have attached a new patch to use the category manager. I am also going to remove the code from nsAppShellService::Initialize(). We don't need the code for nsIMetaCharsetService any longer. dougt,valeski: can any of you /r=? alecf: can you /sr=? Thanks
looks good to me. r=valeski.
this is great - I'm glad to see the junk removed from apprunner. my only request is that you make sure you're actually getting Observe() on the app-startup topic, so that in case someone has registered you for other topics, that you aren't called over and over
alecf: Is this good for check in? Can you /sr=? Thanks
sr=alecf
checked-in.
New checkin in 66030. (04/16/01 17:07) See comments. MetaCharset detector should also be enabled in gtkEmbed.
Changing QA contact back to teruko.
QA Contact: andreasb → teruko
Target Milestone: mozilla0.9 → mozilla0.9.1
You have to do the following: ===========Comment from 66030=========== Now the meta charset detector is in place, it is up to the embedder to include which language he/she likes to support. If he/she would like to support: -Japanese, copy components/ucvja.dll -korean, copy components/ucvko.dlland so on.
this has been fixed since at least march 23. I have inadvertantly been testing the same bits each day since then. marking fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
This was fixed while ago.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: