mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 10:08:41 +00:00
bug 851520 part 1 - expose systemDefaultScale attribute on nsIScreenManager. r=roc
This commit is contained in:
parent
6d0e972630
commit
c189ce6fa7
@ -105,3 +105,9 @@ nsScreenManagerAndroid::GetNumberOfScreens(uint32_t *aNumberOfScreens)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerAndroid::GetSystemDefaultScale(float *aDefaultScale)
|
||||
{
|
||||
*aDefaultScale = 1.0f;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -96,6 +96,13 @@ nsScreenManagerCocoa::GetNumberOfScreens (uint32_t *aNumberOfScreens)
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerCocoa::GetSystemDefaultScale(float *aDefaultScale)
|
||||
{
|
||||
*aDefaultScale = 1.0f;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerCocoa::ScreenForNativeWidget (void *nativeWidget, nsIScreen **outScreen)
|
||||
{
|
||||
|
@ -284,6 +284,13 @@ nsScreenManagerGtk :: GetNumberOfScreens(uint32_t *aNumberOfScreens)
|
||||
|
||||
} // GetNumberOfScreens
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerGtk::GetSystemDefaultScale(float *aDefaultScale)
|
||||
{
|
||||
*aDefaultScale = 1.0f;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerGtk :: ScreenForNativeWidget (void *aWidget, nsIScreen **outScreen)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIScreen.idl"
|
||||
|
||||
[scriptable, uuid(B92319E6-9A84-4ca7-A2CC-EEC22EA9854E)]
|
||||
[scriptable, uuid(1C195990-FF9E-412B-AFE7-67D1C660BB27)]
|
||||
interface nsIScreenManager : nsISupports
|
||||
{
|
||||
//
|
||||
@ -25,6 +25,26 @@ interface nsIScreenManager : nsISupports
|
||||
// Holds the number of screens that are available
|
||||
readonly attribute unsigned long numberOfScreens;
|
||||
|
||||
// The default DPI scaling factor of the screen environment (number of
|
||||
// screen pixels corresponding to 1 CSS px, at the default zoom level).
|
||||
//
|
||||
// This is currently fixed at 1.0 on most platforms, but varies on Windows
|
||||
// if the "logical DPI" scaling option in the Display control panel is set
|
||||
// to a value other than 100% (e.g. 125% or 150% are increasingly common
|
||||
// defaults on laptops with high-dpi screens). See bug 851520.
|
||||
//
|
||||
// NOTE that on OS X, this does -not- reflect the "backing scale factor"
|
||||
// used to support Retina displays, which is a per-display property,
|
||||
// not a system-wide scaling factor. The default ratio of CSS pixels to
|
||||
// Cocoa points remains 1:1, even on a Retina screen where one Cocoa point
|
||||
// corresponds to two device pixels. (This is exposed via other APIs:
|
||||
// see window.devicePixelRatio).
|
||||
//
|
||||
// NOTE also that on Linux, this does -not- currently reflect changes
|
||||
// to the system-wide (X11 or Gtk2) DPI value, as Firefox does not yet
|
||||
// honor these settings. See bug 798362 and bug 712898.
|
||||
readonly attribute float systemDefaultScale;
|
||||
|
||||
// Returns the nsIScreen instance for the given native widget pointer;
|
||||
// the pointer is specific to the particular widget implementation,
|
||||
// and is generally of the same type that NS_NATIVE_WINDOW is.
|
||||
|
@ -91,6 +91,13 @@ nsScreenManagerOS2 :: GetNumberOfScreens(uint32_t *aNumberOfScreens)
|
||||
|
||||
} // GetNumberOfScreens
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerOS2::GetSystemDefaultScale(float *aDefaultScale)
|
||||
{
|
||||
*aDefaultScale = 1.0f;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerOS2 :: ScreenForNativeWidget(void *nativeWidget, nsIScreen **aScreen)
|
||||
{
|
||||
|
@ -99,6 +99,13 @@ nsScreenManagerQt::GetNumberOfScreens(uint32_t *aNumberOfScreens)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerQt::GetSystemDefaultScale(float *aDefaultScale)
|
||||
{
|
||||
*aDefaultScale = 1.0f;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerQt :: ScreenForNativeWidget (void *aWidget, nsIScreen **outScreen)
|
||||
{
|
||||
|
@ -154,6 +154,13 @@ nsScreenManagerWin :: GetNumberOfScreens(uint32_t *aNumberOfScreens)
|
||||
|
||||
} // GetNumberOfScreens
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerWin::GetSystemDefaultScale(float *aDefaultScale)
|
||||
{
|
||||
*aDefaultScale = float(gfxWindowsPlatform::GetPlatform()->GetDPIScale());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScreenManagerWin :: ScreenForNativeWidget(void *aWidget, nsIScreen **outScreen)
|
||||
{
|
||||
|
@ -762,5 +762,12 @@ PuppetScreenManager::GetNumberOfScreens(uint32_t* aNumberOfScreens)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PuppetScreenManager::GetSystemDefaultScale(float *aDefaultScale)
|
||||
{
|
||||
*aDefaultScale = 1.0f;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace widget
|
||||
} // namespace mozilla
|
||||
|
Loading…
x
Reference in New Issue
Block a user