Closed Bug 99509 Opened 24 years ago Closed 17 years ago

Clean-up GTK+ and Xlib gfx code

Categories

(Core :: XUL, enhancement)

All
Linux
enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: roland.mainz, Assigned: roland.mainz)

References

Details

Attachments

(2 files, 3 obsolete files)

I quoted this idea multiple times this month in various bugs that someone should clean-up the GTK+ and Xlib gfx code. Xlib is mainly "done" - now it's the time to pull over the improvements from Xlib gfx to GTK+ gfx code. This includes: - Use nsCOMPtr instead of manual refcounting - Use unique class names (to avoid StaticBuild issues and make LXR search more useable) - Use |const char *| instead of |char *| - Kill compiler warnings (both gcc and Sun Workshop) * more stuff...
Accepting bug...
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.5
Could you fix bug 97969 while you're cleaning up here?
dbaron: In theory yes... but my problem is that I do not know much about Mozilla's string code (--> "helpwanted"... or "hintswanted")... ;-(
Summary: Clean-up GTK+ and Xlib fontmetrics code → Clean-up GTK+ and Xlib gfx code
Attached patch Patch for 2001-09-08-08-trunk (obsolete) — Splinter Review
Comments: It may be usefull to read the reviewer/superreviewer comments in bug 90380 to understand this monster. Most of the code already exist in Xlib gfx code - this is only a port to GTK+ gfx code (except the parts which port from code from GTK+ --> Xlib gfx code...) ... The cleanup is little bit incomplete... but the current patch is already ~90k in size, other minor nits can be done later... dbaron, wanna do the r=, please ?
Keywords: patch, review
I don't really understand what this is doing: -NS_IMPL_ISUPPORTS1(nsDeviceContextGTK, nsIDeviceContext) - nsDeviceContextGTK::nsDeviceContextGTK() + : DeviceContextImpl() Why are we adding GTK to more places? I thought we were moving toward Xlib. Or are you trying to make the code match line for line. If so, to what advantage? -struct nsFontCharSetMap; -struct nsFontFamilyName; -struct nsFontPropertyName; +/* Prototype some structs */ +struct nsFontCharSetMapGTK; +struct nsFontFamilyNameGTK; +struct nsFontPropertyNameGTK; Minor nit: I would prefer to avoid using "my": - XChar2b _16bit_space; - _16bit_space.byte1 = 0; - _16bit_space.byte2 = ' '; + XChar2b my16bit_space; + my16bit_space.byte1 = 0; + my16bit_space.byte2 = ' ';
Roland: instead of adding xxxGTK what if we add a neutral tag like xxxXMoz (or even xxxX) so we can work toward the files being identical and then merged into a single file? Does anyone know exactly what the gfs/src/gtk version really needs from GTK?
> I don't really understand what this is doing: > > -NS_IMPL_ISUPPORTS1(nsDeviceContextGTK, nsIDeviceContext) > - > nsDeviceContextGTK::nsDeviceContextGTK() > + : DeviceContextImpl() Well... everything is already "done" by the superclass |DeviceContextImpl| - why should we replicate this here, too ? BTW: That code works prefectly in Xlib and Xprint stuff since eternity... > Why are we adding GTK to more places? I thought we were > moving toward Xlib. Or are you trying to make the code match line > for line. If so, to what advantage? > > -struct nsFontCharSetMap; > -struct nsFontFamilyName; > -struct nsFontPropertyName; > +/* Prototype some structs */ > +struct nsFontCharSetMapGTK; > +struct nsFontFamilyNameGTK; > +struct nsFontPropertyNameGTK; I want to have _unique_ class&struct names, even per toolkit. I had some problems as I started to reuse Xlib gfx code in Xprint module which screwed-up StaticBuild - I had to rename all classes and add the "Xlib" string to the names. This time I am doing the same for GTK+ side - to get other toolkits (Qt/Win/Photon) to do the same. At least it's usefull to get better search results from LXR and unstable.elemental (see http://unstable.elemental.com/mozilla/build/latest/mozilla/gfx/dox/classes.html) > Minor nit: I would prefer to avoid using "my": > > - XChar2b _16bit_space; > - _16bit_space.byte1 = 0; > - _16bit_space.byte2 = ' '; > + XChar2b my16bit_space; > + my16bit_space.byte1 = 0; > + my16bit_space.byte2 = ' '; Aww... why ? :-) > ------- Additional Comments From Brian Stell 2001-09-13 23:01 ------- > > Roland: instead of adding xxxGTK what if we add a neutral tag like xxxXMoz (or > even xxxX) so we can work toward the files being identical and then > merged into a single file? See comment above... > Does anyone know exactly what the gfs/src/gtk version really needs from > GTK? Nothing. Only the widget code (widget/src/) needs to be ported to plain Xlib, but thats less than a week of work (we have a working version in widget/src/xlib/ - except that the X Input method stuff is missing). But I won't start this discussion again... it just ends-up in a massive flame-war from the GDK/GTK+ people here...
Marking WONTFIX. I cannot work on Mozilla code for the next month thanks to endico.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → WONTFIX
Reopening. Whether or not gisburn is on IRC at the moment, this is something that should be done. Temporarily reassigning to myself.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
OKOK... got it. I can still do this thing - but I cannot give explanations via IRC not can I guide reviewers/superreviewers through the patch via IRC... ;-( More ToDO: - Port architectural changes in Xlib gfx code introduced in bug 87285 to GTK+ code (incl. comments for the font change stuff requested by kin) - Document the code. We should add more comments how the code works and use JavaDoc-style comments for the XPCOM-style interfaces (take a look at http://unstable.elemental.com/mozilla/build/latest/mozilla/gfx/dox/classes.html :-)
Comment on attachment 49290 [details] [diff] [review] Patch for 2001-09-08-08-trunk I am going to file a new patch after all my builds recompiled (~18-24h from now) ...
Attachment #49290 - Attachment is obsolete: true
Attachment #49290 - Flags: needs-work+
Taking again... but I doubt I can "fix" this in 0.9.5 ...
Status: REOPENED → ASSIGNED
Keywords: patch, review
Target Milestone: mozilla0.9.5 → mozilla0.9.6
OK, I'm holding off reviewing until roland says "go." Just drop me some email when you are ready again.
blizzard: thanks! ---- Adding dependicy to bug 94327 because it touches huge piles of nsFontMetrics{Xlib,GTK}.* code. I prefer to wait with this one until the noise from these high-priority bugs (is there any other bug which touches gfx/src/{gtk,xlib}/ in the next three weeks ?) is gone before I go and file another 100KB patch for this one... =:-) ---- More ToDo: - Add _BIG_ link to the (hopefully soon) updated docs in bug 90384 at the top of mozilla/gfx/src/{gtk,xlib}/nsFontMetrics{GTK,Xlib}.{cpp,h} ...
Depends on: 94327
blizzard: When do you have time to give me a quick r=/sr= for the new (upcoming patch) patch ? I'd like to file a patch when you have time and discuss/review it via IRC chat if possible - I'd like to get it "in" quick quick quick because the patch is xx@@!!-_huge_) ...
Blocks: 103151
Looks like this won't make it in for 0.9.6.
0.9.6 is long gone. -> 0.9.7
Target Milestone: mozilla0.9.6 → mozilla0.9.7
cleaned by recasting variables on lines complier complained. Split warning where Image size <=0 in separate <0 and =0.
This appear to be a c++ file. Could it be attached as a patch (ie: cvs diff -u and also not mark it octet stream).
reattached as a patch. My changes are in between comments //my code //my code ends. Src file from ftp. My connection too slow for CVS. I don't have authority to remove my old attachment. Anyone who does feel free to blow away.
> I don't have authority to remove my old attachment. Anyone who does feel > free to blow away. Are you able to use the "Edit" "Actions" and mark it as obsolete? Attachment 72002 [details] [diff] does not look like a patch to me. Did you make it by doing a 'cvs diff <filepath/filename>' ?
having problems connecting to cvs. will try again. sorry.
produced with cvs diff. Pulled src code from 2002030407_0.9.9-0_rh7. Tried to mark both my other attachments as obsolete by receive this error message "You must be authorized to make changes to attachments to make attachments obsolete when creating a new attachment."
Attachment #71788 - Attachment is obsolete: true
Attachment #72002 - Attachment is obsolete: true
To the senior staff: Am I missing something here? Is there some reason why we are doing this without consulting the author of this code, tor? (Did I cc: the right tor?)
could someone please review my patch?
attachment 72527 [details] [diff] [review]: - if (destX==mWidth) + if (destX== (unsigned int) mWidth) Spacing seems odd. - for (PRInt32 y=0; y<readHeight; y+=compY) { + for (PRInt32 y=0; (unsigned int)y < (unsigned int)readHeight; (unsigned int)y+=compY) { if (y==0) { - compY = PR_MIN(mHeight-destY, readHeight-y); + compY = PR_MIN((unsigned int)mHeight-destY, (unsigned int)readHeight-y); Do we know what type these should be? Is there a less clumsy way to do this?
I will try and find a less clumsy way to fix. The compiler had been complaining about comparing signed and unsigned int so I would assume they are signed ints.
Hope this better.
Target Milestone: mozilla0.9.7 → ---
gtk is gone, we now only use Gtk2 in Thebes --> WONTFIX
Status: ASSIGNED → RESOLVED
Closed: 24 years ago17 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: