Skip to content

Commit

Permalink
Bug 1123844: Add MOZ_OVERRIDE annotations (and a few 'virtual' annota…
Browse files Browse the repository at this point in the history
…tions) where appropriate, for headers used in widget/gtk. r=karlt
  • Loading branch information
dholbert committed Jan 20, 2015
1 parent 6da5743 commit f63abc1
Show file tree
Hide file tree
Showing 13 changed files with 201 additions and 187 deletions.
34 changes: 18 additions & 16 deletions gfx/thebes/gfxPlatformGtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,21 @@ class gfxPlatformGtk : public gfxPlatform {
CreateOffscreenSurface(const IntSize& size,
gfxContentType contentType) MOZ_OVERRIDE;

mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont);
virtual mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont) MOZ_OVERRIDE;

nsresult GetFontList(nsIAtom *aLangGroup,
const nsACString& aGenericFamily,
nsTArray<nsString>& aListOfFonts);
virtual nsresult GetFontList(nsIAtom *aLangGroup,
const nsACString& aGenericFamily,
nsTArray<nsString>& aListOfFonts) MOZ_OVERRIDE;

nsresult UpdateFontList();
virtual nsresult UpdateFontList() MOZ_OVERRIDE;

nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName);
virtual nsresult GetStandardFamilyName(const nsAString& aFontName,
nsAString& aFamilyName) MOZ_OVERRIDE;

gfxFontGroup *CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
const gfxFontStyle *aStyle,
gfxUserFontSet *aUserFontSet);
virtual gfxFontGroup* CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
const gfxFontStyle *aStyle,
gfxUserFontSet *aUserFontSet) MOZ_OVERRIDE;

/**
* Look up a local platform font using the full font face name (needed to
Expand All @@ -54,7 +55,7 @@ class gfxPlatformGtk : public gfxPlatform {
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,
uint16_t aWeight,
int16_t aStretch,
bool aItalic);
bool aItalic) MOZ_OVERRIDE;

/**
* Activate a platform font (needed to support @font-face src url() )
Expand All @@ -65,14 +66,14 @@ class gfxPlatformGtk : public gfxPlatform {
int16_t aStretch,
bool aItalic,
const uint8_t* aFontData,
uint32_t aLength);
uint32_t aLength) MOZ_OVERRIDE;

/**
* Check whether format is supported on a platform or not (if unclear,
* returns true).
*/
virtual bool IsFontFormatSupported(nsIURI *aFontURI,
uint32_t aFormatFlags);
uint32_t aFormatFlags) MOZ_OVERRIDE;

#if (MOZ_WIDGET_GTK == 2)
static void SetGdkDrawable(cairo_surface_t *target,
Expand Down Expand Up @@ -104,15 +105,16 @@ class gfxPlatformGtk : public gfxPlatform {
#endif
}

virtual gfxImageFormat GetOffscreenFormat();
virtual gfxImageFormat GetOffscreenFormat() MOZ_OVERRIDE;

virtual int GetScreenDepth() const;
virtual int GetScreenDepth() const MOZ_OVERRIDE;

protected:
static gfxFontconfigUtils *sFontconfigUtils;

private:
virtual void GetPlatformCMSOutputProfile(void *&mem, size_t &size);
virtual void GetPlatformCMSOutputProfile(void *&mem,
size_t &size) MOZ_OVERRIDE;

#ifdef MOZ_X11
static bool sUseXRender;
Expand Down
7 changes: 4 additions & 3 deletions gfx/thebes/gfxXlibSurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ class gfxXlibSurface MOZ_FINAL : public gfxASurface {
virtual ~gfxXlibSurface();

virtual already_AddRefed<gfxASurface>
CreateSimilarSurface(gfxContentType aType, const gfxIntSize& aSize);
CreateSimilarSurface(gfxContentType aType,
const gfxIntSize& aSize) MOZ_OVERRIDE;
virtual void Finish() MOZ_OVERRIDE;

virtual const gfxIntSize GetSize() const;
virtual const gfxIntSize GetSize() const MOZ_OVERRIDE;

Display* XDisplay() { return mDisplay; }
Screen* XScreen();
Expand All @@ -80,7 +81,7 @@ class gfxXlibSurface MOZ_FINAL : public gfxASurface {

// This surface is a wrapper around X pixmaps, which are stored in the X
// server, not the main application.
virtual gfxMemoryLocation GetMemoryLocation() const;
virtual gfxMemoryLocation GetMemoryLocation() const MOZ_OVERRIDE;

#if defined(GL_PROVIDER_GLX)
GLXPixmap GetGLXPixmap();
Expand Down
50 changes: 25 additions & 25 deletions widget/GfxInfoX11.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ class GfxInfo MOZ_FINAL : public GfxInfoBase

// We only declare the subset of nsIGfxInfo that we actually implement. The
// rest is brought forward from GfxInfoBase.
NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled);
NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled);
NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID);
NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active);
NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled) MOZ_OVERRIDE;
NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled) MOZ_OVERRIDE;
NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion) MOZ_OVERRIDE;
NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) MOZ_OVERRIDE;
NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate) MOZ_OVERRIDE;
NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) MOZ_OVERRIDE;
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;

