News from the MBS Xojo Plugins Version 25.3

In this article I want to introduce you the new functionalities from the MBS Xojo Plugins in version 25.3.

DynaPDF

A very usefull feature in DynaPDF is the signing of documents. This allows the user to ensure that the document has not been changed in the meantime. A PDF document that is signed can sometimes have several signature fields. In this case, the first signature field without a value is selected for signing by default. With the new method SetActiveSigField from the class DynaPDFMBS you can choose which field should be signed.

New compression methods for zip archives

The zip format is essential for storage. We have been supporting functionalities for it for years. We’ve brought you two compression methods in this release. With the new ZipSetCompressionZStd and ZipSetCompressionBZip2 methods, you can now use the ZStd and Bzip2 compression algorithms. Bzip2 is characterized by a very good compression rate and is therefore particularly suitable for applications where storage space needs to be saved. However, compression and decompression take a little longer here. If you want a good compression rate, but time is also a factor for you, then ZStd can help you realize your project, as it is incredibly fast.

See ArchiveWriterMBS class.

SQL

The MBS Xojo SQL Plugin gets very cool new methods in this release. The method DumpToStrings from InternalSQLiteLibraryMBSmodule. This method converts an SQLite database into UTF-8 text SQL statements that will exactly recreate that original database. Also new in this module are three properties that activate extensions. With Base64ExtensionEnabled you can enable the base64 extensions to convert (binary) blobs and base64 text into each other. You can also use CSVExtensionEnabled to activate the CSV extensions and thus have an implementation of an SQLite virtual table for reading CSV files. You also have the property UUIDExtensionEnabled which activates a uuid extension. This SQLite extension implements functions that handling RFC-4122 UUIDs.

SSL

In the SSL area, we have added three new methods in the OpenSSLMBS class that return an array to the existing cipher names, digest algorithms or provider names.

CURL

For the classes CURLSMBS, CURLMBS and CURLNMBS we have the new property OptionSSLSignatureAlgorithms. Here you can set and read the TLS supported signature algorithms. It hold a colon-delimited list of signature scheme names. e.g. DSA+SHA256:rsa_pss_pss_sha256

We also have an announcement to make for this section. If you use CURLSMBS or CURLNMBS classes on macOS with Secure Transport this may be important for you. Since CURL removes support for Secure Transport, we will deprecate CURLNMBS now and remove it later this year. Anyone using it, please move to CURLSMBS. There you can pick the backend dynamically in code. You can still pick Secure Transport (as long as it stays available) there as well as Windows Secure Channel.

Java

Methods have also been added for Java in this release. You can use them to find out more about the classes, fields and methods available in Java. With the LoadedClasses method from the JavaVMMBS class, we can find out more about the existing classes. The method returns an array of type JavaClassMBS with the individual classes. We can then query these objects information further, for example.

// show all class names

var vm as JavaVMMBS // your VM
Var arg As New MemoryBlock(8)
Var LoadedClassNames() As String
Var LoadedClasses() As JavaClassMBS = vm.LoadedClasses
For Each c As JavaClassMBS In LoadedClasses
  Var jc As JavaClassMBS = c.ObjectClass
  Var jm As JavaMethodMBS = jc.GetMethod("getName", "()Ljava/lang/String;")
  Var jo As Variant = c.CallObjectMethod(jm, arg)
  Var js As JavaStringMBS = jo
  Var name As String = js.StringValue
  LoadedClassNames.Add name
Next
MessageBox String.FromArray(LoadedClassNames, EndOfLine)

This works in a similar way with the Fields and Methods methods from the JavaClassMBS class. These also return arrays that we can explore further.

// List field names

Var vm as JavaVMMBS  // your VM
Var jclass As JavaClassMBS = vm.FindClass("test")
Var fields() As JavaFieldMBS = jclass.Fields
Var fieldNames() As String

For Each field As JavaFieldMBS In fields
  fieldNames.add field.Name
Next

MessageBox String.FromArray(fieldNames, EndOfLine)


// List method names

Var vm as JavaVMMBS  // your VM
Var jclass As JavaClassMBS = vm.FindClass("test")
Var Methods() As JavaMethodMBS = jclass.Methods
Var MethodNames() As String

For Each Method As JavaMethodMBS In Methods
  MethodNames.add Method.Name
Next

MessageBox String.FromArray(MethodNames, EndOfLine)

PKey

We also have new features in the Encryption and Hash area in relation to public and private keys. These changes can be found in the PKeyMBS class. First of all, we have two new methods GenerateCertificateSigningRequest and GenerateRootCertificate. The GenerateCertificateSigningRequest method creates a certificate signing request. The Fields dictionary allows you to pass text strings for company, organization and a few more.

As the name suggests, GenerateRootCertificate generates a root certificate. Again, you have space for company, organization and a few more.

