Since there are more RTL languages, shouldn't we use some flag rather than hardcoding hebrew?

Am 17.06.2013 00:04, schrieb drei...@svn.reactos.org:
Author: dreimer
Date: Sun Jun 16 22:04:48 2013
New Revision: 59242

URL: http://svn.reactos.org/svn/reactos?rev=59242&view=rev
Log:
Right-to-Left mirroring fixes for various applications by Baruch Rutman
CORE-7015 #resolve #comment Committed in revision r59241, thanks for help.

Modified:
     trunk/reactos/base/applications/fontview/fontview.c
     trunk/reactos/base/applications/fontview/fontview.h
     trunk/reactos/base/applications/kbswitch/kbswitch.c
     trunk/reactos/base/applications/magnify/magnifier.c
     trunk/reactos/base/applications/magnify/magnifier.h
     trunk/reactos/base/applications/mscutils/devmgmt/devmgmt.c
     trunk/reactos/base/applications/mscutils/devmgmt/precomp.h
     trunk/reactos/base/applications/mscutils/servman/precomp.h
     trunk/reactos/base/applications/mscutils/servman/servman.c
     trunk/reactos/base/applications/notepad/main.c
     trunk/reactos/base/applications/rapps/winmain.c
     trunk/reactos/base/applications/regedit/main.c

Modified: trunk/reactos/base/applications/fontview/fontview.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/fontview/fontview.c?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/fontview/fontview.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/fontview/fontview.c [iso-8859-1] Sun Jun 16 
22:04:48 2013
@@ -94,7 +94,17 @@
        HINSTANCE hDLL;
        PGFRI GetFontResourceInfoW;
        LPCWSTR fileName;
-
+
+    switch (GetUserDefaultUILanguage())
+    {
+    case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
+      SetProcessDefaultLayout(LAYOUT_RTL);
+      break;
+
+    default:
+      break;
+    }
+
        g_hInstance = hThisInstance;
/* Get unicode command line */

Modified: trunk/reactos/base/applications/fontview/fontview.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/fontview/fontview.h?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/fontview/fontview.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/fontview/fontview.h [iso-8859-1] Sun Jun 16 
22:04:48 2013
@@ -1,6 +1,7 @@
  #include <stdarg.h>
  #include <windef.h>
  #include <winbase.h>
+#include <winnls.h>
  #include <shellapi.h>
#include "resource.h"

Modified: trunk/reactos/base/applications/kbswitch/kbswitch.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/kbswitch/kbswitch.c?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/kbswitch/kbswitch.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/kbswitch/kbswitch.c [iso-8859-1] Sun Jun 16 
22:04:48 2013
@@ -516,6 +516,17 @@
  {
      WNDCLASS WndClass = {0};
      MSG msg;
+
+    switch (GetUserDefaultUILanguage())
+    {
+    case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
+      SetProcessDefaultLayout(LAYOUT_RTL);
+      break;
+
+    default:
+      break;
+    }
+
      HANDLE hMutex;
hMutex = CreateMutex(NULL, FALSE, szKbSwitcherName);

Modified: trunk/reactos/base/applications/magnify/magnifier.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/magnifier.c?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/magnify/magnifier.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/magnify/magnifier.c [iso-8859-1] Sun Jun 16 
22:04:48 2013
@@ -45,7 +45,17 @@
      // TODO: Place code here.
      MSG msg;
      HACCEL hAccelTable;
-
+
+    switch (GetUserDefaultUILanguage())
+  {
+    case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
+      SetProcessDefaultLayout(LAYOUT_RTL);
+      break;
+
+    default:
+      break;
+  }
+
      UNREFERENCED_PARAMETER(hPrevInstance);
      UNREFERENCED_PARAMETER(lpCmdLine);
@@ -170,7 +180,7 @@
      HDC HdcStrech;
      HANDLE hOld;
      HBITMAP HbmpStrech;
-
+
      RECT R;
      RECT appRect;
      DWORD rop = SRCCOPY;
@@ -202,7 +212,7 @@
/* Select our bitmap in memory DC and save the old one.*/
      hOld = SelectObject (HdcStrech , HbmpStrech);
-
+
      /* Paint the screen bitmap to our in memory DC */
      BitBlt(
          HdcStrech,
@@ -214,7 +224,7 @@
          0,
          0,
          SRCCOPY);
-
+
      /* Draw the mouse pointer in the right position */
      DrawIcon(
          HdcStrech ,
@@ -271,8 +281,9 @@
          blitAreaY,
          blitAreaWidth,
          blitAreaHeight,
-        rop);
-
+        rop | NOMIRRORBITMAP);
+
+
      /* Cleanup.*/
      if (iinfo.hbmMask)
          DeleteObject(iinfo.hbmMask);

Modified: trunk/reactos/base/applications/magnify/magnifier.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/magnifier.h?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/magnify/magnifier.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/magnify/magnifier.h [iso-8859-1] Sun Jun 16 
22:04:48 2013
@@ -25,6 +25,7 @@
  #include <winreg.h>
  #include <wingdi.h>
  #include <tchar.h>
