mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=682625 move XVisualIDToInfo to X11Util r=cjones
--HG-- extra : transplant_source : %BA%AF%7F%B2%B3%12%F2%CBl%FAy%5C%F25lI%23%EC%92%28
This commit is contained in:
parent
25280e6ccf
commit
5d027f5e32
@ -963,37 +963,6 @@ PluginInstanceChild::RecvWindowPosChanged(const NPRemoteEvent& event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
|
|
||||||
static bool
|
|
||||||
XVisualIDToInfo(Display* aDisplay, VisualID aVisualID,
|
|
||||||
Visual** aVisual, unsigned int* aDepth)
|
|
||||||
{
|
|
||||||
if (aVisualID == None) {
|
|
||||||
*aVisual = NULL;
|
|
||||||
*aDepth = 0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Screen* screen = DefaultScreenOfDisplay(aDisplay);
|
|
||||||
|
|
||||||
for (int d = 0; d < screen->ndepths; d++) {
|
|
||||||
Depth *d_info = &screen->depths[d];
|
|
||||||
for (int v = 0; v < d_info->nvisuals; v++) {
|
|
||||||
Visual* visual = &d_info->visuals[v];
|
|
||||||
if (visual->visualid == aVisualID) {
|
|
||||||
*aVisual = visual;
|
|
||||||
*aDepth = d_info->depth;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_ERROR("VisualID not on Screen.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
|
PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
|
||||||
{
|
{
|
||||||
|
@ -41,6 +41,34 @@
|
|||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
bool
|
||||||
|
XVisualIDToInfo(Display* aDisplay, VisualID aVisualID,
|
||||||
|
Visual** aVisual, unsigned int* aDepth)
|
||||||
|
{
|
||||||
|
if (aVisualID == None) {
|
||||||
|
*aVisual = NULL;
|
||||||
|
*aDepth = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Screen* screen = DefaultScreenOfDisplay(aDisplay);
|
||||||
|
|
||||||
|
for (int d = 0; d < screen->ndepths; d++) {
|
||||||
|
Depth *d_info = &screen->depths[d];
|
||||||
|
for (int v = 0; v < d_info->nvisuals; v++) {
|
||||||
|
Visual* visual = &d_info->visuals[v];
|
||||||
|
if (visual->visualid == aVisualID) {
|
||||||
|
*aVisual = visual;
|
||||||
|
*aDepth = d_info->depth;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_ERROR("VisualID not on Screen.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ScopedXErrorHandler::ErrorEvent* ScopedXErrorHandler::sXErrorPtr;
|
ScopedXErrorHandler::ErrorEvent* ScopedXErrorHandler::sXErrorPtr;
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -72,6 +72,17 @@ DefaultXDisplay()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets *aVisual to point to aDisplay's Visual struct corresponding to
|
||||||
|
* aVisualID, and *aDepth to its depth. When aVisualID is None, these are set
|
||||||
|
* to NULL and 0 respectively. Both out-parameter pointers are assumed
|
||||||
|
* non-NULL. Returns true in both of these situations, but false if aVisualID
|
||||||
|
* is not None and not found on the Display.
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
XVisualIDToInfo(Display* aDisplay, VisualID aVisualID,
|
||||||
|
Visual** aVisual, unsigned int* aDepth);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoke XFree() on a pointer to memory allocated by Xlib (if the
|
* Invoke XFree() on a pointer to memory allocated by Xlib (if the
|
||||||
* pointer is nonnull) when this class goes out of scope.
|
* pointer is nonnull) when this class goes out of scope.
|
||||||
|
Loading…
Reference in New Issue
Block a user