We also have a shared method SignCertificate that signs a certificate sign request to make a new certificate.

// we need a root key
Var RootKey As String = OpenSSLMBS.GeneratePrivateKey
Var pRootKey As PKeyMBS = PKeyMBS.Open(RootKey)

// and a root certificate
Var rootCertFields As New Dictionary
rootCertFields.Value("C") = "US"
rootCertFields.Value("O") = "MyOrg Root CA"
rootCertFields.Value("CN") = "MyRootCA"
var rootCert as X509MBS = pRootKey.GenerateRootCertificate(rootCertFields)

// and a client key
var clientKey as String = OpenSSLMBS.GeneratePrivateKey
Var pclientKey As PKeyMBS = PKeyMBS.Open(clientKey)

// and we request a client certificate
Var clientCertFields As New Dictionary
clientCertFields.Value("C") = "US"
clientCertFields.Value("O") = "Client Org"
clientCertFields.Value("CN") = "Client Company"
var clientCSR as String = pclientKey.GenerateCertificateSigningRequest(clientCertFields)

// let's make a client certificate
Var ClientCert As X509MBS = pRootKey.SignCertificate(clientCSR, pRootKey, rootCert)

Break

C function

Since release 20.3, you can also declare C functions in Xojo. In this release, we have added two properties to the DeclareFunctionMBS class for you. The properties Result and RawResult now contain the identically named results of the last invocation.

The raw is the direct value, while the normal result is converted to a variant based on the data type.

New functionalities for Mac

The MBS Xojo Plugins in version 25.3 offers some more new features for Mac users

Sign with Apple

We also added a new section in the Xojo plugins. The AuthenticationServices section contains classes for the Sign In with Apple service. This means you can offer a sign in via your Apple ID. We also have controls for the buttons with which you can log in. The controls ASAuthorizationAppleIDButtonControlMBS, ASAuthorizationAppleIDButtonIOSControlMBS and DesktopASAuthorizationAppleIDButtonControlMBS are available for the corresponding platform.

You can use one of the concrete requests, like ASAuthorizationAppleIDRequestMBS or ASAuthorizationPasswordRequestMBS as authorization requests. You typically generate one of these using the corresponding provider, which is an instance of ASAuthorizationAppleIDProviderMBS or ASAuthorizationPasswordProviderMBS, respectively.

Var provider As New ASAuthorizationAppleIDProviderMBS
Var request As ASAuthorizationAppleIDRequestMBS = provider.createRequest
Var controller As New ASAuthorizationControllerMBS(Array(request))
Break

Dispatch I/O

We also have a new area for Asynchronous I/O for macOS. This area contains the two classes DispatchDataMBS and DispatchIOMBS. The DispatchIOMBS class provides both stream and random access asynchronous read and write operations on file descriptors. One or more dispatch I/O channels may be created from a file descriptor as either the kTypeStream type or kTypeRandom type. Once a channel has been created the application may schedule asynchronous read and write operations.The application may set policies on the dispatch I/O channel to indicate the desired frequency of I/O handlers for long-running operations.

Dispatch I/O also provides a memory management model for I/O buffers that avoids unnecessary copying of data when pipelined between channels. It monitors the overall memory pressure and I/O access patterns for the application to optimize resource utilization. An Object of the class DispatchDataMBS describes contiguous or sparse regions of memory that may be managed by the system or by the application. If you want to learn more about the new area, take a look at the blog article Asynchronous File I/O in Xojo with DispatchIOMBS.

Pasteboard

To handle pasteboard permissions on macOS, we got a new method for NSPasteboardMBS class. With accessBehavior we define the current pasteboard access behavior. The user can customize this behavior per-app in System Settings for any app that has triggered a pasteboard access alert in the past.

Var pb As NSPasteboardMBS = NSPasteboardMBS.generalPasteboard

Var accessBehavior As Integer = pb.accessBehavior

Select Case accessBehavior
Case pb.AccessBehaviorAlwaysAllow
  MessageBox "AccessBehaviorAlwaysAllow"
Case pb.AccessBehaviorAlwaysDeny
  MessageBox "AccessBehaviorAlwaysDeny"
Case pb.AccessBehaviorAsk
  MessageBox "AccessBehaviorAsk"
Case pb.AccessBehaviorDefault
  MessageBox "AccessBehaviorDefault"
End Select

In addition, we have methods in the NSPasteboardItemMBS and NSPasteboardMBS classes to detect patterns, metadata or values in the items. Take a look at the methods detectMetadata, detectPatterns and detectValues. We have added a few shared methods in the NSPasteboardMBS class to recognize the patterns. For example, calendar entries, email addresses, flight numbers, links, money amounts, telephone numbers, addresses and shipping numbers can be recognized in your entries.

