Replace Unicode character categories with blocks
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: ZRCola\n"
|
||||
"POT-Creation-Date: 2022-02-17 13:32+0100\n"
|
||||
"POT-Creation-Date: 2025-11-14 16:23+0100\n"
|
||||
"PO-Revision-Date: 2019-04-01 19:38+0200\n"
|
||||
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
|
||||
"Language-Team: Amebis, d. o. o., Kamnik <info@amebis.si>\n"
|
||||
@@ -21,7 +21,7 @@ msgstr ""
|
||||
msgid "© 2004-%s ZRC SAZU"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolaapp.cpp:60 zrcolafrm.cpp:118 zrcolagui.cpp:232 zrcolagui.cpp:943
|
||||
#: zrcolaapp.cpp:60 zrcolafrm.cpp:110 zrcolagui.cpp:232 zrcolagui.cpp:943
|
||||
#: zrcolagui.h:119 MSIBuild/en_US.ARM64.Debug.Feature-2.idtx:4
|
||||
#: MSIBuild/en_US.ARM64.Debug.Shortcut-2.idtx:4
|
||||
#: MSIBuild/en_US.ARM64.Release.Feature-2.idtx:4
|
||||
@@ -45,7 +45,7 @@ msgstr ""
|
||||
msgid "Context"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolachrreq.cpp:50 zrcolagui.h:376
|
||||
#: zrcolachrreq.cpp:50 zrcolagui.h:382
|
||||
msgid "Request a New Character"
|
||||
msgstr ""
|
||||
|
||||
@@ -62,7 +62,7 @@ msgstr ""
|
||||
msgid "Invalid character in Unicode found: %c"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolachrslct.cpp:201 zrcolachrslct.cpp:377 zrcolachrslct.cpp:874
|
||||
#: zrcolachrslct.cpp:201 zrcolachrslct.cpp:377 zrcolachrslct.cpp:870
|
||||
msgid "▸ Search Options"
|
||||
msgstr ""
|
||||
|
||||
@@ -70,35 +70,35 @@ msgstr ""
|
||||
msgid ", "
|
||||
msgstr ""
|
||||
|
||||
#: zrcolachrslct.cpp:380 zrcolachrslct.cpp:871
|
||||
#: zrcolachrslct.cpp:380 zrcolachrslct.cpp:867
|
||||
msgid "▾ Search Options"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolafrm.cpp:84
|
||||
#: zrcolafrm.cpp:76
|
||||
msgid "No Translation"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolafrm.cpp:97
|
||||
#: zrcolafrm.cpp:89
|
||||
msgid "Custom Translation..."
|
||||
msgstr ""
|
||||
|
||||
#: zrcolafrm.cpp:217
|
||||
#: zrcolafrm.cpp:209
|
||||
msgid "ZRCola keyboard shortcut Win+F5 could not be registered. Some functionality will not be available."
|
||||
msgstr ""
|
||||
|
||||
#: zrcolafrm.cpp:217 zrcolafrm.cpp:219
|
||||
#: zrcolafrm.cpp:209 zrcolafrm.cpp:211
|
||||
msgid "Warning"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolafrm.cpp:219
|
||||
#: zrcolafrm.cpp:211
|
||||
msgid "ZRCola keyboard shortcut Win+F6 could not be registered. Some functionality will not be available."
|
||||
msgstr ""
|
||||
|
||||
#: zrcolafrm.cpp:513
|
||||
#: zrcolafrm.cpp:505
|
||||
msgid "http://zrcola.zrc-sazu.si/en/info/instructions/"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolafrm.cpp:538
|
||||
#: zrcolafrm.cpp:530
|
||||
msgid "http://zrcola.zrc-sazu.si/wp-content/uploads/2016/06/ZRCola_tipkovnica_Jun2016.pdf"
|
||||
msgstr ""
|
||||
|
||||
@@ -399,7 +399,7 @@ msgid "Shows/hides additional search options"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.cpp:517
|
||||
msgid "List of Unicode character categories to search in"
|
||||
msgid "List of Unicode character blocks to search in"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.cpp:524
|
||||
@@ -415,7 +415,7 @@ msgid "None"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.cpp:530
|
||||
msgid "Clear category selection"
|
||||
msgid "Clear block selection"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.cpp:534
|
||||
@@ -423,7 +423,7 @@ msgid "Invert"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.cpp:535
|
||||
msgid "Invert category selection"
|
||||
msgid "Invert block selection"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.cpp:574
|
||||
@@ -467,7 +467,7 @@ msgid "Character tags"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.cpp:691
|
||||
msgid "Unicode character category"
|
||||
msgid "Unicode character block"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.cpp:698
|
||||
@@ -637,23 +637,23 @@ msgstr ""
|
||||
msgid "↓"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.h:260
|
||||
#: zrcolagui.h:262
|
||||
msgid "Character Search"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.h:296
|
||||
#: zrcolagui.h:299
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.h:322
|
||||
#: zrcolagui.h:326
|
||||
msgid "About ZRCola"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.h:347 zrcolaupdater.cpp:81
|
||||
#: zrcolagui.h:352 zrcolaupdater.cpp:81
|
||||
msgid "Product Update"
|
||||
msgstr ""
|
||||
|
||||
#: zrcolagui.h:418
|
||||
#: zrcolagui.h:425
|
||||
msgid "Custom Translation Sequence"
|
||||
msgstr ""
|
||||
|
||||
@@ -661,7 +661,7 @@ msgstr ""
|
||||
msgid "INS key is pressed. Type the Unicode code of desired character now (up to four hexadecimal digits: 0-9, A-F), then release INS."
|
||||
msgstr ""
|
||||
|
||||
#: zrcolasettings.cpp:73
|
||||
#: zrcolasettings.cpp:72
|
||||
msgid "Start ZRCola automatically on logon"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -2216,7 +2216,7 @@
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_categories</property>
|
||||
<property name="name">m_blocks</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
@@ -2229,7 +2229,7 @@
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">List of Unicode character categories to search in</property>
|
||||
<property name="tooltip">List of Unicode character blocks to search in</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
@@ -2237,7 +2237,7 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnCheckListBoxToggled">OnCategoriesToggle</event>
|
||||
<event name="OnCheckListBoxToggled">OnBlocksToggle</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
@@ -2246,7 +2246,7 @@
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="false">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bSizerCategoriesCtrl</property>
|
||||
<property name="name">bSizerBlocksCtrl</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="false">
|
||||
@@ -2291,7 +2291,7 @@
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_categoriesAll</property>
|
||||
<property name="name">m_blocksAll</property>
|
||||
<property name="normal_color"></property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
@@ -2311,7 +2311,7 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnHyperlink">OnCategoriesAll</event>
|
||||
<event name="OnHyperlink">OnBlocksAll</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
@@ -2356,7 +2356,7 @@
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_categoriesNone</property>
|
||||
<property name="name">m_blocksNone</property>
|
||||
<property name="normal_color"></property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
@@ -2370,13 +2370,13 @@
|
||||
<property name="style">wxHL_DEFAULT_STYLE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Clear category selection</property>
|
||||
<property name="tooltip">Clear block selection</property>
|
||||
<property name="url"></property>
|
||||
<property name="visited_color"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnHyperlink">OnCategoriesNone</event>
|
||||
<event name="OnHyperlink">OnBlocksNone</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="false">
|
||||
@@ -2421,7 +2421,7 @@
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_categoriesInvert</property>
|
||||
<property name="name">m_blocksInvert</property>
|
||||
<property name="normal_color"></property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
@@ -2435,13 +2435,13 @@
|
||||
<property name="style">wxHL_DEFAULT_STYLE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Invert category selection</property>
|
||||
<property name="tooltip">Invert block selection</property>
|
||||
<property name="url"></property>
|
||||
<property name="visited_color"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnHyperlink">OnCategoriesInvert</event>
|
||||
<event name="OnHyperlink">OnBlocksInvert</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
@@ -3137,7 +3137,7 @@
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_category</property>
|
||||
<property name="name">m_block</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
@@ -3150,7 +3150,7 @@
|
||||
<property name="style">wxTE_READONLY|wxTE_CENTER</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Unicode character category</property>
|
||||
<property name="tooltip">Unicode character block</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
|
||||
@@ -512,32 +512,32 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
|
||||
wxBoxSizer* sbSizerSearch;
|
||||
sbSizerSearch = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxArrayString m_categoriesChoices;
|
||||
m_categories = new wxCheckListBox( m_search_panel, wxID_ANY, wxDefaultPosition, wxSize( -1,60 ), m_categoriesChoices, 0 );
|
||||
m_categories->SetToolTip( _("List of Unicode character categories to search in") );
|
||||
wxArrayString m_blocksChoices;
|
||||
m_blocks = new wxCheckListBox( m_search_panel, wxID_ANY, wxDefaultPosition, wxSize( -1,60 ), m_blocksChoices, 0 );
|
||||
m_blocks->SetToolTip( _("List of Unicode character blocks to search in") );
|
||||
|
||||
sbSizerSearch->Add( m_categories, 0, wxALL|wxEXPAND, 5 );
|
||||
sbSizerSearch->Add( m_blocks, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerCategoriesCtrl;
|
||||
bSizerCategoriesCtrl = new wxBoxSizer( wxHORIZONTAL );
|
||||
wxBoxSizer* bSizerBlocksCtrl;
|
||||
bSizerBlocksCtrl = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_categoriesAll = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("All"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_categoriesAll->SetToolTip( _("Select all categories") );
|
||||
m_blocksAll = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("All"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_blocksAll->SetToolTip( _("Select all categories") );
|
||||
|
||||
bSizerCategoriesCtrl->Add( m_categoriesAll, 0, wxALL, 5 );
|
||||
bSizerBlocksCtrl->Add( m_blocksAll, 0, wxALL, 5 );
|
||||
|
||||
m_categoriesNone = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("None"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_categoriesNone->SetToolTip( _("Clear category selection") );
|
||||
m_blocksNone = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("None"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_blocksNone->SetToolTip( _("Clear block selection") );
|
||||
|
||||
bSizerCategoriesCtrl->Add( m_categoriesNone, 0, wxALL, 5 );
|
||||
bSizerBlocksCtrl->Add( m_blocksNone, 0, wxALL, 5 );
|
||||
|
||||
m_categoriesInvert = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("Invert"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_categoriesInvert->SetToolTip( _("Invert category selection") );
|
||||
m_blocksInvert = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("Invert"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_blocksInvert->SetToolTip( _("Invert block selection") );
|
||||
|
||||
bSizerCategoriesCtrl->Add( m_categoriesInvert, 0, wxALL, 5 );
|
||||
bSizerBlocksCtrl->Add( m_blocksInvert, 0, wxALL, 5 );
|
||||
|
||||
|
||||
sbSizerSearch->Add( bSizerCategoriesCtrl, 0, wxALIGN_RIGHT, 5 );
|
||||
sbSizerSearch->Add( bSizerBlocksCtrl, 0, wxALIGN_RIGHT, 5 );
|
||||
|
||||
|
||||
m_search_panel->SetSizer( sbSizerSearch );
|
||||
@@ -687,10 +687,10 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
|
||||
|
||||
sbSizerPreview->Add( m_tags, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_category = new wxTextCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_CENTER );
|
||||
m_category->SetToolTip( _("Unicode character category") );
|
||||
m_block = new wxTextCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_CENTER );
|
||||
m_block->SetToolTip( _("Unicode character block") );
|
||||
|
||||
sbSizerPreview->Add( m_category, 0, wxALL|wxEXPAND, 5 );
|
||||
sbSizerPreview->Add( m_block, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizerNavigateButtons;
|
||||
bSizerNavigateButtons = new wxBoxSizer( wxHORIZONTAL );
|
||||
@@ -780,10 +780,10 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
|
||||
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaCharSelectBase::OnIdle ) );
|
||||
m_search->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnSearchText ), NULL, this );
|
||||
m_search_more->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnSearchMore ), NULL, this );
|
||||
m_categories->Connect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnCategoriesToggle ), NULL, this );
|
||||
m_categoriesAll->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesAll ), NULL, this );
|
||||
m_categoriesNone->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesNone ), NULL, this );
|
||||
m_categoriesInvert->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesInvert ), NULL, this );
|
||||
m_blocks->Connect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnBlocksToggle ), NULL, this );
|
||||
m_blocksAll->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksAll ), NULL, this );
|
||||
m_blocksNone->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksNone ), NULL, this );
|
||||
m_blocksInvert->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksInvert ), NULL, this );
|
||||
m_gridResults->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( wxZRColaCharSelectBase::OnResultCellDClick ), NULL, this );
|
||||
m_gridResults->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnResultSelectCell ), NULL, this );
|
||||
m_gridResults->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnResultsKeyDown ), NULL, this );
|
||||
@@ -805,10 +805,10 @@ wxZRColaCharSelectBase::~wxZRColaCharSelectBase()
|
||||
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaCharSelectBase::OnIdle ) );
|
||||
m_search->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnSearchText ), NULL, this );
|
||||
m_search_more->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnSearchMore ), NULL, this );
|
||||
m_categories->Disconnect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnCategoriesToggle ), NULL, this );
|
||||
m_categoriesAll->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesAll ), NULL, this );
|
||||
m_categoriesNone->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesNone ), NULL, this );
|
||||
m_categoriesInvert->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesInvert ), NULL, this );
|
||||
m_blocks->Disconnect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnBlocksToggle ), NULL, this );
|
||||
m_blocksAll->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksAll ), NULL, this );
|
||||
m_blocksNone->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksNone ), NULL, this );
|
||||
m_blocksInvert->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksInvert ), NULL, this );
|
||||
m_gridResults->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( wxZRColaCharSelectBase::OnResultCellDClick ), NULL, this );
|
||||
m_gridResults->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnResultSelectCell ), NULL, this );
|
||||
m_gridResults->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnResultsKeyDown ), NULL, this );
|
||||
|
||||
@@ -216,10 +216,10 @@ class wxZRColaCharSelectBase : public wxDialog
|
||||
wxSearchCtrl* m_search;
|
||||
wxHyperlinkCtrl* m_search_more;
|
||||
wxPanel* m_search_panel;
|
||||
wxCheckListBox* m_categories;
|
||||
wxHyperlinkCtrl* m_categoriesAll;
|
||||
wxHyperlinkCtrl* m_categoriesNone;
|
||||
wxHyperlinkCtrl* m_categoriesInvert;
|
||||
wxCheckListBox* m_blocks;
|
||||
wxHyperlinkCtrl* m_blocksAll;
|
||||
wxHyperlinkCtrl* m_blocksNone;
|
||||
wxHyperlinkCtrl* m_blocksInvert;
|
||||
wxZRColaCharGrid* m_gridResults;
|
||||
wxZRColaCharGrid* m_gridRecent;
|
||||
wxStaticText* m_labelUnicode;
|
||||
@@ -228,7 +228,7 @@ class wxZRColaCharSelectBase : public wxDialog
|
||||
wxGrid* m_gridPreview;
|
||||
wxTextCtrl* m_description;
|
||||
wxTextCtrl* m_tags;
|
||||
wxTextCtrl* m_category;
|
||||
wxTextCtrl* m_block;
|
||||
wxHyperlinkCtrl* m_navigateBack;
|
||||
wxHyperlinkCtrl* m_navigateForward;
|
||||
wxZRColaCharGrid* m_gridRelated;
|
||||
@@ -238,10 +238,10 @@ class wxZRColaCharSelectBase : public wxDialog
|
||||
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
|
||||
virtual void OnSearchText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSearchMore( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnCategoriesToggle( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCategoriesAll( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnCategoriesNone( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnCategoriesInvert( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnBlocksToggle( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnBlocksAll( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnBlocksNone( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnBlocksInvert( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnResultCellDClick( wxGridEvent& event ) { event.Skip(); }
|
||||
virtual void OnResultSelectCell( wxGridEvent& event ) { event.Skip(); }
|
||||
virtual void OnResultsKeyDown( wxKeyEvent& event ) { event.Skip(); }
|
||||
|
||||
@@ -126,12 +126,6 @@ bool ZRColaApp::OnInit()
|
||||
wxFAIL_MSG(wxT("Error reading character data from ZRCola.zrcdb."));
|
||||
m_chr_db.clear();
|
||||
}
|
||||
} else if (id == ZRCola::chrcat_rec::id()) {
|
||||
dat >> ZRCola::chrcat_rec(m_cc_db);
|
||||
if (!dat.good()) {
|
||||
wxFAIL_MSG(wxT("Error reading character category data from ZRCola.zrcdb."));
|
||||
m_cc_db.clear();
|
||||
}
|
||||
} else if (id == ZRCola::chrblk_rec::id()) {
|
||||
dat >> ZRCola::chrblk_rec(m_cb_db);
|
||||
if (!dat.good()) {
|
||||
|
||||
@@ -70,7 +70,6 @@ public:
|
||||
ZRCola::language_db m_lang_db; ///< Language database
|
||||
ZRCola::keyseq_db m_ks_db; ///< Key sequence database
|
||||
ZRCola::character_db m_chr_db; ///< Character database
|
||||
ZRCola::chrcat_db m_cc_db; ///< Character category database
|
||||
ZRCola::chrblk_db m_cb_db; ///< Character block database
|
||||
ZRCola::chrtag_db m_ct_db; ///< Character tag database
|
||||
ZRCola::tagname_db m_tn_db; ///< Tag name database
|
||||
|
||||
@@ -202,13 +202,13 @@ wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) :
|
||||
|
||||
m_unicode->SetValidator(wxZRColaUnicodeDumpValidator(&m_char));
|
||||
|
||||
// Fill categories.
|
||||
// Fill blocks.
|
||||
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
|
||||
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
|
||||
const auto &cc = app->m_cc_db.idxRank[i];
|
||||
int idx = m_categories->Insert(wxGetTranslation(wxString(cc.name(), cc.name_len()), wxT("ZRCola-zrcdb")), (unsigned int)i);
|
||||
m_categories->Check(idx);
|
||||
m_ccOrder.insert(std::make_pair(cc.id, idx));
|
||||
for (size_t i = 0, n = app->m_cb_db.idxRank.size(); i < n; i++) {
|
||||
const auto &cb = app->m_cb_db.idxRank[i];
|
||||
int idx = m_blocks->Insert(wxGetTranslation(wxString(cb.name(), cb.name_len()), wxT("ZRCola-zrcdb")), (unsigned int)i);
|
||||
m_blocks->Check(idx);
|
||||
m_cbOrder.insert(std::make_pair(cb.id, idx));
|
||||
}
|
||||
|
||||
ResetResults();
|
||||
@@ -265,20 +265,20 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
|
||||
m_shortcut->SetValue(wxEmptyString);
|
||||
}
|
||||
{
|
||||
// Update character category.
|
||||
ZRCola::chrcat_db::indexChrId::size_type cc_start;
|
||||
if (app->m_cc_db.idxChrId.find(ZRCola::chrcat_db::chrcls(chr.cat), cc_start)) {
|
||||
const auto &cat = app->m_cc_db.idxChrId[cc_start];
|
||||
m_category->SetValue(wxGetTranslation(wxString(cat.name(), cat.name_len()), wxT("ZRCola-zrcdb")));
|
||||
// Update character block.
|
||||
ZRCola::chrblk_db::indexChrId::size_type cb_start;
|
||||
if (app->m_cb_db.idxChrId.find(ZRCola::chrblk_db::chrcls(chr.blk), cb_start)) {
|
||||
const auto &blk = app->m_cb_db.idxChrId[cb_start];
|
||||
m_block->SetValue(wxGetTranslation(wxString(blk.name(), blk.name_len()), wxT("ZRCola-zrcdb")));
|
||||
} else
|
||||
m_category->SetValue(wxEmptyString);
|
||||
m_block->SetValue(wxEmptyString);
|
||||
}
|
||||
// Update related characters.
|
||||
m_gridRelated->SetCharacters(wxString(chr.rel(), chr.rel_end()));
|
||||
} else {
|
||||
m_description->SetValue(wxEmptyString);
|
||||
m_shortcut->SetValue(wxEmptyString);
|
||||
m_category->SetValue(wxEmptyString);
|
||||
m_block->SetValue(wxEmptyString);
|
||||
m_gridRelated->ClearGrid();
|
||||
}
|
||||
|
||||
@@ -340,11 +340,11 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event)
|
||||
|
||||
m_searchThread->m_search.assign(val.c_str(), val.Length());
|
||||
|
||||
// Select categories.
|
||||
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
|
||||
const auto &cc = app->m_cc_db.idxRank[i];
|
||||
if (m_categories->IsChecked((unsigned int)i))
|
||||
m_searchThread->m_cats.insert(cc.id);
|
||||
// Select blocks.
|
||||
for (size_t i = 0, n = app->m_cb_db.idxRank.size(); i < n; i++) {
|
||||
const auto &cb = app->m_cb_db.idxRank[i];
|
||||
if (m_blocks->IsChecked((unsigned int)i))
|
||||
m_searchThread->m_blks.insert(cb.id);
|
||||
}
|
||||
|
||||
if (m_searchThread->Run() != wxTHREAD_NO_ERROR) {
|
||||
@@ -384,43 +384,43 @@ void wxZRColaCharSelect::OnSearchMore(wxHyperlinkEvent& event)
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaCharSelect::OnCategoriesAll(wxHyperlinkEvent& event)
|
||||
void wxZRColaCharSelect::OnBlocksAll(wxHyperlinkEvent& event)
|
||||
{
|
||||
event.StopPropagation();
|
||||
|
||||
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
|
||||
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
|
||||
m_categories->Check((unsigned int)i, true);
|
||||
for (size_t i = 0, n = app->m_cb_db.idxRank.size(); i < n; i++)
|
||||
m_blocks->Check((unsigned int)i, true);
|
||||
|
||||
m_searchChanged = true;
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaCharSelect::OnCategoriesNone(wxHyperlinkEvent& event)
|
||||
void wxZRColaCharSelect::OnBlocksNone(wxHyperlinkEvent& event)
|
||||
{
|
||||
event.StopPropagation();
|
||||
|
||||
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
|
||||
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
|
||||
m_categories->Check((unsigned int)i, false);
|
||||
for (size_t i = 0, n = app->m_cb_db.idxRank.size(); i < n; i++)
|
||||
m_blocks->Check((unsigned int)i, false);
|
||||
|
||||
m_searchChanged = true;
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaCharSelect::OnCategoriesInvert(wxHyperlinkEvent& event)
|
||||
void wxZRColaCharSelect::OnBlocksInvert(wxHyperlinkEvent& event)
|
||||
{
|
||||
event.StopPropagation();
|
||||
|
||||
auto app = dynamic_cast<ZRColaApp*>(wxTheApp);
|
||||
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++)
|
||||
m_categories->Check((unsigned int)i, !m_categories->IsChecked((unsigned int)i));
|
||||
for (size_t i = 0, n = app->m_cb_db.idxRank.size(); i < n; i++)
|
||||
m_blocks->Check((unsigned int)i, !m_blocks->IsChecked((unsigned int)i));
|
||||
|
||||
m_searchChanged = true;
|
||||
}
|
||||
|
||||
|
||||
void wxZRColaCharSelect::OnCategoriesToggle(wxCommandEvent& event)
|
||||
void wxZRColaCharSelect::OnBlocksToggle(wxCommandEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
|
||||
@@ -625,8 +625,8 @@ void wxZRColaCharSelect::ResetResults()
|
||||
val.reserve(n);
|
||||
for (i = 0; i < n; i++) {
|
||||
const auto &chr = app->m_chr_db.idxChr[i];
|
||||
auto idx = m_ccOrder.find(chr.cat);
|
||||
if (idx == m_ccOrder.end() || m_categories->IsChecked(idx->second))
|
||||
auto idx = m_cbOrder.find(chr.blk);
|
||||
if (idx == m_cbOrder.end() || m_blocks->IsChecked(idx->second))
|
||||
val.Add(wxString(chr.chr(), chr.chr_len()));
|
||||
}
|
||||
m_gridResults->SetCharacters(val);
|
||||
@@ -720,13 +720,13 @@ wxThread::ExitCode wxZRColaCharSelect::SearchThread::Entry()
|
||||
// Search by tags: Get tags with given names. Then, get characters of found tags.
|
||||
std::map<ZRCola::tagid_t, uint16_t> hits_tag;
|
||||
if (!app->m_tn_db.Search(m_search.c_str(), m_parent->m_locale, hits_tag, TestDestroyS, this)) return (wxThread::ExitCode)1;
|
||||
if (!app->m_ct_db.Search(hits_tag, app->m_chr_db, m_cats, hits, TestDestroyS, this)) return (wxThread::ExitCode)1;
|
||||
if (!app->m_ct_db.Search(hits_tag, app->m_chr_db, m_blks, hits, TestDestroyS, this)) return (wxThread::ExitCode)1;
|
||||
}
|
||||
|
||||
{
|
||||
// Search by description and merge results.
|
||||
std::map<std::wstring, ZRCola::charrank_t> hits_sub;
|
||||
if (!app->m_chr_db.Search(m_search.c_str(), m_cats, hits, hits_sub, TestDestroyS, this)) return (wxThread::ExitCode)1;
|
||||
if (!app->m_chr_db.Search(m_search.c_str(), m_blks, hits, hits_sub, TestDestroyS, this)) return (wxThread::ExitCode)1;
|
||||
for (auto i = hits_sub.cbegin(), i_end = hits_sub.cend(); i != i_end; ++i) {
|
||||
if (TestDestroy()) return (wxThread::ExitCode)1;
|
||||
auto idx = hits.find(i->first);
|
||||
@@ -820,11 +820,9 @@ void wxPersistentZRColaCharSelect::Save() const
|
||||
SaveValue(wxT("recentChars" ), str ); // Save in legacy format for backward compatibility.
|
||||
SaveValue(wxT("recentChars2"), str2); // Save in native format
|
||||
|
||||
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
|
||||
const auto &cc = app->m_cc_db.idxRank[i];
|
||||
wxString name(wxT("category"));
|
||||
name.Append(cc.id.data, _countof(cc.id.data));
|
||||
SaveValue(name, wnd->m_categories->IsChecked((unsigned int)i));
|
||||
for (size_t i = 0, n = app->m_cb_db.idxRank.size(); i < n; i++) {
|
||||
const auto &cb = app->m_cb_db.idxRank[i];
|
||||
SaveValue(wxString::Format(wxT("block%u"), cb.id), wnd->m_blocks->IsChecked((unsigned int)i));
|
||||
}
|
||||
|
||||
SaveValue(wxT("searchPanel"), wnd->m_search_panel->IsShown());
|
||||
@@ -855,13 +853,11 @@ bool wxPersistentZRColaCharSelect::Restore()
|
||||
wnd->m_gridRecent->SetCharacters(val);
|
||||
}
|
||||
|
||||
for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) {
|
||||
const auto &cc = app->m_cc_db.idxRank[i];
|
||||
wxString name(wxT("category"));
|
||||
name.Append(cc.id.data, _countof(cc.id.data));
|
||||
for (size_t i = 0, n = app->m_cb_db.idxRank.size(); i < n; i++) {
|
||||
const auto &cb = app->m_cb_db.idxRank[i];
|
||||
bool val;
|
||||
if (RestoreValue(name, &val))
|
||||
wnd->m_categories->Check((unsigned int)i, val);
|
||||
if (RestoreValue(wxString::Format(wxT("block%u"), cb.id), &val))
|
||||
wnd->m_blocks->Check((unsigned int)i, val);
|
||||
}
|
||||
|
||||
bool search_panel;
|
||||
|
||||
@@ -140,10 +140,10 @@ protected:
|
||||
virtual void OnIdle(wxIdleEvent& event);
|
||||
virtual void OnSearchText(wxCommandEvent& event);
|
||||
virtual void OnSearchMore(wxHyperlinkEvent& event);
|
||||
virtual void OnCategoriesAll(wxHyperlinkEvent& event);
|
||||
virtual void OnCategoriesNone(wxHyperlinkEvent& event);
|
||||
virtual void OnCategoriesInvert(wxHyperlinkEvent& event);
|
||||
virtual void OnCategoriesToggle(wxCommandEvent& event);
|
||||
virtual void OnBlocksAll(wxHyperlinkEvent& event);
|
||||
virtual void OnBlocksNone(wxHyperlinkEvent& event);
|
||||
virtual void OnBlocksInvert(wxHyperlinkEvent& event);
|
||||
virtual void OnBlocksToggle(wxCommandEvent& event);
|
||||
void OnSearchComplete(wxThreadEvent& event);
|
||||
virtual void OnResultSelectCell(wxGridEvent& event);
|
||||
virtual void OnResultCellDClick(wxGridEvent& event);
|
||||
@@ -168,8 +168,8 @@ public:
|
||||
|
||||
protected:
|
||||
LCID m_locale; ///< Locale for tag lookup
|
||||
bool m_searchChanged; ///< Did Search field or category selection change?
|
||||
std::map<ZRCola::chrcatid_t, int> m_ccOrder; ///< Character category order
|
||||
bool m_searchChanged; ///< Did Search field or block selection change?
|
||||
std::map<ZRCola::chrblkid_t, int> m_cbOrder; ///< Character block order
|
||||
bool m_unicodeChanged; ///< Did Unicode field change?
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ protected:
|
||||
|
||||
public:
|
||||
std::wstring m_search; ///< Search phrase
|
||||
std::set<ZRCola::chrcatid_t> m_cats; ///< Search categories
|
||||
std::set<ZRCola::chrblkid_t> m_blks; ///< Search blocks
|
||||
std::vector<std::pair<ZRCola::charrank_t, std::wstring> > m_hits; ///< Search results
|
||||
|
||||
protected:
|
||||
|
||||
@@ -512,32 +512,32 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
|
||||
wxBoxSizer* sbSizerSearch;
|
||||
sbSizerSearch = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxArrayString m_categoriesChoices;
|
||||
m_categories = new wxCheckListBox( m_search_panel, wxID_ANY, wxDefaultPosition, FromDIP(wxSize( -1,60 )), m_categoriesChoices, 0 );
|
||||
m_categories->SetToolTip( _("List of Unicode character categories to search in") );
|
||||
wxArrayString m_blocksChoices;
|
||||
m_blocks = new wxCheckListBox( m_search_panel, wxID_ANY, wxDefaultPosition, FromDIP(wxSize( -1,60 )), m_blocksChoices, 0 );
|
||||
m_blocks->SetToolTip( _("List of Unicode character blocks to search in") );
|
||||
|
||||
sbSizerSearch->Add( m_categories, 0, wxALL|wxEXPAND, FromDIP(5) );
|
||||
sbSizerSearch->Add( m_blocks, 0, wxALL|wxEXPAND, FromDIP(5) );
|
||||
|
||||
wxBoxSizer* bSizerCategoriesCtrl;
|
||||
bSizerCategoriesCtrl = new wxBoxSizer( wxHORIZONTAL );
|
||||
wxBoxSizer* bSizerBlocksCtrl;
|
||||
bSizerBlocksCtrl = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_categoriesAll = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("All"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_categoriesAll->SetToolTip( _("Select all categories") );
|
||||
m_blocksAll = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("All"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_blocksAll->SetToolTip( _("Select all categories") );
|
||||
|
||||
bSizerCategoriesCtrl->Add( m_categoriesAll, 0, wxALL, FromDIP(5) );
|
||||
bSizerBlocksCtrl->Add( m_blocksAll, 0, wxALL, FromDIP(5) );
|
||||
|
||||
m_categoriesNone = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("None"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_categoriesNone->SetToolTip( _("Clear category selection") );
|
||||
m_blocksNone = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("None"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_blocksNone->SetToolTip( _("Clear block selection") );
|
||||
|
||||
bSizerCategoriesCtrl->Add( m_categoriesNone, 0, wxALL, FromDIP(5) );
|
||||
bSizerBlocksCtrl->Add( m_blocksNone, 0, wxALL, FromDIP(5) );
|
||||
|
||||
m_categoriesInvert = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("Invert"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_categoriesInvert->SetToolTip( _("Invert category selection") );
|
||||
m_blocksInvert = new wxHyperlinkCtrl( m_search_panel, wxID_ANY, _("Invert"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
|
||||
m_blocksInvert->SetToolTip( _("Invert block selection") );
|
||||
|
||||
bSizerCategoriesCtrl->Add( m_categoriesInvert, 0, wxALL, FromDIP(5) );
|
||||
bSizerBlocksCtrl->Add( m_blocksInvert, 0, wxALL, FromDIP(5) );
|
||||
|
||||
|
||||
sbSizerSearch->Add( bSizerCategoriesCtrl, 0, wxALIGN_RIGHT, FromDIP(5) );
|
||||
sbSizerSearch->Add( bSizerBlocksCtrl, 0, wxALIGN_RIGHT, FromDIP(5) );
|
||||
|
||||
|
||||
m_search_panel->SetSizer( sbSizerSearch );
|
||||
@@ -687,10 +687,10 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
|
||||
|
||||
sbSizerPreview->Add( m_tags, 1, wxALL|wxEXPAND, FromDIP(5) );
|
||||
|
||||
m_category = new wxTextCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_CENTER );
|
||||
m_category->SetToolTip( _("Unicode character category") );
|
||||
m_block = new wxTextCtrl( sbSizerPreview->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_CENTER );
|
||||
m_block->SetToolTip( _("Unicode character block") );
|
||||
|
||||
sbSizerPreview->Add( m_category, 0, wxALL|wxEXPAND, FromDIP(5) );
|
||||
sbSizerPreview->Add( m_block, 0, wxALL|wxEXPAND, FromDIP(5) );
|
||||
|
||||
wxBoxSizer* bSizerNavigateButtons;
|
||||
bSizerNavigateButtons = new wxBoxSizer( wxHORIZONTAL );
|
||||
@@ -780,10 +780,10 @@ wxZRColaCharSelectBase::wxZRColaCharSelectBase( wxWindow* parent, wxWindowID id,
|
||||
this->Connect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaCharSelectBase::OnIdle ) );
|
||||
m_search->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnSearchText ), NULL, this );
|
||||
m_search_more->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnSearchMore ), NULL, this );
|
||||
m_categories->Connect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnCategoriesToggle ), NULL, this );
|
||||
m_categoriesAll->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesAll ), NULL, this );
|
||||
m_categoriesNone->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesNone ), NULL, this );
|
||||
m_categoriesInvert->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesInvert ), NULL, this );
|
||||
m_blocks->Connect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnBlocksToggle ), NULL, this );
|
||||
m_blocksAll->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksAll ), NULL, this );
|
||||
m_blocksNone->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksNone ), NULL, this );
|
||||
m_blocksInvert->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksInvert ), NULL, this );
|
||||
m_gridResults->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( wxZRColaCharSelectBase::OnResultCellDClick ), NULL, this );
|
||||
m_gridResults->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnResultSelectCell ), NULL, this );
|
||||
m_gridResults->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnResultsKeyDown ), NULL, this );
|
||||
@@ -805,10 +805,10 @@ wxZRColaCharSelectBase::~wxZRColaCharSelectBase()
|
||||
this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( wxZRColaCharSelectBase::OnIdle ) );
|
||||
m_search->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( wxZRColaCharSelectBase::OnSearchText ), NULL, this );
|
||||
m_search_more->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnSearchMore ), NULL, this );
|
||||
m_categories->Disconnect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnCategoriesToggle ), NULL, this );
|
||||
m_categoriesAll->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesAll ), NULL, this );
|
||||
m_categoriesNone->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesNone ), NULL, this );
|
||||
m_categoriesInvert->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnCategoriesInvert ), NULL, this );
|
||||
m_blocks->Disconnect( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEventHandler( wxZRColaCharSelectBase::OnBlocksToggle ), NULL, this );
|
||||
m_blocksAll->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksAll ), NULL, this );
|
||||
m_blocksNone->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksNone ), NULL, this );
|
||||
m_blocksInvert->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( wxZRColaCharSelectBase::OnBlocksInvert ), NULL, this );
|
||||
m_gridResults->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( wxZRColaCharSelectBase::OnResultCellDClick ), NULL, this );
|
||||
m_gridResults->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( wxZRColaCharSelectBase::OnResultSelectCell ), NULL, this );
|
||||
m_gridResults->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( wxZRColaCharSelectBase::OnResultsKeyDown ), NULL, this );
|
||||
|
||||
@@ -216,10 +216,10 @@ class wxZRColaCharSelectBase : public wxDialog
|
||||
wxSearchCtrl* m_search;
|
||||
wxHyperlinkCtrl* m_search_more;
|
||||
wxPanel* m_search_panel;
|
||||
wxCheckListBox* m_categories;
|
||||
wxHyperlinkCtrl* m_categoriesAll;
|
||||
wxHyperlinkCtrl* m_categoriesNone;
|
||||
wxHyperlinkCtrl* m_categoriesInvert;
|
||||
wxCheckListBox* m_blocks;
|
||||
wxHyperlinkCtrl* m_blocksAll;
|
||||
wxHyperlinkCtrl* m_blocksNone;
|
||||
wxHyperlinkCtrl* m_blocksInvert;
|
||||
wxZRColaCharGrid* m_gridResults;
|
||||
wxZRColaCharGrid* m_gridRecent;
|
||||
wxStaticText* m_labelUnicode;
|
||||
@@ -228,7 +228,7 @@ class wxZRColaCharSelectBase : public wxDialog
|
||||
wxGrid* m_gridPreview;
|
||||
wxTextCtrl* m_description;
|
||||
wxTextCtrl* m_tags;
|
||||
wxTextCtrl* m_category;
|
||||
wxTextCtrl* m_block;
|
||||
wxHyperlinkCtrl* m_navigateBack;
|
||||
wxHyperlinkCtrl* m_navigateForward;
|
||||
wxZRColaCharGrid* m_gridRelated;
|
||||
@@ -238,10 +238,10 @@ class wxZRColaCharSelectBase : public wxDialog
|
||||
virtual void OnIdle( wxIdleEvent& event ) { event.Skip(); }
|
||||
virtual void OnSearchText( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnSearchMore( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnCategoriesToggle( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCategoriesAll( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnCategoriesNone( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnCategoriesInvert( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnBlocksToggle( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnBlocksAll( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnBlocksNone( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnBlocksInvert( wxHyperlinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnResultCellDClick( wxGridEvent& event ) { event.Skip(); }
|
||||
virtual void OnResultSelectCell( wxGridEvent& event ) { event.Skip(); }
|
||||
virtual void OnResultsKeyDown( wxKeyEvent& event ) { event.Skip(); }
|
||||
|
||||
@@ -613,44 +613,6 @@ bool ZRCola::DBSource::GetLanguage(const com_obj<ADOField>& f, ZRCola::langid_t&
|
||||
}
|
||||
|
||||
|
||||
bool ZRCola::DBSource::GetChrCat(const com_obj<ADOField>& f, chrcatid_t& cc) const
|
||||
{
|
||||
wxASSERT_MSG(f.valid(), wxT("field is empty"));
|
||||
|
||||
variant v;
|
||||
wxVERIFY(SUCCEEDED(f->get_Value(&v)));
|
||||
if (V_VT(&v) != VT_NULL) {
|
||||
wxCHECK(SUCCEEDED(v.change_type(VT_BSTR)), false);
|
||||
|
||||
// Parse the field.
|
||||
size_t n = wcsnlen(V_BSTR(&v), ::SysStringLen(V_BSTR(&v)));
|
||||
if (n < 1 || 2 < n) {
|
||||
bstr fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
|
||||
_ftprintf(stderr, wxT("%s: error ZCC0110: Syntax error in \"%.*ls\" field (\"%.*ls\"). Character category ID must be one (1) or two (2) characters long.\n"), m_filename.c_str(), fieldname.length(), (BSTR)fieldname, n, V_BSTR(&v));
|
||||
return false;
|
||||
}
|
||||
for (size_t i = 0;; i++) {
|
||||
if (i < sizeof(cc)) {
|
||||
if (i < n) {
|
||||
wchar_t c = V_BSTR(&v)[i];
|
||||
if ((unsigned short)c > 0x7f) {
|
||||
bstr fieldname; wxVERIFY(SUCCEEDED(f->get_Name(&fieldname)));
|
||||
_ftprintf(stderr, wxT("%s: error ZCC0111: Syntax error in \"%.*ls\" field (\"%.*ls\"). Character category ID must contain ASCII characters only.\n"), m_filename.c_str(), fieldname.length(), (BSTR)fieldname, n, V_BSTR(&v));
|
||||
return false;
|
||||
}
|
||||
cc.data[i] = (char)c;
|
||||
} else
|
||||
cc.data[i] = 0;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
} else
|
||||
memset(cc.data, 0, sizeof(cc));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ZRCola::DBSource::GetTagNames(const winstd::com_obj<ADOField>& f, LCID lcid, list<wstring>& names) const
|
||||
{
|
||||
wxASSERT_MSG(f.valid(), wxT("field is empty"));
|
||||
@@ -1242,7 +1204,7 @@ bool ZRCola::DBSource::SelectCharacters(com_obj<ADORecordset>& rs) const
|
||||
|
||||
// Open it.
|
||||
if (FAILED(rs->Open(variant(
|
||||
L"SELECT DISTINCT [znak], [opis_en], [kat], [znak_v], [znak_m] "
|
||||
L"SELECT DISTINCT [znak], [opis_en], [znak_v], [znak_m] "
|
||||
L"FROM [VRS_CharList] "
|
||||
L"WHERE "
|
||||
L"[aktiven]=1 AND " // Active characters only
|
||||
@@ -1303,12 +1265,6 @@ bool ZRCola::DBSource::GetCharacter(const com_obj<ADORecordset>& rs, character&
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
com_obj<ADOField> f;
|
||||
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"kat"), &f)));
|
||||
wxCHECK(GetChrCat(f, chr.second.cat), false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1375,57 +1331,6 @@ bool ZRCola::DBSource::GetCharacterBlock(const com_obj<ADORecordset>& rs, chrblk
|
||||
}
|
||||
|
||||
|
||||
bool ZRCola::DBSource::SelectCharacterCategories(com_obj<ADORecordset>& rs) const
|
||||
{
|
||||
// Create a new recordset.
|
||||
rs.free();
|
||||
wxCHECK(SUCCEEDED(::CoCreateInstance(CLSID_CADORecordset, NULL, CLSCTX_ALL, IID_IADORecordset, (LPVOID*)&rs)), false);
|
||||
|
||||
// Open it.
|
||||
if (FAILED(rs->Open(variant(
|
||||
L"SELECT DISTINCT [kat], [opis_en], [Rang] "
|
||||
L"FROM [VRS_CharCategory] "
|
||||
L"WHERE [kat]<>'g' " // Ignore "Other, Control" category!
|
||||
L"ORDER BY [Rang], [opis_en]"), variant((IDispatch*)m_db), adOpenStatic, adLockReadOnly, adCmdText)))
|
||||
{
|
||||
_ftprintf(stderr, wxT("%s: error ZCC0130: Error loading character categories from database. Please make sure the file is ZRCola.zrc compatible.\n"), m_filename.c_str());
|
||||
LogErrors();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ZRCola::DBSource::GetCharacterCategory(const com_obj<ADORecordset>& rs, chrcat& cc) const
|
||||
{
|
||||
wxASSERT_MSG(rs.valid(), wxT("recordset is empty"));
|
||||
|
||||
com_obj<ADOFields> flds;
|
||||
wxVERIFY(SUCCEEDED(rs->get_Fields(&flds)));
|
||||
|
||||
{
|
||||
com_obj<ADOField> f;
|
||||
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"kat"), &f)));
|
||||
wxCHECK(GetChrCat(f, cc.cat), false);
|
||||
}
|
||||
|
||||
{
|
||||
com_obj<ADOField> f;
|
||||
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"Rang"), &f)));
|
||||
wxCHECK(GetValue(f, cc.rank), false);
|
||||
}
|
||||
|
||||
{
|
||||
com_obj<ADOField> f;
|
||||
wxVERIFY(SUCCEEDED(flds->get_Item(variant(L"opis_en"), &f)));
|
||||
wxCHECK(GetValue(f, cc.name), false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ZRCola::DBSource::SelectCharacterTags(winstd::com_obj<ADORecordset>& rs) const
|
||||
{
|
||||
// Create a new recordset.
|
||||
|
||||
@@ -209,7 +209,6 @@ namespace ZRCola {
|
||||
/// Character data
|
||||
///
|
||||
struct character_data {
|
||||
ZRCola::chrcatid_t cat; ///< Category ID
|
||||
std::wstring desc; ///< Character description
|
||||
std::set<std::wstring> terms; ///< Search terms
|
||||
std::set<std::wstring> terms_rel; ///< Relevant terms for relating characters
|
||||
@@ -341,16 +340,6 @@ namespace ZRCola {
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
/// Character category
|
||||
///
|
||||
struct chrcat {
|
||||
ZRCola::chrcatid_t cat; ///> Category ID
|
||||
short rank = 0; ///< Rank
|
||||
std::wstring name; ///< Name
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
/// Character tag
|
||||
///
|
||||
@@ -522,18 +511,6 @@ namespace ZRCola {
|
||||
///
|
||||
bool GetLanguage(const winstd::com_obj<ADOField>& f, langid_t& lang) const;
|
||||
|
||||
///
|
||||
/// Gets character category ID from ZRCola.zrc database
|
||||
///
|
||||
/// \param[in] f Data field
|
||||
/// \param[out] cc Character category
|
||||
///
|
||||
/// \returns
|
||||
/// - true when successful
|
||||
/// - false otherwise
|
||||
///
|
||||
bool GetChrCat(const winstd::com_obj<ADOField>& f, chrcatid_t& cc) const;
|
||||
|
||||
///
|
||||
/// Gets tag names from ZRCola.zrc database
|
||||
///
|
||||
@@ -777,10 +754,10 @@ namespace ZRCola {
|
||||
bool SelectCharacterBlocks(winstd::com_obj<ADORecordset>& rs) const;
|
||||
|
||||
///
|
||||
/// Returns character category data
|
||||
/// Returns character block data
|
||||
///
|
||||
/// \param[in] rs Recordset with results
|
||||
/// \param[out] cc Character category
|
||||
/// \param[out] cb Character block
|
||||
///
|
||||
/// \returns
|
||||
/// - true when succeeded
|
||||
@@ -788,29 +765,6 @@ namespace ZRCola {
|
||||
///
|
||||
bool GetCharacterBlock(const winstd::com_obj<ADORecordset>& rs, chrblk& cb) const;
|
||||
|
||||
///
|
||||
/// Returns character categories
|
||||
///
|
||||
/// \param[out] rs Recordset with results
|
||||
///
|
||||
/// \returns
|
||||
/// - true when query succeeds
|
||||
/// - false otherwise
|
||||
///
|
||||
bool SelectCharacterCategories(winstd::com_obj<ADORecordset>& rs) const;
|
||||
|
||||
///
|
||||
/// Returns character category data
|
||||
///
|
||||
/// \param[in] rs Recordset with results
|
||||
/// \param[out] cc Character category
|
||||
///
|
||||
/// \returns
|
||||
/// - true when succeeded
|
||||
/// - false otherwise
|
||||
///
|
||||
bool GetCharacterCategory(const winstd::com_obj<ADORecordset>& rs, chrcat& cc) const;
|
||||
|
||||
///
|
||||
/// Returns character tags
|
||||
///
|
||||
@@ -826,7 +780,7 @@ namespace ZRCola {
|
||||
/// Returns character tag data
|
||||
///
|
||||
/// \param[in] rs Recordset with results
|
||||
/// \param[out] cc Character tag
|
||||
/// \param[out] tc Character tag
|
||||
///
|
||||
/// \returns
|
||||
/// - true when succeeded
|
||||
@@ -1041,7 +995,6 @@ inline ZRCola::chrgrp_db& operator<<(_Inout_ ZRCola::chrgrp_db &db, _In_ const Z
|
||||
inline ZRCola::character_db& operator<<(_Inout_ ZRCola::character_db &db, _In_ const ZRCola::DBSource::character &rec)
|
||||
{
|
||||
uint32_t idx = db.data.size();
|
||||
db.data.insert(db.data.end(), reinterpret_cast<const uint16_t*>(&rec.second.cat), reinterpret_cast<const uint16_t*>(&rec.second.cat + 1));
|
||||
db.data.push_back((uint16_t)rec.second.blk);
|
||||
std::wstring::size_type n = rec.first.length();
|
||||
wxASSERT_MSG(n <= 0xffff, wxT("character overflow"));
|
||||
@@ -1077,22 +1030,6 @@ inline ZRCola::chrblk_db& operator<<(_Inout_ ZRCola::chrblk_db &db, _In_ const Z
|
||||
}
|
||||
|
||||
|
||||
inline ZRCola::chrcat_db& operator<<(_Inout_ ZRCola::chrcat_db &db, _In_ const ZRCola::DBSource::chrcat &rec)
|
||||
{
|
||||
uint32_t idx = db.data.size();
|
||||
db.data.insert(db.data.end(), reinterpret_cast<const uint16_t*>(&rec.cat), reinterpret_cast<const uint16_t*>(&rec.cat + 1));
|
||||
db.data.push_back((uint16_t)rec.rank);
|
||||
std::wstring::size_type n = rec.name.length();
|
||||
wxASSERT_MSG(n <= 0xffff, wxT("character category name overflow"));
|
||||
db.data.push_back((uint16_t)n);
|
||||
db.data.insert(db.data.end(), rec.name.cbegin(), rec.name.cend());
|
||||
db.idxChrId.push_back(idx);
|
||||
db.idxRank .push_back(idx);
|
||||
|
||||
return db;
|
||||
}
|
||||
|
||||
|
||||
inline ZRCola::chrtag_db& operator<<(_Inout_ ZRCola::chrtag_db &db, _In_ const ZRCola::DBSource::chrtag &rec)
|
||||
{
|
||||
uint32_t idx = db.data.size();
|
||||
|
||||
@@ -745,8 +745,6 @@ int _tmain(int argc, _TCHAR *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
set<ZRCola::chrcatid_t> categories_used;
|
||||
|
||||
{
|
||||
// Get characters.
|
||||
com_obj<ADORecordset> rs;
|
||||
@@ -809,9 +807,6 @@ int _tmain(int argc, _TCHAR *argv[])
|
||||
// Add description (and keywords) to index.
|
||||
idxChrDsc.add_keywords(chr->second.terms, chr->first, 0);
|
||||
idxChrDscSub.add_keywords(chr->second.terms, chr->first, 3);
|
||||
|
||||
// Mark category used.
|
||||
categories_used.insert(chr->second.cat);
|
||||
}
|
||||
|
||||
// Write characters to file.
|
||||
@@ -859,52 +854,6 @@ int _tmain(int argc, _TCHAR *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// Get character categories.
|
||||
com_obj<ADORecordset> rs;
|
||||
if (src.SelectCharacterCategories(rs)) {
|
||||
size_t count = src.GetRecordsetCount(rs);
|
||||
if (count < 0xffffffff) { // 4G check (-1 is reserved for error condition)
|
||||
ZRCola::DBSource::chrcat cc;
|
||||
ZRCola::chrcat_db db;
|
||||
|
||||
// Preallocate memory.
|
||||
db.idxChrId.reserve(count);
|
||||
db.idxRank .reserve(count);
|
||||
db.data .reserve(count*4);
|
||||
|
||||
// Parse character categories and build index and data.
|
||||
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
|
||||
// Read character category from the database.
|
||||
if (src.GetCharacterCategory(rs, cc)) {
|
||||
if (build_pot)
|
||||
pot.insert(cc.name);
|
||||
|
||||
if (categories_used.find(cc.cat) == categories_used.end()) {
|
||||
// Skip empty character categories.
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add character category to index and data.
|
||||
db << cc;
|
||||
} else
|
||||
has_errors = true;
|
||||
}
|
||||
|
||||
// Write character categories to file.
|
||||
db.idxChrId.sort();
|
||||
db.idxRank .sort();
|
||||
dst << ZRCola::chrcat_rec(db);
|
||||
} else {
|
||||
_ftprintf(stderr, wxT("%s: error ZCC0019: Error getting character category count from database or too many character categories.\n"), (LPCTSTR)filenameIn.c_str());
|
||||
has_errors = true;
|
||||
}
|
||||
} else {
|
||||
_ftprintf(stderr, wxT("%s: error ZCC0018: Error getting character categories from database. Please make sure the file is ZRCola.zrc compatible.\n"), (LPCTSTR)filenameIn.c_str());
|
||||
has_errors = true;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// Get characters tags.
|
||||
com_obj<ADORecordset> rs;
|
||||
|
||||
@@ -23,7 +23,7 @@ transet_db ts_db;
|
||||
langchar_db lc_db;
|
||||
language_db lang_db;
|
||||
// character_db chr_db;
|
||||
// chrcat_db cc_db;
|
||||
// chrblk_db cb_db;
|
||||
// chrtag_db ct_db;
|
||||
// tagname_db tn_db;
|
||||
// highlight_db h_db;
|
||||
@@ -84,11 +84,11 @@ static void load_database()
|
||||
// OATPP_LOGE(__FUNCTION__, "Error reading character data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
||||
// chr_db.clear();
|
||||
// }
|
||||
// } else if (id == chrcat_rec::id()) {
|
||||
// dat >> chrcat_rec(cc_db);
|
||||
// } else if (id == chrblk_rec::id()) {
|
||||
// dat >> chrblk_rec(cb_db);
|
||||
// if (!dat.good()) {
|
||||
// OATPP_LOGE(__FUNCTION__, "Error reading character category data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
||||
// cc_db.clear();
|
||||
// OATPP_LOGE(__FUNCTION__, "Error reading character block data from " PREFIX "/share/zrcola/ZRCola.zrcdb.");
|
||||
// cb_db.clear();
|
||||
// }
|
||||
// } else if (id == chrtag_rec::id()) {
|
||||
// dat >> chrtag_rec(ct_db);
|
||||
|
||||
@@ -18,7 +18,7 @@ extern ZRCola::transet_db ts_db;
|
||||
extern ZRCola::langchar_db lc_db;
|
||||
extern ZRCola::language_db lang_db;
|
||||
// extern ZRCola::character_db chr_db;
|
||||
// extern ZRCola::chrcat_db cc_db;
|
||||
// extern ZRCola::chrblk_db cb_db;
|
||||
// extern ZRCola::chrtag_db ct_db;
|
||||
// extern ZRCola::tagname_db tn_db;
|
||||
// extern ZRCola::highlight_db h_db;
|
||||
|
||||
@@ -39,137 +39,6 @@ namespace ZRCola {
|
||||
size_t wcsnlen(_In_z_count_(count) const char_t* str, _In_ size_t count);
|
||||
#endif
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(2)
|
||||
///
|
||||
/// Character category ID type
|
||||
/// Two letter abbreviation, non-terminated
|
||||
///
|
||||
struct chrcatid_t {
|
||||
char data[2];
|
||||
|
||||
chrcatid_t()
|
||||
{
|
||||
data[0] = 0;
|
||||
data[1] = 0;
|
||||
}
|
||||
|
||||
chrcatid_t& operator=(const chrcatid_t &src)
|
||||
{
|
||||
data[0] = src.data[0];
|
||||
data[1] = src.data[1];
|
||||
return *this;
|
||||
}
|
||||
|
||||
chrcatid_t& operator=(const char *src)
|
||||
{
|
||||
data[1] = (data[0] = src[0]) != 0 ? src[1] : 0;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
///
|
||||
/// Compares two character category IDs
|
||||
///
|
||||
/// \param[in] a First character category ID
|
||||
/// \param[in] b Second character category ID
|
||||
///
|
||||
/// \returns
|
||||
/// - true when \p a == \p b
|
||||
/// - false otherwise
|
||||
///
|
||||
inline bool operator==(const chrcatid_t &a, const chrcatid_t & b)
|
||||
{
|
||||
return
|
||||
a.data[0] == b.data[0] &&
|
||||
(a.data[0] == 0 || a.data[1] == b.data[1]);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Compares two character category IDs
|
||||
///
|
||||
/// \param[in] a First character category ID
|
||||
/// \param[in] b Second character category ID
|
||||
///
|
||||
/// \returns
|
||||
/// - true when \p a != \p b
|
||||
/// - false otherwise
|
||||
///
|
||||
inline bool operator!=(const chrcatid_t &a, const chrcatid_t & b)
|
||||
{
|
||||
return !operator==(a, b);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Compares two character category IDs
|
||||
///
|
||||
/// \param[in] a First character category ID
|
||||
/// \param[in] b Second character category ID
|
||||
///
|
||||
/// \returns
|
||||
/// - true when \p a < \p b
|
||||
/// - false otherwise
|
||||
///
|
||||
inline bool operator<(const chrcatid_t& a, const chrcatid_t& b)
|
||||
{
|
||||
if (a.data[0] < b.data[0]) return true;
|
||||
else if (a.data[0] > b.data[0]) return false;
|
||||
else if (a.data[1] < b.data[1]) return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Compares two character category IDs
|
||||
///
|
||||
/// \param[in] a First character category ID
|
||||
/// \param[in] b Second character category ID
|
||||
///
|
||||
/// \returns
|
||||
/// - true when \p a > \p b
|
||||
/// - false otherwise
|
||||
///
|
||||
inline bool operator>(const chrcatid_t& a, const chrcatid_t& b)
|
||||
{
|
||||
return operator<(b, a);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Compares two character category IDs
|
||||
///
|
||||
/// \param[in] a First character category ID
|
||||
/// \param[in] b Second character category ID
|
||||
///
|
||||
/// \returns
|
||||
/// - true when \p a <= \p b
|
||||
/// - false otherwise
|
||||
///
|
||||
inline bool operator<=(const chrcatid_t &a, const chrcatid_t & b)
|
||||
{
|
||||
return !operator>(a, b);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Compares two character category IDs
|
||||
///
|
||||
/// \param[in] a First character category ID
|
||||
/// \param[in] b Second character category ID
|
||||
///
|
||||
/// \returns
|
||||
/// - true when \p a >= \p b
|
||||
/// - false otherwise
|
||||
///
|
||||
inline bool operator>=(const chrcatid_t &a, const chrcatid_t & b)
|
||||
{
|
||||
return !operator<(a, b);
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Character block ID
|
||||
@@ -189,7 +58,6 @@ namespace ZRCola {
|
||||
///
|
||||
struct character {
|
||||
public:
|
||||
chrcatid_t cat; ///> Character category ID
|
||||
chrblkid_t blk; ///> Character block ID
|
||||
|
||||
protected:
|
||||
@@ -208,7 +76,6 @@ namespace ZRCola {
|
||||
///
|
||||
/// \param[in] chr Character
|
||||
/// \param[in] chr_len Number of UTF-16 characters in \p chr
|
||||
/// \param[in] cat Category
|
||||
/// \param[in] blk Unicode block
|
||||
/// \param[in] desc Description
|
||||
/// \param[in] desc_len Number of UTF-16 characters in \p desc
|
||||
@@ -218,14 +85,12 @@ namespace ZRCola {
|
||||
character(
|
||||
_In_opt_z_count_(chr_len) const char_t *chr = NULL,
|
||||
_In_opt_ size_t chr_len = 0,
|
||||
_In_opt_ chrcatid_t cat = chrcatid_t(),
|
||||
_In_opt_ chrblkid_t blk = 0,
|
||||
_In_opt_z_count_(desc_len) const char_t *desc = NULL,
|
||||
_In_opt_ size_t desc_len = 0,
|
||||
_In_opt_z_count_(rel_len) const char_t *rel = NULL,
|
||||
_In_opt_ size_t rel_len = 0)
|
||||
{
|
||||
this->cat = cat;
|
||||
this->blk = blk;
|
||||
this->chr_to = static_cast<uint16_t>(chr_len);
|
||||
if (chr && chr_len) memcpy(this->data, chr, sizeof(char_t)*chr_len);
|
||||
@@ -310,35 +175,16 @@ namespace ZRCola {
|
||||
}
|
||||
|
||||
///
|
||||
/// Search for characters by description in given categories
|
||||
/// Search for characters by description in given blocks
|
||||
///
|
||||
/// \param[in ] str Search string
|
||||
/// \param[in ] cats Set of categories, character must be a part of
|
||||
/// \param[in ] blks Set of blocks, character must be a part of
|
||||
/// \param[inout] hits (character, count) map to append full-word hits to
|
||||
/// \param[inout] hits_sub (character, count) map to append partial-word hits to
|
||||
/// \param[in ] fn_abort Pointer to function to periodically test for search cancellation
|
||||
/// \param[in ] cookie Cookie for \p fn_abort call
|
||||
///
|
||||
bool Search(_In_z_ const char_t *str, _In_ const std::set<chrcatid_t> &cats, _Inout_ std::map<string_t, charrank_t> &hits, _Inout_ std::map<string_t, charrank_t> &hits_sub, _In_opt_ bool (__cdecl *fn_abort)(void *cookie) = NULL, _In_opt_ void *cookie = NULL) const;
|
||||
|
||||
///
|
||||
/// Get character category
|
||||
///
|
||||
/// \param[in] chr Character
|
||||
/// \param[in] len Number of UTF-16 characters in \p chr
|
||||
///
|
||||
/// \returns
|
||||
/// - Character category if character found
|
||||
/// - Zero `ZRCola::chrcatid_t` otherwise
|
||||
///
|
||||
chrcatid_t GetCharCat(_In_z_count_(len) const char_t *chr, _In_ const size_t len) const
|
||||
{
|
||||
assert(len <= 0xffff);
|
||||
std::unique_ptr<character> c((character*)new char[sizeof(character) + sizeof(char_t)*len]);
|
||||
new (c.get()) character(chr, len);
|
||||
indexChr::size_type start;
|
||||
return idxChr.find(*c, start) ? idxChr[start].cat : chrcatid_t();
|
||||
}
|
||||
bool Search(_In_z_ const char_t *str, _In_ const std::set<chrblkid_t> &blks, _Inout_ std::map<string_t, charrank_t> &hits, _Inout_ std::map<string_t, charrank_t> &hits_sub, _In_opt_ bool (__cdecl *fn_abort)(void *cookie) = NULL, _In_opt_ void *cookie = NULL) const;
|
||||
|
||||
///
|
||||
/// Get character block
|
||||
@@ -674,12 +520,6 @@ namespace ZRCola {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
/// Character category database
|
||||
///
|
||||
using chrcat_db = chrclass_db<chrcatid_t>;
|
||||
|
||||
///
|
||||
/// Character block database
|
||||
///
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
namespace ZRCola {
|
||||
typedef stdex::idrec::record<character_db, recordid_t, 0x524843 /*"CHR"*/, recordsize_t, ZRCOLA_RECORD_ALIGN> character_rec;
|
||||
typedef stdex::idrec::record<chrcat_db, recordid_t, 0x544343 /*"CCT"*/, recordsize_t, ZRCOLA_RECORD_ALIGN> chrcat_rec;
|
||||
typedef stdex::idrec::record<chrblk_db, recordid_t, 0x4c4243 /*"CBL"*/, recordsize_t, ZRCOLA_RECORD_ALIGN> chrblk_rec;
|
||||
typedef stdex::idrec::record<highlight_db, recordid_t, 0x484748 /*"HGH"*/, recordsize_t, ZRCOLA_RECORD_ALIGN> highlight_rec;
|
||||
typedef stdex::idrec::record<langchar_db, recordid_t, 0x432d4c /*"L-C"*/, recordsize_t, ZRCOLA_RECORD_ALIGN> langchar_rec;
|
||||
|
||||
@@ -204,12 +204,12 @@ namespace ZRCola {
|
||||
///
|
||||
/// \param[in ] tags Search tags
|
||||
/// \param[in ] ch_db Character database
|
||||
/// \param[in ] cats Set of categories from \p ch_db, character must be a part of
|
||||
/// \param[in ] blks Set of blocks from \p ch_db, character must be a part of
|
||||
/// \param[inout] hits (character, count) map to append hits to
|
||||
/// \param[in ] fn_abort Pointer to function to periodically test for search cancellation
|
||||
/// \param[in ] cookie Cookie for \p fn_abort call
|
||||
///
|
||||
bool Search(_In_ const std::map<tagid_t, uint16_t> &tags, _In_ const character_db &ch_db, _In_ const std::set<chrcatid_t> &cats, _Inout_ std::map<string_t, charrank_t> &hits, _In_opt_ bool (__cdecl *fn_abort)(void *cookie) = NULL, _In_opt_ void *cookie = NULL) const;
|
||||
bool Search(_In_ const std::map<tagid_t, uint16_t> &tags, _In_ const character_db &ch_db, _In_ const std::set<chrblkid_t> &blks, _Inout_ std::map<string_t, charrank_t> &hits, _In_opt_ bool (__cdecl *fn_abort)(void *cookie) = NULL, _In_opt_ void *cookie = NULL) const;
|
||||
|
||||
|
||||
///
|
||||
|
||||
@@ -28,7 +28,7 @@ size_t ZRCola::wcsnlen(const char_t *str, size_t count)
|
||||
|
||||
|
||||
_Use_decl_annotations_
|
||||
bool ZRCola::character_db::Search(const char_t *str, const std::set<chrcatid_t> &cats, std::map<string_t, charrank_t> &hits, std::map<string_t, charrank_t> &hits_sub, bool (__cdecl *fn_abort)(void *cookie), void *cookie) const
|
||||
bool ZRCola::character_db::Search(const char_t *str, const std::set<chrblkid_t> &blks, std::map<string_t, charrank_t> &hits, std::map<string_t, charrank_t> &hits_sub, bool (__cdecl *fn_abort)(void *cookie), void *cookie) const
|
||||
{
|
||||
assert(str);
|
||||
|
||||
@@ -84,7 +84,7 @@ bool ZRCola::character_db::Search(const char_t *str, const std::set<chrcatid_t>
|
||||
for (size_t i = 0, j = 0; i < val_len; i += j + 1) {
|
||||
if (fn_abort && fn_abort(cookie)) return false;
|
||||
j = wcsnlen(val + i, val_len - i);
|
||||
if (cats.find(GetCharCat(val + i, j)) != cats.end()) {
|
||||
if (blks.find(GetCharBlk(val + i, j)) != blks.end()) {
|
||||
string_t c(val + i, j);
|
||||
auto idx = hits.find(c);
|
||||
if (idx == hits.end()) {
|
||||
@@ -103,7 +103,7 @@ bool ZRCola::character_db::Search(const char_t *str, const std::set<chrcatid_t>
|
||||
for (size_t i = 0, j = 0; i < val_len; i += j + 1) {
|
||||
if (fn_abort && fn_abort(cookie)) return false;
|
||||
j = wcsnlen(val + i, val_len - i);
|
||||
if (cats.find(GetCharCat(val + i, j)) != cats.end()) {
|
||||
if (blks.find(GetCharBlk(val + i, j)) != blks.end()) {
|
||||
string_t c(val + i, j);
|
||||
auto idx = hits_sub.find(c);
|
||||
if (idx == hits_sub.end()) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "pch.h"
|
||||
|
||||
|
||||
bool ZRCola::chrtag_db::Search(_In_ const std::map<tagid_t, uint16_t> &tags, _In_ const character_db &ch_db, _In_ const std::set<chrcatid_t> &cats, _Inout_ std::map<string_t, charrank_t> &hits, _In_opt_ bool (__cdecl *fn_abort)(void *cookie), _In_opt_ void *cookie) const
|
||||
bool ZRCola::chrtag_db::Search(_In_ const std::map<tagid_t, uint16_t> &tags, _In_ const character_db &ch_db, _In_ const std::set<chrblkid_t> &blks, _Inout_ std::map<string_t, charrank_t> &hits, _In_opt_ bool (__cdecl *fn_abort)(void *cookie), _In_opt_ void *cookie) const
|
||||
{
|
||||
for (auto tag = tags.cbegin(), tag_end = tags.cend(); tag != tag_end; ++tag) {
|
||||
if (fn_abort && fn_abort(cookie)) return false;
|
||||
@@ -18,7 +18,7 @@ bool ZRCola::chrtag_db::Search(_In_ const std::map<tagid_t, uint16_t> &tags, _In
|
||||
if (fn_abort && fn_abort(cookie)) return false;
|
||||
const chrtag &ct = idxTag[i];
|
||||
uint16_t len = ct.chr_len();
|
||||
if (cats.find(ch_db.GetCharCat(ct.chr(), len)) != cats.end()) {
|
||||
if (blks.find(ch_db.GetCharBlk(ct.chr(), len)) != blks.end()) {
|
||||
string_t chr(ct.chr(), len);
|
||||
auto idx = hits.find(chr);
|
||||
if (idx == hits.end()) {
|
||||
|
||||
@@ -12,7 +12,7 @@ transeq_db tsq_db;
|
||||
langchar_db lc_db;
|
||||
language_db lang_db;
|
||||
character_db chr_db;
|
||||
chrcat_db cc_db;
|
||||
chrblk_db cb_db;
|
||||
chrtag_db ct_db;
|
||||
tagname_db tn_db;
|
||||
highlight_db h_db;
|
||||
@@ -73,11 +73,11 @@ static void load_database()
|
||||
cerr << "Error reading character data from ZRCola.zrcdb.\n";
|
||||
chr_db.clear();
|
||||
}
|
||||
} else if (id == chrcat_rec::id()) {
|
||||
dat >> chrcat_rec(cc_db);
|
||||
} else if (id == chrblk_rec::id()) {
|
||||
dat >> chrblk_rec(cb_db);
|
||||
if (!dat.good()) {
|
||||
cerr << "Error reading character category data from ZRCola.zrcdb.\n";
|
||||
cc_db.clear();
|
||||
cerr << "Error reading character block data from ZRCola.zrcdb.\n";
|
||||
cb_db.clear();
|
||||
}
|
||||
} else if (id == chrtag_rec::id()) {
|
||||
dat >> chrtag_rec(ct_db);
|
||||
|
||||
Binary file not shown.
@@ -499,21 +499,6 @@ msgstr ""
|
||||
msgid "Letter u"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letter, Lowercase"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letter, Modifier"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letter, Other"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letter, Titlecase"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letter, Uppercase"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letterlike Symbols"
|
||||
msgstr ""
|
||||
|
||||
@@ -529,15 +514,6 @@ msgstr ""
|
||||
msgid "Maltese"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mark, Enclosing"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mark, Non-Spacing"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mark, Spacing Combining"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mathematical And Physical Symbols"
|
||||
msgstr ""
|
||||
|
||||
@@ -610,15 +586,6 @@ msgstr ""
|
||||
msgid "Number Forms"
|
||||
msgstr ""
|
||||
|
||||
msgid "Number, Decimal Digit"
|
||||
msgstr ""
|
||||
|
||||
msgid "Number, Letter"
|
||||
msgstr ""
|
||||
|
||||
msgid "Number, Other"
|
||||
msgstr ""
|
||||
|
||||
msgid "Numbers"
|
||||
msgstr ""
|
||||
|
||||
@@ -628,12 +595,6 @@ msgstr ""
|
||||
msgid "Other Modifiers"
|
||||
msgstr ""
|
||||
|
||||
msgid "Other, Format"
|
||||
msgstr ""
|
||||
|
||||
msgid "Other, Surrogate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Parentheses"
|
||||
msgstr ""
|
||||
|
||||
@@ -655,27 +616,6 @@ msgstr ""
|
||||
msgid "Punctuation"
|
||||
msgstr ""
|
||||
|
||||
msgid "Punctuation, Close"
|
||||
msgstr ""
|
||||
|
||||
msgid "Punctuation, Connector"
|
||||
msgstr ""
|
||||
|
||||
msgid "Punctuation, Dash"
|
||||
msgstr ""
|
||||
|
||||
msgid "Punctuation, Final quote"
|
||||
msgstr ""
|
||||
|
||||
msgid "Punctuation, Initial quote"
|
||||
msgstr ""
|
||||
|
||||
msgid "Punctuation, Open"
|
||||
msgstr ""
|
||||
|
||||
msgid "Punctuation, Other"
|
||||
msgstr ""
|
||||
|
||||
msgid "Quotes"
|
||||
msgstr ""
|
||||
|
||||
@@ -685,15 +625,6 @@ msgstr ""
|
||||
msgid "Russian"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Line"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Paragraph"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Space"
|
||||
msgstr ""
|
||||
|
||||
msgid "Serbian – Cyrillic"
|
||||
msgstr ""
|
||||
|
||||
@@ -796,18 +727,6 @@ msgstr ""
|
||||
msgid "Symbol ?"
|
||||
msgstr ""
|
||||
|
||||
msgid "Symbol, Currency"
|
||||
msgstr ""
|
||||
|
||||
msgid "Symbol, Math"
|
||||
msgstr ""
|
||||
|
||||
msgid "Symbol, Modifier"
|
||||
msgstr ""
|
||||
|
||||
msgid "Symbol, Other"
|
||||
msgstr ""
|
||||
|
||||
msgid "Syriac"
|
||||
msgstr ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user