News from the MBS Xojo Plugins in Version 25.1

In this article I want to introduce you the new functionalities from the MBS Xojo Plugins in version 25.1.
ECKey
When it comes to encryption, you can now use the CurveNameToID method in the ECKeyMBS class to find out the ID of a curve. If you want to sign data, we have also added new methods for this. You can sign data with Sign. It can look like this, for example:
const NID_secp192k1 = 711 Var key as ECKeyMBS = ECKeyMBS.KeyByCurveName(NID_secp192k1) Var text as string = "Hello World" Var data as string = SHA512MBS.Hash(text) Var sig as string = key.Sign(data) if key.Verify(data, sig) then MsgBox "Signature ok" end if
We highly recommend to use a hash like SHA-512 to preprocess the data. The whole thing can then be verified with Verify. If you want to sign with SHA256, you can sign directly with the ES256Sign method and verify with ES256Verify. You can pass the data as a string or memory block. Both are possible.
Tess Engine
There is also an innovation in the Tesseract area. In the class TessEngineMBS we have the new shared method SetDllDirectory, with which we add a directory to the search path used to locate DLLs for our application. The SetDllDirectory function affects all subsequent calls to the LoadLibrary and LoadLibraryEx functions. It also effectively disables safe DLL search mode while the specified directory is in the search path. To revert to the default search path used by LoadLibrary and LoadLibraryEx, call SetDllDirectory with nil. This also restores safe DLL search mode based on the SafeDllSearchMode registry value. You have the option of passing the path as a string or as a folder item.
A similar shared method with an identical name is now also available in the SQLGlobalsMBS class.
Python
In Python, we have also added a new method to the PythonMBS class. The AddSysPath method adds a file path to the system path list. This allows you to add the path to the current virtual environment.
Saxon
In the last release, we introduced you to the new Saxon area. With the property hasLicense from the SaxonProcessorMBS class, you can check whether a license is set. You can use the License as String property from the SaxonMBS class to query the type of license. Can currently be either one for Saxon-PE or Saxon-EEV or an empty string. If you want to remove a license, you can easily do this with the ClearLicense method.
Emails
The CURLEmailMBS class has a new property: Use8BitMime. With this property you can check and decide whether 8bit encoding is used when sending the mail.
Together with emails, we also have a new method in the MimeEmailMBS class. We can use the SourceWithoutAttachments method to return the source of the email without attachments. The plugin passes the email, removes attachments and produces this source for you. This can for example be useful to archive emails without attachments.
Sort
We have also extended a lot of methods in the SortMBS class. We have already integrated the methods AddArrayMBS and AddMBS in the SortMBS class since 2024. We extend these with the now usable data types Date, DateTime and Variant. The methods CopyArrayMBS and CopyMBS are also extended by the data types Date and DateTime. The ReverseMBS methods have also been added. This allows you to reverse the order in arrays. You can use arrays of the following data types for this: Boolean, Color, Currency, Date, DateTime, Double, Int32, Int64, Object, Ptr, Single and String.
DynaPDF
Would you like to know which DynaPDF license you are currently working with? Then the new CustomerID property from the DynaPDFMBS class may be useful for you. It returns your customer ID. The HasOutputFile property is also new. You can use this to check whether we have an open output file.
New functionalities for Mac
The MBS Xojo Plugins in version 25.1 offers some more new features for Mac users
PhotoPicker
You can use PHPickerMBS to show a window for the user to pick photos from his library without your application requiring permissions to do so. With the new PHPickerControlMBS and DesktopPHPickerControlMBS controls, you can embed this picker in your own window. They provide us with some events to support us in our work.
For the PHPhotoLibraryMBS class we have the new method requestAuthorizationForAccessLevel. With this you can request the user's permission, if needed, to access the photo library, just like with the already known function requestAuthorization. Compared to the other method, you can ask for read & write or for add-only mode. For this we have the constants PHAccessLevelReadWrite and PHAccessLevelAddOnly. We can then use the authorizationStatusForAccessLevel method to query the set level.
Player View
We have a new control AVPlayerViewControllerControlMBS. with this control you can host an AVPlayerViewControllerMBS object. A player view controller makes it simple to add media playback capabilities to your app that match the styling and features of the native system players. Using this object also means that your app automatically adopts the new features and styling of future operating system releases.
AVCapture
There are also some new methods and properties in the AVCaptureDeviceMBS class. First of all, we have the discoverDevices method. This function allows clients to discover devices by providing certain search criteria. The objective of this class is to help find devices by device type and optionally by media type or position. You can set this information in the parameters. You can now also query the device type of a device directly using the new property. You can also use the constituentDevices function to query an array of constituent physical devices comprising a virtual device.
We have also introduced many device type constants as shared methods, which you can use to describe microphones and cameras on Mac and iOS, for example.
- AVCaptureDeviceTypeBuiltInDualCamera
- AVCaptureDeviceTypeBuiltInDualWideCamera
- AVCaptureDeviceTypeBuiltInLiDARDepthCamera
- AVCaptureDeviceTypeBuiltInTelephotoCamera
- AVCaptureDeviceTypeBuiltInTripleCamera
- AVCaptureDeviceTypeBuiltInTrueDepthCamera
- AVCaptureDeviceTypeBuiltInUltraWideCamera
- AVCaptureDeviceTypeBuiltInWideAngleCamera
- AVCaptureDeviceTypeContinuityCamera
- AVCaptureDeviceTypeDeskViewCamera
- AVCaptureDeviceTypeExternal
- AVCaptureDeviceTypeMicrophone
There is also the shared method systemPreferredCamera. It specifies the best camera to use as determined by the system. Apple chooses the default value. This property incorporates userPreferredCamera as well as other factors, such as camera suspension and Apple cameras appearing that should be automatically chosen. The property may change spontaneously, such as when the preferred camera goes away. This property always returns a device that is present. If no camera is available nil is returned.
To match this, we then have the shared property userPreferredCamera that is a settable property that specifies a user preferred camera. Setting this property allows an application to persist its user's preferred camera across app launches and reboots. The property internally maintains a short history, so if your user's most recent preferred camera is not currently connected, it still reports the next best choice.
Then we have a few more properties about CenterStage. When CenterStage is active, the camera automatically adjusts to keep people optimally framed within the field of view. The field of view may pan, tighten or widen as needed.
With centerStageEnabled you get a Boolean value whether the Center Stage feature is currently enabled or disabled. The property isCenterStageActive indicates whether Center Stage is currently active on a particular AVCaptureDevice. With the property centerStageControlMode we can set and query the current Center Stage mode. This can be user, app, or cooperative.
With the property centerStageRectOfInterest you can specify the effective region within the output pixel buffer that will be used to perform Center Stage framing. Applications that wish to apply additional processing (such as cropping) on top of Center Stage's output can use this property to guide Center Stage's framing. You can query whether the device supports this functionality with isCenterStageRectOfInterestSupported.
These and other new methods and properties are available in the AVCaptureDeviceMBS class.

