Closed Bug 100612 Opened 24 years ago Closed 4 years ago

remove dependency on widget from gfx

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED INACTIVE

People

(Reporter: jonsmirl, Unassigned)

References

Details

(Whiteboard: fix in hand)

Attachments

(1 file, 3 obsolete files)

Minor changes to remove dependency on widget. 1) added to h: typedef void * nsNativeWidget; class nsIWidget; 2) adjusted a few includes 3) removed 2 unreference variables 4) removed unecessary requires: dom, uriloader, timer, mimetype, content, layout
Depends on: 100586
Attached patch remove dependency on widget (obsolete) — Splinter Review
gfx subdirectories for OS's other than windows may need to add a few includes for "nsIWidget.h" in order to build. I have only checked the windows build.
Blocks: 100107
wow! this is fantastic. sr=alecf, but I'd like to see an r= from someone on gecko before you check this in.
Attachment #49941 - Attachment is obsolete: true
we need some additional linux and mac testers. adding sfraser for mac help, I'll try to do linux on thursday, unless someone beats me to it.
This probably conflicts (or is blocked by) my making widget and gfx into components on Mac (bug 94434 and bug 94435).
This made the platform independent part of gfx not depend on widget. The windows subdirectory still depends on widget. The same would probably be true for the mac subdirectory. So if the mac component still needs widget, refer to it from the gfx/mac directory not the gfx directory.
Depends on: 94434
I just had to add an include for nsIWidget in nsPluginView.cpp. Not sure if this patch cased this or something else in the 1000 file pull I just did.
Had to add nsIWidget.h includes in: nsPluginView.cpp nsGlobalWindow.cpp nsDocumentViewer.cpp nsSelection.cpp nsPresShell.cpp nsDocShell.h I must have messed up the build when looking for files that needed this
can you include a diff of just the additional files you've changed?
Index: mozilla/modules/plugin/base/src/nsPluginViewer.cpp =================================================================== RCS file: /cvsroot/mozilla/modules/plugin/base/src/nsPluginViewer.cpp,v retrieving revision 1.79 diff -u -r1.79 nsPluginViewer.cpp --- mozilla/modules/plugin/base/src/nsPluginViewer.cpp 2001/09/20 00:02:43 1.79 +++ mozilla/modules/plugin/base/src/nsPluginViewer.cpp 2001/09/20 15:16:41 @@ -48,6 +48,7 @@ #include "nsPluginViewer.h" #include "nsGUIEvent.h" #include "nsIPluginViewer.h" +#include "nsIWidget.h" #include "nsITimer.h" Index: mozilla/dom/src/base/nsGlobalWindow.cpp =================================================================== RCS file: /cvsroot/mozilla/dom/src/base/nsGlobalWindow.cpp,v retrieving revision 1.443 diff -u -r1.443 nsGlobalWindow.cpp --- mozilla/dom/src/base/nsGlobalWindow.cpp 2001/08/31 04:28:07 1.443 +++ mozilla/dom/src/base/nsGlobalWindow.cpp 2001/09/20 15:15:52 @@ -104,6 +104,7 @@ #include "nsISupportsPrimitives.h" #include "nsDOMClassInfo.h" #include "nsIJSNativeInitializer.h" +#include "nsIWidget.h" #include "nsWindowRoot.h" Index: mozilla/content/base/src/nsDocumentViewer.cpp =================================================================== RCS file: /cvsroot/mozilla/content/base/src/nsDocumentViewer.cpp,v retrieving revision 1.147 diff -u -r1.147 nsDocumentViewer.cpp --- mozilla/content/base/src/nsDocumentViewer.cpp 2001/09/20 12:13:48 1.147 +++ mozilla/content/base/src/nsDocumentViewer.cpp 2001/09/20 15:15:35 @@ -88,6 +88,7 @@ #include "nsIDOMHTMLAreaElement.h" #include "nsIDOMHTMLLinkElement.h" #include "nsIDOMHTMLImageElement.h" +#include "nsIWidget.h" #include "nsIChromeRegistry.h" Index: mozilla/content/base/src/nsSelection.cpp =================================================================== RCS file: /cvsroot/mozilla/content/base/src/nsSelection.cpp,v retrieving revision 3.106 diff -u -r3.106 nsSelection.cpp --- mozilla/content/base/src/nsSelection.cpp 2001/08/21 18:38:20 3.106 +++ mozilla/content/base/src/nsSelection.cpp 2001/09/20 15:15:42 @@ -52,6 +52,7 @@ #include "nsIDocumentEncoder.h" #include "nsIIndependentSelection.h" #include "nsIPref.h" +#include "nsIWidget.h" // for IBMBIDI Index: mozilla/layout/html/base/src/nsPresShell.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/base/src/nsPresShell.cpp,v retrieving revision 3.449 diff -u -r3.449 nsPresShell.cpp --- mozilla/layout/html/base/src/nsPresShell.cpp 2001/09/19 07:08:13 3.449 +++ mozilla/layout/html/base/src/nsPresShell.cpp 2001/09/20 15:16:26 @@ -96,6 +96,7 @@ #include "nsILayoutHistoryState.h" #include "nsIScrollPositionListener.h" #include "nsICompositeListener.h" +#include "nsIWidget.h" #include "nsILineIterator.h" // for ScrollFrameIntoView #include "nsTimer.h" #include "nsWeakPtr.h" Index: mozilla/docshell/base/nsDocShell.h =================================================================== RCS file: /cvsroot/mozilla/docshell/base/nsDocShell.h,v retrieving revision 1.107 diff -u -r1.107 nsDocShell.h --- mozilla/docshell/base/nsDocShell.h 2001/09/07 22:06:08 1.107 +++ mozilla/docshell/base/nsDocShell.h 2001/09/20 15:15:47 @@ -75,6 +75,7 @@ #include "nsIDocShellHistory.h" #include "nsIURIFixup.h" #include "nsIWebBrowserFind.h" +#include "nsIWidget.h" #define MAKE_LOAD_TYPE(type, flags) ((type) | ((flags) << 16))
over to jon, he's doing the work
Assignee: attinasi → jonsmirl
can you attach patches, rather than pasting them in the bug? that way we can mark them as "reviewed" or "super-reviewed" and they'll show up in the attachment list above. thanks!
Is using a typedef actually better than just using |void *| in all the appropriate places?
The void * typedef is already defined in three other places: view/public/nsIView.h, line 34 widget/public/nsIWidget.h, line 87 widget/public/nsIWidget.idl, line 86
I like shaver's idea... since nsNativeWidget is basically just an opaque pointer anyway. but I'm more than willing to do this initial review to get this in and then I'd be willing to review another bug that eradicates all use of nsNativeWidget in favor of void*. So we're all on the same page: The dependency we're really breaking is an #include dependency, and not so much a runtime dependency. But this fixes problems like when some component #includes nsDeviceContext.h and thus requires not just the component "gfx" but also "widget" when all it really wanted to deal with was gfx, which is why I think this is valuble.
Keywords: patch
This patch removes all use of nsNativeWidget and replaces it with references to void *. I patched the code for all OS's but I can only compile and test on Windows. This patch only removes needless include dependencies no code is actually changed. Let's start a contest - this patch removes 10 interdirectory dependencies. Can anyone do better? After this one is checked in there is another similar one I can do but it stacks on top of this one.
Attachment #50083 - Attachment is obsolete: true
Attachment #49942 - Attachment is obsolete: true
Comment on attachment 50827 [details] [diff] [review] remove all use of nsNativeWidget this is great. sr=alecf on everything except the patch to html/style/src/makefile.win, because you're adding a dependency on raptor, which I don't quite understand
Attachment #50827 - Flags: superreview+
It is ok to leave out the raptor stuff. SVG uses the raptor module and it is building on a branch. I should not have had raptor included in the patch.
Whiteboard: fix in hand
Depends on: 106686
No longer blocks: 100107
/me sees no progress here, although patch has sr=
QA Contact: chrispetersen → layout

The bug assignee didn't login in Bugzilla in the last 7 months.
:dholbert, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: jonsmirl → nobody
Flags: needinfo?(dholbert)

Seems unlikely to still be a relevant code-refactoring, given 20 years of inactivity. To the extent that there's anything that needs doing here, we'd be better off doing so in a new bug.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(dholbert)
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: