root/trunk/llmozlib2/build_mozilla/linden.patch
| Revision 13, 56.0 kB (checked in by zen.linden, 2 years ago) |
|---|
-
layout/generic/nsObjectFrame.cpp
old new 1784 1784 return rv; 1785 1785 } 1786 1786 1787 NS_IMETHODIMP 1788 nsObjectFrame::Paint(nsPresContext* aPresContext, 1789 nsIRenderingContext& aRenderingContext, 1790 const nsRect& aDirtyRect, 1791 nsFramePaintLayer aWhichLayer, 1792 PRUint32 aFlags) 1793 { 1794 if (!GetStyleVisibility()->IsVisibleOrCollapsed()) 1795 return NS_OK; 1796 1797 nsIFrame * child = mFrames.FirstChild(); 1798 if (child) { // if we have children, we are probably not really a plugin 1799 nsObjectFrameSuper::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer); 1800 return NS_OK; 1801 } 1802 1803 // If we are painting in Print Preview do nothing.... 1804 if (aPresContext->Type() == nsPresContext::eContext_PrintPreview) { 1805 return NS_OK; 1806 } 1807 1808 // determine if we are printing 1809 if (aPresContext->Type() == nsPresContext::eContext_Print) { 1810 // UNIX Plugins can't PP at this time, so draw an empty box 1811 // we only want to print on the content layer pass 1812 if (eFramePaintLayer_Content != aWhichLayer) 1813 return NS_OK; 1814 1815 // if we are printing, we need to get the correct nsIPluginInstance 1816 // for THIS content node in order to call ->Print() on the right plugin 1817 1787 // set values for aPlugWin, aPlugPrint and aPlugInstance 1788 nsresult 1789 nsObjectFrame::SetupPrinting(nsIRenderingContext& aRenderingContext, 1790 nsPresContext *aPresContext, 1791 nsPluginWindow &aPlugWin, 1792 nsPluginPrint &aPlugPrint, 1793 nsIPluginInstance *&aPlugInstance) { 1794 // We need to make sure we have the right frame for the plugin. This 1795 // seems silly, but it is actually necessary on some pages. We 1796 // will actually get a null mPluginInstanceOwner sometimes if we 1797 // don't do this. 1818 1798 // first, we need to get the document 1819 1799 nsCOMPtr<nsIDocument> doc = mContent->GetDocument(); 1820 1800 NS_ENSURE_TRUE(doc, NS_ERROR_NULL_POINTER); … … 1837 1817 objectFrame = GetNextObjectFrame(aPresContext,frame); 1838 1818 NS_ENSURE_TRUE(objectFrame,NS_ERROR_FAILURE); 1839 1819 1840 // finally we can get our plugin instance 1841 nsCOMPtr<nsIPluginInstance> pi; 1842 if (NS_FAILED(objectFrame->GetPluginInstance(*getter_AddRefs(pi))) || !pi) 1820 // finally, get our plugin instance 1821 nsCOMPtr<nsIPluginInstance> tempPluginInstance; 1822 if (NS_FAILED(objectFrame->GetPluginInstance(*getter_AddRefs(tempPluginInstance))) || 1823 !tempPluginInstance) 1843 1824 return NS_ERROR_FAILURE; 1825 NS_IF_ADDREF(aPlugInstance = tempPluginInstance); 1844 1826 1845 1827 // now we need to setup the correct location for printing 1846 nsresult rv;1847 nsPluginWindow window;1848 1828 nsPoint origin; 1849 1829 float t2p; 1850 window.window =nsnull;1830 aPlugWin.window = nsnull; 1851 1831 1852 1832 // prepare embedded mode printing struct 1853 nsPluginPrint npprint; 1854 npprint.mode = nsPluginMode_Embedded; 1833 aPlugPrint.mode = nsPluginMode_Embedded; 1855 1834 1856 1835 // we need to find out if we are windowless or not 1857 1836 PRBool windowless = PR_FALSE; 1858 pi->GetValue(nsPluginInstanceVariable_WindowlessBool, (void *)&windowless);1859 window.type = windowless ? nsPluginWindowType_Drawable : nsPluginWindowType_Window;1837 aPlugInstance->GetValue(nsPluginInstanceVariable_WindowlessBool, (void *)&windowless); 1838 aPlugWin.type = windowless ? nsPluginWindowType_Drawable : nsPluginWindowType_Window; 1860 1839 1861 1840 // Get the offset of the DC 1862 1841 nsTransform2D* rcTransform; … … 1868 1847 1869 1848 // set it all up 1870 1849 // XXX is windowless different? 1871 window.x = origin.x; 1872 window.y = origin.y; 1873 window.width = NSToCoordRound(mRect.width * t2p); 1874 window.height= NSToCoordRound(mRect.height * t2p); 1875 window.clipRect.bottom = 0; window.clipRect.top = 0; 1876 window.clipRect.left = 0; window.clipRect.right = 0; 1850 aPlugWin.x = origin.x; 1851 aPlugWin.y = origin.y; 1852 aPlugWin.width = NSToCoordRound(mRect.width * t2p); 1853 aPlugWin.height= NSToCoordRound(mRect.height * t2p); 1854 aPlugWin.clipRect.bottom = 0; aPlugWin.clipRect.top = 0; 1855 aPlugWin.clipRect.left = 0; aPlugWin.clipRect.right = 0; 1856 aPlugPrint.print.embedPrint.window = aPlugWin; 1857 1858 return NS_OK; 1859 } 1860 1861 NS_IMETHODIMP 1862 nsObjectFrame::Paint(nsPresContext* aPresContext, 1863 nsIRenderingContext& aRenderingContext, 1864 const nsRect& aDirtyRect, 1865 nsFramePaintLayer aWhichLayer, 1866 PRUint32 aFlags) 1867 { 1868 if (!GetStyleVisibility()->IsVisibleOrCollapsed()) 1869 return NS_OK; 1870 1871 nsIFrame * child = mFrames.FirstChild(); 1872 if (child) { // if we have children, we are probably not really a plugin 1873 nsObjectFrameSuper::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer); 1874 return NS_OK; 1875 } 1876 1877 // If we are painting in Print Preview do nothing.... 1878 if (aPresContext->Type() == nsPresContext::eContext_PrintPreview) { 1879 return NS_OK; 1880 } 1881 1882 if (aPresContext->Type() == nsPresContext::eContext_Print) { 1883 // UNIX Plugins can't PP at this time, so draw an empty box 1884 // we only want to print on the content layer pass 1885 if (eFramePaintLayer_Content != aWhichLayer) 1886 return NS_OK; 1887 1888 // data to pass on to the plugin 1889 nsPluginPrint npprint; 1890 nsPluginWindow window; 1891 nsCOMPtr<nsIPluginInstance> pi; 1892 nsresult rv; 1893 1894 // sets fields in the plugin structs and gets the plugin instance 1895 rv = SetupPrinting(aRenderingContext, aPresContext, window, npprint, (*getter_AddRefs(pi))); 1896 if (NS_FAILED(rv)) 1897 return rv; 1877 1898 1878 1899 // XXX platform specific printing code 1879 1900 #if defined(XP_MAC) && !TARGET_CARBON … … 1896 1917 1897 1918 window.window = &port; 1898 1919 npprint.print.embedPrint.platformPrint = (void*)window.window; 1899 npprint.print.embedPrint.window = window;1900 1920 // send off print info to plugin 1901 1921 rv = pi->Print(&npprint); 1902 1922 #elif defined(XP_UNIX) && !defined(XP_MACOSX) … … 1925 1945 window.y = aDirtyRect.y; 1926 1946 window.width = aDirtyRect.width; 1927 1947 window.height = aDirtyRect.height; 1928 npprint.print.embedPrint.window = window;1929 1948 rv = pi->Print(&npprint); 1930 1949 if (NS_FAILED(rv)) { 1931 1950 PR_LOG(nsObjectFrameLM, PR_LOG_DEBUG, ("error: plugin returned failure %lx\n", (long)rv)); … … 1951 1970 return NS_OK; // no dc implemented so quit 1952 1971 1953 1972 npprint.print.embedPrint.platformPrint = (void*)pDC; 1954 npprint.print.embedPrint.window = window;1955 1973 // send off print info to plugin 1956 1974 rv = pi->Print(&npprint); 1957 1975 … … 1965 1983 #endif 1966 1984 1967 1985 // XXX Nav 4.x always sent a SetWindow call after print. Should we do the same? 1986 /* XXXjgaunt - commenting this out because we lost the frame in 1987 - re-factoring. (setupPrinting()) 1988 - Is this really necessary??? 1968 1989 nsDidReflowStatus status = NS_FRAME_REFLOW_FINISHED; // should we use a special status? 1969 1990 frame->DidReflow(shell->GetPresContext(), 1970 1991 nsnull, status); // DidReflow will take care of it 1992 */ 1971 1993 1972 1994 return rv; // done with printing 1973 1995 } … … 1978 2000 if ((NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) && mInstanceOwner) 1979 2001 mInstanceOwner->Paint(aDirtyRect); 1980 2002 #elif defined (XP_WIN) || defined(XP_OS2) 1981 if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {1982 2003 nsCOMPtr<nsIPluginInstance> inst; 1983 2004 GetPluginInstance(*getter_AddRefs(inst)); 1984 if (inst) { 2005 if (!inst) 2006 return NS_ERROR_FAILURE; 1985 2007 // Look if it's windowless 1986 2008 nsPluginWindow * window; 1987 2009 mInstanceOwner->GetWindow(window); 1988 2010 1989 if (window->type == nsPluginWindowType_Drawable) { 2011 if (window->type == nsPluginWindowType_Drawable && 2012 NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) { 1990 2013 // check if we need to call SetWindow with updated parameters 1991 2014 PRBool doupdatewindow = PR_FALSE; 1992 2015 … … 2058 2081 #endif 2059 2082 2060 2083 inst->SetWindow(window); 2061 }2062 2084 2063 2085 mInstanceOwner->Paint(aDirtyRect, hdc); 2064 2086 } 2065 2087 } 2088 else if (window->type == nsPluginWindowType_Window && 2089 eFramePaintLayer_Content == aWhichLayer) { 2090 // This section handles the case of being called from 2091 // nsViewManager::RenderOffscreen(). That call is made 2092 // from the nsCanvas impl as well as for some embedding 2093 // applications. 2094 // We must set things up like we are printing and then 2095 // have the plugin render to a DeviceContext created 2096 // in RenderOffscreen() 2097 // We may also get here during regular operation. In that 2098 // case the location we tell the plugin to print is 2099 // merely it's own window. 2100 2101 // data to pass on to the plugin 2102 nsPluginPrint npprint; 2103 nsPluginWindow window; 2104 nsCOMPtr<nsIPluginInstance> pi; 2105 nsresult rv; 2106 2107 // sets fields in the plugin structs and gets the plugin instance 2108 rv = SetupPrinting(aRenderingContext, aPresContext, window, npprint, (*getter_AddRefs(pi))); 2109 if (NS_FAILED(rv)) 2110 return rv; 2111 2112 #ifdef XP_WIN 2113 // This will be the plugin's window's DC or one provided by RenderOffscreen 2114 PRUint32 pDC = 0; 2115 aRenderingContext.RetrieveCurrentNativeGraphicData((void**)&pDC); 2116 if (!pDC) 2117 return NS_OK; // no dc implemented so quit 2118 2119 // set the context to print to 2120 npprint.print.embedPrint.platformPrint = (void*) pDC; 2121 2122 // tell the plugin to render to the DC - works for Flash, not for quicktime 2123 rv = pi->Print(&npprint); 2124 2125 // XXXjgaunt - try sending a WM_PRINTCLIENT w/ PRF_CLIENT in lparam and DC in wparam 2126 /* 2127 nsPluginWindowHelper helper; 2128 2129 nsPluginEvent pPluginEvent; 2130 pPluginEvent.event = WM_PRINTCLIENT; 2131 pPluginEvent.wParam = (PRUint32) pDC; 2132 pPluginEvent.lParam = PRF_CLIENT; 2133 2134 // call the WinProc with the HWND and the event (message,wparam,lparam) 2135 helper.LLSendEventToWindow((void*) &window, (void*) mInstanceOwner->GetPluginPort(), (void*) &pPluginEvent); 2136 */ 2137 2138 #endif /* XP_WIN */ 2066 2139 } 2067 2140 #endif /* !XP_MAC */ 2068 2141 DO_GLOBAL_REFLOW_COUNT_DSP("nsObjectFrame", &aRenderingContext); … … 2090 2163 } 2091 2164 2092 2165 #ifdef XP_WIN 2166 // XXXjgaunt - added the windowless check 2167 PRBool windowless = PR_FALSE; 2168 nsCOMPtr<nsIPluginInstance> pluginInstance; 2169 GetPluginInstance(*getter_AddRefs(pluginInstance)); 2170 2171 if(pluginInstance) 2172 pluginInstance->GetValue(nsPluginInstanceVariable_WindowlessBool, 2173 (void *)&windowless); 2174 2175 if (windowless) { 2093 2176 rv = nsObjectFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus); 2177 } 2178 else { 2179 *anEventStatus = mInstanceOwner->ProcessEvent(*anEvent); 2180 rv = *anEventStatus; 2181 } 2094 2182 return rv; 2095 2183 #endif 2096 2184 … … 3893 3981 #endif 3894 3982 3895 3983 #ifdef XP_WIN 3896 // this code supports windowless plugins3897 3984 nsPluginEvent * pPluginEvent = (nsPluginEvent *)anEvent.nativeMsg; 3898 3985 // we can get synthetic events from the nsEventStateManager... these 3899 3986 // have no nativeMsg 3900 3987 3901 if (pPluginEvent) {3902 3988 PRBool eventHandled = PR_FALSE; 3989 if (pPluginEvent) { 3990 // XXXjgaunt 3991 // Are we windowed? If so, pass the event on to the window 3992 PRBool windowless = PR_FALSE; 3993 mInstance->GetValue(nsPluginInstanceVariable_WindowlessBool, 3994 (void *)&windowless); 3995 3996 if (windowless) { 3903 3997 mInstance->HandleEvent(pPluginEvent, &eventHandled); 3904 3998 if (eventHandled) 3905 3999 rv = nsEventStatus_eConsumeNoDefault; 3906 4000 } 4001 else { 4002 // set this here, but it could happen earlier. Right now the only 4003 // case we need to set this is for certain types of embedding 4004 // that need to translate mouse click locations from screen to 4005 // client coordinates. 4006 // Default behavior would be to capture (PR_TRUE) 4007 nsPluginWindowHelper helper; 4008 if (anEvent.flags & NS_EVENT_FLAG_NO_MOUSE_CAPTURE) { 4009 helper.SetMouseCapture(mPluginWindow, PR_FALSE); 4010 } 4011 else { 4012 helper.SetMouseCapture(mPluginWindow, PR_TRUE); 4013 } 4014 // call the WinProc with the HWND and the event (message,wparam,lparam) 4015 helper.LLSendEventToWindow(mPluginWindow, (void*) GetPluginPort(), (void*) pPluginEvent); 4016 // XXXjgaunt - not sure if this is right, just following what was above 4017 rv = nsEventStatus_eConsumeNoDefault; 4018 } 4019 } 3907 4020 #endif 3908 4021 3909 4022 return rv; -
layout/generic/nsObjectFrame.h
old new 203 203 nsHTMLReflowMetrics& aMetrics, 204 204 const nsHTMLReflowState& aReflowState); 205 205 206 // called from Paint() to collect functionality that is used in 207 // mulitple places for drastically different purposes: Printing; 208 // and painting to a different DC than associated with a 209 // windowed plugin. 210 nsresult SetupPrinting(nsIRenderingContext& aRenderingContext, 211 nsPresContext *aPresContext, 212 nsPluginWindow &aPlugWin, 213 nsPluginPrint &aPlugPrint, 214 nsIPluginInstance *&aPlugInstance); 215 206 216 friend class nsPluginInstanceOwner; 207 217 private: 208 218 nsPluginInstanceOwner *mInstanceOwner; -
modules/plugin/base/public/npapi.h
old new 631 631 #define NPVERS_68K_HAS_LIVECONNECT 11 632 632 #define NPVERS_HAS_WINDOWLESS 11 633 633 #define NPVERS_HAS_XPCONNECT_SCRIPTING 13 634 #define NPVERS_HAS_NPRUNTIME_SCRIPTING 14 635 #define NPVERS_HAS_FORM_VALUES 15 636 #define NPVERS_HAS_POPUPS_ENABLED_STATE 16 634 #define NPVERS_HAS_NPRUNTIME_SCRIPTING 14 635 #define NPVERS_HAS_FORM_VALUES 15 636 #define NPVERS_HAS_POPUPS_ENABLED_STATE 16 637 637 #define NPVERS_HAS_RESPONSE_HEADERS 17 638 638 639 639 /*----------------------------------------------------------------------*/ -
modules/plugin/base/public/nsPluginNativeWindow.h
old new 106 106 nsresult PLUG_NewPluginNativeWindow(nsPluginNativeWindow ** aPluginNativeWindow); 107 107 nsresult PLUG_DeletePluginNativeWindow(nsPluginNativeWindow * aPluginNativeWindow); 108 108 109 /** 110 * Allows access to platform specific window implementations. 111 * 112 * Because the platform specific definitions are in the implementation files 113 * it isn't possible to call them directly (and probably a good thing at that). 114 * This class allows access to those classes without revealing the details of 115 * implementation underneath. 116 */ 117 class nsPluginWindowHelper { 118 public: 119 nsPluginWindowHelper() {} 120 virtual ~nsPluginWindowHelper() {} 121 /** 122 * The default behavior for mozilla's winowed plugins is to capture 123 * the mouse input on a mouse down message and to release it on a mouse up. 124 * this works fine if the input coordinates are in the right coordinate 125 * system. But in some embedding cases it is necessary to translate the 126 * actual screen coordinates that get passed in by the sytsem. This method 127 * allows the embedding application to receive the mouse events first so as 128 * to perform any coordinate translation that needs to happen. 129 * 130 * See the use of this in nsObjectFrame to see an example of it's use. 131 * 132 * @arg aNativeWindow - a pointer to the nsPluginNativeWindow(Win|Mac|Unix..) 133 * for the plugin. If aMouseCapture is PR_FALSE, this window 134 * will receive the mouse events. 135 * 136 * @arg aMouseCapture - PR_TRUE means mozilla will capture mouse events 137 * PR_FALSE means it won't. 138 */ 139 nsresult SetMouseCapture(void *aNativeWindow, PRBool aMouseCapture); 140 141 /** 142 * This allows a message to be sent directly to the plugin's window. 143 * 144 * @arg aNativeWindow - a pointer to the nsPluginNativeWindow(Win|Mac|Unix..) 145 * for the plugin. 146 * 147 * @arg aPluginPort - a pointer to the platform dependant impl of the 148 * nsPluginPort struct. On Windows this is a HWND. This is the handle 149 * to the plugin's window that will recieve the message. 150 * 151 * @arg aNativeMessage - The native message for the platform. On windows 152 * this is a nsPluginEvent pointer (event, wParam, lParam). This is 153 * the message that will be sent to the plugin's window 154 */ 155 nsresult LLSendEventToWindow(void *aNativeWindow, void *aPluginPort, void *aNativeMsg); 156 }; 157 109 158 #endif //_nsPluginNativeWindow_h_ -
modules/plugin/base/src/nsPluginNativeWindowWin.cpp
old new 140 140 nsIEventQueueService *GetEventService(); 141 141 PluginWindowEvent * GetPluginWindowEvent(HWND aWnd, UINT aMsg, WPARAM aWParam, LPARAM aLParam); 142 142 143 // XXXjgaunt 144 void SetMouseCapture(PRBool aCapture) { mCanCaptureMouse = aCapture; } 145 PRBool CanCaptureMouse() { return mCanCaptureMouse; } 146 PRBool CanReleaseMouse() { return mMouseCaptured; } 147 void MouseCaptured() { mMouseCaptured = PR_TRUE; } 148 void MouseReleased() { mMouseCaptured = PR_FALSE; } 149 143 150 private: 144 151 WNDPROC mPluginWinProc; 145 152 nsCOMPtr<nsIEventQueueService> mEventService; 146 153 PluginWindowEvent mPluginWindowEvent; 154 PRBool mCanCaptureMouse; 155 PRBool mMouseCaptured; 147 156 148 157 public: 149 158 nsPluginType mPluginType; 150 159 }; 151 160 161 // XXXjgaunt 162 // class nsPluginWindowHelper 163 nsresult nsPluginWindowHelper::SetMouseCapture(void *aNativeWindow, PRBool aMouseCapture) { 164 nsPluginNativeWindowWin *nativeWin = (nsPluginNativeWindowWin *) aNativeWindow; 165 if (nativeWin) { 166 nativeWin->SetMouseCapture(aMouseCapture); 167 return NS_OK; 168 } 169 return NS_ERROR_FAILURE; 170 } 171 172 // on windows the incomimg pluginport is an HWND, nativemsg is (msg, wparam, lparam) 173 nsresult nsPluginWindowHelper::LLSendEventToWindow(void *aNativeWindow, void *aPluginPort, void *aNativeMsg) 174 { 175 nsresult rv = NS_ERROR_FAILURE; 176 nsPluginNativeWindowWin *nativeWin = (nsPluginNativeWindowWin *) aNativeWindow; 177 if (nativeWin) { 178 nsPluginEvent *plugEvent = (nsPluginEvent *) aNativeMsg; 179 if (plugEvent) { 180 if (((nsPluginEvent *) aNativeMsg)->event == 0x0020) { // the code for WM_SETCURSOR 181 // the wParam for SETCURSOR messages may be set to the parent window, not the plugin's window 182 // rv = PluginWndProc((HWND) aPluginPort, plugEvent->event, (PRUint32)aPluginPort, plugEvent->lParam); 183 // rv = SendMessage((HWND) aPluginPort, plugEvent->event, (PRUint32)aPluginPort, plugEvent->lParam); 184 rv = PostMessage((HWND) aPluginPort, plugEvent->event, (PRUint32)aPluginPort, plugEvent->lParam); 185 } 186 else { 187 // rv = PluginWndProc((HWND) aPluginPort, plugEvent->event, plugEvent->wParam, plugEvent->lParam); 188 // rv = SendMessage((HWND) aPluginPort, plugEvent->event, plugEvent->wParam, plugEvent->lParam); 189 rv = PostMessage((HWND) aPluginPort, plugEvent->event, plugEvent->wParam, plugEvent->lParam); 190 } 191 } 192 } 193 return rv; 194 } 195 152 196 static PRBool sInMessageDispatch = PR_FALSE; 153 197 static UINT sLastMsg = 0; 154 198 … … 208 252 if (!win) 209 253 return TRUE; 210 254 211 // check plugin myme type and cache whether it is Flash or not 255 // XXXjgaunt - so SendMessage() doesn't block 256 if (InSendMessage()) 257 ReplyMessage(TRUE); 258 259 // check plugin mime-type and cache whether it is Flash or not 212 260 // Flash will need special treatment later 213 261 if (win->mPluginType == nsPluginType_Unknown) { 214 262 nsCOMPtr<nsIPluginInstance> inst; … … 259 307 case WM_RBUTTONDOWN: { 260 308 nsCOMPtr<nsIWidget> widget; 261 309 win->GetPluginWidget(getter_AddRefs(widget)); 262 if (widget )310 if (widget && win->CanCaptureMouse()) { 263 311 widget->CaptureMouse(PR_TRUE); 312 win->MouseCaptured(); 313 } 264 314 break; 265 315 } 266 316 case WM_LBUTTONUP: … … 271 321 case WM_RBUTTONUP: { 272 322 nsCOMPtr<nsIWidget> widget; 273 323 win->GetPluginWidget(getter_AddRefs(widget)); 274 if (widget )324 if (widget && win->CanReleaseMouse()) { 275 325 widget->CaptureMouse(PR_FALSE); 326 win->MouseReleased(); 327 } 276 328 break; 277 329 } 278 330 case WM_KEYDOWN: … … 377 429 mPluginWinProc = NULL; 378 430 mPluginWindowEvent.SetIsAlloced(PR_FALSE); 379 431 mPluginType = nsPluginType_Unknown; 432 mCanCaptureMouse = PR_TRUE; 433 mMouseCaptured = PR_FALSE; 380 434 } 381 435 382 436 nsPluginNativeWindowWin::~nsPluginNativeWindowWin() -
view/src/nsViewManager.cpp
old new 1875 1875 } 1876 1876 1877 1877 UpdateWidgetArea(widgetParent, nsRegion(damagedRect), nsnull); 1878 1878 1879 } else { 1879 1880 // Propagate the update to the root widget of the root view manager, since 1880 1881 // iframes, for example, can overlap each other and be translucent. So we … … 2012 2013 // Make sure to not send WillPaint notifications while scrolling 2013 2014 nsViewManager* rootVM = RootViewManager(); 2014 2015 2016 2015 2017 nsIWidget *widget = mRootView->GetWidget(); 2016 2018 PRBool translucentWindow = PR_FALSE; 2017 2019 if (widget) … … 2429 2431 // Determine, for each view, whether it is or contains a ZPlaceholderView 2430 2432 ComputePlaceholderContainment(displayRoot); 2431 2433 2432 // Create the Z-ordered view tree 2433 PRBool paintFloats; 2434 if (aEventProcessing) { 2435 paintFloats = PR_TRUE; 2436 } else { 2437 paintFloats = displayRoot->GetFloating(); 2438 } 2434 // XXXjgaunt - Linden - Always paint floats 2435 PRBool paintFloats = PR_TRUE; 2439 2436 2440 2437 { 2441 2438 nsHashtable PlaceholderHash; … … 3571 3568 nsAutoVoidArray displayList; 3572 3569 PLArenaPool displayArena; 3573 3570 PL_INIT_ARENA_POOL(&displayArena, "displayArena", 1024); 3571 // XXXjgaunt - Linden - fixes scrollbars, popups, iframes, framesets 3574 3572 BuildRenderingDisplayList(view, nsRegion(r), &displayList, displayArena, 3575 PR_TRUE, PR_ TRUE, suppressScrolling);3573 PR_TRUE, PR_FALSE, suppressScrolling); 3576 3574 RenderViews(view, *localcx, nsRegion(aRect), surface, displayList); 3577 3575 PL_FreeArenaPool(&displayArena); 3578 3576 PL_FinishArenaPool(&displayArena); … … 3710 3708 nsHashtable &aMapPlaceholderViewToZTreeNode, 3711 3709 PLArenaPool &aPool) 3712 3710 { 3711 // XXXjgaunt - Linden - always paint floats 3712 aPaintFloats = PR_TRUE; 3713 3713 PRBool retval = PR_FALSE; 3714 3714 3715 3715 aResult = nsnull; -
widget/public/nsGUIEvent.h
old new 118 118 #define NS_EVENT_FLAG_SYSTEM_EVENT 0x0200 119 119 #define NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY 0x0400 // @see nsIDOM3Event::stopImmediatePropagation() 120 120 #define NS_EVENT_FLAG_DISPATCHING 0x0800 121 #define NS_EVENT_FLAG_NO_MOUSE_CAPTURE 0x1000 // XXXjgaunt 121 122 122 123 #define NS_PRIV_EVENT_UNTRUSTED_PERMITTED 0x8000 123 124 -
widget/public/nsIToolkit.idl
old new 43 43 #include "prthread.h" 44 44 %} 45 45 46 interface nsIWidget; 47 46 48 [ptr] native PRThread(PRThread); 47 49 50 [uuid(792dc3f5-adc0-4ef7-a07d-e0fd9be8cc9f)] 51 interface nsIToolkitObserver : nsISupports 52 { 53 /** 54 * Called after a native widget has been invalidated, either manually 55 * via nsIWidget::Invalidate or due to a widget being moved, shown or 56 * resized. We pass the coordinates of the rectangle that bounds the 57 * area that has been invalidated, relative to the origin of nsIWidget 58 * in pixels. 59 */ 60 void notifyInvalidated(in nsIWidget aWidget, in long x, in long y, in long width, in long height); 61 }; 48 62 49 63 [uuid(18032BD0-B265-11d1-AA2A-000000000000)] 50 64 interface nsIToolkit : nsISupports … … 58 72 */ 59 73 void Init(in PRThread aThread); 60 74 75 void addObserver(in nsIToolkitObserver aObserver); 76 void removeObserver(in nsIToolkitObserver aObserver); 61 77 }; 62 78 63 79 -
widget/public/nsITransferable.idl
old new 57 57 58 58 #define kURLMime "text/x-moz-url" // data contains url\ntitle 59 59 #define kURLDataMime "text/x-moz-url-data" // data contains url only 60 #define kURLDescriptionMime "text/x-moz-url-desc" // data contains description 60 #define kURLDescriptionMime "text/x-moz-url-desc" // data contains description 61 61 #define kURLPrivateMime "text/x-moz-url-priv" // same as kURLDataMime but for private uses 62 62 #define kNativeImageMime "application/x-moz-nativeimage" 63 63 #define kNativeHTMLMime "application/x-moz-nativehtml" -
widget/src/gtk2/nsAppShell.h
old new 43 43 #include "nsIEventQueue.h" 44 44 #include "nsCOMPtr.h" 45 45 46 class nsIToolkit; 47 46 48 class nsAppShell : public nsIAppShell { 47 49 public: 48 50 -
widget/src/gtk2/nsToolkit.cpp
old new 107 107 return NS_OK; 108 108 } 109 109 110 //------------------------------------------------------------------------- 111 // 112 // 113 //------------------------------------------------------------------------- 114 NS_IMETHODIMP 115 nsToolkit::AddObserver(nsIToolkitObserver* aObserver) 116 { 117 if (! aObserver) 118 return NS_ERROR_NULL_POINTER; 119 120 if (! mObservers.AppendObject(aObserver)) { 121 return NS_ERROR_FAILURE; 122 } 123 124 return NS_OK; 125 } 126 127 NS_IMETHODIMP 128 nsToolkit::RemoveObserver(nsIToolkitObserver* aObserver) 129 { 130 if (! aObserver) 131 return NS_ERROR_NULL_POINTER; 132 133 mObservers.RemoveObject(aObserver); 134 135 return NS_OK; 136 137 } 138 139 void nsToolkit::NotifyInvalidated(nsIWidget* aWidget, int x, int y, int width, int height) 140 { 141 PRInt32 count = mObservers.Count(); 142 for (PRInt32 i = 0; i < count; ++i) 143 { 144 (void) mObservers[i]->NotifyInvalidated(aWidget, x, y, width, height); 145 } 146 } 110 147 111 148 //------------------------------------------------------------------------- 112 149 // -
widget/src/gtk2/nsToolkit.h
old new 41 41 #define TOOLKIT_H 42 42 43 43 #include "nsIToolkit.h" 44 #include "nsCOMArray.h" 44 45 #include <gtk/gtk.h> 45 46 46 47 /** … … 62 63 void CreateSharedGC(void); 63 64 GdkGC *GetSharedGC(void); 64 65 66 NS_IMETHOD AddObserver(nsIToolkitObserver* aObserver); 67 NS_IMETHOD RemoveObserver(nsIToolkitObserver* aObserver); 68 69 void NotifyInvalidated(nsIWidget* aWidget, int x, int y, 70 int width, int height); 71 65 72 private: 66 73 GdkGC *mSharedGC; 74 nsCOMArray<nsIToolkitObserver> mObservers; 67 75 }; 68 76 69 77 -
widget/src/gtk2/nsWindow.cpp
old new 322 322 mLastDragMotionWindow = NULL; 323 323 } 324 324 325 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 326 325 327 delete[] mTransparencyBitmap; 326 328 mTransparencyBitmap = nsnull; 327 329 … … 467 469 468 470 if (!mShell && mDrawingarea) { 469 471 moz_drawingarea_reparent(mDrawingarea, newParentWindow); 472 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 470 473 } else { 471 474 NS_NOTREACHED("nsWindow::SetParent - reparenting a non-child window"); 472 475 } … … 575 578 moz_drawingarea_move(mDrawingarea, aX, aY); 576 579 } 577 580 581 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 582 578 583 return NS_OK; 579 584 } 580 585 … … 614 619 gdk_window_lower(w->mDrawingarea->clip_window); 615 620 } 616 621 } 622 623 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 624 617 625 return NS_OK; 618 626 } 619 627 … … 651 659 652 660 mSizeState = mSizeMode; 653 661 662 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 663 654 664 return rv; 655 665 } 656 666 … … 1003 1013 NS_IMETHODIMP 1004 1014 nsWindow::Validate() 1005 1015 { 1016 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1017 1006 1018 // Get the update for this window and, well, just drop it on the 1007 1019 // floor. 1008 if (!mDrawingarea) 1009 return NS_OK;1020 if (!mDrawingarea) 1021 return NS_OK; 1010 1022 1011 1023 GdkRegion *region = gdk_window_get_update_area(mDrawingarea->inner_window); 1012 1024 … … 1021 1033 { 1022 1034 GdkRectangle rect; 1023 1035 1036 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1037 1024 1038 rect.x = mBounds.x; 1025 1039 rect.y = mBounds.y; 1026 1040 rect.width = mBounds.width; … … 1054 1068 LOGDRAW(("Invalidate (rect) [%p]: %d %d %d %d (sync: %d)\n", (void *)this, 1055 1069 rect.x, rect.y, rect.width, rect.height, aIsSynchronous)); 1056 1070 1071 NotifyInvalidated(aRect); 1072 1057 1073 if (!mDrawingarea) 1058 1074 return NS_OK; 1059 1075 … … 1062 1078 if (aIsSynchronous) 1063 1079 gdk_window_process_updates(mDrawingarea->inner_window, FALSE); 1064 1080 1081 NotifyInvalidated(aRect); 1082 1065 1083 return NS_OK; 1066 1084 } 1067 1085 … … 1082 1100 1083 1101 gdk_window_invalidate_region(mDrawingarea->inner_window, 1084 1102 region, FALSE); 1103 1104 NotifyInvalidated(nsRect(rect.x, rect.y, rect.width, rect.height)); 1085 1105 } 1086 1106 else { 1087 1107 LOGDRAW(("Invalidate (region) [%p] with empty region\n", … … 1094 1114 NS_IMETHODIMP 1095 1115 nsWindow::Update() 1096 1116 { 1117 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1118 1097 1119 if (!mDrawingarea) 1098 1120 return NS_OK; 1099 1121 1100 1122 gdk_window_process_updates(mDrawingarea->inner_window, FALSE); 1123 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1101 1124 return NS_OK; 1102 1125 } 1103 1126 … … 1112 1135 PRInt32 aDy, 1113 1136 nsRect *aClipRect) 1114 1137 { 1138 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1139 1115 1140 if (!mDrawingarea) 1116 1141 return NS_OK; 1117 1142 … … 1128 1153 1129 1154 // Process all updates so that everything is drawn. 1130 1155 gdk_window_process_all_updates(); 1156 1157 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1158 1131 1159 return NS_OK; 1132 1160 } 1133 1161 … … 1135 1163 nsWindow::ScrollWidgets(PRInt32 aDx, 1136 1164 PRInt32 aDy) 1137 1165 { 1166 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1167 1138 1168 if (!mDrawingarea) 1139 1169 return NS_OK; 1140 1170 1141 1171 moz_drawingarea_scroll(mDrawingarea, aDx, aDy); 1172 1173 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1174 1142 1175 return NS_OK; 1143 1176 } 1144 1177 … … 1465 1498 DispatchEvent(&event, status); 1466 1499 1467 1500 g_free(rects); 1501 1502 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1468 1503 1469 1504 // check the return value! 1470 1505 return TRUE; … … 1513 1548 (void *)this, aAllocation->x, aAllocation->y, 1514 1549 aAllocation->width, aAllocation->height)); 1515 1550 1551 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1552 1516 1553 nsRect rect(aAllocation->x, aAllocation->y, 1517 1554 aAllocation->width, aAllocation->height); 1518 1555 … … 1528 1565 1529 1566 nsEventStatus status; 1530 1567 DispatchResizeEvent (rect, status); 1568 1569 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1531 1570 } 1532 1571 1533 1572 void … … 2394 2433 nsIToolkit *aToolkit, 2395 2434 nsWidgetInitData *aInitData) 2396 2435 { 2436 // mToolkit = aToolkit; 2437 2397 2438 // only set the base parent if we're going to be a dialog or a 2398 2439 // toplevel 2399 2440 nsIWidget *baseParent = aInitData && … … 2726 2767 LOG(("nsWindow::NativeResize [%p] %d %d\n", (void *)this, 2727 2768 aWidth, aHeight)); 2728 2769 2770 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2771 2729 2772 ResizeTransparencyBitmap(aWidth, aHeight); 2730 2773 2731 2774 // clear our resize flag … … 2751 2794 PRInt32 aWidth, PRInt32 aHeight, 2752 2795 PRBool aRepaint) 2753 2796 { 2797 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2798 2754 2799 mNeedsResize = PR_FALSE; 2755 2800 mNeedsMove = PR_FALSE; 2756 2801 … … 2793 2838 else if (mDrawingarea) { 2794 2839 moz_drawingarea_move_resize(mDrawingarea, aX, aY, aWidth, aHeight); 2795 2840 } 2841 2842 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2796 2843 } 2797 2844 2798 2845 void … … 2840 2887 moz_drawingarea_set_visibility(mDrawingarea, FALSE); 2841 2888 } 2842 2889 } 2890 2891 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2843 2892 } 2844 2893 2845 2894 void … … 3015 3064 3016 3065 gtk_widget_shape_combine_mask(mShell, maskBitmap, 0, 0); 3017 3066 gdk_bitmap_unref(maskBitmap); 3067 3068 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 3018 3069 } 3019 3070 3020 3071 NS_IMETHODIMP -
widget/src/gtk2/nsWindow.h
old new 39 39 #ifndef __nsWindow_h__ 40 40 41 41 #include "nsCommonWidget.h" 42 #include "nsToolkit.h" 42 43 43 44 #include "mozcontainer.h" 44 45 #include "mozdrawingarea.h" … … 286 287 NS_IMETHOD UpdateTranslucentWindowAlpha(const nsRect& aRect, PRUint8* aAlphas); 287 288 #endif 288 289 290 protected: 291 void NotifyInvalidated(const nsRect& aRect) { 292 nsToolkit* tk = NS_STATIC_CAST(nsToolkit*, mToolkit); 293 if (tk) { 294 tk->NotifyInvalidated(this, aRect.x, aRect.y, aRect.width, aRect.height); 295 } 296 } 297 298 289 299 private: 290 300 void GetToplevelWidget(GtkWidget **aWidget); 291 301 void GetContainerWindow(nsWindow **aWindow); -
widget/src/mac/nsToolkitBase.cpp
old new 243 243 } 244 244 } 245 245 246 NS_IMETHODIMP 247 nsToolkitBase::AddObserver(nsIToolkitObserver* aObserver) 248 { 249 if (! aObserver) 250 return NS_ERROR_NULL_POINTER; 251 252 if (! mObservers.AppendObject(aObserver)) { 253 return NS_ERROR_FAILURE; 254 } 255 256 return NS_OK; 257 } 258 259 NS_IMETHODIMP 260 nsToolkitBase::RemoveObserver(nsIToolkitObserver* aObserver) 261 { 262 if (! aObserver) 263 return NS_ERROR_NULL_POINTER; 264 265 mObservers.RemoveObject(aObserver); 266 267 return NS_OK; 268 269 } 270 271 void nsToolkitBase::NotifyInvalidated(nsIWidget* aWidget, int x, int y, int width, int height) 272 { 273 PRInt32 count = mObservers.Count(); 274 for (PRInt32 i = 0; i < count; ++i) 275 { 276 (void) mObservers[i]->NotifyInvalidated(aWidget, x, y, width, height); 277 } 278 279 //if (mObserver) 280 // mObserver->NotifyInvalidated(aWidget, x, y, width, height); 281 282 283 } 284 285 246 286 247 287 #pragma mark - 248 288 -
widget/src/mac/nsToolkitBase.h
old new 43 43 #include "nsIToolkit.h" 44 44 45 45 #include "nsCOMPtr.h" 46 #include "nsCOMArray.h" 46 47 #include "nsIEventQueueService.h" 47 48 48 49 … … 57 58 58 59 static void PostSleepWakeNotification(const char* aNotification); 59 60 61 void NotifyInvalidated(nsIWidget* aWidget, int x, int y, int width, int height); 62 60 63 protected: 61 64 62 65 virtual nsresult InitEventQueue(PRThread * aThread) = 0; … … 76 79 77 80 CFRunLoopSourceRef mSleepWakeNotificationRLS; 78 81 io_object_t mPowerNotifier; 82 //nsCOMPtr<nsIToolkitObserver> mObserver; 83 nsCOMArray<nsIToolkitObserver> mObservers; 79 84 }; 80 85 81 86 extern nsToolkitBase* NS_CreateToolkitInstance(); -
widget/src/mac/nsWindow.cpp
old new 292 292 293 293 mDestructorCalled = PR_TRUE; 294 294 295 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 296 295 297 //Destroy(); 296 298 297 299 if (mWindowRegion) … … 423 425 NS_IF_RELEASE(mMenuBar); 424 426 SetMenuBar(nsnull); 425 427 428 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 429 426 430 ReportDestroyEvent(); // beard: this seems to cause the window to be deleted. moved all release code to destructor. 427 431 428 432 return NS_OK; … … 533 537 NS_IMETHODIMP nsWindow::Show(PRBool bState) 534 538 { 535 539 mVisible = bState; 540 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 536 541 return NS_OK; 537 542 } 538 543 … … 878 883 { 879 884 if ((mBounds.x != aX) || (mBounds.y != aY)) 880 885 { 886 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 887 881 888 // Invalidate the current location (unless it's the top-level window) 882 889 if ((mParent != nsnull) && (!mIsTopWidgetWindow)) 883 890 Invalidate(PR_FALSE); … … 891 898 892 899 // Report the event 893 900 ReportMoveEvent(); 901 902 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 894 903 } 895 904 return NS_OK; 896 905 } … … 902 911 //------------------------------------------------------------------------- 903 912 NS_IMETHODIMP nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint) 904 913 { 914 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 915 905 916 if ((mBounds.width != aWidth) || (mBounds.height != aHeight)) 906 917 { 918 907 919 // Set the bounds 908 920 mBounds.width = aWidth; 909 921 mBounds.height = aHeight; … … 917 929 918 930 // Report the event 919 931 ReportSizeEvent(); 932 933 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 920 934 } 921 935 else { 922 936 // Recalculate the regions. We always need to do this, our parents may have … … 927 941 Invalidate(PR_FALSE); 928 942 } 929 943 944 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 945 930 946 return NS_OK; 931 947 } 932 948 … … 1051 1067 if ( aIsSynchronous ) 1052 1068 Update(); 1053 1069 1070 NotifyInvalidated(aRect); 1071 1054 1072 return NS_OK; 1055 1073 } 1056 1074 … … 1091 1109 if ( aIsSynchronous ) 1092 1110 Update(); 1093 1111 1112 PRInt32 x, y, width, height; 1113 NS_CONST_CAST(nsIRegion*, aRegion)->GetBoundingBox(&x, &y, &width, &height); 1114 NotifyInvalidated(nsRect(x, y, width, height)); 1115 1094 1116 return NS_OK; 1095 1117 } 1096 1118 … … 1469 1491 1470 1492 NS_ASSERTION(ValidateDrawingState(), "Bad drawing state"); 1471 1493 1494 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1495 1472 1496 return NS_OK; 1473 1497 } 1474 1498 … … 1702 1726 ScrollBits(macRect,aDx,aDy); 1703 1727 1704 1728 EndDraw(); 1729 1730 NotifyInvalidated(scrollRect); 1705 1731 } 1706 1732 } 1707 1733 -
widget/src/mac/nsWindow.h
old new 41 41 #include "nsIPluginWidget.h" 42 42 #include "nsBaseWidget.h" 43 43 #include "nsDeleteObserver.h" 44 #include "nsToolkit.h" 44 45 45 46 #include "nsIWidget.h" 46 47 #include "nsIKBStateControl.h" … … 238 239 void CombineRects ( TRectArray & inRectArray ) ; 239 240 void SortRectsLeftToRight ( TRectArray & inRectArray ) ; 240 241 242 void NotifyInvalidated(const nsRect& aRect) { 243 nsToolkit* tk = NS_STATIC_CAST(nsToolkit*, mToolkit); 244 if (tk) { 245 tk->NotifyInvalidated(this, aRect.x, aRect.y, aRect.width, aRect.height); 246 } 247 } 248 241 249 protected: 242 250 #if DEBUG 243 251 const char* gInstanceClassName; -
widget/src/windows/nsToolkit.cpp
old new 734 734 return nsnull; 735 735 } 736 736 737 NS_IMETHODIMP 738 nsToolkit::AddObserver(nsIToolkitObserver* aObserver) 739 { 740 if (! aObserver) 741 return NS_ERROR_NULL_POINTER; 742 743 if (! mObservers.AppendObject(aObserver)) { 744 return NS_ERROR_FAILURE; 745 } 746 747 return NS_OK; 748 } 749 750 NS_IMETHODIMP 751 nsToolkit::RemoveObserver(nsIToolkitObserver* aObserver) 752 { 753 if (! aObserver) 754 return NS_ERROR_NULL_POINTER; 755 756 mObservers.RemoveObject(aObserver); 757 758 return NS_OK; 759 760 } 761 762 void nsToolkit::NotifyInvalidated(nsIWidget* aWidget, int x, int y, int width, int height) 763 { 764 PRInt32 count = mObservers.Count(); 765 for (PRInt32 i = 0; i < count; ++i) 766 { 767 (void) mObservers[i]->NotifyInvalidated(aWidget, x, y, width, height); 768 } 769 770 //if (mObserver) 771 // mObserver->NotifyInvalidated(aWidget, x, y, width, height); 772 773 774 } 775 737 776 //------------------------------------------------------------------------- 738 777 // 739 778 // Register the window class for the internal window and create the window -
widget/src/windows/nsToolkit.h
old new 46 46 #include "nsWindowAPI.h" 47 47 #include "nsITimer.h" 48 48 #include "nsCOMPtr.h" 49 #include "nsCOMArray.h" 50 51 #include <stdio.h> 49 52 50 53 struct MethodInfo; 51 54 class nsIEventQueue; … … 84 87 PRBool UserIsMovingWindow(void); 85 88 nsIEventQueue* GetEventQueue(void); 86 89 90 NS_IMETHOD AddObserver(nsIToolkitObserver* aObserver); 91 NS_IMETHOD RemoveObserver(nsIToolkitObserver* aObserver); 92 87 93 private: 88 94 ~nsToolkit(); 89 95 void CreateUIThread(void); 90 96 91 97 public: 98 void NotifyInvalidated(nsIWidget* aWidget, int x, int y, int width, int height); 99 92 100 // Window procedure for the internal window 93 101 static LRESULT CALLBACK WindowProc(HWND hWnd, 94 102 UINT Msg, … … 100 108 HWND mDispatchWnd; 101 109 // Thread Id of the "main" Gui thread. 102 110 PRThread *mGuiThread; 111 //nsCOMPtr<nsIToolkitObserver> mObserver; 112 nsCOMArray<nsIToolkitObserver> mObservers; 103 113 104 114 public: 105 115 static HINSTANCE mDllInstance; -
widget/src/windows/nsWindow.cpp
old new 1832 1832 } 1833 1833 #endif 1834 1834 1835 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1836 1835 1837 VERIFY(::DestroyWindow(mWnd)); 1836 1838 1837 1839 mWnd = NULL; … … 1849 1851 1850 1852 NS_IMETHODIMP nsWindow::SetParent(nsIWidget *aNewParent) 1851 1853 { 1854 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1852 1855 if (aNewParent) { 1853 1856 HWND newParent = (HWND)aNewParent->GetNativeData(NS_NATIVE_WINDOW); 1854 1857 NS_ASSERTION(newParent, "Parent widget has a null native window handle"); 1855 1858 ::SetParent(mWnd, newParent); 1859 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 1856 1860 1857 1861 return NS_OK; 1858 1862 } … … 2009 2013 SWP_NOZORDER | SWP_NOACTIVATE); 2010 2014 } 2011 2015 } 2016 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2012 2017 } 2013 2018 mIsVisible = bState; 2014 2019 … … 2056 2061 } 2057 2062 2058 2063 ::SetWindowPos(mWnd, behind, 0, 0, 0, 0, flags); 2064 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2059 2065 return NS_OK; 2060 2066 } 2061 2067 … … 2268 2274 return NS_OK; 2269 2275 } 2270 2276 2277 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2278 2271 2279 mBounds.x = aX; 2272 2280 mBounds.y = aY; 2273 2281 … … 2310 2318 2311 2319 NS_IF_RELEASE(par); 2312 2320 } 2321 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2313 2322 return NS_OK; 2314 2323 } 2315 2324 … … 2328 2337 ResizeTranslucentWindow(aWidth, aHeight); 2329 2338 #endif 2330 2339 2340 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2331 2341 // Set cached value for lightweight and printing 2332 2342 mBounds.width = aWidth; 2333 2343 mBounds.height = aHeight; … … 2358 2368 NS_IF_RELEASE(par); 2359 2369 } 2360 2370 2371 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2372 2361 2373 if (aRepaint) 2362 2374 Invalidate(PR_FALSE); 2363 2375 … … 2380 2392 ResizeTranslucentWindow(aWidth, aHeight); 2381 2393 #endif 2382 2394 2395 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2396 2383 2397 // Set cached value for lightweight and printing 2384 2398 mBounds.x = aX; 2385 2399 mBounds.y = aY; … … 2411 2425 NS_IF_RELEASE(par); 2412 2426 } 2413 2427 2428 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 2429 2414 2430 if (aRepaint) 2415 2431 Invalidate(PR_FALSE); 2416 2432 … … 3234 3250 VERIFY(::UpdateWindow(mWnd)); 3235 3251 } 3236 3252 } 3253 3254 NotifyInvalidated(nsRect(nsPoint(0,0), mBounds.Size())); 3237 3255 } 3238 3256 return NS_OK; 3239 3257 } … … 3274 3292 VERIFY(::UpdateWindow(mWnd)); 3275 3293 } 3276 3294 } 3295 3296 NotifyInvalidated(aRect); 3277 3297 } 3278 3298 return NS_OK; 3279 3299 } … … 3303 3323 rv = NS_ERROR_FAILURE; 3304 3324 } 3305 3325 } 3326 3327 PRInt32 x, y, width, height; 3328 NS_CONST_CAST(nsIRegion*, aRegion)->GetBoundingBox(&x, &y, &width, &height); 3329 NotifyInvalidated(nsRect(x, y, width, height)); 3306 3330 } 3307 3331 return rv; 3308 3332 } … … 3444 3468 3445 3469 ::ScrollWindowEx(mWnd, aDx, aDy, (nsnull != aClipRect) ? &trect : NULL, NULL, 3446 3470 NULL, NULL, SW_INVALIDATE | SW_SCROLLCHILDREN); 3471 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 3447 3472 ::UpdateWindow(mWnd); 3448 3473 return NS_OK; 3449 3474 } … … 3453 3478 // Scroll the entire contents of the window + change the offset of any child windows 3454 3479 ::ScrollWindowEx(mWnd, aDx, aDy, NULL, NULL, NULL, 3455 3480 NULL, SW_INVALIDATE | SW_SCROLLCHILDREN); 3481 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 3456 3482 ::UpdateWindow(mWnd); // Force synchronous generation of NS_PAINT 3457 3483 return NS_OK; 3458 3484 } … … 3470 3496 // Child windows are not scrolled. 3471 3497 ::ScrollWindowEx(mWnd, aDx, aDy, &trect, NULL, NULL, 3472 3498 NULL, SW_INVALIDATE); 3499 NotifyInvalidated(nsRect(nsPoint(0, 0), mBounds.Size())); 3473 3500 ::UpdateWindow(mWnd); // Force synchronous generation of NS_PAINT 3474 3501 return NS_OK; 3475 3502 } … … 8270 8297 // Rollup if the event is outside the popup. 8271 8298 PRBool rollup = !nsWindow::EventIsInsideWindow(inMsg, (nsWindow*)gRollupWidget); 8272 8299 8300 // XXXjgaunt - Linden - to get events to the popup 8301 rollup = PR_FALSE; 8302 8273 8303 if (rollup && (inMsg == WM_MOUSEWHEEL || inMsg == uMSH_MOUSEWHEEL || 8274 8304 inMsg == WM_MOUSEHWHEEL)) 8275 8305 { -
widget/src/windows/nsWindow.h
old new 526 526 527 527 PRBool CanTakeFocus(); 528 528 529 void NotifyInvalidated(const nsRect& aRect) { 530 nsToolkit* tk = NS_STATIC_CAST(nsToolkit*, mToolkit); 531 if (tk) { 532 tk->NotifyInvalidated(this, aRect.x, aRect.y, aRect.width, aRect.height); 533 } 534 } 535 529 536 private: 530 537 531 538 -
xulrunner/installer/mac/Makefile.in
old new 79 79 80 80 # Syntax "chown_root <directory>" 81 81 # Should be equivalent to "chown -R root:admin <directory>" 82 CHOWN_ROOT ?= $(error CHOWN_ROOT must be set to a setuid script.) 82 # MBW -- XXX -- turning this off, since it breaks us. 83 #CHOWN_ROOT ?= $(error CHOWN_ROOT must be set to a setuid script.) 83 84 84 85 # Syntax "chown_revert <directory>" 85 86 # Should be equivalent to "chown -R <getuid> <directory>" 86 CHOWN_REVERT ?= $(error CHOWN_REVERT must be set to a setuid script.) 87 # MBW -- XXX -- turning this off, since it breaks us. 88 #CHOWN_REVERT ?= $(error CHOWN_REVERT must be set to a setuid script.) 87 89 88 90 # Do the real work here: we take $(DIST)/XUL.framework and make it into an 89 91 # installer .pkg bundle. The xulrunner/installer makefile will then pack the … … 94 96 $(RM) -rf $(DIST)/$(STAGEPATH)xulrunner-pkg 95 97 mkdir $(DIST)/$(STAGEPATH)xulrunner-pkg 96 98 chmod -R a+rX,u+w,go-w,-s,-t $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME) 99 # MBW -- XXX -- turning this off, since it breaks us. 100 # create the package directory at least, so rsync doesn't die. 101 mkdir -p $(_ABS_DIST)/$(STAGEPATH)xulrunner-pkg/$(PKG_BASENAME).pkg/Contents/MacOS 97 102 # For some unknown reason, PackageMaker requires absolute paths to everything. 98 unset NEXT_ROOT; \99 $(CHOWN_ROOT) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME) && \100 /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -build -v \101 -p $(_ABS_DIST)/$(STAGEPATH)xulrunner-pkg/$(PKG_BASENAME).pkg \102 -f $(_ABS_DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME) \103 -r $(_ABS_OBJDIR)/resource-stage \104 -i $(_ABS_OBJDIR)/Info.plist \105 -d $(_ABS_OBJDIR)/Description.plist > packagemaker.log; \106 SAVED=$$?; \107 if [ "$$SAVED" == "1" -a \108 `grep -c 'was completed with the following non-fatal errors' < packagemaker.log` -gt 0 ]; then \109 SAVED=0; \110 fi; \111 $(CHOWN_REVERT) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME); \112 exit $$SAVED103 # unset NEXT_ROOT; \ 104 # $(CHOWN_ROOT) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME) && \ 105 # /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -build -v \ 106 # -p $(_ABS_DIST)/$(STAGEPATH)xulrunner-pkg/$(PKG_BASENAME).pkg \ 107 # -f $(_ABS_DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME) \ 108 # -r $(_ABS_OBJDIR)/resource-stage \ 109 # -i $(_ABS_OBJDIR)/Info.plist \ 110 # -d $(_ABS_OBJDIR)/Description.plist > packagemaker.log; \ 111 # SAVED=$$?; \ 112 # if [ "$$SAVED" == "1" -a \ 113 # `grep -c 'was completed with the following non-fatal errors' < packagemaker.log` -gt 0 ]; then \ 114 # SAVED=0; \ 115 # fi; \ 116 # $(CHOWN_REVERT) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME); \ 117 # exit $$SAVED -
widget/src/mac/nsMacTSMMessagePump.cpp
old new 172 172 NS_ASSERTION(err==noErr, "nsMacTSMMessagePump::PositionToOffsetHandler: AEGetParamPtr[TSMRefcon] failed"); 173 173 if (err!=noErr) 174 174 return err; 175 176 if(NULL==eventHandler) 177 return errAEEventNotHandled; 175 178 176 179 // 177 180 // Extract the Position parameter. … … 220 223 NS_ASSERTION(err==noErr, "nsMacTSMMessagePump::OffsetToPositionHandler: AEGetParamPtr[TSMRefcon] failed."); 221 224 if (err!=noErr) 222 225 return err; 226 227 if(NULL==eventHandler) 228 return errAEEventNotHandled; 223 229 224 230 // 225 231 // Extract the Offset parameter … … 264 270 NS_ASSERTION(err==noErr, "nsMacTSMMessagePump::GetAppleEventTSMData: AEGetParamPtr[TSMRefcon] failed."); 265 271 if (err) 266 272 return err; 273 274 if(NULL==*outEventHandler) 275 return errAEEventNotHandled; 267 276 268 277 // 269 278 // get text … … 438 447 NS_ASSERTION(err==noErr, "nsMacTSMMessagePump::UnicodeGetSelectedTextHandler: AEGetParamPtr[TSMRefcon] failed."); 439 448 if (err!=noErr) 440 449 return err; 450 451 if(NULL==eventHandler) 452 return errAEEventNotHandled; 441 453 442 454 // 443 455 // Extract the Offset parameter -
modules/plugin/base/src/nsPluginsDirDarwin.cpp
old new 260 260 static char* p2cstrdup(StringPtr pstr) 261 261 { 262 262 int len = pstr[0]; 263 char* cstr = new char[len + 1];263 char* cstr = (char*)PR_Malloc((len + 1) * sizeof(char)); 264 264 if (cstr != NULL) { 265 265 ::BlockMoveData(pstr + 1, cstr, len); 266 266 cstr[len] = '\0'; … … 373 373 374 374 // fill-in rest of info struct 375 375 int variantCount = info.fVariantCount; 376 info.fMimeTypeArray = new char*[variantCount];377 info.fExtensionArray = new char*[variantCount];376 info.fMimeTypeArray = (char **)PR_Malloc(variantCount * sizeof(char *)); 377 info.fExtensionArray = (char **)PR_Malloc(variantCount * sizeof(char *)); 378 378 if (mi.infoStrings) 379 info.fMimeDescriptionArray = new char*[variantCount];379 info.fMimeDescriptionArray = (char **)PR_Malloc(variantCount * sizeof(char *)); 380 380 381 381 short mimeIndex = 2, descriptionIndex = 2; 382 382 for (int i = 0; i < variantCount; i++) { … … 403 403 { 404 404 if (info.fPluginInfoSize <= sizeof(nsPluginInfo)) 405 405 { 406 delete[] info.fName; 407 delete[] info.fDescription; 406 407 PR_Free(info.fName); 408 PR_Free(info.fDescription); 408 409 int variantCount = info.fVariantCount; 409 410 for (int i = 0; i < variantCount; i++) 410 411 { 411 delete[] info.fMimeTypeArray[i];412 delete[] info.fExtensionArray[i];413 delete[] info.fMimeDescriptionArray[i];412 PR_Free(info.fMimeTypeArray[i]); 413 PR_Free(info.fExtensionArray[i]); 414 PR_Free(info.fMimeDescriptionArray[i]); 414 415 } 415 delete[] info.fMimeTypeArray;416 delete[] info.fMimeDescriptionArray;417 delete[] info.fExtensionArray;418 delete[] info.fFileName;419 delete[] info.fFullPath;416 PR_Free(info.fMimeTypeArray); 417 PR_Free(info.fMimeDescriptionArray); 418 PR_Free(info.fExtensionArray); 419 PR_Free(info.fFileName); 420 PL_strfree(info.fFullPath); 420 421 } 421 422 return NS_OK; 422 423 }
Note: See TracBrowser for help on using the browser.