Buttons
If you want to give your Xojo buttons a different font color, the new property contentTintColor from the NSButtonMBS class can be useful. You can use this property on frameless buttons. Here you can see an example with which you can change the font color of button1 to red:
Var n As NSButtonMBS = Button1.NSButtonMBS n.contentTintColor = NSColorMBS.redColor n.isBordered = False
Genmojis
On macOS and iOS you can use Genmojis with the NSAdaptiveImageGlyphMBS class. We can render images using NSAdaptiveImageGlyphImageMBS class.
In the NSTextViewMBS class we have the matching property supportsAdaptiveImageGlyph. That is a Boolean value that indicates whether the document supports adaptive images in the input. When this property is false, the input system doesn't allow the text input to contain adaptive images.
Another property of this class is usesAdaptiveColorMappingForDarkAppearance a Boolean value that indicates whether the framework should use adaptive color mapping for dark appearance.
In the WKWebViewConfigurationMBS class, we also have a supportsAdaptiveImageGlyph property to activate the Genmojis there too.
New functionalities for Windows
Also we offer new features for Windows users.
AVI
A cool new class is the WindowsAVIWriteMBS class. With this class you can create an AVI video file from pictures. You first create the file, then the video stream, set options and add frames.
Var w As New WindowsAVIWriteMBS Var p as Picture = logoMBS(500) w.Width = p.width w.Height = p.Height Var file as FolderItem = SpecialFolder.Desktop.Child("test.avi") call w.CreateFile(file) call w.CreateVideoStream call w.SetOptions call w.AddFrame(p) call w.CloseFile

Power Manager

With the WindowsPowerManagerMBS class you get information about a device's battery and power supply status. For example, you can query what percentage your battery has left.
MessageBox str(WindowsPowerManagerMBS.RemainingChargePercent)+"% remaining"
Process
This time we have also included some other functionalities that give us information about our setup. The WindowsProcessDiagnosticInfoMBS class provides diagnostic information about a process or the system, such as CPU usage, disk usage, memory usage and so on.
Share
You can now call a sharing panel from Xojo under windows. The WindowsSharePanelMBS class is available for this purpose. The class show a share panel on Windows 8 or newer. What Windows can share and what application it offers depends on the local software installation on the PC. e.g. if you have an email application, you may see contact names and the option to send an email.
panel = New WindowsSharePanel // add a file on disk var f as FolderItem = SpecialFolder.Desktop.Child("test.jpg") panel.AddFile f // show the panel panel.Present
Web View 2
We have added the new event Failed for the classes DesktopWebView2ControlMBS and WebView2ControlMBS. That allows you to close the window, show an error message or switch to a Xojo HTMLViewer. e.g. you get a file not found error if the WebView2 component is not installed.
New functionalities for Linux
Last but not least we have new Avahi classes for Linux
Since many years we have our Bonjour classes for macOS, iOS and Windows to find computers on the local network by publishing and browsing for services. For Linux we use Avahi library. In this release we have added 4 new classes. With the new class AvahiAddressResolverMBS we look for an address. The AvahiEntryGroupMBS class is the class for publishing services. For example, you can add addresses and services here. With the AvahiHostNameResolverMBS class you get a service resolver object. With the class AvahiRecordBrowserMBS you get a class for a record browser.
We hope you will also find some interesting new features. We wish you a lot of fun with MBS Xojo Plugins version 25.1. If you have any Ideas for new cool features, need a license or have any questions, please contact us.