virtual nsresult Init();
virtual nsresult Init() MOZ_OVERRIDE;

NS_IMETHOD_(void) GetData();
NS_IMETHOD_(void) GetData() MOZ_OVERRIDE;

#ifdef DEBUG
NS_DECL_ISUPPORTS_INHERITED
Expand All @@ -60,8 +60,8 @@ class GfxInfo MOZ_FINAL : public GfxInfoBase
int32_t *aStatus,
nsAString & aSuggestedDriverVersion,
const nsTArray<GfxDriverInfo>& aDriverInfo,
OperatingSystem* aOS = nullptr);
virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo();
OperatingSystem* aOS = nullptr) MOZ_OVERRIDE;
virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo() MOZ_OVERRIDE;

private:
nsCString mVendor;
Expand Down
3 changes: 2 additions & 1 deletion widget/gtk/WakeLockListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class WakeLockListener MOZ_FINAL : public nsIDOMMozWakeLockListener
static WakeLockListener* GetSingleton(bool aCreate = true);
static void Shutdown();

nsresult Callback(const nsAString& topic, const nsAString& state);
virtual nsresult Callback(const nsAString& topic,
const nsAString& state) MOZ_OVERRIDE;

private:
WakeLockListener();
Expand Down
14 changes: 8 additions & 6 deletions widget/gtk/nsDeviceContextSpecG.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ class nsDeviceContextSpecGTK : public nsIDeviceContextSpec

NS_DECL_ISUPPORTS

NS_IMETHOD GetSurfaceForPrinter(gfxASurface **surface);
NS_IMETHOD GetSurfaceForPrinter(gfxASurface **surface) MOZ_OVERRIDE;

NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS, bool aIsPrintPreview);
NS_IMETHOD BeginDocument(const nsAString& aTitle, char16_t * aPrintToFileName, int32_t aStartPage, int32_t aEndPage);
NS_IMETHOD EndDocument();
NS_IMETHOD BeginPage() { return NS_OK; }
NS_IMETHOD EndPage() { return NS_OK; }
NS_IMETHOD Init(nsIWidget *aWidget, nsIPrintSettings* aPS,
bool aIsPrintPreview) MOZ_OVERRIDE;
NS_IMETHOD BeginDocument(const nsAString& aTitle, char16_t * aPrintToFileName,
int32_t aStartPage, int32_t aEndPage) MOZ_OVERRIDE;
NS_IMETHOD EndDocument() MOZ_OVERRIDE;
NS_IMETHOD BeginPage() MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD EndPage() MOZ_OVERRIDE { return NS_OK; }

NS_IMETHOD GetPath (const char **aPath);
static nsresult GetPrintMethod(const char *aPrinter, PrintMethod &aMethod);
Expand Down
17 changes: 9 additions & 8 deletions widget/gtk/nsDragService.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,18 @@ class nsDragService MOZ_FINAL : public nsBaseDragService,
NS_IMETHOD InvokeDragSession (nsIDOMNode *aDOMNode,
nsISupportsArray * anArrayTransferables,
nsIScriptableRegion * aRegion,
uint32_t aActionType);
NS_IMETHOD StartDragSession();
NS_IMETHOD EndDragSession(bool aDoneDrag);
uint32_t aActionType) MOZ_OVERRIDE;
NS_IMETHOD StartDragSession() MOZ_OVERRIDE;
NS_IMETHOD EndDragSession(bool aDoneDrag) MOZ_OVERRIDE;

