gecko/widget/gtk2/nsDragService.cpp
Brian R. Bondy 05fe36a0da Bug 679226 - Fold widget/src into widget. r=roc
--HG--
rename : widget/public/LookAndFeel.h => widget/LookAndFeel.h
rename : widget/public/WidgetTraceEvent.h => widget/WidgetTraceEvent.h
rename : widget/src/android/AndroidBridge.cpp => widget/android/AndroidBridge.cpp
rename : widget/src/android/AndroidBridge.h => widget/android/AndroidBridge.h
rename : widget/src/android/AndroidDirectTexture.cpp => widget/android/AndroidDirectTexture.cpp
rename : widget/src/android/AndroidDirectTexture.h => widget/android/AndroidDirectTexture.h
rename : widget/src/android/AndroidGraphicBuffer.cpp => widget/android/AndroidGraphicBuffer.cpp
rename : widget/src/android/AndroidGraphicBuffer.h => widget/android/AndroidGraphicBuffer.h
rename : widget/src/android/AndroidJNI.cpp => widget/android/AndroidJNI.cpp
rename : widget/src/android/AndroidJavaWrappers.cpp => widget/android/AndroidJavaWrappers.cpp
rename : widget/src/android/AndroidJavaWrappers.h => widget/android/AndroidJavaWrappers.h
rename : widget/src/android/GfxInfo.cpp => widget/android/GfxInfo.cpp
rename : widget/src/android/GfxInfo.h => widget/android/GfxInfo.h
rename : widget/src/android/Makefile.in => widget/android/Makefile.in
rename : widget/src/android/nsAppShell.cpp => widget/android/nsAppShell.cpp
rename : widget/src/android/nsAppShell.h => widget/android/nsAppShell.h
rename : widget/src/android/nsClipboard.cpp => widget/android/nsClipboard.cpp
rename : widget/src/android/nsClipboard.h => widget/android/nsClipboard.h
rename : widget/src/android/nsDeviceContextAndroid.cpp => widget/android/nsDeviceContextAndroid.cpp
rename : widget/src/android/nsDeviceContextAndroid.h => widget/android/nsDeviceContextAndroid.h
rename : widget/src/android/nsFilePicker.cpp => widget/android/nsFilePicker.cpp
rename : widget/src/android/nsFilePicker.h => widget/android/nsFilePicker.h
rename : widget/src/android/nsIAndroidBridge.idl => widget/android/nsIAndroidBridge.idl
rename : widget/src/android/nsIMEPicker.cpp => widget/android/nsIMEPicker.cpp
rename : widget/src/android/nsIMEPicker.h => widget/android/nsIMEPicker.h
rename : widget/src/android/nsIdleServiceAndroid.cpp => widget/android/nsIdleServiceAndroid.cpp
rename : widget/src/android/nsIdleServiceAndroid.h => widget/android/nsIdleServiceAndroid.h
rename : widget/src/android/nsLookAndFeel.cpp => widget/android/nsLookAndFeel.cpp
rename : widget/src/android/nsLookAndFeel.h => widget/android/nsLookAndFeel.h
rename : widget/src/android/nsPrintOptionsAndroid.cpp => widget/android/nsPrintOptionsAndroid.cpp
rename : widget/src/android/nsPrintOptionsAndroid.h => widget/android/nsPrintOptionsAndroid.h
rename : widget/src/android/nsScreenManagerAndroid.cpp => widget/android/nsScreenManagerAndroid.cpp
rename : widget/src/android/nsScreenManagerAndroid.h => widget/android/nsScreenManagerAndroid.h
rename : widget/src/android/nsWidgetFactory.cpp => widget/android/nsWidgetFactory.cpp
rename : widget/src/android/nsWindow.cpp => widget/android/nsWindow.cpp
rename : widget/src/android/nsWindow.h => widget/android/nsWindow.h
rename : widget/src/build/Makefile.in => widget/build/Makefile.in
rename : widget/src/build/nsWinWidgetFactory.cpp => widget/build/nsWinWidgetFactory.cpp
rename : widget/src/build/res/aliasb.cur => widget/build/res/aliasb.cur
rename : widget/src/build/res/cell.cur => widget/build/res/cell.cur
rename : widget/src/build/res/col_resize.cur => widget/build/res/col_resize.cur
rename : widget/src/build/res/copy.cur => widget/build/res/copy.cur
rename : widget/src/build/res/grab.cur => widget/build/res/grab.cur
rename : widget/src/build/res/grabbing.cur => widget/build/res/grabbing.cur
rename : widget/src/build/res/none.cur => widget/build/res/none.cur
rename : widget/src/build/res/row_resize.cur => widget/build/res/row_resize.cur
rename : widget/src/build/res/select.cur => widget/build/res/select.cur
rename : widget/src/build/res/vertical_text.cur => widget/build/res/vertical_text.cur
rename : widget/src/build/res/zoom_in.cur => widget/build/res/zoom_in.cur
rename : widget/src/build/res/zoom_out.cur => widget/build/res/zoom_out.cur
rename : widget/src/build/widget.rc => widget/build/widget.rc
rename : widget/src/cocoa/ComplexTextInputPanel.h => widget/cocoa/ComplexTextInputPanel.h
rename : widget/src/cocoa/ComplexTextInputPanel.mm => widget/cocoa/ComplexTextInputPanel.mm
rename : widget/src/cocoa/CustomCocoaEvents.h => widget/cocoa/CustomCocoaEvents.h
rename : widget/src/cocoa/GfxInfo.h => widget/cocoa/GfxInfo.h
rename : widget/src/cocoa/GfxInfo.mm => widget/cocoa/GfxInfo.mm
rename : widget/src/cocoa/Makefile.in => widget/cocoa/Makefile.in
rename : widget/src/cocoa/TextInputHandler.h => widget/cocoa/TextInputHandler.h
rename : widget/src/cocoa/TextInputHandler.mm => widget/cocoa/TextInputHandler.mm
rename : widget/src/cocoa/WidgetTraceEvent.mm => widget/cocoa/WidgetTraceEvent.mm
rename : widget/src/cocoa/crashtests/373122-1-inner.html => widget/cocoa/crashtests/373122-1-inner.html
rename : widget/src/cocoa/crashtests/373122-1.html => widget/cocoa/crashtests/373122-1.html
rename : widget/src/cocoa/crashtests/397209-1.html => widget/cocoa/crashtests/397209-1.html
rename : widget/src/cocoa/crashtests/403296-1.xhtml => widget/cocoa/crashtests/403296-1.xhtml
rename : widget/src/cocoa/crashtests/419737-1.html => widget/cocoa/crashtests/419737-1.html
rename : widget/src/cocoa/crashtests/435223-1.html => widget/cocoa/crashtests/435223-1.html
rename : widget/src/cocoa/crashtests/444260-1.xul => widget/cocoa/crashtests/444260-1.xul
rename : widget/src/cocoa/crashtests/444864-1.html => widget/cocoa/crashtests/444864-1.html
rename : widget/src/cocoa/crashtests/449111-1.html => widget/cocoa/crashtests/449111-1.html
rename : widget/src/cocoa/crashtests/460349-1.xhtml => widget/cocoa/crashtests/460349-1.xhtml
rename : widget/src/cocoa/crashtests/460387-1.html => widget/cocoa/crashtests/460387-1.html
rename : widget/src/cocoa/crashtests/464589-1.html => widget/cocoa/crashtests/464589-1.html
rename : widget/src/cocoa/crashtests/crashtests.list => widget/cocoa/crashtests/crashtests.list
rename : widget/src/cocoa/cursors/arrowN.tiff => widget/cocoa/cursors/arrowN.tiff
rename : widget/src/cocoa/cursors/arrowS.tiff => widget/cocoa/cursors/arrowS.tiff
rename : widget/src/cocoa/cursors/colResize.tiff => widget/cocoa/cursors/colResize.tiff
rename : widget/src/cocoa/cursors/help.tiff => widget/cocoa/cursors/help.tiff
rename : widget/src/cocoa/cursors/rowResize.tiff => widget/cocoa/cursors/rowResize.tiff
rename : widget/src/cocoa/cursors/sizeNE.tiff => widget/cocoa/cursors/sizeNE.tiff
rename : widget/src/cocoa/cursors/sizeNESW.tiff => widget/cocoa/cursors/sizeNESW.tiff
rename : widget/src/cocoa/cursors/sizeNS.tiff => widget/cocoa/cursors/sizeNS.tiff
rename : widget/src/cocoa/cursors/sizeNW.tiff => widget/cocoa/cursors/sizeNW.tiff
rename : widget/src/cocoa/cursors/sizeNWSE.tiff => widget/cocoa/cursors/sizeNWSE.tiff
rename : widget/src/cocoa/cursors/sizeSE.tiff => widget/cocoa/cursors/sizeSE.tiff
rename : widget/src/cocoa/cursors/sizeSW.tiff => widget/cocoa/cursors/sizeSW.tiff
rename : widget/src/cocoa/cursors/spin1.tiff => widget/cocoa/cursors/spin1.tiff
rename : widget/src/cocoa/cursors/spin2.tiff => widget/cocoa/cursors/spin2.tiff
rename : widget/src/cocoa/cursors/spin3.tiff => widget/cocoa/cursors/spin3.tiff
rename : widget/src/cocoa/cursors/spin4.tiff => widget/cocoa/cursors/spin4.tiff
rename : widget/src/cocoa/cursors/vtIBeam.tiff => widget/cocoa/cursors/vtIBeam.tiff
rename : widget/src/cocoa/cursors/zoomIn.tiff => widget/cocoa/cursors/zoomIn.tiff
rename : widget/src/cocoa/cursors/zoomOut.tiff => widget/cocoa/cursors/zoomOut.tiff
rename : widget/src/cocoa/mozView.h => widget/cocoa/mozView.h
rename : widget/src/cocoa/nsAppShell.h => widget/cocoa/nsAppShell.h
rename : widget/src/cocoa/nsAppShell.mm => widget/cocoa/nsAppShell.mm
rename : widget/src/cocoa/nsBidiKeyboard.h => widget/cocoa/nsBidiKeyboard.h
rename : widget/src/cocoa/nsBidiKeyboard.mm => widget/cocoa/nsBidiKeyboard.mm
rename : widget/src/cocoa/nsChangeObserver.h => widget/cocoa/nsChangeObserver.h
rename : widget/src/cocoa/nsChildView.h => widget/cocoa/nsChildView.h
rename : widget/src/cocoa/nsChildView.mm => widget/cocoa/nsChildView.mm
rename : widget/src/cocoa/nsClipboard.h => widget/cocoa/nsClipboard.h
rename : widget/src/cocoa/nsClipboard.mm => widget/cocoa/nsClipboard.mm
rename : widget/src/cocoa/nsCocoaFeatures.h => widget/cocoa/nsCocoaFeatures.h
rename : widget/src/cocoa/nsCocoaFeatures.mm => widget/cocoa/nsCocoaFeatures.mm
rename : widget/src/cocoa/nsCocoaUtils.h => widget/cocoa/nsCocoaUtils.h
rename : widget/src/cocoa/nsCocoaUtils.mm => widget/cocoa/nsCocoaUtils.mm
rename : widget/src/cocoa/nsCocoaWindow.h => widget/cocoa/nsCocoaWindow.h
rename : widget/src/cocoa/nsCocoaWindow.mm => widget/cocoa/nsCocoaWindow.mm
rename : widget/src/cocoa/nsCursorManager.h => widget/cocoa/nsCursorManager.h
rename : widget/src/cocoa/nsCursorManager.mm => widget/cocoa/nsCursorManager.mm
rename : widget/src/cocoa/nsDeviceContextSpecX.h => widget/cocoa/nsDeviceContextSpecX.h
rename : widget/src/cocoa/nsDeviceContextSpecX.mm => widget/cocoa/nsDeviceContextSpecX.mm
rename : widget/src/cocoa/nsDragService.h => widget/cocoa/nsDragService.h
rename : widget/src/cocoa/nsDragService.mm => widget/cocoa/nsDragService.mm
rename : widget/src/cocoa/nsFilePicker.h => widget/cocoa/nsFilePicker.h
rename : widget/src/cocoa/nsFilePicker.mm => widget/cocoa/nsFilePicker.mm
rename : widget/src/cocoa/nsIdleServiceX.h => widget/cocoa/nsIdleServiceX.h
rename : widget/src/cocoa/nsIdleServiceX.mm => widget/cocoa/nsIdleServiceX.mm
rename : widget/src/cocoa/nsLookAndFeel.h => widget/cocoa/nsLookAndFeel.h
rename : widget/src/cocoa/nsLookAndFeel.mm => widget/cocoa/nsLookAndFeel.mm
rename : widget/src/cocoa/nsMacCursor.h => widget/cocoa/nsMacCursor.h
rename : widget/src/cocoa/nsMacCursor.mm => widget/cocoa/nsMacCursor.mm
rename : widget/src/cocoa/nsMacDockSupport.h => widget/cocoa/nsMacDockSupport.h
rename : widget/src/cocoa/nsMacDockSupport.mm => widget/cocoa/nsMacDockSupport.mm
rename : widget/src/cocoa/nsMenuBarX.h => widget/cocoa/nsMenuBarX.h
rename : widget/src/cocoa/nsMenuBarX.mm => widget/cocoa/nsMenuBarX.mm
rename : widget/src/cocoa/nsMenuBaseX.h => widget/cocoa/nsMenuBaseX.h
rename : widget/src/cocoa/nsMenuGroupOwnerX.h => widget/cocoa/nsMenuGroupOwnerX.h
rename : widget/src/cocoa/nsMenuGroupOwnerX.mm => widget/cocoa/nsMenuGroupOwnerX.mm
rename : widget/src/cocoa/nsMenuItemIconX.h => widget/cocoa/nsMenuItemIconX.h
rename : widget/src/cocoa/nsMenuItemIconX.mm => widget/cocoa/nsMenuItemIconX.mm
rename : widget/src/cocoa/nsMenuItemX.h => widget/cocoa/nsMenuItemX.h
rename : widget/src/cocoa/nsMenuItemX.mm => widget/cocoa/nsMenuItemX.mm
rename : widget/src/cocoa/nsMenuUtilsX.h => widget/cocoa/nsMenuUtilsX.h
rename : widget/src/cocoa/nsMenuUtilsX.mm => widget/cocoa/nsMenuUtilsX.mm
rename : widget/src/cocoa/nsMenuX.h => widget/cocoa/nsMenuX.h
rename : widget/src/cocoa/nsMenuX.mm => widget/cocoa/nsMenuX.mm
rename : widget/src/cocoa/nsNativeThemeCocoa.h => widget/cocoa/nsNativeThemeCocoa.h
rename : widget/src/cocoa/nsNativeThemeCocoa.mm => widget/cocoa/nsNativeThemeCocoa.mm
rename : widget/src/cocoa/nsNativeThemeColors.h => widget/cocoa/nsNativeThemeColors.h
rename : widget/src/cocoa/nsPIWidgetCocoa.idl => widget/cocoa/nsPIWidgetCocoa.idl
rename : widget/src/cocoa/nsPrintDialogX.h => widget/cocoa/nsPrintDialogX.h
rename : widget/src/cocoa/nsPrintDialogX.mm => widget/cocoa/nsPrintDialogX.mm
rename : widget/src/cocoa/nsPrintOptionsX.h => widget/cocoa/nsPrintOptionsX.h
rename : widget/src/cocoa/nsPrintOptionsX.mm => widget/cocoa/nsPrintOptionsX.mm
rename : widget/src/cocoa/nsPrintSettingsX.h => widget/cocoa/nsPrintSettingsX.h
rename : widget/src/cocoa/nsPrintSettingsX.mm => widget/cocoa/nsPrintSettingsX.mm
rename : widget/src/cocoa/nsScreenCocoa.h => widget/cocoa/nsScreenCocoa.h
rename : widget/src/cocoa/nsScreenCocoa.mm => widget/cocoa/nsScreenCocoa.mm
rename : widget/src/cocoa/nsScreenManagerCocoa.h => widget/cocoa/nsScreenManagerCocoa.h
rename : widget/src/cocoa/nsScreenManagerCocoa.mm => widget/cocoa/nsScreenManagerCocoa.mm
rename : widget/src/cocoa/nsSound.h => widget/cocoa/nsSound.h
rename : widget/src/cocoa/nsSound.mm => widget/cocoa/nsSound.mm
rename : widget/src/cocoa/nsStandaloneNativeMenu.h => widget/cocoa/nsStandaloneNativeMenu.h
rename : widget/src/cocoa/nsStandaloneNativeMenu.mm => widget/cocoa/nsStandaloneNativeMenu.mm
rename : widget/src/cocoa/nsToolkit.h => widget/cocoa/nsToolkit.h
rename : widget/src/cocoa/nsToolkit.mm => widget/cocoa/nsToolkit.mm
rename : widget/src/cocoa/nsWidgetFactory.mm => widget/cocoa/nsWidgetFactory.mm
rename : widget/src/cocoa/nsWindowMap.h => widget/cocoa/nsWindowMap.h
rename : widget/src/cocoa/nsWindowMap.mm => widget/cocoa/nsWindowMap.mm
rename : widget/src/cocoa/resources/MainMenu.nib/classes.nib => widget/cocoa/resources/MainMenu.nib/classes.nib
rename : widget/src/cocoa/resources/MainMenu.nib/info.nib => widget/cocoa/resources/MainMenu.nib/info.nib
rename : widget/src/cocoa/resources/MainMenu.nib/keyedobjects.nib => widget/cocoa/resources/MainMenu.nib/keyedobjects.nib
rename : widget/src/crashtests/303901-1.html => widget/crashtests/303901-1.html
rename : widget/src/crashtests/303901-2.html => widget/crashtests/303901-2.html
rename : widget/src/crashtests/380359-1.xhtml => widget/crashtests/380359-1.xhtml
rename : widget/src/crashtests/crashtests.list => widget/crashtests/crashtests.list
rename : widget/src/gonk/Framebuffer.cpp => widget/gonk/Framebuffer.cpp
rename : widget/src/gonk/Framebuffer.h => widget/gonk/Framebuffer.h
rename : widget/src/gonk/Makefile.in => widget/gonk/Makefile.in
rename : widget/src/gonk/nsAppShell.cpp => widget/gonk/nsAppShell.cpp
rename : widget/src/gonk/nsAppShell.h => widget/gonk/nsAppShell.h
rename : widget/src/gonk/nsLookAndFeel.cpp => widget/gonk/nsLookAndFeel.cpp
rename : widget/src/gonk/nsLookAndFeel.h => widget/gonk/nsLookAndFeel.h
rename : widget/src/gonk/nsScreenManagerGonk.cpp => widget/gonk/nsScreenManagerGonk.cpp
rename : widget/src/gonk/nsScreenManagerGonk.h => widget/gonk/nsScreenManagerGonk.h
rename : widget/src/gonk/nsWidgetFactory.cpp => widget/gonk/nsWidgetFactory.cpp
rename : widget/src/gonk/nsWindow.cpp => widget/gonk/nsWindow.cpp
rename : widget/src/gonk/nsWindow.h => widget/gonk/nsWindow.h
rename : widget/src/gtk2/Makefile.in => widget/gtk2/Makefile.in
rename : widget/src/gtk2/WidgetTraceEvent.cpp => widget/gtk2/WidgetTraceEvent.cpp
rename : widget/src/gtk2/crashtests/673390-1.html => widget/gtk2/crashtests/673390-1.html
rename : widget/src/gtk2/crashtests/crashtests.list => widget/gtk2/crashtests/crashtests.list
rename : widget/src/gtk2/gtk2compat.h => widget/gtk2/gtk2compat.h
rename : widget/src/gtk2/gtk2drawing.c => widget/gtk2/gtk2drawing.c
rename : widget/src/gtk2/gtkdrawing.h => widget/gtk2/gtkdrawing.h
rename : widget/src/gtk2/maiRedundantObjectFactory.c => widget/gtk2/maiRedundantObjectFactory.c
rename : widget/src/gtk2/maiRedundantObjectFactory.h => widget/gtk2/maiRedundantObjectFactory.h
rename : widget/src/gtk2/mozcontainer.c => widget/gtk2/mozcontainer.c
rename : widget/src/gtk2/mozcontainer.h => widget/gtk2/mozcontainer.h
rename : widget/src/gtk2/nsAppShell.cpp => widget/gtk2/nsAppShell.cpp
rename : widget/src/gtk2/nsAppShell.h => widget/gtk2/nsAppShell.h
rename : widget/src/gtk2/nsBidiKeyboard.cpp => widget/gtk2/nsBidiKeyboard.cpp
rename : widget/src/gtk2/nsBidiKeyboard.h => widget/gtk2/nsBidiKeyboard.h
rename : widget/src/gtk2/nsCUPSShim.cpp => widget/gtk2/nsCUPSShim.cpp
rename : widget/src/gtk2/nsCUPSShim.h => widget/gtk2/nsCUPSShim.h
rename : widget/src/gtk2/nsClipboard.cpp => widget/gtk2/nsClipboard.cpp
rename : widget/src/gtk2/nsClipboard.h => widget/gtk2/nsClipboard.h
rename : widget/src/gtk2/nsDeviceContextSpecG.cpp => widget/gtk2/nsDeviceContextSpecG.cpp
rename : widget/src/gtk2/nsDeviceContextSpecG.h => widget/gtk2/nsDeviceContextSpecG.h
rename : widget/src/gtk2/nsDragService.cpp => widget/gtk2/nsDragService.cpp
rename : widget/src/gtk2/nsDragService.h => widget/gtk2/nsDragService.h
rename : widget/src/gtk2/nsFilePicker.cpp => widget/gtk2/nsFilePicker.cpp
rename : widget/src/gtk2/nsFilePicker.h => widget/gtk2/nsFilePicker.h
rename : widget/src/gtk2/nsGTKToolkit.h => widget/gtk2/nsGTKToolkit.h
rename : widget/src/gtk2/nsGtkCursors.h => widget/gtk2/nsGtkCursors.h
rename : widget/src/gtk2/nsGtkIMModule.cpp => widget/gtk2/nsGtkIMModule.cpp
rename : widget/src/gtk2/nsGtkIMModule.h => widget/gtk2/nsGtkIMModule.h
rename : widget/src/gtk2/nsGtkKeyUtils.cpp => widget/gtk2/nsGtkKeyUtils.cpp
rename : widget/src/gtk2/nsGtkKeyUtils.h => widget/gtk2/nsGtkKeyUtils.h
rename : widget/src/gtk2/nsIImageToPixbuf.h => widget/gtk2/nsIImageToPixbuf.h
rename : widget/src/gtk2/nsIdleServiceGTK.cpp => widget/gtk2/nsIdleServiceGTK.cpp
rename : widget/src/gtk2/nsIdleServiceGTK.h => widget/gtk2/nsIdleServiceGTK.h
rename : widget/src/gtk2/nsImageToPixbuf.cpp => widget/gtk2/nsImageToPixbuf.cpp
rename : widget/src/gtk2/nsImageToPixbuf.h => widget/gtk2/nsImageToPixbuf.h
rename : widget/src/gtk2/nsLookAndFeel.cpp => widget/gtk2/nsLookAndFeel.cpp
rename : widget/src/gtk2/nsLookAndFeel.h => widget/gtk2/nsLookAndFeel.h
rename : widget/src/gtk2/nsNativeKeyBindings.cpp => widget/gtk2/nsNativeKeyBindings.cpp
rename : widget/src/gtk2/nsNativeKeyBindings.h => widget/gtk2/nsNativeKeyBindings.h
rename : widget/src/gtk2/nsNativeThemeGTK.cpp => widget/gtk2/nsNativeThemeGTK.cpp
rename : widget/src/gtk2/nsNativeThemeGTK.h => widget/gtk2/nsNativeThemeGTK.h
rename : widget/src/gtk2/nsPSPrinters.cpp => widget/gtk2/nsPSPrinters.cpp
rename : widget/src/gtk2/nsPSPrinters.h => widget/gtk2/nsPSPrinters.h
rename : widget/src/gtk2/nsPaperPS.cpp => widget/gtk2/nsPaperPS.cpp
rename : widget/src/gtk2/nsPaperPS.h => widget/gtk2/nsPaperPS.h
rename : widget/src/gtk2/nsPrintDialogGTK.cpp => widget/gtk2/nsPrintDialogGTK.cpp
rename : widget/src/gtk2/nsPrintDialogGTK.h => widget/gtk2/nsPrintDialogGTK.h
rename : widget/src/gtk2/nsPrintOptionsGTK.cpp => widget/gtk2/nsPrintOptionsGTK.cpp
rename : widget/src/gtk2/nsPrintOptionsGTK.h => widget/gtk2/nsPrintOptionsGTK.h
rename : widget/src/gtk2/nsPrintSettingsGTK.cpp => widget/gtk2/nsPrintSettingsGTK.cpp
rename : widget/src/gtk2/nsPrintSettingsGTK.h => widget/gtk2/nsPrintSettingsGTK.h
rename : widget/src/gtk2/nsScreenGtk.cpp => widget/gtk2/nsScreenGtk.cpp
rename : widget/src/gtk2/nsScreenGtk.h => widget/gtk2/nsScreenGtk.h
rename : widget/src/gtk2/nsScreenManagerGtk.cpp => widget/gtk2/nsScreenManagerGtk.cpp
rename : widget/src/gtk2/nsScreenManagerGtk.h => widget/gtk2/nsScreenManagerGtk.h
rename : widget/src/gtk2/nsSound.cpp => widget/gtk2/nsSound.cpp
rename : widget/src/gtk2/nsSound.h => widget/gtk2/nsSound.h
rename : widget/src/gtk2/nsToolkit.cpp => widget/gtk2/nsToolkit.cpp
rename : widget/src/gtk2/nsWidgetFactory.cpp => widget/gtk2/nsWidgetFactory.cpp
rename : widget/src/gtk2/nsWindow.cpp => widget/gtk2/nsWindow.cpp
rename : widget/src/gtk2/nsWindow.h => widget/gtk2/nsWindow.h
rename : widget/src/gtkxtbin/Makefile.in => widget/gtkxtbin/Makefile.in
rename : widget/src/gtkxtbin/gtk2xtbin.c => widget/gtkxtbin/gtk2xtbin.c
rename : widget/src/gtkxtbin/gtk2xtbin.h => widget/gtkxtbin/gtk2xtbin.h
rename : widget/src/gtkxtbin/xembed.h => widget/gtkxtbin/xembed.h
rename : widget/public/nsEvent.h => widget/nsEvent.h
rename : widget/public/nsGUIEvent.h => widget/nsGUIEvent.h
rename : widget/public/nsGUIEventIPC.h => widget/nsGUIEventIPC.h
rename : widget/public/nsIAppShell.idl => widget/nsIAppShell.idl
rename : widget/public/nsIBaseWindow.idl => widget/nsIBaseWindow.idl
rename : widget/public/nsIBidiKeyboard.idl => widget/nsIBidiKeyboard.idl
rename : widget/public/nsIClipboard.idl => widget/nsIClipboard.idl
rename : widget/public/nsIClipboardDragDropHookList.idl => widget/nsIClipboardDragDropHookList.idl
rename : widget/public/nsIClipboardDragDropHooks.idl => widget/nsIClipboardDragDropHooks.idl
rename : widget/public/nsIClipboardHelper.idl => widget/nsIClipboardHelper.idl
rename : widget/public/nsIClipboardOwner.idl => widget/nsIClipboardOwner.idl
rename : widget/public/nsIDeviceContextSpec.h => widget/nsIDeviceContextSpec.h
rename : widget/public/nsIDragService.idl => widget/nsIDragService.idl
rename : widget/public/nsIDragSession.idl => widget/nsIDragSession.idl
rename : widget/public/nsIDragSessionGTK.h => widget/nsIDragSessionGTK.h
rename : widget/public/nsIDragSessionOS2.h => widget/nsIDragSessionOS2.h
rename : widget/public/nsIFilePicker.idl => widget/nsIFilePicker.idl
rename : widget/public/nsIFormatConverter.idl => widget/nsIFormatConverter.idl
rename : widget/public/nsIGfxInfo.idl => widget/nsIGfxInfo.idl
rename : widget/public/nsIGfxInfoDebug.idl => widget/nsIGfxInfoDebug.idl
rename : widget/public/nsIIMEPicker.idl => widget/nsIIMEPicker.idl
rename : widget/public/nsIIdleService.idl => widget/nsIIdleService.idl
rename : widget/public/nsIJumpListBuilder.idl => widget/nsIJumpListBuilder.idl
rename : widget/public/nsIJumpListItem.idl => widget/nsIJumpListItem.idl
rename : widget/public/nsIMacDockSupport.idl => widget/nsIMacDockSupport.idl
rename : widget/public/nsINativeKeyBindings.h => widget/nsINativeKeyBindings.h
rename : widget/public/nsINativeMenuService.h => widget/nsINativeMenuService.h
rename : widget/public/nsIPluginWidget.h => widget/nsIPluginWidget.h
rename : widget/public/nsIPrintDialogService.h => widget/nsIPrintDialogService.h
rename : widget/public/nsIPrintOptions.idl => widget/nsIPrintOptions.idl
rename : widget/public/nsIPrintSession.idl => widget/nsIPrintSession.idl
rename : widget/public/nsIPrintSettings.idl => widget/nsIPrintSettings.idl
rename : widget/public/nsIPrintSettingsService.idl => widget/nsIPrintSettingsService.idl
rename : widget/public/nsIPrintSettingsWin.idl => widget/nsIPrintSettingsWin.idl
rename : widget/public/nsIRollupListener.h => widget/nsIRollupListener.h
rename : widget/public/nsIRwsService.idl => widget/nsIRwsService.idl
rename : widget/public/nsIScreen.idl => widget/nsIScreen.idl
rename : widget/public/nsIScreenManager.idl => widget/nsIScreenManager.idl
rename : widget/public/nsISound.idl => widget/nsISound.idl
rename : widget/public/nsIStandaloneNativeMenu.idl => widget/nsIStandaloneNativeMenu.idl
rename : widget/public/nsITaskbarOverlayIconController.idl => widget/nsITaskbarOverlayIconController.idl
rename : widget/public/nsITaskbarPreview.idl => widget/nsITaskbarPreview.idl
rename : widget/public/nsITaskbarPreviewButton.idl => widget/nsITaskbarPreviewButton.idl
rename : widget/public/nsITaskbarPreviewController.idl => widget/nsITaskbarPreviewController.idl
rename : widget/public/nsITaskbarProgress.idl => widget/nsITaskbarProgress.idl
rename : widget/public/nsITaskbarTabPreview.idl => widget/nsITaskbarTabPreview.idl
rename : widget/public/nsITaskbarWindowPreview.idl => widget/nsITaskbarWindowPreview.idl
rename : widget/public/nsITransferable.idl => widget/nsITransferable.idl
rename : widget/public/nsIWidget.h => widget/nsIWidget.h
rename : widget/public/nsIWinTaskbar.idl => widget/nsIWinTaskbar.idl
rename : widget/public/nsNativeWidget.h => widget/nsNativeWidget.h
rename : widget/public/nsWidgetInitData.h => widget/nsWidgetInitData.h
rename : widget/public/nsWidgetsCID.h => widget/nsWidgetsCID.h
rename : widget/src/os2/Makefile.in => widget/os2/Makefile.in
rename : widget/src/os2/MozSounds.cmd => widget/os2/MozSounds.cmd
rename : widget/src/os2/README.firefox => widget/os2/README.firefox
rename : widget/src/os2/README.seamonkey => widget/os2/README.seamonkey
rename : widget/src/os2/README.thunderbird => widget/os2/README.thunderbird
rename : widget/src/os2/nsAppShell.cpp => widget/os2/nsAppShell.cpp
rename : widget/src/os2/nsAppShell.h => widget/os2/nsAppShell.h
rename : widget/src/os2/nsBidiKeyboard.cpp => widget/os2/nsBidiKeyboard.cpp
rename : widget/src/os2/nsBidiKeyboard.h => widget/os2/nsBidiKeyboard.h
rename : widget/src/os2/nsClipboard.cpp => widget/os2/nsClipboard.cpp
rename : widget/src/os2/nsClipboard.h => widget/os2/nsClipboard.h
rename : widget/src/os2/nsDeviceContextSpecOS2.cpp => widget/os2/nsDeviceContextSpecOS2.cpp
rename : widget/src/os2/nsDeviceContextSpecOS2.h => widget/os2/nsDeviceContextSpecOS2.h
rename : widget/src/os2/nsDragService.cpp => widget/os2/nsDragService.cpp
rename : widget/src/os2/nsDragService.h => widget/os2/nsDragService.h
rename : widget/src/os2/nsFilePicker.cpp => widget/os2/nsFilePicker.cpp
rename : widget/src/os2/nsFilePicker.h => widget/os2/nsFilePicker.h
rename : widget/src/os2/nsGfxDefs.h => widget/os2/nsGfxDefs.h
rename : widget/src/os2/nsIdleServiceOS2.cpp => widget/os2/nsIdleServiceOS2.cpp
rename : widget/src/os2/nsIdleServiceOS2.h => widget/os2/nsIdleServiceOS2.h
rename : widget/src/os2/nsLookAndFeel.cpp => widget/os2/nsLookAndFeel.cpp
rename : widget/src/os2/nsLookAndFeel.h => widget/os2/nsLookAndFeel.h
rename : widget/src/os2/nsOS2Uni.cpp => widget/os2/nsOS2Uni.cpp
rename : widget/src/os2/nsOS2Uni.h => widget/os2/nsOS2Uni.h
rename : widget/src/os2/nsPrintOS2.cpp => widget/os2/nsPrintOS2.cpp
rename : widget/src/os2/nsPrintOS2.h => widget/os2/nsPrintOS2.h
rename : widget/src/os2/nsPrintOptionsOS2.cpp => widget/os2/nsPrintOptionsOS2.cpp
rename : widget/src/os2/nsPrintOptionsOS2.h => widget/os2/nsPrintOptionsOS2.h
rename : widget/src/os2/nsPrintdOS2.h => widget/os2/nsPrintdOS2.h
rename : widget/src/os2/nsRwsService.cpp => widget/os2/nsRwsService.cpp
rename : widget/src/os2/nsRwsService.h => widget/os2/nsRwsService.h
rename : widget/src/os2/nsScreenManagerOS2.cpp => widget/os2/nsScreenManagerOS2.cpp
rename : widget/src/os2/nsScreenManagerOS2.h => widget/os2/nsScreenManagerOS2.h
rename : widget/src/os2/nsScreenOS2.cpp => widget/os2/nsScreenOS2.cpp
rename : widget/src/os2/nsScreenOS2.h => widget/os2/nsScreenOS2.h
rename : widget/src/os2/nsSound.cpp => widget/os2/nsSound.cpp
rename : widget/src/os2/nsSound.h => widget/os2/nsSound.h
rename : widget/src/os2/nsWidgetFactory.cpp => widget/os2/nsWidgetFactory.cpp
rename : widget/src/os2/nsWindow.cpp => widget/os2/nsWindow.cpp
rename : widget/src/os2/nsWindow.h => widget/os2/nsWindow.h
rename : widget/src/os2/os2FrameWindow.cpp => widget/os2/os2FrameWindow.cpp
rename : widget/src/os2/os2FrameWindow.h => widget/os2/os2FrameWindow.h
rename : widget/src/os2/res/aliasb.ptr => widget/os2/res/aliasb.ptr
rename : widget/src/os2/res/arrow_wait.ptr => widget/os2/res/arrow_wait.ptr
rename : widget/src/os2/res/cell.ptr => widget/os2/res/cell.ptr
rename : widget/src/os2/res/col_resize.ptr => widget/os2/res/col_resize.ptr
rename : widget/src/os2/res/copy.ptr => widget/os2/res/copy.ptr
rename : widget/src/os2/res/crosshair.ptr => widget/os2/res/crosshair.ptr
rename : widget/src/os2/res/dndtext.ico => widget/os2/res/dndtext.ico
rename : widget/src/os2/res/dndurl.ico => widget/os2/res/dndurl.ico
rename : widget/src/os2/res/grab.ptr => widget/os2/res/grab.ptr
rename : widget/src/os2/res/grabbing.ptr => widget/os2/res/grabbing.ptr
rename : widget/src/os2/res/help.ptr => widget/os2/res/help.ptr
rename : widget/src/os2/res/none.ptr => widget/os2/res/none.ptr
rename : widget/src/os2/res/row_resize.ptr => widget/os2/res/row_resize.ptr
rename : widget/src/os2/res/select.ptr => widget/os2/res/select.ptr
rename : widget/src/os2/res/vertical_text.ptr => widget/os2/res/vertical_text.ptr
rename : widget/src/os2/res/zoom_in.ptr => widget/os2/res/zoom_in.ptr
rename : widget/src/os2/res/zoom_out.ptr => widget/os2/res/zoom_out.ptr
rename : widget/src/os2/rws.h => widget/os2/rws.h
rename : widget/src/os2/rwserr.h => widget/os2/rwserr.h
rename : widget/src/os2/wdgtos2rc.h => widget/os2/wdgtos2rc.h
rename : widget/src/os2/widget.rc => widget/os2/widget.rc
rename : widget/src/qt/Makefile.in => widget/qt/Makefile.in
rename : widget/src/qt/faststartupqt/Makefile.in => widget/qt/faststartupqt/Makefile.in
rename : widget/src/qt/faststartupqt/mozqwidgetfast.cpp => widget/qt/faststartupqt/mozqwidgetfast.cpp
rename : widget/src/qt/faststartupqt/mozqwidgetfast.h => widget/qt/faststartupqt/mozqwidgetfast.h
rename : widget/src/qt/faststartupqt/nsFastStartupQt.cpp => widget/qt/faststartupqt/nsFastStartupQt.cpp
rename : widget/src/qt/faststartupqt/nsFastStartupQt.h => widget/qt/faststartupqt/nsFastStartupQt.h
rename : widget/src/qt/mozSwipeGesture.cpp => widget/qt/mozSwipeGesture.cpp
rename : widget/src/qt/mozSwipeGesture.h => widget/qt/mozSwipeGesture.h
rename : widget/src/qt/moziqwidget.h => widget/qt/moziqwidget.h
rename : widget/src/qt/mozqorientationsensorfilter.cpp => widget/qt/mozqorientationsensorfilter.cpp
rename : widget/src/qt/mozqorientationsensorfilter.h => widget/qt/mozqorientationsensorfilter.h
rename : widget/src/qt/mozqwidget.cpp => widget/qt/mozqwidget.cpp
rename : widget/src/qt/mozqwidget.h => widget/qt/mozqwidget.h
rename : widget/src/qt/nsAppShell.cpp => widget/qt/nsAppShell.cpp
rename : widget/src/qt/nsAppShell.h => widget/qt/nsAppShell.h
rename : widget/src/qt/nsBidiKeyboard.cpp => widget/qt/nsBidiKeyboard.cpp
rename : widget/src/qt/nsBidiKeyboard.h => widget/qt/nsBidiKeyboard.h
rename : widget/src/qt/nsClipboard.cpp => widget/qt/nsClipboard.cpp
rename : widget/src/qt/nsClipboard.h => widget/qt/nsClipboard.h
rename : widget/src/qt/nsCommonWidget.cpp => widget/qt/nsCommonWidget.cpp
rename : widget/src/qt/nsCommonWidget.h => widget/qt/nsCommonWidget.h
rename : widget/src/qt/nsDeviceContextSpecQt.cpp => widget/qt/nsDeviceContextSpecQt.cpp
rename : widget/src/qt/nsDeviceContextSpecQt.h => widget/qt/nsDeviceContextSpecQt.h
rename : widget/src/qt/nsDragService.cpp => widget/qt/nsDragService.cpp
rename : widget/src/qt/nsDragService.h => widget/qt/nsDragService.h
rename : widget/src/qt/nsFilePicker.cpp => widget/qt/nsFilePicker.cpp
rename : widget/src/qt/nsFilePicker.h => widget/qt/nsFilePicker.h
rename : widget/src/qt/nsIdleServiceQt.cpp => widget/qt/nsIdleServiceQt.cpp
rename : widget/src/qt/nsIdleServiceQt.h => widget/qt/nsIdleServiceQt.h
rename : widget/src/qt/nsLookAndFeel.cpp => widget/qt/nsLookAndFeel.cpp
rename : widget/src/qt/nsLookAndFeel.h => widget/qt/nsLookAndFeel.h
rename : widget/src/qt/nsMFilePicker.cpp => widget/qt/nsMFilePicker.cpp
rename : widget/src/qt/nsMFilePicker.h => widget/qt/nsMFilePicker.h
rename : widget/src/qt/nsNativeThemeQt.cpp => widget/qt/nsNativeThemeQt.cpp
rename : widget/src/qt/nsNativeThemeQt.h => widget/qt/nsNativeThemeQt.h
rename : widget/src/qt/nsPrintDialogQt.cpp => widget/qt/nsPrintDialogQt.cpp
rename : widget/src/qt/nsPrintDialogQt.h => widget/qt/nsPrintDialogQt.h
rename : widget/src/qt/nsPrintOptionsQt.cpp => widget/qt/nsPrintOptionsQt.cpp
rename : widget/src/qt/nsPrintOptionsQt.h => widget/qt/nsPrintOptionsQt.h
rename : widget/src/qt/nsPrintSettingsQt.cpp => widget/qt/nsPrintSettingsQt.cpp
rename : widget/src/qt/nsPrintSettingsQt.h => widget/qt/nsPrintSettingsQt.h
rename : widget/src/qt/nsQtKeyUtils.cpp => widget/qt/nsQtKeyUtils.cpp
rename : widget/src/qt/nsQtKeyUtils.h => widget/qt/nsQtKeyUtils.h
rename : widget/src/qt/nsScreenManagerQt.cpp => widget/qt/nsScreenManagerQt.cpp
rename : widget/src/qt/nsScreenManagerQt.h => widget/qt/nsScreenManagerQt.h
rename : widget/src/qt/nsScreenQt.cpp => widget/qt/nsScreenQt.cpp
rename : widget/src/qt/nsScreenQt.h => widget/qt/nsScreenQt.h
rename : widget/src/qt/nsSound.cpp => widget/qt/nsSound.cpp
rename : widget/src/qt/nsSound.h => widget/qt/nsSound.h
rename : widget/src/qt/nsWidgetFactory.cpp => widget/qt/nsWidgetFactory.cpp
rename : widget/src/qt/nsWindow.cpp => widget/qt/nsWindow.cpp
rename : widget/src/qt/nsWindow.h => widget/qt/nsWindow.h
rename : widget/src/shared/Makefile.in => widget/shared/Makefile.in
rename : widget/src/shared/WidgetUtils.cpp => widget/shared/WidgetUtils.cpp
rename : widget/src/shared/WidgetUtils.h => widget/shared/WidgetUtils.h
rename : widget/src/shared/nsShmImage.cpp => widget/shared/nsShmImage.cpp
rename : widget/src/shared/nsShmImage.h => widget/shared/nsShmImage.h
rename : widget/src/shared/x11/Makefile.in => widget/shared/x11/Makefile.in
rename : widget/src/shared/x11/keysym2ucs.c => widget/shared/x11/keysym2ucs.c
rename : widget/src/shared/x11/keysym2ucs.h => widget/shared/x11/keysym2ucs.h
rename : widget/src/windows/AudioSession.cpp => widget/windows/AudioSession.cpp
rename : widget/src/windows/AudioSession.h => widget/windows/AudioSession.h
rename : widget/src/windows/GfxInfo.cpp => widget/windows/GfxInfo.cpp
rename : widget/src/windows/GfxInfo.h => widget/windows/GfxInfo.h
rename : widget/src/windows/IEnumFE.cpp => widget/windows/IEnumFE.cpp
rename : widget/src/windows/IEnumFE.h => widget/windows/IEnumFE.h
rename : widget/src/windows/JumpListBuilder.cpp => widget/windows/JumpListBuilder.cpp
rename : widget/src/windows/JumpListBuilder.h => widget/windows/JumpListBuilder.h
rename : widget/src/windows/JumpListItem.cpp => widget/windows/JumpListItem.cpp
rename : widget/src/windows/JumpListItem.h => widget/windows/JumpListItem.h
rename : widget/src/windows/KeyboardLayout.cpp => widget/windows/KeyboardLayout.cpp
rename : widget/src/windows/KeyboardLayout.h => widget/windows/KeyboardLayout.h
rename : widget/src/windows/LSPAnnotator.cpp => widget/windows/LSPAnnotator.cpp
rename : widget/src/windows/Makefile.in => widget/windows/Makefile.in
rename : widget/src/windows/TaskbarPreview.cpp => widget/windows/TaskbarPreview.cpp
rename : widget/src/windows/TaskbarPreview.h => widget/windows/TaskbarPreview.h
rename : widget/src/windows/TaskbarPreviewButton.cpp => widget/windows/TaskbarPreviewButton.cpp
rename : widget/src/windows/TaskbarPreviewButton.h => widget/windows/TaskbarPreviewButton.h
rename : widget/src/windows/TaskbarTabPreview.cpp => widget/windows/TaskbarTabPreview.cpp
rename : widget/src/windows/TaskbarTabPreview.h => widget/windows/TaskbarTabPreview.h
rename : widget/src/windows/TaskbarWindowPreview.cpp => widget/windows/TaskbarWindowPreview.cpp
rename : widget/src/windows/TaskbarWindowPreview.h => widget/windows/TaskbarWindowPreview.h
rename : widget/src/windows/WidgetTraceEvent.cpp => widget/windows/WidgetTraceEvent.cpp
rename : widget/src/windows/WinTaskbar.cpp => widget/windows/WinTaskbar.cpp
rename : widget/src/windows/WinTaskbar.h => widget/windows/WinTaskbar.h
rename : widget/src/windows/WindowHook.cpp => widget/windows/WindowHook.cpp
rename : widget/src/windows/WindowHook.h => widget/windows/WindowHook.h
rename : widget/src/windows/nsAppShell.cpp => widget/windows/nsAppShell.cpp
rename : widget/src/windows/nsAppShell.h => widget/windows/nsAppShell.h
rename : widget/src/windows/nsBidiKeyboard.cpp => widget/windows/nsBidiKeyboard.cpp
rename : widget/src/windows/nsBidiKeyboard.h => widget/windows/nsBidiKeyboard.h
rename : widget/src/windows/nsClipboard.cpp => widget/windows/nsClipboard.cpp
rename : widget/src/windows/nsClipboard.h => widget/windows/nsClipboard.h
rename : widget/src/windows/nsDataObj.cpp => widget/windows/nsDataObj.cpp
rename : widget/src/windows/nsDataObj.h => widget/windows/nsDataObj.h
rename : widget/src/windows/nsDataObjCollection.cpp => widget/windows/nsDataObjCollection.cpp
rename : widget/src/windows/nsDataObjCollection.h => widget/windows/nsDataObjCollection.h
rename : widget/src/windows/nsDeviceContextSpecWin.cpp => widget/windows/nsDeviceContextSpecWin.cpp
rename : widget/src/windows/nsDeviceContextSpecWin.h => widget/windows/nsDeviceContextSpecWin.h
rename : widget/src/windows/nsDragService.cpp => widget/windows/nsDragService.cpp
rename : widget/src/windows/nsDragService.h => widget/windows/nsDragService.h
rename : widget/src/windows/nsFilePicker.cpp => widget/windows/nsFilePicker.cpp
rename : widget/src/windows/nsFilePicker.h => widget/windows/nsFilePicker.h
rename : widget/src/windows/nsIMM32Handler.cpp => widget/windows/nsIMM32Handler.cpp
rename : widget/src/windows/nsIMM32Handler.h => widget/windows/nsIMM32Handler.h
rename : widget/src/windows/nsIdleServiceWin.cpp => widget/windows/nsIdleServiceWin.cpp
rename : widget/src/windows/nsIdleServiceWin.h => widget/windows/nsIdleServiceWin.h
rename : widget/src/windows/nsImageClipboard.cpp => widget/windows/nsImageClipboard.cpp
rename : widget/src/windows/nsImageClipboard.h => widget/windows/nsImageClipboard.h
rename : widget/src/windows/nsLookAndFeel.cpp => widget/windows/nsLookAndFeel.cpp
rename : widget/src/windows/nsLookAndFeel.h => widget/windows/nsLookAndFeel.h
rename : widget/src/windows/nsNativeDragSource.cpp => widget/windows/nsNativeDragSource.cpp
rename : widget/src/windows/nsNativeDragSource.h => widget/windows/nsNativeDragSource.h
rename : widget/src/windows/nsNativeDragTarget.cpp => widget/windows/nsNativeDragTarget.cpp
rename : widget/src/windows/nsNativeDragTarget.h => widget/windows/nsNativeDragTarget.h
rename : widget/src/windows/nsNativeThemeWin.cpp => widget/windows/nsNativeThemeWin.cpp
rename : widget/src/windows/nsNativeThemeWin.h => widget/windows/nsNativeThemeWin.h
rename : widget/src/windows/nsPrintOptionsWin.cpp => widget/windows/nsPrintOptionsWin.cpp
rename : widget/src/windows/nsPrintOptionsWin.h => widget/windows/nsPrintOptionsWin.h
rename : widget/src/windows/nsPrintSettingsWin.cpp => widget/windows/nsPrintSettingsWin.cpp
rename : widget/src/windows/nsPrintSettingsWin.h => widget/windows/nsPrintSettingsWin.h
rename : widget/src/windows/nsScreenManagerWin.cpp => widget/windows/nsScreenManagerWin.cpp
rename : widget/src/windows/nsScreenManagerWin.h => widget/windows/nsScreenManagerWin.h
rename : widget/src/windows/nsScreenWin.cpp => widget/windows/nsScreenWin.cpp
rename : widget/src/windows/nsScreenWin.h => widget/windows/nsScreenWin.h
rename : widget/src/windows/nsSound.cpp => widget/windows/nsSound.cpp
rename : widget/src/windows/nsSound.h => widget/windows/nsSound.h
rename : widget/src/windows/nsTextStore.cpp => widget/windows/nsTextStore.cpp
rename : widget/src/windows/nsTextStore.h => widget/windows/nsTextStore.h
rename : widget/src/windows/nsToolkit.cpp => widget/windows/nsToolkit.cpp
rename : widget/src/windows/nsToolkit.h => widget/windows/nsToolkit.h
rename : widget/src/windows/nsUXThemeConstants.h => widget/windows/nsUXThemeConstants.h
rename : widget/src/windows/nsUXThemeData.cpp => widget/windows/nsUXThemeData.cpp
rename : widget/src/windows/nsUXThemeData.h => widget/windows/nsUXThemeData.h
rename : widget/src/windows/nsWinGesture.cpp => widget/windows/nsWinGesture.cpp
rename : widget/src/windows/nsWinGesture.h => widget/windows/nsWinGesture.h
rename : widget/src/windows/nsWindow.cpp => widget/windows/nsWindow.cpp
rename : widget/src/windows/nsWindow.h => widget/windows/nsWindow.h
rename : widget/src/windows/nsWindowDbg.cpp => widget/windows/nsWindowDbg.cpp
rename : widget/src/windows/nsWindowDbg.h => widget/windows/nsWindowDbg.h
rename : widget/src/windows/nsWindowDefs.h => widget/windows/nsWindowDefs.h
rename : widget/src/windows/nsWindowGfx.cpp => widget/windows/nsWindowGfx.cpp
rename : widget/src/windows/nsWindowGfx.h => widget/windows/nsWindowGfx.h
rename : widget/src/windows/nsdefs.h => widget/windows/nsdefs.h
rename : widget/src/windows/resource.h => widget/windows/resource.h
rename : widget/src/windows/tests/Makefile.in => widget/windows/tests/Makefile.in
rename : widget/src/windows/tests/TestWinDND.cpp => widget/windows/tests/TestWinDND.cpp
rename : widget/src/xpwidgets/GfxDriverInfo.cpp => widget/xpwidgets/GfxDriverInfo.cpp
rename : widget/src/xpwidgets/GfxDriverInfo.h => widget/xpwidgets/GfxDriverInfo.h
rename : widget/src/xpwidgets/GfxInfoBase.cpp => widget/xpwidgets/GfxInfoBase.cpp
rename : widget/src/xpwidgets/GfxInfoBase.h => widget/xpwidgets/GfxInfoBase.h
rename : widget/src/xpwidgets/GfxInfoCollector.h => widget/xpwidgets/GfxInfoCollector.h
rename : widget/src/xpwidgets/GfxInfoWebGL.cpp => widget/xpwidgets/GfxInfoWebGL.cpp
rename : widget/src/xpwidgets/GfxInfoWebGL.h => widget/xpwidgets/GfxInfoWebGL.h
rename : widget/src/xpwidgets/GfxInfoX11.cpp => widget/xpwidgets/GfxInfoX11.cpp
rename : widget/src/xpwidgets/GfxInfoX11.h => widget/xpwidgets/GfxInfoX11.h
rename : widget/src/xpwidgets/Makefile.in => widget/xpwidgets/Makefile.in
rename : widget/src/xpwidgets/PuppetWidget.cpp => widget/xpwidgets/PuppetWidget.cpp
rename : widget/src/xpwidgets/PuppetWidget.h => widget/xpwidgets/PuppetWidget.h
rename : widget/src/xpwidgets/nsAppShellSingleton.h => widget/xpwidgets/nsAppShellSingleton.h
rename : widget/src/xpwidgets/nsBaseAppShell.cpp => widget/xpwidgets/nsBaseAppShell.cpp
rename : widget/src/xpwidgets/nsBaseAppShell.h => widget/xpwidgets/nsBaseAppShell.h
rename : widget/src/xpwidgets/nsBaseClipboard.cpp => widget/xpwidgets/nsBaseClipboard.cpp
rename : widget/src/xpwidgets/nsBaseClipboard.h => widget/xpwidgets/nsBaseClipboard.h
rename : widget/src/xpwidgets/nsBaseDragService.cpp => widget/xpwidgets/nsBaseDragService.cpp
rename : widget/src/xpwidgets/nsBaseDragService.h => widget/xpwidgets/nsBaseDragService.h
rename : widget/src/xpwidgets/nsBaseFilePicker.cpp => widget/xpwidgets/nsBaseFilePicker.cpp
rename : widget/src/xpwidgets/nsBaseFilePicker.h => widget/xpwidgets/nsBaseFilePicker.h
rename : widget/src/xpwidgets/nsBaseWidget.cpp => widget/xpwidgets/nsBaseWidget.cpp
rename : widget/src/xpwidgets/nsBaseWidget.h => widget/xpwidgets/nsBaseWidget.h
rename : widget/src/xpwidgets/nsClipboardHelper.cpp => widget/xpwidgets/nsClipboardHelper.cpp
rename : widget/src/xpwidgets/nsClipboardHelper.h => widget/xpwidgets/nsClipboardHelper.h
rename : widget/src/xpwidgets/nsClipboardPrivacyHandler.cpp => widget/xpwidgets/nsClipboardPrivacyHandler.cpp
rename : widget/src/xpwidgets/nsClipboardPrivacyHandler.h => widget/xpwidgets/nsClipboardPrivacyHandler.h
rename : widget/src/xpwidgets/nsFilePickerProxy.cpp => widget/xpwidgets/nsFilePickerProxy.cpp
rename : widget/src/xpwidgets/nsFilePickerProxy.h => widget/xpwidgets/nsFilePickerProxy.h
rename : widget/src/xpwidgets/nsHTMLFormatConverter.cpp => widget/xpwidgets/nsHTMLFormatConverter.cpp
rename : widget/src/xpwidgets/nsHTMLFormatConverter.h => widget/xpwidgets/nsHTMLFormatConverter.h
rename : widget/src/xpwidgets/nsIdleService.cpp => widget/xpwidgets/nsIdleService.cpp
rename : widget/src/xpwidgets/nsIdleService.h => widget/xpwidgets/nsIdleService.h
rename : widget/src/xpwidgets/nsNativeTheme.cpp => widget/xpwidgets/nsNativeTheme.cpp
rename : widget/src/xpwidgets/nsNativeTheme.h => widget/xpwidgets/nsNativeTheme.h
rename : widget/src/xpwidgets/nsPrimitiveHelpers.cpp => widget/xpwidgets/nsPrimitiveHelpers.cpp
rename : widget/src/xpwidgets/nsPrimitiveHelpers.h => widget/xpwidgets/nsPrimitiveHelpers.h
rename : widget/src/xpwidgets/nsPrintOptionsImpl.cpp => widget/xpwidgets/nsPrintOptionsImpl.cpp
rename : widget/src/xpwidgets/nsPrintOptionsImpl.h => widget/xpwidgets/nsPrintOptionsImpl.h
rename : widget/src/xpwidgets/nsPrintSession.cpp => widget/xpwidgets/nsPrintSession.cpp
rename : widget/src/xpwidgets/nsPrintSession.h => widget/xpwidgets/nsPrintSession.h
rename : widget/src/xpwidgets/nsPrintSettingsImpl.cpp => widget/xpwidgets/nsPrintSettingsImpl.cpp
rename : widget/src/xpwidgets/nsPrintSettingsImpl.h => widget/xpwidgets/nsPrintSettingsImpl.h
rename : widget/src/xpwidgets/nsTransferable.cpp => widget/xpwidgets/nsTransferable.cpp
rename : widget/src/xpwidgets/nsTransferable.h => widget/xpwidgets/nsTransferable.h
rename : widget/src/xpwidgets/nsXPLookAndFeel.cpp => widget/xpwidgets/nsXPLookAndFeel.cpp
rename : widget/src/xpwidgets/nsXPLookAndFeel.h => widget/xpwidgets/nsXPLookAndFeel.h
rename : widget/src/xremoteclient/Makefile.in => widget/xremoteclient/Makefile.in
rename : widget/src/xremoteclient/XRemoteClient.cpp => widget/xremoteclient/XRemoteClient.cpp
rename : widget/src/xremoteclient/XRemoteClient.h => widget/xremoteclient/XRemoteClient.h
rename : widget/src/xremoteclient/XRemoteClientFactory.cpp => widget/xremoteclient/XRemoteClientFactory.cpp
rename : widget/src/xremoteclient/mozilla-xremote-client.cpp => widget/xremoteclient/mozilla-xremote-client.cpp
rename : widget/src/xremoteclient/nsRemoteClient.h => widget/xremoteclient/nsRemoteClient.h
2012-01-03 22:09:29 -05:00

