summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsolenv/bin/native-code.py204
-rw-r--r--vcl/source/window/builder.cxx12
2 files changed, 212 insertions, 4 deletions
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 430a429e9b6d..82c030ff79b5 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -365,6 +365,192 @@ constructor_map = {
'writer' : writer_constructor_list,
}
+custom_widgets = [
+ 'ArgEdit',
+ 'AutoCompleteMultiListBox',
+ 'AutoCorrEdit',
+ 'AutoFormatPreview',
+ 'BackgroundPreview',
+ 'BmpWindow',
+ 'BookmarksBox',
+ 'CaptionComboBox',
+ 'CategoryListBox',
+ 'ClassificationEditView',
+ 'ColorConfigCtrl',
+ 'ColorFieldControl',
+ 'ColorPreviewControl',
+ 'ColorSliderControl',
+ 'ColumnEdit',
+ 'ColumnValueSet',
+ 'CommandCategoryListBox',
+ 'ConditionEdit',
+ 'ContentListBox',
+ 'ContextVBox',
+ 'CuiCustomMultilineEdit',
+ 'CustomPropertiesControl',
+ 'DataTreeListBox',
+ 'DialControl',
+ 'DriverListControl',
+ 'DropdownBox',
+ 'EditBox',
+ 'EmbossControl',
+ 'EmojiView',
+ 'ExtBoxWithBtns',
+ 'ExtensionBox',
+ 'FEdit',
+ 'FontNameBox',
+ 'FontSizeBox',
+ 'FontStyleBox',
+ 'FontStyleBox',
+ 'FormattedField',
+ 'FormulaListBox',
+ 'FrameDirectionListBox',
+ 'GalleryPreview',
+ 'GraphCtrl',
+ 'GraphicPreviewWindow',
+ 'HexColorControl',
+ 'HyphenEdit',
+ 'IndexBox',
+ 'IndexBox',
+ 'IntellectualPropertyPartEdit',
+ 'LightButton',
+ 'LineEndLB',
+ 'LineLB',
+ 'LineListBox',
+ 'LookUpComboBox',
+ 'MacroEventListBox',
+ 'ManagedMenuButton',
+ 'MultiLineEditSyntaxHighlight',
+ 'NumFormatListBox',
+ 'NumberingPreview',
+ 'OFileURLControl',
+ 'OptionalBox',
+ 'PageNumberListBox',
+ 'PaperSizeListBox',
+ 'PriorityHBox',
+ 'PriorityMergedHBox',
+ 'PropertyControl',
+ 'RecentDocsView',
+ 'RefButton',
+ 'RefEdit',
+ 'ReplaceEdit',
+ 'ReturnActionEdit',
+ 'RowEdit',
+ 'RubyEdit',
+ 'RubyPreview',
+ 'RubyRadioButton',
+ 'SFTreeListBox',
+ 'SameContentListBox',
+ 'ScAutoFmtPreview',
+ 'ScCondFormatList',
+ 'ScCsvTableBox',
+ 'ScCursorRefEdit',
+ 'ScDPFunctionListBox',
+ 'ScDataTableView',
+ 'ScDoubleField',
+ 'ScEditWindow',
+ 'ScExtIButton',
+ 'ScPivotLayoutTreeList',
+ 'ScPivotLayoutTreeListData',
+ 'ScPivotLayoutTreeListLabel',
+ 'ScRefButtonEx',
+ 'ScTabBgColorValueSet',
+ 'SdPageObjsTLB',
+ 'SearchBox',
+ 'SearchResultsBox',
+ 'SelectionListBox',
+ 'SentenceEditWindow',
+ 'SeriesListBox',
+ 'SfxAccCfgTabListBox',
+ 'SfxConfigFunctionListBox',
+ 'SfxConfigGroupListBox',
+ 'SfxPreviewWin',
+ 'ShowNupOrderWindow',
+ 'ShowNupOrderWindow',
+ 'SidebarDialControl',
+ 'SidebarToolBox',
+ 'SlideTransitionBox',
+ 'SmallButton',
+ 'SmallButton',
+ 'SpacingListBox',
+ 'StatusBar',
+ 'StructListBox',
+ 'SuggestionDisplay',
+ 'SuggestionEdit',
+ 'SvSimpleTableContainer',
+ 'SvTabListBox',
+ 'SvTreeListBox',
+ 'SvtFileView',
+ 'SvtIconChoiceCtrl',
+ 'SvtURLBox',
+ 'Svx3DPreviewControl',
+ 'SvxBmpNumValueSet',
+ 'SvxCharView',
+ 'SvxCheckListBox',
+ 'SvxColorListBox',
+ 'SvxColorValueSet',
+ 'SvxCropExample',
+ 'SvxDictEdit',
+ 'SvxFillAttrBox',
+ 'SvxFillTypeBox',
+ 'SvxFontListBox',
+ 'SvxFontPrevWindow',
+ 'SvxFrameSelector',
+ 'SvxHlmarkTreeLBox',
+ 'SvxHyperURLBox',
+ 'SvxLanguageBox',
+ 'SvxLanguageComboBox',
+ 'SvxLanguageComboBox',
+ 'SvxLightCtl3D',
+ 'SvxNoSpaceEdit',
+ 'SvxNumValueSet',
+ 'SvxNumberPreview',
+ 'SvxNumberingPreview',
+ 'SvxPageWindow',
+ 'SvxParaPrevWindow',
+ 'SvxPathControl',
+ 'SvxPixelCtl',
+ 'SvxPresetListBox',
+ 'SvxRectCtl',
+ 'SvxRelativeField',
+ 'SvxSearchCharSet',
+ 'SvxShowCharSet',
+ 'SvxShowText',
+ 'SvxSwFrameExample',
+ 'SvxTextEncodingBox',
+ 'SvxTextEncodingBox',
+ 'SvxXConnectionPreview',
+ 'SvxXLinePreview',
+ 'SvxXMeasurePreview',
+ 'SvxXRectPreview',
+ 'SvxXShadowPreview',
+ 'SwAddressPreview',
+ 'SwCaptionPreview',
+ 'SwColExample',
+ 'SwColumnOnlyExample',
+ 'SwDropCapsPict',
+ 'SwEnvPreview',
+ 'SwFieldRefTreeListBox',
+ 'SwGlTreeListBox',
+ 'SwGlossaryGroupTLB',
+ 'SwIdxTreeListBox',
+ 'SwLabPreview',
+ 'SwMarkPreview',
+ 'SwNavHelpToolBox',
+ 'SwNumberingTypeListBox',
+ 'SwPageGridExample',
+ 'SwTokenWindow',
+ 'TabWin_Impl',
+ 'TableDesignBox',
+ 'TableValueSet',
+ 'TemplateDefaultView',
+ 'TemplateLocalView',
+ 'TemplateSearchView',
+ 'TextDirectionListBox',
+ 'ThesaurusAlternativesCtrl',
+ 'ValueSet',
+ ]
+
def get_constructor_guard(constructor):
if type(full_constructor_map[constructor]) is bool:
return None
@@ -469,6 +655,24 @@ for constructor in sorted(full_constructor_map.keys()):
if constructor_guard:
print ('#endif')
+print ('')
+for entry in sorted(custom_widgets):
+ print ('void make' + entry + '();')
+print ('static struct { const char *name; void(*func)(); } custom_widgets[] = {')
+for entry in sorted(custom_widgets):
+ print (' { "make' + entry + '", make' + entry + ' },')
+print ('};')
+print ('')
+print ("""
+void (*lo_get_custom_widget_func(const char* name))()
+{
+ for (int i = 0; i < sizeof(custom_widgets) / sizeof(custom_widgets[0]); i++)
+ if (strcmp(name, custom_widgets[i].name) == 0)
+ return custom_widgets[i].func;
+ return nullptr;
+}
+""")
+
print ("""
const lib_to_factory_mapping *
lo_get_factory_map(void)
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index d8b80b5a10a5..b3e88485c743 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1181,6 +1181,10 @@ void VclBuilder::preload()
#endif // DISABLE_DYNLOADING
}
+#if defined DISABLE_DYNLOADING && !HAVE_FEATURE_DESKTOP
+extern "C" VclBuilder::customMakeWidget lo_get_custom_widget_func(const char* name);
+#endif
+
VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &name, const OString &id,
stringmap &rMap)
{
@@ -1698,12 +1702,12 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
}
else
pFunction = reinterpret_cast<customMakeWidget>(aI->second->getFunctionSymbol(sFunction));
+#elif !HAVE_FEATURE_DESKTOP
+ pFunction = lo_get_custom_widget_func(sFunction.toUtf8().getStr());
+ SAL_WARN_IF(!pFunction, "vcl.layout", "Could not find " << sFunction);
+ assert(pFunction);
#else
pFunction = reinterpret_cast<customMakeWidget>(osl_getFunctionSymbol((oslModule) RTLD_DEFAULT, sFunction.pData));
-#if !HAVE_FEATURE_DESKTOP
- SAL_WARN_IF(!pFunction, "vcl.layout", "Lookup of " << sFunction << " failed");
- assert(pFunction);
-#endif
#endif
if (pFunction)
{