// nsIDragSession
NS_IMETHOD SetCanDrop (bool aCanDrop);
NS_IMETHOD GetCanDrop (bool *aCanDrop);
NS_IMETHOD GetNumDropItems (uint32_t * aNumItems);
NS_IMETHOD SetCanDrop (bool aCanDrop) MOZ_OVERRIDE;
NS_IMETHOD GetCanDrop (bool *aCanDrop) MOZ_OVERRIDE;
NS_IMETHOD GetNumDropItems (uint32_t * aNumItems) MOZ_OVERRIDE;
NS_IMETHOD GetData (nsITransferable * aTransferable,
uint32_t aItemIndex);
NS_IMETHOD IsDataFlavorSupported (const char *aDataFlavor, bool *_retval);
uint32_t aItemIndex) MOZ_OVERRIDE;
NS_IMETHOD IsDataFlavorSupported (const char *aDataFlavor,
bool *_retval) MOZ_OVERRIDE;

// Methods called from nsWindow to handle responding to GTK drag
// destination signals
Expand Down
30 changes: 16 additions & 14 deletions widget/gtk/nsFilePicker.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,24 @@ class nsFilePicker : public nsBaseFilePicker
NS_DECL_ISUPPORTS

// nsIFilePicker (less what's in nsBaseFilePicker)
NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback);
NS_IMETHODIMP AppendFilters(int32_t aFilterMask);
NS_IMETHODIMP AppendFilter(const nsAString& aTitle, const nsAString& aFilter);
NS_IMETHODIMP SetDefaultString(const nsAString& aString);
NS_IMETHODIMP GetDefaultString(nsAString& aString);
NS_IMETHODIMP SetDefaultExtension(const nsAString& aExtension);
NS_IMETHODIMP GetDefaultExtension(nsAString& aExtension);
NS_IMETHODIMP GetFilterIndex(int32_t *aFilterIndex);
NS_IMETHODIMP SetFilterIndex(int32_t aFilterIndex);
NS_IMETHODIMP GetFile(nsIFile **aFile);
NS_IMETHODIMP GetFileURL(nsIURI **aFileURL);
NS_IMETHODIMP GetFiles(nsISimpleEnumerator **aFiles);
NS_IMETHODIMP Show(int16_t *aReturn);
NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback) MOZ_OVERRIDE;
NS_IMETHODIMP AppendFilters(int32_t aFilterMask) MOZ_OVERRIDE;
NS_IMETHODIMP AppendFilter(const nsAString& aTitle,
const nsAString& aFilter) MOZ_OVERRIDE;
NS_IMETHODIMP SetDefaultString(const nsAString& aString) MOZ_OVERRIDE;
NS_IMETHODIMP GetDefaultString(nsAString& aString) MOZ_OVERRIDE;
NS_IMETHODIMP SetDefaultExtension(const nsAString& aExtension) MOZ_OVERRIDE;
NS_IMETHODIMP GetDefaultExtension(nsAString& aExtension) MOZ_OVERRIDE;
NS_IMETHODIMP GetFilterIndex(int32_t *aFilterIndex) MOZ_OVERRIDE;
NS_IMETHODIMP SetFilterIndex(int32_t aFilterIndex) MOZ_OVERRIDE;
NS_IMETHODIMP GetFile(nsIFile **aFile) MOZ_OVERRIDE;
NS_IMETHODIMP GetFileURL(nsIURI **aFileURL) MOZ_OVERRIDE;
NS_IMETHODIMP GetFiles(nsISimpleEnumerator **aFiles) MOZ_OVERRIDE;
NS_IMETHODIMP Show(int16_t *aReturn) MOZ_OVERRIDE;

// nsBaseFilePicker
virtual void InitNative(nsIWidget *aParent, const nsAString& aTitle);
virtual void InitNative(nsIWidget *aParent,
const nsAString& aTitle) MOZ_OVERRIDE;

static void Shutdown();

Expand Down
4 changes: 2 additions & 2 deletions widget/gtk/nsIdleServiceGTK.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class nsIdleServiceGTK : public nsIdleService
public:
NS_DECL_ISUPPORTS_INHERITED

bool PollIdleTime(uint32_t* aIdleTime);
virtual bool PollIdleTime(uint32_t* aIdleTime) MOZ_OVERRIDE;

static already_AddRefed<nsIdleServiceGTK> GetInstance()
{
Expand All @@ -46,7 +46,7 @@ class nsIdleServiceGTK : public nsIdleService

protected:
nsIdleServiceGTK();
bool UsePollMode();
virtual bool UsePollMode() MOZ_OVERRIDE;
};