1674 lines
66 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:expandtab:shiftwidth=4:tabstop=4:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Christopher Blizzard <blizzard@mozilla.org>.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Christopher Blizzard <blizzard@mozilla.org>
* Markus G. Kuhn <mkuhn@acm.org>
* Richard Verhoeven <river@win.tue.nl>
* Frank Tang <ftang@netscape.com> adopt into mozilla
* Ginn Chen <ginn.chen@sun.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsDragService.h"
#include "nsIObserverService.h"
#include "nsWidgetsCID.h"
#include "nsWindow.h"
#include "nsIServiceManager.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIIOService.h"
#include "nsIFileURL.h"
#include "nsNetUtil.h"
#include "prlog.h"
#include "nsTArray.h"
#include "nsPrimitiveHelpers.h"
#include "prtime.h"
#include "prthread.h"
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include "nsCRT.h"
#include "mozilla/Services.h"
#include "gfxASurface.h"
#include "gfxXlibSurface.h"
#include "gfxContext.h"
#include "nsImageToPixbuf.h"
#include "nsPresContext.h"
#include "nsIDocument.h"
#include "nsISelection.h"
#include "nsIFrame.h"
// This sets how opaque the drag image is
#define DRAG_IMAGE_ALPHA_LEVEL 0.5
// These values are copied from GtkDragResult (rather than using GtkDragResult
// directly) so that this code can be compiled against versions of GTK+ that
// do not have GtkDragResult.
// GtkDragResult is available from GTK+ version 2.12.
enum {
MOZ_GTK_DRAG_RESULT_SUCCESS,
MOZ_GTK_DRAG_RESULT_NO_TARGET
};
// Some gobject functions expect functions for gpointer arguments.
// gpointer is void* but C++ doesn't like casting functions to void*.
template<class T> static inline gpointer
FuncToGpointer(T aFunction)
{
return reinterpret_cast<gpointer>
(reinterpret_cast<uintptr_t>
// This cast just provides a warning if T is not a function.
(reinterpret_cast<void (*)()>(aFunction)));
}
static PRLogModuleInfo *sDragLm = NULL;
static guint sMotionEventTimerID;
static const char gMimeListType[] = "application/x-moz-internal-item-list";
static const char gMozUrlType[] = "_NETSCAPE_URL";
static const char gTextUriListType[] = "text/uri-list";
static const char gTextPlainUTF8Type[] = "text/plain;charset=utf-8";
static void
invisibleSourceDragBegin(GtkWidget *aWidget,
GdkDragContext *aContext,
gpointer aData);
static void
invisibleSourceDragEnd(GtkWidget *aWidget,
GdkDragContext *aContext,
gpointer aData);
static gboolean
invisibleSourceDragFailed(GtkWidget *aWidget,
GdkDragContext *aContext,
gint aResult,
gpointer aData);
static void
invisibleSourceDragDataGet(GtkWidget *aWidget,
GdkDragContext *aContext,
GtkSelectionData *aSelectionData,
guint aInfo,
guint32 aTime,
gpointer aData);
nsDragService::nsDragService()
{
// We have to destroy the hidden widget before the event loop stops
// running.
nsCOMPtr<nsIObserverService> obsServ =
mozilla::services::GetObserverService();
obsServ->AddObserver(this, "quit-application", false);
// our hidden source widget
mHiddenWidget = gtk_invisible_new();
// make sure that the widget is realized so that
// we can use it as a drag source.
gtk_widget_realize(mHiddenWidget);
// hook up our internal signals so that we can get some feedback
// from our drag source
g_signal_connect(mHiddenWidget, "drag_begin",
G_CALLBACK(invisibleSourceDragBegin), this);
g_signal_connect(mHiddenWidget, "drag_data_get",
G_CALLBACK(invisibleSourceDragDataGet), this);
g_signal_connect(mHiddenWidget, "drag_end",
G_CALLBACK(invisibleSourceDragEnd), this);
// drag-failed is available from GTK+ version 2.12
guint dragFailedID = g_signal_lookup("drag-failed",
G_TYPE_FROM_INSTANCE(mHiddenWidget));
if (dragFailedID) {
g_signal_connect_closure_by_id(mHiddenWidget, dragFailedID, 0,
g_cclosure_new(G_CALLBACK(invisibleSourceDragFailed),
this, NULL),
FALSE);
}
// set up our logging module
if (!sDragLm)
sDragLm = PR_NewLogModule("nsDragService");
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::nsDragService"));
mGrabWidget = 0;
mTargetWidget = 0;
mTargetDragContext = 0;
mTargetTime = 0;
mCanDrop = false;
mTargetDragDataReceived = false;
mTargetDragData = 0;
mTargetDragDataLen = 0;
}
nsDragService::~nsDragService()
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::~nsDragService"));
}
NS_IMPL_ISUPPORTS_INHERITED2(nsDragService, nsBaseDragService,
nsIDragSessionGTK, nsIObserver)
// nsIObserver
NS_IMETHODIMP
nsDragService::Observe(nsISupports *aSubject, const char *aTopic,
const PRUnichar *aData)
{
if (!nsCRT::strcmp(aTopic, "quit-application")) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("nsDragService::Observe(\"quit-application\")"));
if (mHiddenWidget) {
gtk_widget_destroy(mHiddenWidget);
mHiddenWidget = 0;
}
TargetResetData();
} else {
NS_NOTREACHED("unexpected topic");
return NS_ERROR_UNEXPECTED;
}
return NS_OK;
}
// Support for periodic drag events
// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#drag-and-drop-processing-model
// and the Xdnd protocol both recommend that drag events are sent periodically,
// but GTK does not normally provide this.
//
// Here GTK is periodically stimulated by copies of the most recent mouse
// motion events so as to send drag position messages to the destination when
// appropriate (after it has received a status event from the previous
// message).
//
// (If events were sent only on the destination side then the destination
// would have no message to which it could reply with a drag status. Without
// sending a drag status to the source, the destination would not be able to
// change its feedback re whether it could accept the drop, and so the
// source's behavior on drop will not be consistent.)
struct MotionEventData {
MotionEventData(GtkWidget *aWidget, GdkEvent *aEvent)
: mWidget(aWidget), mEvent(gdk_event_copy(aEvent))
{
MOZ_COUNT_CTOR(MotionEventData);
g_object_ref(mWidget);
}
~MotionEventData()
{
MOZ_COUNT_DTOR(MotionEventData);
g_object_unref(mWidget);
gdk_event_free(mEvent);
}
GtkWidget *mWidget;
GdkEvent *mEvent;
};
static void
DestroyMotionEventData(gpointer data)
{
delete static_cast<MotionEventData*>(data);
}
static gboolean
DispatchMotionEventCopy(gpointer aData)
{
MotionEventData *data = static_cast<MotionEventData*>(aData);
// Clear the timer id before OnSourceGrabEventAfter is called during event dispatch.
sMotionEventTimerID = 0;
// If there is no longer a grab on the widget, then the drag is over and
// there is no need to continue drag motion.
if (gtk_grab_get_current() == data->mWidget) {
gtk_propagate_event(data->mWidget, data->mEvent);
}
// Cancel this timer;
// We've already started another if the motion event was dispatched.
return FALSE;
}
static void
OnSourceGrabEventAfter(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
if (event->type != GDK_MOTION_NOTIFY)
return;
if (sMotionEventTimerID) {
g_source_remove(sMotionEventTimerID);
}
MotionEventData *data = new MotionEventData(widget, event);
// G_PRIORITY_DEFAULT_IDLE is lower priority than GDK's redraw idle source
// and lower than GTK's idle source that sends drag position messages after
// motion-notify signals.
//
// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#drag-and-drop-processing-model
// recommends an interval of 350ms +/- 200ms.
sMotionEventTimerID =
g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 350,
DispatchMotionEventCopy, data, DestroyMotionEventData);
}
// nsIDragService
NS_IMETHODIMP
nsDragService::InvokeDragSession(nsIDOMNode *aDOMNode,
nsISupportsArray * aArrayTransferables,
nsIScriptableRegion * aRegion,
PRUint32 aActionType)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::InvokeDragSession"));
nsresult rv = nsBaseDragService::InvokeDragSession(aDOMNode,
aArrayTransferables,
aRegion, aActionType);
NS_ENSURE_SUCCESS(rv, rv);
// make sure that we have an array of transferables to use
if (!aArrayTransferables)
return NS_ERROR_INVALID_ARG;
// set our reference to the transferables. this will also addref
// the transferables since we're going to hang onto this beyond the
// length of this call
mSourceDataItems = aArrayTransferables;
// get the list of items we offer for drags
GtkTargetList *sourceList = GetSourceList();
if (!sourceList)
return NS_OK;
// stored temporarily until the drag-begin signal has been received
mSourceRegion = aRegion;
// save our action type
GdkDragAction action = GDK_ACTION_DEFAULT;
if (aActionType & DRAGDROP_ACTION_COPY)
action = (GdkDragAction)(action | GDK_ACTION_COPY);
if (aActionType & DRAGDROP_ACTION_MOVE)
action = (GdkDragAction)(action | GDK_ACTION_MOVE);
if (aActionType & DRAGDROP_ACTION_LINK)
action = (GdkDragAction)(action | GDK_ACTION_LINK);
// Create a fake event for the drag so we can pass the time
// (so to speak.) If we don't do this the drag can end as a
// result of a button release that is actually _earlier_ than
// CurrentTime. So we use the time on the last button press
// event, as that will always be older than the button release
// that ends any drag.
GdkEvent event;
memset(&event, 0, sizeof(GdkEvent));
event.type = GDK_BUTTON_PRESS;
event.button.window = mHiddenWidget->window;
event.button.time = nsWindow::sLastButtonPressTime;
// start our drag.
GdkDragContext *context = gtk_drag_begin(mHiddenWidget,
sourceList,
action,
1,
&event);
mSourceRegion = nsnull;
if (context) {
// GTK uses another hidden window for receiving mouse events.
mGrabWidget = gtk_grab_get_current();
if (mGrabWidget) {
g_object_ref(mGrabWidget);
// Only motion events are required but connect to
// "event-after" as this is never blocked by other handlers.
g_signal_connect(mGrabWidget, "event-after",
G_CALLBACK(OnSourceGrabEventAfter), NULL);
}
}
else {
rv = NS_ERROR_FAILURE;
}
gtk_target_list_unref(sourceList);
StartDragSession();
return rv;
}
bool
nsDragService::SetAlphaPixmap(gfxASurface *aSurface,
GdkDragContext *aContext,
PRInt32 aXOffset,
PRInt32 aYOffset,
const nsIntRect& dragRect)
{
GdkScreen* screen = gtk_widget_get_screen(mHiddenWidget);
// Transparent drag icons need, like a lot of transparency-related things,
// a compositing X window manager
if (!gdk_screen_is_composited(screen))
return false;
GdkColormap* alphaColormap = gdk_screen_get_rgba_colormap(screen);
if (!alphaColormap)
return false;
GdkPixmap* pixmap = gdk_pixmap_new(NULL, dragRect.width, dragRect.height,
gdk_colormap_get_visual(alphaColormap)->depth);
if (!pixmap)
return false;
gdk_drawable_set_colormap(GDK_DRAWABLE(pixmap), alphaColormap);
// Make a gfxXlibSurface wrapped around the pixmap to render on
nsRefPtr<gfxASurface> xPixmapSurface =
nsWindow::GetSurfaceForGdkDrawable(GDK_DRAWABLE(pixmap),
dragRect.Size());
if (!xPixmapSurface)
return false;
nsRefPtr<gfxContext> xPixmapCtx = new gfxContext(xPixmapSurface);
// Clear it...
xPixmapCtx->SetOperator(gfxContext::OPERATOR_CLEAR);
xPixmapCtx->Paint();
// ...and paint the drag image with translucency
xPixmapCtx->SetOperator(gfxContext::OPERATOR_SOURCE);
xPixmapCtx->SetSource(aSurface);
xPixmapCtx->Paint(DRAG_IMAGE_ALPHA_LEVEL);
// The drag transaction addrefs the pixmap, so we can just unref it from us here
gtk_drag_set_icon_pixmap(aContext, alphaColormap, pixmap, NULL,
aXOffset, aYOffset);
g_object_unref(pixmap);
return true;
}
NS_IMETHODIMP
nsDragService::StartDragSession()
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::StartDragSession"));
return nsBaseDragService::StartDragSession();
}
NS_IMETHODIMP
nsDragService::EndDragSession(bool aDoneDrag)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::EndDragSession %d",
aDoneDrag));
if (mGrabWidget) {
g_signal_handlers_disconnect_by_func(mGrabWidget,
FuncToGpointer(OnSourceGrabEventAfter), NULL);
g_object_unref(mGrabWidget);
mGrabWidget = NULL;
if (sMotionEventTimerID) {
g_source_remove(sMotionEventTimerID);
sMotionEventTimerID = 0;
}
}
// unset our drag action
SetDragAction(DRAGDROP_ACTION_NONE);
return nsBaseDragService::EndDragSession(aDoneDrag);
}
// nsIDragSession
NS_IMETHODIMP
nsDragService::SetCanDrop(bool aCanDrop)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::SetCanDrop %d",
aCanDrop));
mCanDrop = aCanDrop;
return NS_OK;
}
NS_IMETHODIMP
nsDragService::GetCanDrop(bool *aCanDrop)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetCanDrop"));
*aCanDrop = mCanDrop;
return NS_OK;
}
// count the number of URIs in some text/uri-list format data.
static PRUint32
CountTextUriListItems(const char *data,
PRUint32 datalen)
{
const char *p = data;
const char *endPtr = p + datalen;
PRUint32 count = 0;
while (p < endPtr) {
// skip whitespace (if any)
while (p < endPtr && *p != '\0' && isspace(*p))
p++;
// if we aren't at the end of the line ...
if (p != endPtr && *p != '\0' && *p != '\n' && *p != '\r')
count++;
// skip to the end of the line
while (p < endPtr && *p != '\0' && *p != '\n')
p++;
p++; // skip the actual newline as well.
}
return count;
}
// extract an item from text/uri-list formatted data and convert it to
// unicode.
static void
GetTextUriListItem(const char *data,
PRUint32 datalen,
PRUint32 aItemIndex,
PRUnichar **convertedText,
PRInt32 *convertedTextLen)
{
const char *p = data;
const char *endPtr = p + datalen;
unsigned int count = 0;
*convertedText = nsnull;
while (p < endPtr) {
// skip whitespace (if any)
while (p < endPtr && *p != '\0' && isspace(*p))
p++;
// if we aren't at the end of the line, we have a url
if (p != endPtr && *p != '\0' && *p != '\n' && *p != '\r')
count++;
// this is the item we are after ...
if (aItemIndex + 1 == count) {
const char *q = p;
while (q < endPtr && *q != '\0' && *q != '\n' && *q != '\r')
q++;
nsPrimitiveHelpers::ConvertPlatformPlainTextToUnicode(
p, q - p, convertedText, convertedTextLen);
break;
}
// skip to the end of the line
while (p < endPtr && *p != '\0' && *p != '\n')
p++;
p++; // skip the actual newline as well.
}
// didn't find the desired item, so just pass the whole lot
if (!*convertedText) {
nsPrimitiveHelpers::ConvertPlatformPlainTextToUnicode(
data, datalen, convertedText, convertedTextLen);
}
}
NS_IMETHODIMP
nsDragService::GetNumDropItems(PRUint32 * aNumItems)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetNumDropItems"));
bool isList = IsTargetContextList();
if (isList)
mSourceDataItems->Count(aNumItems);
else {
GdkAtom gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE);
GetTargetDragData(gdkFlavor);
if (mTargetDragData) {
const char *data = reinterpret_cast<char*>(mTargetDragData);
*aNumItems = CountTextUriListItems(data, mTargetDragDataLen);
} else
*aNumItems = 1;
}
PR_LOG(sDragLm, PR_LOG_DEBUG, ("%d items", *aNumItems));
return NS_OK;
}
NS_IMETHODIMP
nsDragService::GetData(nsITransferable * aTransferable,
PRUint32 aItemIndex)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::GetData %d", aItemIndex));
// make sure that we have a transferable
if (!aTransferable)
return NS_ERROR_INVALID_ARG;
// get flavor list that includes all acceptable flavors (including
// ones obtained through conversion). Flavors are nsISupportsStrings
// so that they can be seen from JS.
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsISupportsArray> flavorList;
rv = aTransferable->FlavorsTransferableCanImport(
getter_AddRefs(flavorList));
if (NS_FAILED(rv))
return rv;
// count the number of flavors
PRUint32 cnt;
flavorList->Count(&cnt);
unsigned int i;
// check to see if this is an internal list
bool isList = IsTargetContextList();
if (isList) {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("it's a list..."));
// find a matching flavor
for (i = 0; i < cnt; ++i) {
nsCOMPtr<nsISupports> genericWrapper;
flavorList->GetElementAt(i, getter_AddRefs(genericWrapper));
nsCOMPtr<nsISupportsCString> currentFlavor;
currentFlavor = do_QueryInterface(genericWrapper);
if (!currentFlavor)
continue;
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
PR_LOG(sDragLm,
PR_LOG_DEBUG,
("flavor is %s\n", (const char *)flavorStr));
// get the item with the right index
nsCOMPtr<nsISupports> genericItem;
mSourceDataItems->GetElementAt(aItemIndex,
getter_AddRefs(genericItem));
nsCOMPtr<nsITransferable> item(do_QueryInterface(genericItem));
if (!item)
continue;
nsCOMPtr<nsISupports> data;
PRUint32 tmpDataLen = 0;
PR_LOG(sDragLm, PR_LOG_DEBUG,
("trying to get transfer data for %s\n",
(const char *)flavorStr));
rv = item->GetTransferData(flavorStr,
getter_AddRefs(data),
&tmpDataLen);
if (NS_FAILED(rv)) {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("failed.\n"));
continue;
}
PR_LOG(sDragLm, PR_LOG_DEBUG, ("succeeded.\n"));
rv = aTransferable->SetTransferData(flavorStr,data,tmpDataLen);
if (NS_FAILED(rv)) {
PR_LOG(sDragLm,
PR_LOG_DEBUG,
("fail to set transfer data into transferable!\n"));
continue;
}
// ok, we got the data
return NS_OK;
}
// if we got this far, we failed
return NS_ERROR_FAILURE;
}
// Now walk down the list of flavors. When we find one that is
// actually present, copy out the data into the transferable in that
// format. SetTransferData() implicitly handles conversions.
for ( i = 0; i < cnt; ++i ) {
nsCOMPtr<nsISupports> genericWrapper;
flavorList->GetElementAt(i,getter_AddRefs(genericWrapper));
nsCOMPtr<nsISupportsCString> currentFlavor;
currentFlavor = do_QueryInterface(genericWrapper);
if (currentFlavor) {
// find our gtk flavor
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
GdkAtom gdkFlavor = gdk_atom_intern(flavorStr, FALSE);
PR_LOG(sDragLm, PR_LOG_DEBUG,
("looking for data in type %s, gdk flavor %ld\n",
static_cast<const char*>(flavorStr), gdkFlavor));
bool dataFound = false;
if (gdkFlavor) {
GetTargetDragData(gdkFlavor);
}
if (mTargetDragData) {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound = true\n"));
dataFound = true;
}
else {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound = false\n"));
// Dragging and dropping from the file manager would cause us
// to parse the source text as a nsILocalFile URL.
if ( strcmp(flavorStr, kFileMime) == 0 ) {
gdkFlavor = gdk_atom_intern(kTextMime, FALSE);
GetTargetDragData(gdkFlavor);
if (mTargetDragData) {
const char* text = static_cast<char*>(mTargetDragData);
PRUnichar* convertedText = nsnull;
PRInt32 convertedTextLen = 0;
GetTextUriListItem(text, mTargetDragDataLen, aItemIndex,
&convertedText, &convertedTextLen);
if (convertedText) {
nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);
nsCOMPtr<nsIURI> fileURI;
nsresult rv = ioService->NewURI(NS_ConvertUTF16toUTF8(convertedText),
nsnull, nsnull, getter_AddRefs(fileURI));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(fileURI, &rv);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIFile> file;
rv = fileURL->GetFile(getter_AddRefs(file));
if (NS_SUCCEEDED(rv)) {
// The common wrapping code at the end of
// this function assumes the data is text
// and calls text-specific operations.
// Make a secret hideout here for nsILocalFile
// objects and return early.
aTransferable->SetTransferData(flavorStr, file,
convertedTextLen);
g_free(convertedText);
return NS_OK;
}
}
}
g_free(convertedText);
}
continue;
}
}
// if we are looking for text/unicode and we fail to find it
// on the clipboard first, try again with text/plain. If that
// is present, convert it to unicode.
if ( strcmp(flavorStr, kUnicodeMime) == 0 ) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("we were looking for text/unicode... \
trying with text/plain;charset=utf-8\n"));
gdkFlavor = gdk_atom_intern(gTextPlainUTF8Type, FALSE);
GetTargetDragData(gdkFlavor);
if (mTargetDragData) {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("Got textplain data\n"));
const char* castedText =
reinterpret_cast<char*>(mTargetDragData);
PRUnichar* convertedText = nsnull;
NS_ConvertUTF8toUTF16 ucs2string(castedText,
mTargetDragDataLen);
convertedText = ToNewUnicode(ucs2string);
if ( convertedText ) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("successfully converted plain text \
to unicode.\n"));
// out with the old, in with the new
g_free(mTargetDragData);
mTargetDragData = convertedText;
mTargetDragDataLen = ucs2string.Length() * 2;
dataFound = true;
} // if plain text data on clipboard
} else {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("we were looking for text/unicode... \
trying again with text/plain\n"));
gdkFlavor = gdk_atom_intern(kTextMime, FALSE);
GetTargetDragData(gdkFlavor);
if (mTargetDragData) {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("Got textplain data\n"));
const char* castedText =
reinterpret_cast<char*>(mTargetDragData);
PRUnichar* convertedText = nsnull;
PRInt32 convertedTextLen = 0;
nsPrimitiveHelpers::ConvertPlatformPlainTextToUnicode(
castedText, mTargetDragDataLen,
&convertedText, &convertedTextLen);
if ( convertedText ) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("successfully converted plain text \
to unicode.\n"));
// out with the old, in with the new
g_free(mTargetDragData);
mTargetDragData = convertedText;
mTargetDragDataLen = convertedTextLen * 2;
dataFound = true;
} // if plain text data on clipboard
} // if plain text flavor present
} // if plain text charset=utf-8 flavor present
} // if looking for text/unicode
// if we are looking for text/x-moz-url and we failed to find
// it on the clipboard, try again with text/uri-list, and then
// _NETSCAPE_URL
if (strcmp(flavorStr, kURLMime) == 0) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("we were looking for text/x-moz-url...\
trying again with text/uri-list\n"));
gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE);
GetTargetDragData(gdkFlavor);
if (mTargetDragData) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("Got text/uri-list data\n"));
const char *data =
reinterpret_cast<char*>(mTargetDragData);
PRUnichar* convertedText = nsnull;
PRInt32 convertedTextLen = 0;
GetTextUriListItem(data, mTargetDragDataLen, aItemIndex,
&convertedText, &convertedTextLen);
if ( convertedText ) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("successfully converted \
_NETSCAPE_URL to unicode.\n"));
// out with the old, in with the new
g_free(mTargetDragData);
mTargetDragData = convertedText;
mTargetDragDataLen = convertedTextLen * 2;
dataFound = true;
}
}
else {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("failed to get text/uri-list data\n"));
}
if (!dataFound) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("we were looking for text/x-moz-url...\
trying again with _NETSCAP_URL\n"));
gdkFlavor = gdk_atom_intern(gMozUrlType, FALSE);
GetTargetDragData(gdkFlavor);
if (mTargetDragData) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("Got _NETSCAPE_URL data\n"));
const char* castedText =
reinterpret_cast<char*>(mTargetDragData);
PRUnichar* convertedText = nsnull;
PRInt32 convertedTextLen = 0;
nsPrimitiveHelpers::ConvertPlatformPlainTextToUnicode(castedText, mTargetDragDataLen, &convertedText, &convertedTextLen);
if ( convertedText ) {
PR_LOG(sDragLm,
PR_LOG_DEBUG,
("successfully converted _NETSCAPE_URL \
to unicode.\n"));
// out with the old, in with the new
g_free(mTargetDragData);
mTargetDragData = convertedText;
mTargetDragDataLen = convertedTextLen * 2;
dataFound = true;
}
}
else {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("failed to get _NETSCAPE_URL data\n"));
}
}
}
} // else we try one last ditch effort to find our data
if (dataFound) {
// the DOM only wants LF, so convert from MacOS line endings
// to DOM line endings.
nsLinebreakHelpers::ConvertPlatformToDOMLinebreaks(
flavorStr,
&mTargetDragData,
reinterpret_cast<int*>(&mTargetDragDataLen));
// put it into the transferable.
nsCOMPtr<nsISupports> genericDataWrapper;
nsPrimitiveHelpers::CreatePrimitiveForData(flavorStr,
mTargetDragData, mTargetDragDataLen,
getter_AddRefs(genericDataWrapper));
aTransferable->SetTransferData(flavorStr,
genericDataWrapper,
mTargetDragDataLen);
// we found one, get out of this loop!
PR_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound and converted!\n"));
break;
}
} // if (currentFlavor)
} // foreach flavor
return NS_OK;
}
NS_IMETHODIMP
nsDragService::IsDataFlavorSupported(const char *aDataFlavor,
bool *_retval)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::IsDataFlavorSupported %s",
aDataFlavor));
if (!_retval)
return NS_ERROR_INVALID_ARG;
// set this to no by default
*_retval = false;
// check to make sure that we have a drag object set, here
if (!mTargetDragContext) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("*** warning: IsDataFlavorSupported \
called without a valid drag context!\n"));
return NS_OK;
}
// check to see if the target context is a list.
bool isList = IsTargetContextList();
// if it is, just look in the internal data since we are the source
// for it.
if (isList) {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("It's a list.."));
PRUint32 numDragItems = 0;
// if we don't have mDataItems we didn't start this drag so it's
// an external client trying to fool us.
if (!mSourceDataItems)
return NS_OK;
mSourceDataItems->Count(&numDragItems);
for (PRUint32 itemIndex = 0; itemIndex < numDragItems; ++itemIndex) {
nsCOMPtr<nsISupports> genericItem;
mSourceDataItems->GetElementAt(itemIndex,
getter_AddRefs(genericItem));
nsCOMPtr<nsITransferable> currItem(do_QueryInterface(genericItem));
if (currItem) {
nsCOMPtr <nsISupportsArray> flavorList;
currItem->FlavorsTransferableCanExport(
getter_AddRefs(flavorList));
if (flavorList) {
PRUint32 numFlavors;
flavorList->Count( &numFlavors );
for ( PRUint32 flavorIndex = 0;
flavorIndex < numFlavors ;
++flavorIndex ) {
nsCOMPtr<nsISupports> genericWrapper;
flavorList->GetElementAt(flavorIndex,
getter_AddRefs(genericWrapper));
nsCOMPtr<nsISupportsCString> currentFlavor;
currentFlavor = do_QueryInterface(genericWrapper);
if (currentFlavor) {
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
PR_LOG(sDragLm, PR_LOG_DEBUG,
("checking %s against %s\n",
(const char *)flavorStr, aDataFlavor));
if (strcmp(flavorStr, aDataFlavor) == 0) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("boioioioiooioioioing!\n"));
*_retval = true;
}
}
}
}
}
}
return NS_OK;
}
// check the target context vs. this flavor, one at a time
GList *tmp;
for (tmp = mTargetDragContext->targets; tmp; tmp = tmp->next) {
/* Bug 331198 */
GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data);
gchar *name = NULL;
name = gdk_atom_name(atom);
PR_LOG(sDragLm, PR_LOG_DEBUG,
("checking %s against %s\n", name, aDataFlavor));
if (name && (strcmp(name, aDataFlavor) == 0)) {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("good!\n"));
*_retval = true;
}
// check for automatic text/uri-list -> text/x-moz-url mapping
if (!*_retval &&
name &&
(strcmp(name, gTextUriListType) == 0) &&
(strcmp(aDataFlavor, kURLMime) == 0)) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("good! ( it's text/uri-list and \
we're checking against text/x-moz-url )\n"));
*_retval = true;
}
// check for automatic _NETSCAPE_URL -> text/x-moz-url mapping
if (!*_retval &&
name &&
(strcmp(name, gMozUrlType) == 0) &&
(strcmp(aDataFlavor, kURLMime) == 0)) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("good! ( it's _NETSCAPE_URL and \
we're checking against text/x-moz-url )\n"));
*_retval = true;
}
// check for auto text/plain -> text/unicode mapping
if (!*_retval &&
name &&
(strcmp(name, kTextMime) == 0) &&
((strcmp(aDataFlavor, kUnicodeMime) == 0) ||
(strcmp(aDataFlavor, kFileMime) == 0))) {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("good! ( it's text plain and we're checking \
against text/unicode or application/x-moz-file)\n"));
*_retval = true;
}
g_free(name);
}
return NS_OK;
}
// nsIDragSessionGTK
NS_IMETHODIMP
nsDragService::TargetSetLastContext(GtkWidget *aWidget,
GdkDragContext *aContext,
guint aTime)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::TargetSetLastContext"));
mTargetWidget = aWidget;
mTargetDragContext = aContext;
mTargetTime = aTime;
return NS_OK;
}
NS_IMETHODIMP
nsDragService::TargetStartDragMotion(void)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::TargetStartDragMotion"));
mCanDrop = false;
return NS_OK;
}
NS_IMETHODIMP
nsDragService::TargetEndDragMotion(GtkWidget *aWidget,
GdkDragContext *aContext,
guint aTime)
{
PR_LOG(sDragLm, PR_LOG_DEBUG,
("nsDragService::TargetEndDragMotion %d", mCanDrop));
if (mCanDrop) {
GdkDragAction action;
// notify the dragger if we can drop
switch (mDragAction) {
case DRAGDROP_ACTION_COPY:
action = GDK_ACTION_COPY;
break;
case DRAGDROP_ACTION_LINK:
action = GDK_ACTION_LINK;
break;
default:
action = GDK_ACTION_MOVE;
break;
}
gdk_drag_status(aContext, action, aTime);
}
else {
gdk_drag_status(aContext, (GdkDragAction)0, aTime);
}
return NS_OK;
}
NS_IMETHODIMP
nsDragService::TargetDataReceived(GtkWidget *aWidget,
GdkDragContext *aContext,
gint aX,
gint aY,
GtkSelectionData *aSelectionData,
guint aInfo,
guint32 aTime)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::TargetDataReceived"));
TargetResetData();
mTargetDragDataReceived = true;
if (aSelectionData->length > 0) {
mTargetDragDataLen = aSelectionData->length;
mTargetDragData = g_malloc(mTargetDragDataLen);
memcpy(mTargetDragData, aSelectionData->data, mTargetDragDataLen);
}
else {
PR_LOG(sDragLm, PR_LOG_DEBUG,
("Failed to get data. selection data len was %d\n",
aSelectionData->length));
}
return NS_OK;
}
NS_IMETHODIMP
nsDragService::TargetSetTimeCallback(nsIDragSessionGTKTimeCB aCallback)
{
return NS_OK;
}
bool
nsDragService::IsTargetContextList(void)
{
bool retval = false;
if (!mTargetDragContext)
return retval;
// gMimeListType drags only work for drags within a single process.
// The gtk_drag_get_source_widget() function will return NULL if the
// source of the drag is another app, so we use it to check if a
// gMimeListType drop will work or not.
if (gtk_drag_get_source_widget(mTargetDragContext) == NULL)
return retval;
GList *tmp;
// walk the list of context targets and see if one of them is a list
// of items.
for (tmp = mTargetDragContext->targets; tmp; tmp = tmp->next) {
/* Bug 331198 */
GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data);
gchar *name = NULL;
name = gdk_atom_name(atom);
if (name && strcmp(name, gMimeListType) == 0)
retval = true;
g_free(name);
if (retval)
break;
}
return retval;
}
// Maximum time to wait for a "drag_received" arrived, in microseconds
#define NS_DND_TIMEOUT 500000
void
nsDragService::GetTargetDragData(GdkAtom aFlavor)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("getting data flavor %d\n", aFlavor));
PR_LOG(sDragLm, PR_LOG_DEBUG, ("mLastWidget is %p and mLastContext is %p\n",
mTargetWidget, mTargetDragContext));
// reset our target data areas
TargetResetData();
gtk_drag_get_data(mTargetWidget, mTargetDragContext, aFlavor, mTargetTime);
PR_LOG(sDragLm, PR_LOG_DEBUG, ("about to start inner iteration."));
PRTime entryTime = PR_Now();
while (!mTargetDragDataReceived && mDoingDrag) {
// check the number of iterations
PR_LOG(sDragLm, PR_LOG_DEBUG, ("doing iteration...\n"));
PR_Sleep(20*PR_TicksPerSecond()/1000); /* sleep for 20 ms/iteration */
if (PR_Now()-entryTime > NS_DND_TIMEOUT) break;
gtk_main_iteration();
}
PR_LOG(sDragLm, PR_LOG_DEBUG, ("finished inner iteration\n"));
}
void
nsDragService::TargetResetData(void)
{
mTargetDragDataReceived = false;
// make sure to free old data if we have to
g_free(mTargetDragData);
mTargetDragData = 0;
mTargetDragDataLen = 0;
}
GtkTargetList *
nsDragService::GetSourceList(void)
{
if (!mSourceDataItems)
return NULL;
nsTArray<GtkTargetEntry*> targetArray;
GtkTargetEntry *targets;
GtkTargetList *targetList = 0;
PRUint32 targetCount = 0;
unsigned int numDragItems = 0;
mSourceDataItems->Count(&numDragItems);
// Check to see if we're dragging > 1 item.
if (numDragItems > 1) {
// as the Xdnd protocol only supports a single item (or is it just
// gtk's implementation?), we don't advertise all flavours listed
// in the nsITransferable.
// the application/x-moz-internal-item-list format, which preserves
// all information for drags within the same mozilla instance.
GdkAtom listAtom = gdk_atom_intern(gMimeListType, FALSE);
GtkTargetEntry *listTarget =
(GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
listTarget->target = g_strdup(gMimeListType);
listTarget->flags = 0;
/* Bug 331198 */
listTarget->info = NS_PTR_TO_UINT32(listAtom);
PR_LOG(sDragLm, PR_LOG_DEBUG,
("automatically adding target %s with id %ld\n",
listTarget->target, listAtom));
targetArray.AppendElement(listTarget);
// check what flavours are supported so we can decide what other
// targets to advertise.
nsCOMPtr<nsISupports> genericItem;
mSourceDataItems->GetElementAt(0, getter_AddRefs(genericItem));
nsCOMPtr<nsITransferable> currItem(do_QueryInterface(genericItem));
if (currItem) {
nsCOMPtr <nsISupportsArray> flavorList;
currItem->FlavorsTransferableCanExport(getter_AddRefs(flavorList));
if (flavorList) {
PRUint32 numFlavors;
flavorList->Count( &numFlavors );
for (PRUint32 flavorIndex = 0;
flavorIndex < numFlavors ;
++flavorIndex ) {
nsCOMPtr<nsISupports> genericWrapper;
flavorList->GetElementAt(flavorIndex,
getter_AddRefs(genericWrapper));
nsCOMPtr<nsISupportsCString> currentFlavor;
currentFlavor = do_QueryInterface(genericWrapper);
if (currentFlavor) {
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
// check if text/x-moz-url is supported.
// If so, advertise
// text/uri-list.
if (strcmp(flavorStr, kURLMime) == 0) {
listAtom = gdk_atom_intern(gTextUriListType, FALSE);
listTarget =
(GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
listTarget->target = g_strdup(gTextUriListType);
listTarget->flags = 0;
/* Bug 331198 */
listTarget->info = NS_PTR_TO_UINT32(listAtom);
PR_LOG(sDragLm, PR_LOG_DEBUG,
("automatically adding target %s with \
id %ld\n", listTarget->target, listAtom));
targetArray.AppendElement(listTarget);
}
}
} // foreach flavor in item
} // if valid flavor list
} // if item is a transferable
} else if (numDragItems == 1) {
nsCOMPtr<nsISupports> genericItem;
mSourceDataItems->GetElementAt(0, getter_AddRefs(genericItem));
nsCOMPtr<nsITransferable> currItem(do_QueryInterface(genericItem));
if (currItem) {
nsCOMPtr <nsISupportsArray> flavorList;
currItem->FlavorsTransferableCanExport(getter_AddRefs(flavorList));
if (flavorList) {
PRUint32 numFlavors;
flavorList->Count( &numFlavors );
for (PRUint32 flavorIndex = 0;
flavorIndex < numFlavors ;
++flavorIndex ) {
nsCOMPtr<nsISupports> genericWrapper;
flavorList->GetElementAt(flavorIndex,
getter_AddRefs(genericWrapper));
nsCOMPtr<nsISupportsCString> currentFlavor;
currentFlavor = do_QueryInterface(genericWrapper);
if (currentFlavor) {
nsXPIDLCString flavorStr;
currentFlavor->ToString(getter_Copies(flavorStr));
// get the atom
GdkAtom atom = gdk_atom_intern(flavorStr, FALSE);
GtkTargetEntry *target =
(GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
target->target = g_strdup(flavorStr);
target->flags = 0;
/* Bug 331198 */
target->info = NS_PTR_TO_UINT32(atom);
PR_LOG(sDragLm, PR_LOG_DEBUG,
("adding target %s with id %ld\n",
target->target, atom));
targetArray.AppendElement(target);
// Check to see if this is text/unicode.
// If it is, add text/plain
// since we automatically support text/plain
// if we support text/unicode.
if (strcmp(flavorStr, kUnicodeMime) == 0) {
// get the atom for the unicode string
GdkAtom plainUTF8Atom =
gdk_atom_intern(gTextPlainUTF8Type, FALSE);
GtkTargetEntry *plainUTF8Target =
(GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
plainUTF8Target->target = g_strdup(gTextPlainUTF8Type);
plainUTF8Target->flags = 0;
/* Bug 331198 */
plainUTF8Target->info = NS_PTR_TO_UINT32(plainUTF8Atom);
PR_LOG(sDragLm, PR_LOG_DEBUG,
("automatically adding target %s with \
id %ld\n", plainUTF8Target->target, plainUTF8Atom));
targetArray.AppendElement(plainUTF8Target);
// get the atom for the ASCII string
GdkAtom plainAtom =
gdk_atom_intern(kTextMime, FALSE);
GtkTargetEntry *plainTarget =
(GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
plainTarget->target = g_strdup(kTextMime);
plainTarget->flags = 0;
/* Bug 331198 */
plainTarget->info = NS_PTR_TO_UINT32(plainAtom);
PR_LOG(sDragLm, PR_LOG_DEBUG,
("automatically adding target %s with \
id %ld\n", plainTarget->target, plainAtom));
targetArray.AppendElement(plainTarget);
}
// Check to see if this is the x-moz-url type.
// If it is, add _NETSCAPE_URL
// this is a type used by everybody.
if (strcmp(flavorStr, kURLMime) == 0) {
// get the atom name for it
GdkAtom urlAtom =
gdk_atom_intern(gMozUrlType, FALSE);
GtkTargetEntry *urlTarget =
(GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry));
urlTarget->target = g_strdup(gMozUrlType);
urlTarget->flags = 0;
/* Bug 331198 */
urlTarget->info = NS_PTR_TO_UINT32(urlAtom);
PR_LOG(sDragLm, PR_LOG_DEBUG,
("automatically adding target %s with \
id %ld\n", urlTarget->target, urlAtom));
targetArray.AppendElement(urlTarget);
}
}
} // foreach flavor in item
} // if valid flavor list
} // if item is a transferable
} // if it is a single item drag
// get all the elements that we created.
targetCount = targetArray.Length();
if (targetCount) {
// allocate space to create the list of valid targets
targets =
(GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry) * targetCount);
PRUint32 targetIndex;
for ( targetIndex = 0; targetIndex < targetCount; ++targetIndex) {
GtkTargetEntry *disEntry = targetArray.ElementAt(targetIndex);
// this is a string reference but it will be freed later.
targets[targetIndex].target = disEntry->target;
targets[targetIndex].flags = disEntry->flags;
targets[targetIndex].info = disEntry->info;
}
targetList = gtk_target_list_new(targets, targetCount);
// clean up the target list
for (PRUint32 cleanIndex = 0; cleanIndex < targetCount; ++cleanIndex) {
GtkTargetEntry *thisTarget = targetArray.ElementAt(cleanIndex);
g_free(thisTarget->target);
g_free(thisTarget);
}
g_free(targets);
}
return targetList;
}
void
nsDragService::SourceEndDragSession(GdkDragContext *aContext,
gint aResult)
{
// this just releases the list of data items that we provide
mSourceDataItems = nsnull;
if (!mDoingDrag)
return; // EndDragSession() was already called on drop or drag-failed
gint x, y;
GdkDisplay* display = gdk_display_get_default();
if (display) {
gdk_display_get_pointer(display, NULL, &x, &y, NULL);
SetDragEndPoint(nsIntPoint(x, y));
}
// Either the drag was aborted or the drop occurred outside the app.
// The dropEffect of mDataTransfer is not updated for motion outside the
// app, but is needed for the dragend event, so set it now.
PRUint32 dropEffect;
if (aResult == MOZ_GTK_DRAG_RESULT_SUCCESS) {
// With GTK+ versions 2.10.x and prior the drag may have been
// cancelled (but no drag-failed signal would have been sent).
// aContext->dest_window will be non-NULL only if the drop was sent.
GdkDragAction action =
aContext->dest_window ? aContext->action : (GdkDragAction)0;
// Only one bit of action should be set, but, just in case someone
// does something funny, erring away from MOVE, and not recording
// unusual action combinations as NONE.
if (!action)
dropEffect = DRAGDROP_ACTION_NONE;
else if (action & GDK_ACTION_COPY)
dropEffect = DRAGDROP_ACTION_COPY;
else if (action & GDK_ACTION_LINK)
dropEffect = DRAGDROP_ACTION_LINK;
else if (action & GDK_ACTION_MOVE)
dropEffect = DRAGDROP_ACTION_MOVE;
else
dropEffect = DRAGDROP_ACTION_COPY;
} else {
dropEffect = DRAGDROP_ACTION_NONE;
if (aResult != MOZ_GTK_DRAG_RESULT_NO_TARGET) {
mUserCancelled = true;
}
}
nsCOMPtr<nsIDOMNSDataTransfer> dataTransfer =
do_QueryInterface(mDataTransfer);
if (dataTransfer) {
dataTransfer->SetDropEffectInt(dropEffect);
}
// Inform the drag session that we're ending the drag.
EndDragSession(true);
}
static void
CreateUriList(nsISupportsArray *items, gchar **text, gint *length)
{
PRUint32 i, count;
GString *uriList = g_string_new(NULL);
items->Count(&count);
for (i = 0; i < count; i++) {
nsCOMPtr<nsISupports> genericItem;
items->GetElementAt(i, getter_AddRefs(genericItem));
nsCOMPtr<nsITransferable> item;
item = do_QueryInterface(genericItem);
if (item) {
PRUint32 tmpDataLen = 0;
void *tmpData = NULL;
nsresult rv = 0;
nsCOMPtr<nsISupports> data;
rv = item->GetTransferData(kURLMime,
getter_AddRefs(data),
&tmpDataLen);
if (NS_SUCCEEDED(rv)) {
nsPrimitiveHelpers::CreateDataFromPrimitive(kURLMime,
data,
&tmpData,
tmpDataLen);
char* plainTextData = nsnull;
PRUnichar* castedUnicode = reinterpret_cast<PRUnichar*>
(tmpData);
PRInt32 plainTextLen = 0;
nsPrimitiveHelpers::ConvertUnicodeToPlatformPlainText(
castedUnicode,
tmpDataLen / 2,
&plainTextData,
&plainTextLen);
if (plainTextData) {
PRInt32 j;
// text/x-moz-url is of form url + "\n" + title.
// We just want the url.
for (j = 0; j < plainTextLen; j++)
if (plainTextData[j] == '\n' ||
plainTextData[j] == '\r') {
plainTextData[j] = '\0';
break;
}
g_string_append(uriList, plainTextData);
g_string_append(uriList, "\r\n");
// this wasn't allocated with glib
free(plainTextData);
}
if (tmpData) {
// this wasn't allocated with glib
free(tmpData);
}
}
}
}
*text = uriList->str;
*length = uriList->len + 1;
g_string_free(uriList, FALSE); // don't free the data
}
void
nsDragService::SourceDataGet(GtkWidget *aWidget,
GdkDragContext *aContext,
GtkSelectionData *aSelectionData,
guint aInfo,
guint32 aTime)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::SourceDataGet"));
GdkAtom atom = (GdkAtom)aInfo;
nsXPIDLCString mimeFlavor;
gchar *typeName = 0;
typeName = gdk_atom_name(atom);
if (!typeName) {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("failed to get atom name.\n"));
return;
}
PR_LOG(sDragLm, PR_LOG_DEBUG, ("Type is %s\n", typeName));
// make a copy since |nsXPIDLCString| won't use |g_free|...
mimeFlavor.Adopt(nsCRT::strdup(typeName));
g_free(typeName);
// check to make sure that we have data items to return.
if (!mSourceDataItems) {
PR_LOG(sDragLm, PR_LOG_DEBUG, ("Failed to get our data items\n"));
return;
}
nsCOMPtr<nsISupports> genericItem;
mSourceDataItems->GetElementAt(0, getter_AddRefs(genericItem));
nsCOMPtr<nsITransferable> item;
item = do_QueryInterface(genericItem);
if (item) {
// if someone was asking for text/plain, lookup unicode instead so
// we can convert it.
bool needToDoConversionToPlainText = false;
const char* actualFlavor = mimeFlavor;
if (strcmp(mimeFlavor, kTextMime) == 0 ||
strcmp(mimeFlavor, gTextPlainUTF8Type) == 0) {
actualFlavor = kUnicodeMime;
needToDoConversionToPlainText = true;
}
// if someone was asking for _NETSCAPE_URL we need to convert to
// plain text but we also need to look for x-moz-url
else if (strcmp(mimeFlavor, gMozUrlType) == 0) {
actualFlavor = kURLMime;
needToDoConversionToPlainText = true;
}
// if someone was asking for text/uri-list we need to convert to
// plain text.
else if (strcmp(mimeFlavor, gTextUriListType) == 0) {
actualFlavor = gTextUriListType;
needToDoConversionToPlainText = true;
}
else
actualFlavor = mimeFlavor;
PRUint32 tmpDataLen = 0;
void *tmpData = NULL;
nsresult rv;
nsCOMPtr<nsISupports> data;
rv = item->GetTransferData(actualFlavor,
getter_AddRefs(data),
&tmpDataLen);
if (NS_SUCCEEDED(rv)) {
nsPrimitiveHelpers::CreateDataFromPrimitive (actualFlavor, data,
&tmpData, tmpDataLen);
// if required, do the extra work to convert unicode to plain
// text and replace the output values with the plain text.
if (needToDoConversionToPlainText) {
char* plainTextData = nsnull;
PRUnichar* castedUnicode = reinterpret_cast<PRUnichar*>
(tmpData);
PRInt32 plainTextLen = 0;
if (strcmp(mimeFlavor, gTextPlainUTF8Type) == 0) {
plainTextData =
ToNewUTF8String(
nsDependentString(castedUnicode, tmpDataLen / 2),
(PRUint32*)&plainTextLen);
} else {
nsPrimitiveHelpers::ConvertUnicodeToPlatformPlainText(
castedUnicode,
tmpDataLen / 2,
&plainTextData,
&plainTextLen);
}
if (tmpData) {
// this was not allocated using glib
free(tmpData);
tmpData = plainTextData;
tmpDataLen = plainTextLen;
}
}
if (tmpData) {
// this copies the data
gtk_selection_data_set(aSelectionData,
aSelectionData->target,
8,
(guchar *)tmpData, tmpDataLen);
// this wasn't allocated with glib
free(tmpData);
}
} else {
if (strcmp(mimeFlavor, gTextUriListType) == 0) {
// fall back for text/uri-list
gchar *uriList;
gint length;
CreateUriList(mSourceDataItems, &uriList, &length);
gtk_selection_data_set(aSelectionData,
aSelectionData->target,
8, (guchar *)uriList, length);
g_free(uriList);
return;
}
}
}
}
void nsDragService::SetDragIcon(GdkDragContext* aContext)
{
if (!mHasImage && !mSelection)
return;
nsIntRect dragRect;
nsPresContext* pc;
nsRefPtr<gfxASurface> surface;
DrawDrag(mSourceNode, mSourceRegion, mScreenX, mScreenY,
&dragRect, getter_AddRefs(surface), &pc);
if (!pc)
return;
PRInt32 sx = mScreenX, sy = mScreenY;
ConvertToUnscaledDevPixels(pc, &sx, &sy);
PRInt32 offsetX = sx - dragRect.x;
PRInt32 offsetY = sy - dragRect.y;
// If a popup is set as the drag image, use its widget. Otherwise, use
// the surface that DrawDrag created.
if (mDragPopup) {
GtkWidget* gtkWidget = nsnull;
nsIFrame* frame = mDragPopup->GetPrimaryFrame();
if (frame) {
// DrawDrag ensured that this is a popup frame.
nsCOMPtr<nsIWidget> widget = frame->GetNearestWidget();
if (widget) {
gtkWidget = (GtkWidget *)widget->GetNativeData(NS_NATIVE_SHELLWIDGET);
if (gtkWidget) {
OpenDragPopup();
gtk_drag_set_icon_widget(aContext, gtkWidget, offsetX, offsetY);
}
}
}
}
else if (surface) {
if (!SetAlphaPixmap(surface, aContext, offsetX, offsetY, dragRect)) {
GdkPixbuf* dragPixbuf =
nsImageToPixbuf::SurfaceToPixbuf(surface, dragRect.width, dragRect.height);
if (dragPixbuf) {
gtk_drag_set_icon_pixbuf(aContext, dragPixbuf, offsetX, offsetY);
g_object_unref(dragPixbuf);
}
}
}
}
static void
invisibleSourceDragBegin(GtkWidget *aWidget,
GdkDragContext *aContext,
gpointer aData)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("invisibleSourceDragBegin"));
nsDragService *dragService = (nsDragService *)aData;
dragService->SetDragIcon(aContext);
}
static void
invisibleSourceDragDataGet(GtkWidget *aWidget,
GdkDragContext *aContext,
GtkSelectionData *aSelectionData,
guint aInfo,
guint32 aTime,
gpointer aData)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("invisibleSourceDragDataGet"));
nsDragService *dragService = (nsDragService *)aData;
dragService->SourceDataGet(aWidget, aContext,
aSelectionData, aInfo, aTime);
}
static gboolean
invisibleSourceDragFailed(GtkWidget *aWidget,
GdkDragContext *aContext,
gint aResult,
gpointer aData)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("invisibleSourceDragFailed %i", aResult));
nsDragService *dragService = (nsDragService *)aData;
// End the drag session now (rather than waiting for the drag-end signal)
// so that operations performed on dropEffect == none can start immediately
// rather than waiting for the drag-failed animation to finish.
dragService->SourceEndDragSession(aContext, aResult);
// We should return TRUE to disable the drag-failed animation iff the
// source performed an operation when dropEffect was none, but the handler
// of the dragend DOM event doesn't provide this information.
return FALSE;
}
static void
invisibleSourceDragEnd(GtkWidget *aWidget,
GdkDragContext *aContext,
gpointer aData)
{
PR_LOG(sDragLm, PR_LOG_DEBUG, ("invisibleSourceDragEnd"));
nsDragService *dragService = (nsDragService *)aData;
// The drag has ended. Release the hostages!
dragService->SourceEndDragSession(aContext, MOZ_GTK_DRAG_RESULT_SUCCESS);
}