From 535ed10c3e551caf228928e678e6daf2a30678a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20V=C3=A1rady?= Date: Thu, 21 Dec 2023 21:06:41 +0100 Subject: [PATCH 1/5] spl_menu.h: translated --- src/plugins/shared/spl_menu.h | 99 ++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/src/plugins/shared/spl_menu.h b/src/plugins/shared/spl_menu.h index 29dbcaf95..2aba21292 100644 --- a/src/plugins/shared/spl_menu.h +++ b/src/plugins/shared/spl_menu.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_menu) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_menu) // so that structures are independent of the set alignment #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -25,32 +26,33 @@ class CSalamanderForOperationsAbstract; // **************************************************************************** // CSalamanderBuildMenuAbstract // -// sada metod Salamandera pro stavbu menu pluginu -// -// jde o podmnozinu metod CSalamanderConnectAbstract, metody se stejne chovaji, -// pouzivaji se stejne konstanty, popis viz CSalamanderConnectAbstract +// set of Salamander methods for building menu of plugin +// +// it is a subset of methods of CSalamanderConnectAbstract, methods behave the same, +// the same constants are used, for description see CSalamanderConnectAbstract class CSalamanderBuildMenuAbstract { public: - // ikony se zadavaji metodou CSalamanderBuildMenuAbstract::SetIconListForMenu, zbytek - // popisu viz CSalamanderConnectAbstract::AddMenuItem + // icons are set by method CSalamanderBuildMenuAbstract::SetIconListForMenu, for the rest + // of description see CSalamanderConnectAbstract::AddMenuItem virtual void WINAPI AddMenuItem(int iconIndex, const char* name, DWORD hotKey, int id, BOOL callGetState, DWORD state_or, DWORD state_and, DWORD skillLevel) = 0; - // ikony se zadavaji metodou CSalamanderBuildMenuAbstract::SetIconListForMenu, zbytek - // popisu viz CSalamanderConnectAbstract::AddSubmenuStart + // icons are set by method CSalamanderBuildMenuAbstract::SetIconListForMenu, for the rest + // of description see CSalamanderConnectAbstract::AddSubmenuStart virtual void WINAPI AddSubmenuStart(int iconIndex, const char* name, int id, BOOL callGetState, DWORD state_or, DWORD state_and, DWORD skillLevel) = 0; - // popis viz CSalamanderConnectAbstract::AddSubmenuEnd + // for description see CSalamanderConnectAbstract::AddSubmenuEnd virtual void WINAPI AddSubmenuEnd() = 0; - // nastavi bitmapu s ikonami pluginu pro menu; bitmapu je treba alokovat pomoci volani - // CSalamanderGUIAbstract::CreateIconList() a nasledne vytvorit a naplnit pomoci - // metod CGUIIconListAbstract interfacu; rozmery ikonek musi byt 16x16 bodu; - // Salamander si objekt bitmapy prebira do sve spravy, plugin ji po zavolani - // teto funkce nesmi destruovat; Salamander ji drzi jen v pameti, nikam se neuklada + // sets bitmap with icons of plugin for menu; bitmap must be allocated by calling + // CSalamanderGUIAbstract::CreateIconList() and then created and filled by methods + // of CGUIIconListAbstract interface; icons must have dimensions 16x16 points; + // Salamander takes the bitmap object into its management, plugin must not destroy it + // after calling this method; Salamander keeps the bitmap only in memory, it is not + // saved anywhere virtual void WINAPI SetIconListForMenu(CGUIIconListAbstract* iconList) = 0; }; @@ -59,56 +61,55 @@ class CSalamanderBuildMenuAbstract // CPluginInterfaceForMenuExtAbstract // -// flagy stavu polozek v menu (pro pluginy rozsireni menu) -#define MENU_ITEM_STATE_ENABLED 0x01 // enablovana, bez tohoto flagu je polozka disablovana -#define MENU_ITEM_STATE_CHECKED 0x02 // pred polozkou je "check" nebo "radio" znacka -#define MENU_ITEM_STATE_RADIO 0x04 // bez MENU_ITEM_STATE_CHECKED se ignoruje, \ - // "radio" znacka, bez tohoto flagu "check" znacka -#define MENU_ITEM_STATE_HIDDEN 0x08 // polozka se v menu vubec nema objevit +// flags of menu item state (for menu extension plugins) +#define MENU_ITEM_STATE_ENABLED 0x01 // enabled, without this flag item is disabled +#define MENU_ITEM_STATE_CHECKED 0x02 // before item is "check" or "radio" tag +#define MENU_ITEM_STATE_RADIO 0x04 // without MENU_ITEM_STATE_CHECKED it is ignored, + // "radio" tag, without this flag "check" tag +#define MENU_ITEM_STATE_HIDDEN 0x08 // items is not supposed to be shown in menu class CPluginInterfaceForMenuExtAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceForMenuExtEncapsulation) +private: // protection against incorrect direct calling of methods (see CPluginInterfaceForMenuExtEncapsulation) friend class CPluginInterfaceForMenuExtEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // vraci stav polozky menu s identifikacnim cislem 'id'; navratova hodnota je kombinaci - // flagu (viz MENU_ITEM_STATE_XXX); 'eventMask' viz CSalamanderConnectAbstract::AddMenuItem + // returns state of menu item with ID 'id'; return value is combination of flags + // (see MENU_ITEM_STATE_XXX); 'eventMask' see CSalamanderConnectAbstract::AddMenuItem virtual DWORD WINAPI GetMenuItemState(int id, DWORD eventMask) = 0; - // spousti prikaz menu s identifikacnim cislem 'id', 'eventMask' viz - // CSalamanderConnectAbstract::AddMenuItem, 'salamander' je sada pouzitelnych metod - // Salamandera pro provadeni operaci (POZOR: muze byt NULL, viz popis metody - // CSalamanderGeneralAbstract::PostMenuExtCommand), 'parent' je parent messageboxu, - // vraci TRUE pokud ma byt v panelu zruseno oznaceni (nebyl pouzit Cancel, mohl byt - // pouzit Skip), jinak vraci FALSE (neprovede se odznaceni); - // POZOR: Pokud prikaz zpusobi zmeny na nejake ceste (diskove/FS), mel by pouzit - // CSalamanderGeneralAbstract::PostChangeOnPathNotification pro informovani - // panelu bez automatickeho refreshe a otevrene FS (aktivni i odpojene) - // POZNAMKA: pokud prikaz pracuje se soubory/adresari z cesty v aktualnim panelu nebo - // i primo s touto cestou, je treba volat - // CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath pro aktualni panel, - // jinak nebude cesta v tomto panelu vlozena do seznamu pracovnich - // adresaru - List of Working Directories (Alt+F12) + // executes menu command with ID 'id', 'eventMask' see CSalamanderConnectAbstract::AddMenuItem, + // 'salamander' is set of usable methods of Salamander for performing operations + // (WARNING: can be NULL, see description of method CSalamanderGeneralAbstract::PostMenuExtCommand), + // 'parent' is parent messagebox, returns TRUE if selection in panel should be cleared + // (Cancel was not used, Skip could be used), otherwise returns FALSE (selection is not cleared); + // WARNING: If command causes changes on some path (disk/FS), it should use + // CSalamanderGeneralAbstract::PostChangeOnPathNotification for informing panel + // without automatic refresh and opened FS (active and disconnected) + // NOTE: if command works with files/directories from path in current panel or even + // directly with this path, it is necessary to call + // CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath for current panel, + // otherwise path in this panel will not be inserted into the list of working + // directories - List of Working Directories (Alt+F12) virtual BOOL WINAPI ExecuteMenuItem(CSalamanderForOperationsAbstract* salamander, HWND parent, int id, DWORD eventMask) = 0; - // zobrazi napovedu pro prikaz menu s identifikacnim cislem 'id' (user stiskne Shift+F1, - // najde v menu Plugins menu tohoto pluginu a vybere z nej prikaz), 'parent' je parent - // messageboxu, vraci TRUE pokud byla zobrazena nejaka napoveda, jinak se zobrazi z helpu - // Salamandera kapitola "Using Plugins" + // displays help for menu command with ID 'id' (user presses Shift+F1, finds menu + // of this plugin in menu Plugins and selects command from it), 'parent' is parent + // of messagebox, returns TRUE if some help was displayed, otherwise help from + // Salamander - chapter "Using Plugins" is displayed virtual BOOL WINAPI HelpForMenuItem(HWND parent, int id) = 0; - // funkce pro "dynamic menu extension", vola se jen pokud zadate FUNCTION_DYNAMICMENUEXT do - // SetBasicPluginData; sestavi menu pluginu pri jeho loadu, a pak vzdy znovu tesne pred - // jeho otevrenim v menu Plugins nebo na Plugin bare (navic i pred otevrenim okna Keyboard - // Shortcuts z Plugins Manageru); prikazy v novem menu by mely mit stejne ID jako ve starem, - // aby jim zustavaly uzivatelem pridelene hotkeys a aby pripadne fungovaly jako posledni - // pouzity prikaz (viz Plugins / Last Command); 'parent' je parent messageboxu, 'salamander' - // je sada metod pro stavbu menu + // function for "dynamic menu extension", it is called only if you set FUNCTION_DYNAMICMENUEXT + // to SetBasicPluginData; it builds menu of plugin when it is loaded and then again just + // before it is opened in menu Plugins or on Plugin bar (in addition also before opening + // Keyboard Shortcuts window from Plugins Manager); commands in new menu should have the + // same ID as in old menu, so that user's hotkeys are preserved and so that they can be + // used as Last Command (see Plugins / Last Command); 'parent' is parent of messagebox, + // 'salamander' is set of methods for building menu virtual void WINAPI BuildMenu(HWND parent, CSalamanderBuildMenuAbstract* salamander) = 0; }; From 6dc497f798a7cc95ff5c6764e3b8a679c5e2a361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20V=C3=A1rady?= Date: Thu, 21 Dec 2023 21:06:53 +0100 Subject: [PATCH 2/5] spl_thum.h: translated --- src/plugins/shared/spl_thum.h | 167 +++++++++++++++++----------------- 1 file changed, 86 insertions(+), 81 deletions(-) diff --git a/src/plugins/shared/spl_thum.h b/src/plugins/shared/spl_thum.h index 0bd9f031a..7be0c8421 100644 --- a/src/plugins/shared/spl_thum.h +++ b/src/plugins/shared/spl_thum.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_thum) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_thum) // so that structures are independent of the set alignment #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -24,72 +25,75 @@ // CSalamanderThumbnailMakerAbstract // -// informace o obrazku, ze ktereho generujeme thumbnail, tyto flagy se pouzivaji -// v CSalamanderThumbnailMakerAbstract::SetParameters(): -#define SSTHUMB_MIRROR_HOR 1 // obrazek je potreba horizontalne zrcadlit -#define SSTHUMB_MIRROR_VERT 2 // obrazek je potreba vertikalne zrcadlit -#define SSTHUMB_ROTATE_90CW 4 // obrazek je potreba otocit o 90 stupnu ve smeru hodinovych rucicek -#define SSTHUMB_ROTATE_180 (SSTHUMB_MIRROR_VERT | SSTHUMB_MIRROR_HOR) // obrazek je potreba otocit o 180 stupnu -#define SSTHUMB_ROTATE_90CCW (SSTHUMB_ROTATE_90CW | SSTHUMB_ROTATE_180) // obrazek je potreba otocit o 90 stupnu proti smeru hodinovych rucicek -// obrazek je v horsi kvalite nebo mensi nez je potreba, Salamander po dokonceni prvniho kola -// ziskavani "rychlych" thumbnailu zkusi pro tento obrazek ziskat "kvalitni" thumbnail +// information about image from which we generate thumbnail, these flags are used +// in CSalamanderThumbnailMakerAbstract::SetParameters(): +#define SSTHUMB_MIRROR_HOR 1 // image must be mirrored horizontally +#define SSTHUMB_MIRROR_VERT 2 // image must be mirrored vertically +#define SSTHUMB_ROTATE_90CW 4 // image must be rotated 90 degrees clockwise +#define SSTHUMB_ROTATE_180 (SSTHUMB_MIRROR_VERT | SSTHUMB_MIRROR_HOR) // image must be rotated 180 degrees +#define SSTHUMB_ROTATE_90CCW (SSTHUMB_ROTATE_90CW | SSTHUMB_ROTATE_180) // image must be rotated 90 degrees counter-clockwise + +// image is in a worse quality or smaller than needed, Salamander after finishing +// the first round of getting "fast" thumbnails tries to get "quality" thumbnail #define SSTHUMB_ONLY_PREVIEW 8 class CSalamanderThumbnailMakerAbstract { public: - // nastaveni parametru zpracovani obrazku pri tvorbe thumbnailu; nutne volat - // jako prvni metodu tohoto rozhrani; 'picWidth' a 'picHeight' jsou rozmery - // zpracovavaneho obrazku (v bodech); 'flags' je kombinace flagu SSTHUMB_XXX, - // ktera udava informace o obrazku predavanem v parametru 'buffer' v metode - // ProcessBuffer; vraci TRUE, pokud se podarilo alokovat buffery pro zmensovani - // a je mozne nasledne volat ProcessBuffer; pokud vrati FALSE, doslo k chybe - // a je treba ukoncit nacitani thumbnailu + // setting of parameters for processing of image when creating thumbnail; must be called + // as the first method of this interface; 'picWidth' and 'picHeight' are dimensions + // of processed image (in points); 'flags' is a combination of flags SSTHUMB_XXX + // which specify information about image passed in parameter 'buffer' in method + // ProcessBuffer; returns TRUE if buffers for resizing were allocated and it is + // possible to call ProcessBuffer then; if returns FALSE, there was an error + // and it is necessary to stop loading of thumbnail virtual BOOL WINAPI SetParameters(int picWidth, int picHeight, DWORD flags) = 0; - // zpracuje cast obrazku v bufferu 'buffer' (zpracovavana cast obrazku je ulozena - // po radcich shora dolu, body na radcich jsou ulozeny zleva doprava, kazdy bod - // reprezentuje 32-bitova hodnota, ktera je slozena z tri bytu s barvami R+G+B a - // ctvrteho bytu, ktery se ignoruje); rozlisujeme dva typy zpracovani: kopie - // obrazku do vysledneho thumbnailu (nepresahuje-li velikost zpracovavaneho obrazku - // velikost thumbnailu) a zmenseni obrazku do thumbnailu (obrazek vetsi nez - // thumbnail); 'buffer' je pouzit pouze pro cteni; 'rowsCount' urcuje kolik radku - // obrazku je v bufferu; - // je-li'buffer' NULL, berou se data z vlastniho bufferu (plugin ziska pres GetBuffer); - // vraci TRUE pokud ma plugin pokracovat s nacitanim obrazku, vraci-li FALSE, - // tvorba thumbnailu je hotova (byl zpracovan cely obrazek) nebo se ma co - // nejdrive prerusit (napr. uzivatel zmenil cestu v panelu, thumbnail tedy jiz - // neni potreba) - // - // POZOR: pokud je spustena metoda CPluginInterfaceForThumbLoader::LoadThumbnail, - // je blokovana zmena cesty v panelu. Z toho duvodu je treba predavat a hlavne - // nacitat vetsi obrazky po castech a testovatovanim navratove hodnoty - // metody ProcessBuffer overovat, zda se nacitani nema prerusit. - // Pokud je treba provest casove narocnejsi operace pred volanim metody SetParameters - // nebo pred volanim ProcessBuffer, je behem teto doby nutne obcas volat GetCancelProcessing. + // processes part of image in buffer 'buffer' (processed part of image is stored + // row by row from top to bottom, points on rows are stored from left to right, + // each point is represented by 32-bit value which is composed of three bytes + // with R+G+B colors and fourth byte which is ignored); we distinguish two types + // of processing: copying of image to final thumbnail (if size of processed image + // does not exceed size of thumbnail) and resizing of image to thumbnail (image + // is larger than thumbnail); 'buffer' is used only for reading; 'rowsCount' + // specifies how many rows of image are in buffer; + // if 'buffer' is NULL, data are taken from own buffer (plugin gets it via GetBuffer); + // returns TRUE if plugin should continue with loading of thumbnail, if returns + // FALSE, creation of thumbnail is finished (whole image was processed) or it is + // necessary to stop loading of thumbnail as soon as possible (e.g. user changed + // path in panel, thumbnail is not needed anymore) + // + // WARNING: if method CPluginInterfaceForThumbLoader::LoadThumbnail is running, + // change of path in panel is blocked. For this reason it is necessary to pass + // and load larger images in parts and test return value of method ProcessBuffer + // if loading should be stopped. + // If it is necessary to perform time-consuming operations before calling method + // SetParameters or before calling ProcessBuffer, it is necessary to call + // GetCancelProcessing from time to time during this period. virtual BOOL WINAPI ProcessBuffer(void* buffer, int rowsCount) = 0; - // vraci vlastni buffer o velikosti potrebne k ulozeni 'rowsCount' radku obrazku - // (4 * 'rowsCount' * 'picWidth' bytu); je-li objekt v chybovem stavu (po volani - // SetError), vraci NULL; - // plugin nesmi dealokovat ziskany buffer (dealokuje se v Salamanderovi automaticky) + // returns own buffer of size needed to store 'rowsCount' rows of image + // (4 * 'rowsCount' * 'picWidth' bytes); if object is in error state (after + // calling SetError), returns NULL; + // plugin must not deallocate the obtained buffer (it is deallocated automatically + // by Salamander) virtual void* WINAPI GetBuffer(int rowsCount) = 0; - // oznameni chyby pri ziskavani obrazku (thumbnail je povazovan za vadny - // a nepouzije se), ostatni metody tohoto rozhrani budou od chvile volani - // SetError uz jen vracet chyby (GetBuffer a SetParameters) nebo preruseni - // prace (ProcessBuffer) + // reporting of error when getting image (thumbnail is considered as invalid + // and it is not used), other methods of this interface will return errors + // (GetBuffer and SetParameters) or stop processing (ProcessBuffer) after + // calling SetError virtual void WINAPI SetError() = 0; - // vraci TRUE, pokud ma plugin preprusit nacitani thumbnailu - // vraci FALSE, pokud ma plugin pokracovat s nacitanim obrazku - // - // metodu lze volat pred i po volani metody SetParameters - // - // slouzi k detekci pozadavku na preruseni v pripadech, kdy plugin - // potrebuje vykonat casove narocne operace jeste pred volanim SetParameters - // nebo v pripade, kdy plugin potrebuje obrazek predrenderovat, tedy po volani - // SetParameters, ale pred volanim ProcessBuffer + // returns TRUE if plugin should stop loading of thumbnail + // returns FALSE if plugin should continue with loading of thumbnail + // + // method can be called before or after calling method SetParameters + // + // serves for detection of request for interruption in cases when plugin + // needs to perform time-consuming operations before calling SetParameters + // or in cases when plugin needs to pre-render image, i.e. after calling + // SetParameters, but before calling ProcessBuffer virtual BOOL WINAPI GetCancelProcessing() = 0; }; @@ -101,38 +105,39 @@ class CSalamanderThumbnailMakerAbstract class CPluginInterfaceForThumbLoaderAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceForThumbLoaderEncapsulation) +private: // protection against incorrect direct calling of methods (see CPluginInterfaceForThumbLoaderEncapsulation) friend class CPluginInterfaceForThumbLoaderEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // nacte thumbnail pro soubor 'filename'; 'thumbWidth' a 'thumbHeight' jsou - // rozmery pozadovaneho thumbnailu; 'thumbMaker' je rozhrani algoritmu pro - // tvorbu thumbnailu (umi prijmout hotovy thumbnail nebo ho vyrobit zmensenim - // obrazku); vraci TRUE pokud je format souboru 'filename' znamy, pokud vrati - // FALSE, Salamander zkusi nacist thumbnail pomoci jineho pluginu; chybu pri - // ziskavani thumbnailu (napr. chybu cteni souboru) plugin hlasi pomoci - // rozhrani 'thumbMaker' - viz metoda SetError; 'fastThumbnail' je TRUE v prvnim - // kole cteni thumbnailu - cilem je vratit thumbnail co nejrychleji (klidne - // v horsi kvalite nebo mensi nez je potreba), v druhem kole cteni thumbnailu - // (jen pokud se v prvnim kole nastavi flag SSTHUMB_ONLY_PREVIEW) je - // 'fastThumbnail' FALSE - cilem je vratit kvalitni thumbnail - // omezeni: jelikoz se vola z threadu pro nacitani ikon (neni to hlavni thread), lze z - // CSalamanderGeneralAbstract pouzivat jen metody, ktere lze volat z libovolneho threadu - // - // Doporucene schema implementace: - // - pokusit se otevrit obrazek - // - pokud se nepodari, vratit FALSE - // - extrahovat rozmery obrazku - // - predat je do Salamandera pres thumbMaker->SetParameters - // - pokud vrati FALSE, uklid a odchod (nepovedlo se alokovat buffery) - // - SMYCKA - // - nacist cast dat z obrazku - // - poslat je do Salamandera pres thumbMaker->ProcessBuffer - // - pokud vrati FALSE, uklid a odchod (preruseni z duvodu zmeny cesty) - // - pokracovat ve SMYCCE, dokud nebude cely obrazek predan - // - uklid a odchod + // loads thumbnail for file 'filename'; 'thumbWidth' and 'thumbHeight' are + // dimensions of requested thumbnail; 'thumbMaker' is an interface of algorithm + // for creating thumbnail (it can accept already created thumbnail or create + // it by resizing image); returns TRUE if format of file 'filename' is known, + // if returns FALSE, Salamander tries to load thumbnail using another plugin; + // error when getting thumbnail (e.g. error when reading file) is reported + // via interface 'thumbMaker' - see method SetError; 'fastThumbnail' is TRUE + // in the first round of loading thumbnail - the goal is to return thumbnail + // as soon as possible (even in worse quality or smaller than needed), in the + // second round of loading thumbnail (only if in the first round flag + // SSTHUMB_ONLY_PREVIEW is set) 'fastThumbnail' is FALSE - the goal is to + // return thumbnail in good quality + // limitation: because it is called from thread for loading icons (it is not + // main thread), only methods which can be called from any thread can be used + // + // Recommended schema of implementation: + // - try to open image + // - if it fails, return FALSE + // - extract dimensions of image + // - pass them to Salamander via thumbMaker->SetParameters + // - if it returns FALSE, cleanup and exit (failed to allocate buffers) + // - LOOP + // - load part of data from image + // - send them to Salamander via thumbMaker->ProcessBuffer + // - if it returns FALSE, cleanup and exit (interruption due to change of path) + // - continue in LOOP until whole image is processed + // - cleanup and exit virtual BOOL WINAPI LoadThumbnail(const char* filename, int thumbWidth, int thumbHeight, CSalamanderThumbnailMakerAbstract* thumbMaker, BOOL fastThumbnail) = 0; From 45ca11e9d3c7856efed479f321ed140bcae43849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20V=C3=A1rady?= Date: Thu, 21 Dec 2023 21:07:00 +0100 Subject: [PATCH 3/5] spl_vers.h: translated --- src/plugins/shared/spl_vers.h | 108 ++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 51 deletions(-) diff --git a/src/plugins/shared/spl_vers.h b/src/plugins/shared/spl_vers.h index 79bc6460d..2c53c043b 100644 --- a/src/plugins/shared/spl_vers.h +++ b/src/plugins/shared/spl_vers.h @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later - +// CommentsTranslationProject: TRANSLATED +// //**************************************************************************** // // Copyright (c) 2023 Open Salamander Authors @@ -25,7 +26,7 @@ #define VERSINFO_SALAMANDER_MINORA 0 #define VERSINFO_SALAMANDER_MINORB 0 -#if (VERSINFO_SALAMANDER_MINORB == 0) // nulu na setinach nepiseme 2.50 -> 2.5 +#if (VERSINFO_SALAMANDER_MINORB == 0) // don't write zero on the hundredths 2.50 -> 2.5 #define VERSINFO_SALAMANDER_VERSION VERSINFO_xstr(VERSINFO_SALAMANDER_MAJOR) "." VERSINFO_xstr(VERSINFO_SALAMANDER_MINORA) VERSINFO_BETAVERSION_TXT #define VERSINFO_SAL_SHORT_VERSION VERSINFO_xstr(VERSINFO_SALAMANDER_MAJOR) VERSINFO_xstr(VERSINFO_SALAMANDER_MINORA) VERSINFO_BETAVERSIONSHORT_TXT #else @@ -33,8 +34,8 @@ #define VERSINFO_SAL_SHORT_VERSION VERSINFO_xstr(VERSINFO_SALAMANDER_MAJOR) VERSINFO_xstr(VERSINFO_SALAMANDER_MINORA) VERSINFO_xstr(VERSINFO_SALAMANDER_MINORB) VERSINFO_BETAVERSIONSHORT_TXT #endif -#ifdef VERSINFO_MAJOR // je definovane jen pokud se pouziva z pluginu -#if (VERSINFO_MINORB == 0) // nulu na setinach nepiseme 2.50 -> 2.5 +#ifdef VERSINFO_MAJOR // only defined if used from plugin +#if (VERSINFO_MINORB == 0) // don't write zero on the hundredths 2.50 -> 2.5 #define VERSINFO_VERSION VERSINFO_xstr(VERSINFO_MAJOR) "." VERSINFO_xstr(VERSINFO_MINORA) VERSINFO_BETAVERSION_TXT #define VERSINFO_VERSION_NO_PLATFORM VERSINFO_xstr(VERSINFO_MAJOR) "." VERSINFO_xstr(VERSINFO_MINORA) VERSINFO_BETAVERSION_TXT_NO_PLATFORM #else @@ -51,14 +52,15 @@ // VERSINFO_BUILDNUMBER: // -// Slouzi ke snadnemu odliseni verzi vsech modulu mezi jednotlivymi verzemi -// Salamandera (jde o posledni komponentu cisla verze vsech pluginu a -// Salamandera). Zvysovat s kazdou verzi (IB, DB, PB, beta, release nebo i -// jen testovaci verze poslana jednomu uzivateli). Prehled ruznych typu verzi -// je v souboru doc\versions.txt. Vzdy zavest komentar s popisem, ke ktere -// verzi Salamandera patri nove pouzite cislo buildu. -// -// Prehled pouzitych hodnot VERSINFO_BUILDNUMBER: +// Used to easily distinguish versions of all modules between individual +// versions of Salamander (it is the last component of the version number of +// all plugins and Salamander). Increase with each version (IB, DB, PB, beta, +// release or even just a test version sent to one user). An overview of the +// various types of versions is in the file doc\versions.txt. Always introduce +// a comment with a description of which version of Salamander the new build +// number belongs to. +// +// Overview of used values of VERSINFO_BUILDNUMBER: // 9 - 2.5 beta 9 // 10 - 2.5 beta 10 // 11 - 2.5 beta 11 @@ -97,52 +99,56 @@ // 182 - 4.0 (CB182) // 183 - 5.0 -// ! DULEZITE: nova cisla buildu je nutne zapsat do vetve "default", a pak -// teprve do vedlejsi vetve (kompletni seznam je jen v "default" vetvi) +// ! IMPORTANT: all build numbers must be written to the "default" branch, and then +// to the secondary branch (the complete list is only in the "default" branch) #define VERSINFO_BUILDNUMBER 183 // VERSINFO_BETAVERSION_TXT: // -// Meni se s kazdym buildem, v pripade release verze bude VERSINFO_BETAVERSION_TXT="". -// Pokud vydavame specialni opravne beta verze typu 2.5 beta 9a, zvysime -// VERSINFO_BUILDNUMBER o jedna a dame VERSINFO_BETAVERSION_TXT==" beta 9a". +// Changed with each build, in the case of the release version VERSINFO_BETAVERSION_TXT=="". +// If we release special bug fix beta versions like 2.5 beta 9a, increase +// VERSINFO_BUILDNUMBER by one and set VERSINFO_BETAVERSION_TXT==" beta 9a". // -// VERSINFO_BETAVERSIONSHORT_TXT slouzi pro pojmenovani bug reportu, jde o co nejkratsi zapis +// VERSINFO_BETAVERSIONSHORT_TXT is used to name bug reports, it is the shortest possible +// name. -// priklady ("x86" je pro 32-bit verzi, "x64" pro 64-bit verzi, v nasledujicich prikladech jsou -// x86/x64 zamenne): " (x86)" (pro release verze), " beta 2 (x64)", " beta 2 (SDK x86)", -// " RC1 (x64)", " beta 2 (IB21 x86)", " beta 2 (DB21 x64)", " beta 2 (PB21 x86)" +// examples ("x86" is for 32-bit version, "x64" for 64-bit version, in the following +// examples x86/x64 are interchangeable): " (x86)" (for release versions), " beta 2 (x64)", +// " beta 2 (SDK x86)", " RC1 (x64)", " beta 2 (IB21 x86)", " beta 2 (DB21 x64)", +// " beta 2 (PB21 x86)" #define VERSINFO_BETAVERSION_TXT " (" SAL_VER_PLATFORM ")" -#define VERSINFO_BETAVERSION_TXT_NO_PLATFORM "" // kopie radku vyse + smazat SAL_VER_PLATFORM + je-li zavorka prazdna, smazat ji + smazat nadbytecne mezery +#define VERSINFO_BETAVERSION_TXT_NO_PLATFORM "" // copy of the line above + delete SAL_VER_PLATFORM + if the bracket is empty, delete it + delete unnecessary spaces -// priklady (x86/x64 viz predchozi odstavec): "x86" (pro release verze), "B2x64", "B2SDKx86", -// "RC1x64", "B2IB21x86", "B2DB21x64", "B2PB21x86" +// examples (x86/x64 see previous paragraph): "x86" (for release versions), "B2x64", +// "B2SDKx86", "RC1x64", "B2IB21x86", "B2DB21x64", "B2PB21x86" #define VERSINFO_BETAVERSIONSHORT_TXT SAL_VER_PLATFORM // LAST_VERSION_OF_SALAMANDER: // -// Podpora pro kontrolu aktualnosti verze Salamandera, kterou interni pluginy -// (distribuovane v jednom balicku se Salamanderem) provadi behem entry-pointu -// (SalamanderPluginEntry) viz metoda CSalamanderPluginEntryAbstract::GetVersion() -// (v spl_base.h). Slouzi hlavne pro jednoduchost: interni plugin muze volat -// jakoukoliv metodu z rozhrani Salamandera, protoze po kontrole na posledni -// verzi Salamandera ma jistotu, ze ji Salamander obsahuje (hrozi mu jen load -// do novejsi verze Salamandera, ktery tyto metody musi tez obsahovat). -// -// Pouziva se i opacne: aby mel interni plugin jistotu, ze mu Salamander bude -// volat vsechny metody (vcetne nejnovejsich), vraci tuto verzi, jako verzi, -// pro kterou byl plugin postaven (viz export pluginu SalamanderPluginGetReqVer). -// -// Pokud nektery plugin vraci z SalamanderPluginGetReqVer nizsi verzi nez -// LAST_VERSION_OF_SALAMANDER (pro zpetnou kompatibilitu se starsimi verzemi -// Salamandera), mel by pridat export SalamanderPluginGetSDKVer a vracet z nej -// LAST_VERSION_OF_SALAMANDER (verze SDK pouzita pro stavbu pluginu), aby mohl -// Salamander (napr. aktualni nebo novejsi) pouzivat i metody pluginu, ktere -// ve verzi vracene z SalamanderPluginGetReqVer jeste nebyly. -// -// Pri zmenach v rozhrani je potreba dodrzet postup uvedeny v doc\how_to_change.txt. -// -// Prehled pouzitych hodnot LAST_VERSION_OF_SALAMANDER: +// Support for checking the current version of Salamander, which internal plugins +// (distributed in one package with Salamander) perform during the entry-point +// (SalamanderPluginEntry) see the method CSalamanderPluginEntryAbstract::GetVersion() +// (in spl_base.h). It is used mainly for simplicity: an internal plugin can call +// any method from the Salamander interface, because after checking the last version +// of Salamander it has the certainty that Salamander contains it (it only threatens +// to load into a newer version of Salamander, which must also contain these methods). +// +// It is also used in reverse: so that the internal plugin has the certainty that +// Salamander will call all methods (including the latest ones), it returns this +// version as the version for which the plugin was built (see the export of the +// SalamanderPluginGetReqVer plugin). +// +// If any plugin returns a lower version from SalamanderPluginGetReqVer than +// LAST_VERSION_OF_SALAMANDER (for backward compatibility with older versions +// of Salamander), it should add the export SalamanderPluginGetSDKVer and return +// LAST_VERSION_OF_SALAMANDER from it (the SDK version used to build the plugin), +// so that Salamander (e.g. current or newer) can also use methods of the plugin +// that were not yet in the version returned from SalamanderPluginGetReqVer. +// +// When changing the interface, it is necessary to follow the procedure given in +// doc\how_to_change.txt. +// +// Overview of used values of LAST_VERSION_OF_SALAMANDER: // 1 - 1.6 beta 4 + 5 // 2 - 1.6 beta 6 // 3 - 1.6 beta 7 @@ -159,13 +165,13 @@ // 14 - 2.5 beta 10 // 15 - 2.5 beta 10a // 16 - 2.5 beta 11 -// 17 - 2.5 beta 12 (jen interni, pustili jsme misto ni RC1) +// 17 - 2.5 beta 12 (internal only, we release RC1 instead of it) // 18 - 2.5 RC1 // 19 - 2.5 RC2 // 20 - 2.5 RC3 // 21 - 2.5 // 22 - 2.51 -// 23 - 2.52 beta 1 (POZOR: nekompatibilni SDK s predchozimi a dalsimi verzemi) +// 23 - 2.52 beta 1 (CAUTION: incompatible SDK with previous and next versions) // 29 - 2.52 beta 2 // 31 - 2.52 // 39 - 2.53 beta 1 + 2.53 beta 1a @@ -185,9 +191,9 @@ // 76 - 3.06 // 79 - 3.07 // 81 - 3.08 -// ! DULEZITE: vsechny verze z VC2008 musi byt < 100, vsechny verze z VC2019 musi byt >= 100, -// nova cisla verzi je nutne zapsat do vetve "default", a pak -// teprve do vedlejsi vetve (kompletni seznam je jen v "default" vetvi) +// IMPORTANT: all versions from VC2008 must be < 100, all versions from VC2019 must be >= 100, +// new version numbers must be written to the "default" branch, and then +// to the secondary branch (the complete list is only in the "default" branch) // 101 - 4.0 beta 1 (DB177) // 102 - 4.0 // 103 - 5.0 From 41e913a927ba3eafd8bce44b3b80e645bcc7a0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20V=C3=A1rady?= Date: Thu, 21 Dec 2023 21:07:08 +0100 Subject: [PATCH 4/5] spl_view.h: translated --- src/plugins/shared/spl_view.h | 53 ++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/src/plugins/shared/spl_view.h b/src/plugins/shared/spl_view.h index e6c6eb161..25374ca5d 100644 --- a/src/plugins/shared/spl_view.h +++ b/src/plugins/shared/spl_view.h @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later - +// CommentsTranslationProject: TRANSLATED +// //**************************************************************************** // // Copyright (c) 2023 Open Salamander Authors @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_view) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_view) // so that structures are independent of the set alignment #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -29,39 +30,41 @@ struct CSalamanderPluginViewerData; class CPluginInterfaceForViewerAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceForViewerEncapsulation) +private: // protection against incorrect calling of methods (see CPluginInterfaceForViewerEncapsulation) friend class CPluginInterfaceForViewerEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // funkce pro "file viewer", vola se pri pozadavku na otevreni viewru a nacteni souboru - // 'name', 'left'+'right'+'width'+'height'+'showCmd'+'alwaysOnTop' je doporucene umisteni - // okna, je-li 'returnLock' FALSE nemaji 'lock'+'lockOwner' zadny vyznam, je-li 'returnLock' - // TRUE, mel by viewer vratit system-event 'lock' v nonsignaled stavu, do signaled stavu 'lock' - // prejde v okamziku ukonceni prohlizeni souboru 'name' (soubor je v tomto okamziku odstranen - // z docasneho adresare), dale by mel vratit v 'lockOwner' TRUE pokud ma byt objekt 'lock' uzavren - // volajicim (FALSE znamena, ze si viewer 'lock' rusi sam - v tomto pripade viewer musi pro - // prechod 'lock' do signaled stavu pouzit metodu CSalamanderGeneralAbstract::UnlockFileInCache); - // pokud viewer nenastavi 'lock' (zustava NULL) je soubor 'name' platny jen do ukonceni volani teto - // metody ViewFile; neni-li 'viewerData' NULL, jde o predani rozsirenych parametru viewru (viz - // CSalamanderGeneralAbstract::ViewFileInPluginViewer); 'enumFilesSourceUID' je UID zdroje (panelu - // nebo Find okna), ze ktereho je viewer otviran, je-li -1, je zdroj neznamy (archivy a - // file_systemy nebo Alt+F11, atd.) - viz napr. CSalamanderGeneralAbstract::GetNextFileNameForViewer; - // 'enumFilesCurrentIndex' je index oteviraneho souboru ve zdroji (panelu nebo Find okne), je-li -1, - // neni zdroj nebo index znamy; vraci TRUE pri uspechu (FALSE znamena neuspech, 'lock' a - // 'lockOwner' v tomto pripade nemaji zadny vyznam) + // fuction for "file viewer", called during the request for opening viewer and loading file + // 'name', 'left'+'right'+'width'+'height'+'showCmd'+'alwaysOnTop' is recommended position + // of window, if 'returnLock' is FALSE, 'lock'+'lockOwner' have no meaning, if 'returnLock' + // is TRUE, viewer should return system-event 'lock' in nonsignaled state, 'lock' should + // change to signaled state when viewer finishes viewing of file 'name' (file is deleted + // from temporary directory at this moment), 'lockOwner' should be TRUE if 'lock' should + // be closed by caller (FALSE means that viewer closes 'lock' itself - in this case viewer + // must use method CSalamanderGeneralAbstract::UnlockFileInCache to change 'lock' to + // signaled state); if viewer does not set 'lock' (remains NULL), file 'name' is valid + // only until the end of calling of this method ViewFile; if 'viewerData' is not NULL, + // it is a transfer of extended parameters of viewer (see + // CSalamanderGeneralAbstract::ViewFileInPluginViewer); 'enumFilesSourceUID' is UID of + // source (panel or Find window) from which viewer is opened, if -1, source is unknown + // (archives and file_systems or Alt+F11, etc.) - see e.g. + // CSalamanderGeneralAbstract::GetNextFileNameForViewer; 'enumFilesCurrentIndex' is index + // of opened file in source (panel or Find window), if -1, source or index is unknown; + // returns TRUE on success (FALSE means failure, 'lock' and 'lockOwner' have no meaning + // in this case) virtual BOOL WINAPI ViewFile(const char* name, int left, int top, int width, int height, UINT showCmd, BOOL alwaysOnTop, BOOL returnLock, HANDLE* lock, BOOL* lockOwner, CSalamanderPluginViewerData* viewerData, int enumFilesSourceUID, int enumFilesCurrentIndex) = 0; - // funkce pro "file viewer", vola se pri pozadavku na otevreni viewru a nacteni souboru - // 'name'; tato fuknce by nemela zobrazovat zadna okna typu "invalid file format", tato - // okna se zobrazi az pri volani metody ViewFile tohoto rozhrani; zjisti jestli je - // soubor 'name' zobrazitelny (napr. soubor ma odpovidajici signaturu) ve vieweru - // a pokud je, vraci TRUE; pokud vrati FALSE, zkusi Salamander pro 'name' najit jiny - // viewer (v prioritnim seznamu vieweru, viz konfiguracni stranka Viewers) + // function for "file viewer", called during the request for opening viewer and loading + // file 'name'; this function should not display any windows like "invalid file format", + // these windows are displayed only when calling method ViewFile of this interface; + // determines whether file 'name' is viewable (e.g. file has appropriate signature) in + // viewer and if it is, returns TRUE; if returns FALSE, Salamander tries to find another + // viewer for 'name' (in the priority list of viewers, see configuration page Viewers) virtual BOOL WINAPI CanViewFile(const char* name) = 0; }; From a73131061d81705e8d0f1b0bdc10bb9b539b5080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20V=C3=A1rady?= Date: Thu, 21 Dec 2023 21:09:08 +0100 Subject: [PATCH 5/5] spl_menu.h, spl_thum.h, spl_vers.h, spl_view.h: translated --- src/plugins/shared/spl_menu.h | 4 ++-- src/plugins/shared/spl_thum.h | 8 ++++---- src/plugins/shared/spl_vers.h | 12 ++++++------ src/plugins/shared/spl_view.h | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/plugins/shared/spl_menu.h b/src/plugins/shared/spl_menu.h index 2aba21292..abb30b2ab 100644 --- a/src/plugins/shared/spl_menu.h +++ b/src/plugins/shared/spl_menu.h @@ -27,7 +27,7 @@ class CSalamanderForOperationsAbstract; // CSalamanderBuildMenuAbstract // // set of Salamander methods for building menu of plugin -// +// // it is a subset of methods of CSalamanderConnectAbstract, methods behave the same, // the same constants are used, for description see CSalamanderConnectAbstract @@ -64,7 +64,7 @@ class CSalamanderBuildMenuAbstract // flags of menu item state (for menu extension plugins) #define MENU_ITEM_STATE_ENABLED 0x01 // enabled, without this flag item is disabled #define MENU_ITEM_STATE_CHECKED 0x02 // before item is "check" or "radio" tag -#define MENU_ITEM_STATE_RADIO 0x04 // without MENU_ITEM_STATE_CHECKED it is ignored, +#define MENU_ITEM_STATE_RADIO 0x04 // without MENU_ITEM_STATE_CHECKED it is ignored, \ // "radio" tag, without this flag "check" tag #define MENU_ITEM_STATE_HIDDEN 0x08 // items is not supposed to be shown in menu diff --git a/src/plugins/shared/spl_thum.h b/src/plugins/shared/spl_thum.h index 7be0c8421..85b5ff32b 100644 --- a/src/plugins/shared/spl_thum.h +++ b/src/plugins/shared/spl_thum.h @@ -62,7 +62,7 @@ class CSalamanderThumbnailMakerAbstract // FALSE, creation of thumbnail is finished (whole image was processed) or it is // necessary to stop loading of thumbnail as soon as possible (e.g. user changed // path in panel, thumbnail is not needed anymore) - // + // // WARNING: if method CPluginInterfaceForThumbLoader::LoadThumbnail is running, // change of path in panel is blocked. For this reason it is necessary to pass // and load larger images in parts and test return value of method ProcessBuffer @@ -87,9 +87,9 @@ class CSalamanderThumbnailMakerAbstract // returns TRUE if plugin should stop loading of thumbnail // returns FALSE if plugin should continue with loading of thumbnail - // + // // method can be called before or after calling method SetParameters - // + // // serves for detection of request for interruption in cases when plugin // needs to perform time-consuming operations before calling SetParameters // or in cases when plugin needs to pre-render image, i.e. after calling @@ -125,7 +125,7 @@ class CPluginInterfaceForThumbLoaderAbstract // return thumbnail in good quality // limitation: because it is called from thread for loading icons (it is not // main thread), only methods which can be called from any thread can be used - // + // // Recommended schema of implementation: // - try to open image // - if it fails, return FALSE diff --git a/src/plugins/shared/spl_vers.h b/src/plugins/shared/spl_vers.h index 2c53c043b..51c942075 100644 --- a/src/plugins/shared/spl_vers.h +++ b/src/plugins/shared/spl_vers.h @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later // CommentsTranslationProject: TRANSLATED -// +// //**************************************************************************** // // Copyright (c) 2023 Open Salamander Authors @@ -59,7 +59,7 @@ // various types of versions is in the file doc\versions.txt. Always introduce // a comment with a description of which version of Salamander the new build // number belongs to. -// +// // Overview of used values of VERSINFO_BUILDNUMBER: // 9 - 2.5 beta 9 // 10 - 2.5 beta 10 @@ -132,22 +132,22 @@ // any method from the Salamander interface, because after checking the last version // of Salamander it has the certainty that Salamander contains it (it only threatens // to load into a newer version of Salamander, which must also contain these methods). -// +// // It is also used in reverse: so that the internal plugin has the certainty that // Salamander will call all methods (including the latest ones), it returns this // version as the version for which the plugin was built (see the export of the // SalamanderPluginGetReqVer plugin). -// +// // If any plugin returns a lower version from SalamanderPluginGetReqVer than // LAST_VERSION_OF_SALAMANDER (for backward compatibility with older versions // of Salamander), it should add the export SalamanderPluginGetSDKVer and return // LAST_VERSION_OF_SALAMANDER from it (the SDK version used to build the plugin), // so that Salamander (e.g. current or newer) can also use methods of the plugin // that were not yet in the version returned from SalamanderPluginGetReqVer. -// +// // When changing the interface, it is necessary to follow the procedure given in // doc\how_to_change.txt. -// +// // Overview of used values of LAST_VERSION_OF_SALAMANDER: // 1 - 1.6 beta 4 + 5 // 2 - 1.6 beta 6 diff --git a/src/plugins/shared/spl_view.h b/src/plugins/shared/spl_view.h index 25374ca5d..b3619b9f0 100644 --- a/src/plugins/shared/spl_view.h +++ b/src/plugins/shared/spl_view.h @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later // CommentsTranslationProject: TRANSLATED -// +// //**************************************************************************** // // Copyright (c) 2023 Open Salamander Authors