From cf9de21af3073e29cb7b149fbd8427241de70729 Mon Sep 17 00:00:00 2001
From: George Hazan <ghazan@miranda.im>
Date: Fri, 28 Oct 2016 16:18:50 +0300
Subject: - old useless helpers removed from the Options module; - mir_app
 functions introduced instead of them; - OPENOPTIONSDIALOG structure removed
 from m_options.h

---
 include/delphi/m_helpers.inc | 25 +++++--------------------
 include/delphi/m_options.inc | 38 ++++++++++----------------------------
 2 files changed, 15 insertions(+), 48 deletions(-)

(limited to 'include/delphi')

diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc
index f923dcc8d9..88feb436ff 100644
--- a/include/delphi/m_helpers.inc
+++ b/include/delphi/m_helpers.inc
@@ -52,7 +52,6 @@ function Menu_AddTrayMenuItem        (mi:PMO_MenuItem):HGENMENU;
 
 procedure SET_UID(pmi:PMO_MenuItem; strguid:PAnsiChar);
 
-function UserInfo_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr;
 function Options_AddPage (wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr;
 function Hotkey_Register(hk:PHOTKEYDESC):int_ptr;
 
@@ -65,8 +64,7 @@ procedure ColourRegister(pColorID:pColourID);
 
 function TopToolbar_AddButton(pButton:PTTBButton):THANDLE;
 
-function Options_Open    (ood:POPENOPTIONSDIALOG):int_ptr;
-function Options_OpenPage(ood:POPENOPTIONSDIALOG):HWND;
+function Options_Open(group,page,tab:PWideChar):int_ptr;
 
 procedure MIcoTab_AddItem (hwnd:HWND; lptzName:PAnsiChar; hIcon:HICON; data:LPARAM; bSharedIcon:bool);
 procedure MIcoTab_AddItemW(hwnd:HWND; lptzName:PWideChar; hIcon:HICON; data:LPARAM; bSharedIcon:bool);
@@ -380,19 +378,6 @@ begin
   result:=_AddTrayMenuItem(mi);
 end;
 
-
-function UserInfo_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr;
-begin
-  odp^.hLangpack:=hLangpack;
-	result:=CallService(MS_USERINFO_ADDPAGE, wParam, LPARAM(odp));
-end;
-
-function Options_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr;
-begin
-  odp^.hLangpack:=hLangpack;
-	result:=CallService(MS_OPT_ADDPAGE, wParam, LPARAM(odp));
-end;
-
 function Hotkey_Register(hk:PHOTKEYDESC):int_ptr;
 begin
 	result:=CallService(MS_HOTKEY_REGISTER, hLangpack, LPARAM(hk));
@@ -428,14 +413,14 @@ begin
   result:=CallService(MS_TTB_ADDBUTTON, WPARAM(pButton), hLangpack);
 end;
 
-function Options_Open(ood:POPENOPTIONSDIALOG):int_ptr;
+function Options_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr;
 begin
-	result:=CallService(MS_OPT_OPENOPTIONS, hLangpack, LPARAM(ood));
+  result:=_Options_AddPage(wParam, odp, hLangpack);
 end;
 
-function Options_OpenPage(ood:POPENOPTIONSDIALOG):HWND;
+function Options_Open(group,page,tab:PWideChar):int_ptr;
 begin
-	result:=CallService(MS_OPT_OPENOPTIONSPAGE, hLangpack, LPARAM(ood));
+	result:=_Options_Open(group,page,tab,hLangpack);
 end;
 
 procedure MIcoTab_AddItem(hwnd:HWND; lptzName:PAnsiChar; hIcon:HICON; data:LPARAM; bSharedIcon:bool);
diff --git a/include/delphi/m_options.inc b/include/delphi/m_options.inc
index 2643237a05..96b643b40b 100644
--- a/include/delphi/m_options.inc
+++ b/include/delphi/m_options.inc
@@ -54,17 +54,17 @@ type
   TOPTIONSDIALOGPAGE = record
     position              :int;     // a position number, lower numbers are topmost
     szTitle               :TChar;   // [TRANSLATED-BY-CORE]
+    szGroup               :TChar;   // [TRANSLATED-BY-CORE]
+    szTab                 :TChar;   // [TRANSLATED-BY-CORE]
     pfnDlgProc            :pointer;
     pszTemplate           :PAnsiChar;
     hInstance             :THANDLE;
-    hIcon                 :HICON;   // v0.1.0.1+
-    szGroup               :TChar;   // v0.1.0.1+ [TRANSLATED-BY-CORE]
-    groupPosition         :int;     // v0.1.0.1+
-    hGroupIcon            :HICON;   // v0.1.0.1+
-    flags                 :dword;   // v0.1.2.1+
-    szTab                 :TChar;   // v0.6.0.0+ [TRANSLATED-BY-CORE]
-    dwInitParam           :LPARAM;  // v0.8.0.0+ a value to pass to lParam of WM_INITDIALOG message
+    hIcon                 :HICON;   // 
+    groupPosition         :int;     // 
     hLangpack             :int;
+    hGroupIcon            :HICON;   // 
+    flags                 :dword;   // 
+    dwInitParam           :LPARAM;  // a value to pass to lParam of WM_INITDIALOG message
   end;
 
 const
@@ -76,27 +76,9 @@ const
 const
   PSM_GETBOLDFONT   = WM_USER+102;   //returns HFONT used for group box titles
 
-  MS_OPT_ADDPAGE:PAnsiChar = 'Opt/AddPage';
+function _Options_AddPage(param:WPARAM; opts:POPTIONSDIALOGPAGE; lang:int) : int; stdcall; external AppDll name 'Options_AddPage';
 
-  { Opens the options dialog, optionally at the specified page    v0.1.2.1+
-    wParam=0
-    lParam=(LPARAM)(OPENOPTIONSDIALOG*)&ood;
-    Returns 0 on success, nonzero on failure
-    The behaviour if the options dialog is already open is that it will just be
-    activated, the page won't be changed. This may change in the future. }
-type
-  POPENOPTIONSDIALOG = ^TOPENOPTIONSDIALOG;
-  TOPENOPTIONSDIALOG = record
-    cbSize  :int;
-    pszGroup:PAnsiChar;  // set to NULL if it's a root item
-    pszPage :PAnsiChar;  // set to NULL to just open the options at no specific page
-    pszTab  :PAnsiChar;  // set to NULL to just open the options at no specific tab
-  end;
-
-const
-  MS_OPT_OPENOPTIONS:PAnsiChar = 'Opt/OpenOptions';
-
-//Opens the options dialog, with only specified page    v0.8.0.x+
-  MS_OPT_OPENOPTIONSPAGE = 'Opt/OpenOptionsPage';
+function _Options_Open(group,page,tab:PWideChar; lang:int):int_ptr; stdcall; external AppDll name 'Options_Open';
+function _Options_OpenPage(group,page,tab:PWideChar; lang:int):HWND; stdcall; external AppDll name 'Options_OpenPage';
 
 {$ENDIF}
-- 
cgit v1.2.3