The key thing is that you can detect the content before you access the clipboard. This way you can streamline to when you may cause a notification to show or a dialog to ask for permissions.

Text Field

In the class NSTextFieldMBS we have 4 new methods. With these you can set or query arrays consisting of strings or attributed strings that will be animated to cycle through one by one when the textField is first responder. Have a look at the methods setPlaceholderStrings, placeholderStrings, setPlaceholderAttributedStrings and placeholderAttributedStrings.

System Information

If you want to know whether your application is running on a Mac with the latest apple operating system, macOS 26 Tahoe, you can use the isTahoe method from the SystemInformationMBS class. This returns true if we are on the Tahoe system or newer.

AV Capture

Since years we have the class AVCaptureStillImageOutputMBS in our plugins. With this class you have the ability that you can use it to capture a high-quality still image with accompanying metadata. This class got new properties in this release. On a receiver where isStillImageStabilizationSupported returns true, image stabilization may be applied to reduce blur commonly found in low light photos. The property automaticallyEnablesStillImageStabilizationWhenAvailable Indicates whether the receiver should automatically use still image stabilization when necessary. If the image stabilization is used, the new property isStillImageStabilizationActive return true. The new property isHighResolutionStillImageOutputEnabled indicates whether the receiver should emit still images at the highest resolution supported by its source AVCaptureDevice’s activeFormat.

Printing

We have a new method related to printing in the NSPrintInfoMBS class. The method removeObjectForKey removes an entry from the underlaying dictionary and thus allows us to remove custom settings. We can also use objectForKey to set or read an entry in the underlaying dictionary.

Var n As New NSPrintInfoMBS

Var d1 As Dictionary = n.Dictionary

// add a custom key
n.objectForKey("test") = 123

Var d2 As Dictionary = n.Dictionary

// and remove it
n.removeObjectForKey "test"

Var d3 As Dictionary = n.Dictionary

// inspect dictionaries in debugger
Break

Select or highlight controls

We have two new properties in the NSControlMBS class. You can use isSelected and isHighlighted to check whether a control is selected or highlighted. However, you can not only query this property, but also set it yourself in the code.

We also have a property for the NSControls in the NSViewMBS class that is decisive for the display. The property prefersCompactControlSizeMetrics specifies whether to prefer compact control size. When this property is true, any NSControls in the view or its descendants will be sized with compact metrics.

Toolbar Item

The new property backgroundTintColor from the class NSToolbarItemMBS under macOS 26 and newer applied a color to tint the background of the toolbar item only if the item’s style is prominent. To set the style to prominent you need the also new property Style from the same class.

Vision

We have added some properties for Vision in this release. Let’s start with the property pitch in the class VNFaceObservationMBS. It’s describes the rotational angle of the face around the x-axis on an image.

Then we have some new properties in the VNBarcodeObservationMBS class. First we have the property payloadData which returns the raw data representation of the barcode’s payload as a memory block, if available.

The property supplementalPayloadData contains the supplemental payload data as a memory block. On the other hand, the property supplementalPayloadString returns the decoded supplemental code as a string value. If you need the supplemental composite type, you can get it with the property supplementalCompositeType. If it is possible, codes can also coalesce multiple codes based on the symbology. If you want to enable this, you can set the property coalesceCompositeSymbologies to true.

If you want to know whether the data in the barcode is GS1 data, you can use the isGS1DataCarrier function to check this.

Last but not least, you can use the property isColorInverted to determine whether the barcode is color inverted.

New functionalities for Windows

Also we offer new features for Windows users

Shell

In the class WindowsProcessMBS, from the topic Shell, we have the new method poll. This method checks for events. Normally we call this automatically internally, but in a tight loop, you can call this to trigger the events.

Affinity

We got a new property in the classes DesktopWindow and Window: WindowDisplayAffinityMBS. With this property we set the window display affinity that specifies where the content of the window can be displayed. It is designed to support the window content protection feature that is new to Windows 7. This feature enables applications to protect their own onscreen window content from being captured or copied through a specific set of public operating system features and APIs.

Search function

Independently of this release, we have a new feature on our website that we would like to draw your attention to. We have added a new search function to the website to help you use the functionality of our plugins and find blog articles on specific topics more quickly. You can now go through our website by entering search terms and find the classes and information you need for your project more easily. You are welcome to try it out.

Here you can find classes, modules, controls, global functions and even some blog articles to explain them.

Omega Bundle 2025

Once again this year, DynaPDF Starter and ChartDirector are included in the OmegaBundle. You can get this and much more in this year’s Omega Bundle for Xojo. Have a look at the Omega Bundle website and get the great functionalities for little money.

We hope you will also find some interesting new features. We wish you a lot of fun with MBS Xojo Plugins version 25.3. If you have any Ideas for new cool features, need a license or have any questions, please contact us.

5 Likes