+#include <winnls.h> //test
#include "resource.h"
Modified: trunk/reactos/base/applications/mscutils/devmgmt/devmgmt.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/devmgmt/devmgmt.c?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/devmgmt.c  [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/devmgmt.c  [iso-8859-1] 
Sun Jun 16 22:04:48 2013
@@ -34,7 +34,17 @@
          }
          return 0;
      }
+
+    switch (GetUserDefaultUILanguage())
+  {
+    case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
+      SetProcessDefaultLayout(LAYOUT_RTL);
+      break;
+ default:
+      break;
+  }
+
      hInstance = hThisInstance;
      ProcessHeap = GetProcessHeap();
Modified: trunk/reactos/base/applications/mscutils/devmgmt/precomp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/devmgmt/precomp.h?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/mscutils/devmgmt/precomp.h  [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/mscutils/devmgmt/precomp.h  [iso-8859-1] 
Sun Jun 16 22:04:48 2013
@@ -7,6 +7,7 @@
  #include <winuser.h>
  #include <winreg.h>
  #include <wingdi.h>
+#include <winnls.h>
  #include <windowsx.h>
  #include <tchar.h>
  #include <setupapi.h>

Modified: trunk/reactos/base/applications/mscutils/servman/precomp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/servman/precomp.h?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/precomp.h  [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/mscutils/servman/precomp.h  [iso-8859-1] 
Sun Jun 16 22:04:48 2013
@@ -8,6 +8,7 @@
  #include <windef.h>
  #include <winbase.h>
  #include <wingdi.h>
+#include <winnls.h>
  #include <winsvc.h>
  #include <winuser.h>
  #include <windowsx.h> /* GET_X/Y_LPARAM */

Modified: trunk/reactos/base/applications/mscutils/servman/servman.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/servman/servman.c?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/servman.c  [iso-8859-1] 
(original)
+++ trunk/reactos/base/applications/mscutils/servman/servman.c  [iso-8859-1] 
Sun Jun 16 22:04:48 2013
@@ -8,7 +8,6 @@
   */
#include "precomp.h"
-
  HINSTANCE hInstance;
  HANDLE ProcessHeap;
@@ -23,7 +22,17 @@
      MSG Msg;
      int Ret = 1;
      INITCOMMONCONTROLSEX icex;
+
+    switch (GetUserDefaultUILanguage())
+  {
+    case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
+      SetProcessDefaultLayout(LAYOUT_RTL);
+      break;
+ default:
+      break;
+  }
+
      hInstance = hThisInstance;
      ProcessHeap = GetProcessHeap();
Modified: trunk/reactos/base/applications/notepad/main.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/main.c?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/notepad/main.c      [iso-8859-1] (original)
+++ trunk/reactos/base/applications/notepad/main.c      [iso-8859-1] Sun Jun 16 
22:04:48 2013
@@ -554,7 +554,17 @@
      HMONITOR    monitor;
      MONITORINFO info;
      INT         x, y;
-
+
+    switch (GetUserDefaultUILanguage())
+  {
+    case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
+      SetProcessDefaultLayout(LAYOUT_RTL);
+      break;
+
+    default:
+      break;
+  }
+
      static const TCHAR className[] = _T("NPClass");
      static const TCHAR winName[]   = _T("Notepad");
Modified: trunk/reactos/base/applications/rapps/winmain.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/winmain.c?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/rapps/winmain.c     [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/winmain.c     [iso-8859-1] Sun Jun 16 
22:04:48 2013
@@ -763,7 +763,17 @@
      WCHAR szErrorText[MAX_STR_LEN];
      HANDLE hMutex = NULL;
      MSG Msg;
-
+
+    switch (GetUserDefaultUILanguage())
+  {
+    case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
+      SetProcessDefaultLayout(LAYOUT_RTL);
+      break;
+
+    default:
+      break;
+  }
+
      hInst = hInstance;
if (!IsUserAnAdmin())

Modified: trunk/reactos/base/applications/regedit/main.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/main.c?rev=59242&r1=59241&r2=59242&view=diff
==============================================================================
--- trunk/reactos/base/applications/regedit/main.c      [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/main.c      [iso-8859-1] Sun Jun 16 
22:04:48 2013
@@ -207,6 +207,16 @@
      LoadStringW(hInstance, IDC_REGEDIT_FRAME, szFrameClass, MAX_LOADSTRING);
      LoadStringW(hInstance, IDC_REGEDIT, szChildClass, MAX_LOADSTRING);
+
+    switch (GetUserDefaultUILanguage())
+  {
+    case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
+      SetProcessDefaultLayout(LAYOUT_RTL);
+      break;
+
+    default:
+      break;
+  }
      /* Store instance handle in our global variable */
      hInst = hInstance;




_______________________________________________
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev

Reply via email to