Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
Sorry for the delay for v2, there was an internet outage in my area.
dlls/comctl32/button.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index f7497a1..0bd416d 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -215,6 +215,13 @@ static inline UINT get_button_type( LONG window_style )
return (window_style & …
[View More]BS_TYPEMASK);
}
+static inline BOOL button_centers_text( LONG window_style )
+{
+ /* Push button's text is centered by default, same for split buttons */
+ UINT type = get_button_type(window_style);
+ return type <= BS_DEFPUSHBUTTON || type == BS_SPLITBUTTON || type == BS_DEFSPLITBUTTON;
+}
+
/* paint a button of any type */
static inline void paint_button( BUTTON_INFO *infoPtr, LONG style, UINT action )
{
@@ -308,9 +315,7 @@ static UINT BUTTON_BStoDT( DWORD style, DWORD ex_style )
case BS_RIGHT: dtStyle |= DT_RIGHT; break;
case BS_CENTER: dtStyle |= DT_CENTER; break;
default:
- /* Pushbutton's text is centered by default */
- if (get_button_type(style) <= BS_DEFPUSHBUTTON) dtStyle |= DT_CENTER;
- /* all other flavours have left aligned text */
+ if (button_centers_text(style)) dtStyle |= DT_CENTER;
}
if (ex_style & WS_EX_RIGHT) dtStyle = DT_RIGHT | (dtStyle & ~(DT_LEFT | DT_CENTER));
@@ -984,8 +989,7 @@ static void BUTTON_PositionRect(LONG style, const RECT *outerRect, RECT *innerRe
if (!(style & BS_CENTER))
{
- /* Push button's text is centered by default, all other types have left aligned text */
- if (get_button_type(style) <= BS_DEFPUSHBUTTON)
+ if (button_centers_text(style))
style |= BS_CENTER;
else
style |= BS_LEFT;
--
2.20.1
[View Less]
Display device handler will be used to initialize the registry.
Different handlers can be implemented according to the interface,
for example, via Xinerama or XRandR. With those registry data,
EnumDisplayDevices, EnumDisplayMonitors and GetMonitorInfo can be
built on top of it.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
Supersede 161265~161271. Rebase to current master.
dlls/winex11.drv/Makefile.in | 1 +
dlls/winex11.drv/display.c | 37 ++++++++++++++++++
dlls/…
[View More]winex11.drv/x11drv.h | 76 ++++++++++++++++++++++++++++++++++++
3 files changed, 114 insertions(+)
create mode 100644 dlls/winex11.drv/display.c
diff --git a/dlls/winex11.drv/Makefile.in b/dlls/winex11.drv/Makefile.in
index 747f509b44..9ca2fc6efe 100644
--- a/dlls/winex11.drv/Makefile.in
+++ b/dlls/winex11.drv/Makefile.in
@@ -9,6 +9,7 @@ C_SRCS = \
brush.c \
clipboard.c \
desktop.c \
+ display.c \
event.c \
graphics.c \
ime.c \
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c
new file mode 100644
index 0000000000..9b9009c255
--- /dev/null
+++ b/dlls/winex11.drv/display.c
@@ -0,0 +1,37 @@
+/*
+ * X11DRV display device functions
+ *
+ * Copyright 2019 Zhiyi Zhang for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+
+#include "wine/debug.h"
+#include "x11drv.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
+
+static struct x11drv_display_device_handler handler;
+
+void X11DRV_DisplayDevices_SetHandler(const struct x11drv_display_device_handler *new_handler)
+{
+ if (new_handler->priority > handler.priority)
+ {
+ handler = *new_handler;
+ TRACE("Display device functions are now handled by: %s\n", handler.name);
+ }
+}
\ No newline at end of file
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index a0308b0675..22c50667be 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -665,6 +665,82 @@ struct x11drv_mode_info *X11DRV_Settings_SetHandlers(const char *name,
void X11DRV_XF86VM_Init(void) DECLSPEC_HIDDEN;
void X11DRV_XRandR_Init(void) DECLSPEC_HIDDEN;
+/* X11 display device driver */
+
+/* Represent a physical GPU in the PCI slots */
+struct x11drv_gpu
+{
+ /* ID to uniquely identify a GPU in handler */
+ ULONG_PTR id;
+ /* Name */
+ WCHAR name[128];
+ /* PCI ID */
+ UINT vendor_id;
+ UINT device_id;
+ UINT subsys_id;
+ UINT revision_id;
+};
+
+/* Represent an adapter in EnumDisplayDevices context */
+struct x11drv_adapter
+{
+ /* ID to uniquely identify an adapter in handler */
+ ULONG_PTR id;
+ /* as StateFlags in DISPLAY_DEVICE struct */
+ DWORD state_flags;
+};
+
+/* Represent a monitor in EnumDisplayDevices context */
+struct x11drv_monitor
+{
+ /* Name */
+ WCHAR name[128];
+ /* as RcMonitor in MONITORINFO struct */
+ RECT rc_monitor;
+ /* as RcWork in MONITORINFO struct */
+ RECT rc_work;
+ /* StateFlags in DISPLAY_DEVICE struct */
+ DWORD state_flags;
+};
+
+/* Required functions for display device registry initialization */
+struct x11drv_display_device_handler
+{
+ /* A name to tell what host driver is used */
+ CHAR name[MAX_PATH];
+
+ /* Higher priority can override handlers with lower proprity */
+ INT priority;
+
+ /* pGetGpus will be called to get a list of GPUs. First GPU has to be where the primary adapter is.
+ *
+ * Return FALSE on failure with parameters unchanged */
+ BOOL (*pGetGpus)(struct x11drv_gpu **gpus, int *count);
+
+ /* pGetAdapters will be called to get a list of adapters in EnumDisplayDevices context under a GPU.
+ * The first adapter has to be primary if GPU is primary.
+ *
+ * Return FALSE on failure with parameters unchanged */
+ BOOL (*pGetAdapters)(ULONG_PTR gpu_id, struct x11drv_adapter **adapters, int *count);
+
+ /* pGetMonitors will be called to get a list of monitors in EnumDisplayDevices context under an adapter.
+ * The first monitor has to be primary if adapter is primary.
+ *
+ * Return FALSE on failure with parameters unchanged */
+ BOOL (*pGetMonitors)(ULONG_PTR adapter_id, struct x11drv_monitor **monitors, int *count);
+
+ /* pFreeGpus will be called to free a GPU list from pGetGpus */
+ void (*pFreeGpus)(struct x11drv_gpu *gpus);
+
+ /* pFreeAdapters will be called to free an adapter list from pGetAdapters */
+ void (*pFreeAdapters)(struct x11drv_adapter *adapters);
+
+ /* pFreeMonitors will be called to free a monitor list from pGetMonitors */
+ void (*pFreeMonitors)(struct x11drv_monitor *monitors);
+};
+
+extern void X11DRV_DisplayDevices_SetHandler(const struct x11drv_display_device_handler *handler) DECLSPEC_HIDDEN;
+
/* XIM support */
extern BOOL X11DRV_InitXIM( const char *input_style ) DECLSPEC_HIDDEN;
extern XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) DECLSPEC_HIDDEN;
--
2.20.1
[View Less]
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
Spotted by Lauri Kenttä.
dlls/mferror/mferror.mc | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/mferror/mferror.mc b/dlls/mferror/mferror.mc
index f0299b0986..826f8e562c 100644
--- a/dlls/mferror/mferror.mc
+++ b/dlls/mferror/mferror.mc
@@ -440,14 +440,14 @@ Severity=Error
Facility=MF
SymbolicName=MF_E_INVALID_STATE_TRANSITION
Language=ENU
-Invalid media source state …
[View More]transition
+Invalid media source state transition.
.
MessageId=16004
Severity=Error
Facility=MF
SymbolicName=MF_E_END_OF_STREAM
Language=ENU
-End of media stream has been reached
+End of media stream has been reached.
.
MessageId=16005
Severity=Error
@@ -461,70 +461,70 @@ Severity=Error
Facility=MF
SymbolicName=MF_E_NO_DURATION
Language=ENU
-Media stream has no duration set
+Media stream has no duration set.
.
MessageId=16012
Severity=Error
Facility=MF
SymbolicName=MF_E_INVALID_FORMAT
Language=ENU
-Media format was recognized but is invalid
+Media format was recognized but is invalid.
.
MessageId=16013
Severity=Error
Facility=MF
SymbolicName=MF_E_PROPERTY_NOT_FOUND
Language=ENU
-Property wasn't found
+Property wasn't found.
.
MessageId=16014
Severity=Error
Facility=MF
SymbolicName=MF_E_PROPERTY_READ_ONLY
Language=ENU
-Property is read-only
+Property is read-only.
.
MessageId=16015
Severity=Error
Facility=MF
SymbolicName=MF_E_PROPERTY_NOT_ALLOWED
Language=ENU
-Property is not allowed
+Property is not allowed.
.
MessageId=16017
Severity=Error
Facility=MF
SymbolicName=MF_E_MEDIA_SOURCE_NOT_STARTED
Language=ENU
-Media source is not started
+Media source is not started.
.
MessageId=16024
Severity=Error
Facility=MF
SymbolicName=MF_E_UNSUPPORTED_FORMAT
Language=ENU
-Unsupported media format
+Unsupported media format.
.
MessageId=16027
Severity=Error
Facility=MF
SymbolicName=MF_E_MEDIA_SOURCE_WRONGSTATE
Language=ENU
-Media source is in wrong state
+Media source is in wrong state.
.
MessageId=16028
Severity=Error
Facility=MF
SymbolicName=MF_E_MEDIA_SOURCE_NO_STREAMS_SELECTED
Language=ENU
-No media streams were selected
+No media streams were selected.
.
MessageId=16030
Severity=Error
Facility=MF
SymbolicName=MF_E_UNSUPPORTED_CHARACTERISTICS
Language=ENU
-Unsupported media source characteristics
+Unsupported media source characteristics.
.
MessageId=21006
Severity=Error
--
2.20.1
[View Less]