#endif // nsIdleServiceGTK_h__
2 changes: 1 addition & 1 deletion widget/gtk/nsImageToPixbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class nsImageToPixbuf MOZ_FINAL : public nsIImageToPixbuf {

public:
NS_DECL_ISUPPORTS
NS_IMETHOD_(GdkPixbuf*) ConvertImageToPixbuf(imgIContainer* aImage);
NS_IMETHOD_(GdkPixbuf*) ConvertImageToPixbuf(imgIContainer* aImage) MOZ_OVERRIDE;

// Friendlier version of ConvertImageToPixbuf for callers inside of
// widget
Expand Down
35 changes: 19 additions & 16 deletions widget/gtk/nsNativeThemeGTK.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,45 @@ class nsNativeThemeGTK: private nsNativeTheme,
NS_IMETHOD DrawWidgetBackground(nsRenderingContext* aContext,
nsIFrame* aFrame, uint8_t aWidgetType,
const nsRect& aRect,
const nsRect& aDirtyRect);
const nsRect& aDirtyRect) MOZ_OVERRIDE;

NS_IMETHOD GetWidgetBorder(nsDeviceContext* aContext, nsIFrame* aFrame,
uint8_t aWidgetType, nsIntMargin* aResult);
uint8_t aWidgetType,
nsIntMargin* aResult) MOZ_OVERRIDE;

virtual bool GetWidgetPadding(nsDeviceContext* aContext,
nsIFrame* aFrame,
uint8_t aWidgetType,
nsIntMargin* aResult);
nsIFrame* aFrame,
uint8_t aWidgetType,
nsIntMargin* aResult) MOZ_OVERRIDE;

virtual bool GetWidgetOverflow(nsDeviceContext* aContext,
nsIFrame* aFrame,
uint8_t aWidgetType,
nsRect* aOverflowRect);
nsIFrame* aFrame,
uint8_t aWidgetType,
nsRect* aOverflowRect) MOZ_OVERRIDE;

NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext,
nsIFrame* aFrame, uint8_t aWidgetType,
nsIntSize* aResult, bool* aIsOverridable);
nsIntSize* aResult,
bool* aIsOverridable) MOZ_OVERRIDE;

NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
nsIAtom* aAttribute, bool* aShouldRepaint);
nsIAtom* aAttribute,
bool* aShouldRepaint) MOZ_OVERRIDE;

NS_IMETHOD ThemeChanged();
NS_IMETHOD ThemeChanged() MOZ_OVERRIDE;

NS_IMETHOD_(bool) ThemeSupportsWidget(nsPresContext* aPresContext,
nsIFrame* aFrame,
uint8_t aWidgetType);
nsIFrame* aFrame,
uint8_t aWidgetType) MOZ_OVERRIDE;

NS_IMETHOD_(bool) WidgetIsContainer(uint8_t aWidgetType);
NS_IMETHOD_(bool) WidgetIsContainer(uint8_t aWidgetType) MOZ_OVERRIDE;

NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;

bool ThemeNeedsComboboxDropmarker();
virtual bool ThemeNeedsComboboxDropmarker() MOZ_OVERRIDE;

virtual Transparency GetWidgetTransparency(nsIFrame* aFrame,
uint8_t aWidgetType);
uint8_t aWidgetType) MOZ_OVERRIDE;

nsNativeThemeGTK();

Expand Down
6 changes: 3 additions & 3 deletions widget/gtk/nsPrintDialogGTK.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class nsPrintDialogServiceGTK : public nsIPrintDialogService

NS_DECL_ISUPPORTS

NS_IMETHODIMP Init();
NS_IMETHODIMP Init() MOZ_OVERRIDE;
NS_IMETHODIMP Show(nsIDOMWindow *aParent, nsIPrintSettings *aSettings,
nsIWebBrowserPrint *aWebBrowserPrint);
nsIWebBrowserPrint *aWebBrowserPrint) MOZ_OVERRIDE;
NS_IMETHODIMP ShowPageSetup(nsIDOMWindow *aParent,
nsIPrintSettings *aSettings);
nsIPrintSettings *aSettings) MOZ_OVERRIDE;
};

#endif
Loading

0 comments on commit f63abc1

Please sign in to comment.