Browse Source

* wire up the code page functions to call the driver functions in case of a legacy driver

git-svn-id: branches/unicodekvm@48912 -
nickysn 4 years ago
parent
commit
df95478d19
1 changed files with 23 additions and 6 deletions
  1. 23 6
      packages/rtl-console/src/inc/video.inc

+ 23 - 6
packages/rtl-console/src/inc/video.inc

@@ -525,8 +525,9 @@ function GetActiveCodePage: TSystemCodePage;
 begin
   if EnhancedVideoInitialized then
     Result := CurrentLegacy2EnhancedTranslationCodePage
+  else if VideoInitialized and Assigned(CurrentVideoDriver.GetActiveCodePage) then
+    Result := CurrentVideoDriver.GetActiveCodePage()
   else
-    {todo: get this from the driver}
     Result := DefaultSystemCodePage;
 end;
 
@@ -541,19 +542,35 @@ begin
      (CodePage=CP_UTF32LE) or (CodePage=CP_UTF32BE) then
     exit;
   if EnhancedVideoInitialized then
-    CurrentLegacy2EnhancedTranslationCodePage := CodePage;
+    CurrentLegacy2EnhancedTranslationCodePage := CodePage
+  else if VideoInitialized and Assigned(CurrentVideoDriver.ActivateCodePage) then
+    CurrentVideoDriver.ActivateCodePage(CodePage);
 end;
 
 function GetSupportedCodePageCount: Integer;
 begin
-  { todo... }
-  Result := 0;
+  if EnhancedVideoInitialized then
+    begin
+      { todo... }
+      Result := 0;
+    end
+  else if VideoInitialized and Assigned(CurrentVideoDriver.GetSupportedCodePageCount) then
+    Result := CurrentVideoDriver.GetSupportedCodePageCount()
+  else
+    Result := 1;
 end;
 
 function GetSupportedCodePage(Index: Integer): TSystemCodePage;
 begin
-  { todo... }
-  Result := 0;
+  if EnhancedVideoInitialized then
+    begin
+      { todo... }
+      Result := 0;
+    end
+  else if VideoInitialized and Assigned(CurrentVideoDriver.GetSupportedCodePage) then
+    Result := CurrentVideoDriver.GetSupportedCodePage(Index)
+  else
+    Result := DefaultSystemCodePage;
 end;
 
 { ---------------------------------------------------------------------