# HG changeset patch # User Olaf Wintermann # Date 1731601523 -3600 # Node ID a612adaee43d0f6e75b0db24dca3bc247e213da8 # Parent 6727ea0f8fbe876c20b74f129ad0085fb1ada45e fix pathbar elmfunc creating an element for an empty string diff -r 6727ea0f8fbe -r a612adaee43d application/window.c --- a/application/window.c Wed Nov 13 22:10:03 2024 +0100 +++ b/application/window.c Thu Nov 14 17:25:23 2024 +0100 @@ -284,6 +284,11 @@ static UiPathElm* dav_get_pathelm(const char *full_path, size_t len, size_t *ret_nelm, void* data) { + if (len == 0) { + *ret_nelm = 0; + return NULL; + } + cxstring fpath = cx_strn(full_path, len); int protocol = 0; if (cx_strcaseprefix(fpath, CX_STR("http://"))) { diff -r 6727ea0f8fbe -r a612adaee43d make/vs/idav/idav.vcxproj --- a/make/vs/idav/idav.vcxproj Wed Nov 13 22:10:03 2024 +0100 +++ b/make/vs/idav/idav.vcxproj Thu Nov 14 17:25:23 2024 +0100 @@ -81,6 +81,10 @@ $(SolutionDir)..\..\build\vs\$(Platform)\$(Configuration)\ ..\..\..\build\vs\idav\$(Platform)\$(Configuration)\ + + $(SolutionDir)..\..\build\vs\$(Platform)\$(Configuration)\ + ..\..\..\build\vs\idav\$(Platform)\$(Configuration)\ + true @@ -131,12 +135,14 @@ Level3 true true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + false + _DEBUG;_CONSOLE;UI_WINUI;%(PreprocessorDefinitions) true + stdc17 + ..\..\..\ucx;..\vcpkg_installed\x64-windows\x64-windows\include;..\..\..\ui\;..\..\..;%(AdditionalIncludeDirectories) - Console + Windows true true true diff -r 6727ea0f8fbe -r a612adaee43d make/vs/libidav/libidav.vcxproj --- a/make/vs/libidav/libidav.vcxproj Wed Nov 13 22:10:03 2024 +0100 +++ b/make/vs/libidav/libidav.vcxproj Thu Nov 14 17:25:23 2024 +0100 @@ -46,7 +46,7 @@ Unicode - Application + StaticLibrary false v143 true @@ -75,6 +75,10 @@ $(SolutionDir)..\..\build\vs\$(Platform)\$(Configuration)\ ..\..\..\build\vs\libidav\$(Platform)\$(Configuration)\ + + $(SolutionDir)..\..\build\vs\$(Platform)\$(Configuration)\ + ..\..\..\build\vs\libidav\$(Platform)\$(Configuration)\ + true @@ -133,8 +137,10 @@ true true true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true + stdc17 + ..\..\..\ucx;..\vcpkg_installed\x64-windows\x64-windows\include Console diff -r 6727ea0f8fbe -r a612adaee43d make/vs/ucx/ucx.vcxproj --- a/make/vs/ucx/ucx.vcxproj Wed Nov 13 22:10:03 2024 +0100 +++ b/make/vs/ucx/ucx.vcxproj Thu Nov 14 17:25:23 2024 +0100 @@ -46,7 +46,7 @@ Unicode - Application + StaticLibrary false v143 true @@ -109,6 +109,7 @@ _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true stdc17 + MultiThreadedDebugDLL Console @@ -120,9 +121,10 @@ Level3 true true - true + false NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true + stdc17 Console diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.AppLifecycle.winmd Binary file make/vs/x64/Debug/Microsoft.Windows.AppLifecycle.winmd has changed diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.AppLifecycle.xml --- a/make/vs/x64/Debug/Microsoft.Windows.AppLifecycle.xml Wed Nov 13 22:10:03 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,235 +0,0 @@ - - - - Microsoft.Windows.AppLifecycle - - - - Provides static methods you can use to register and unregister for certain types of activations for your app. - - - Registers to activate the app when the specified file type is opened via ShellExecute, or the command-line. - One or more supported file types, specified by the file extension including the leading ., such as .docx. - The path to the image or resource used by Windows for the file type. For packaged apps, this parameter is a package-relative path to an image file. For unpackaged, this parameter is a literal filepath to a binary file (DLL, EXE) plus a resource index. - This display name used by Windows for the file type. - Zero or more app-defined verbs. Each verb is added to the File Explorer context menu when a registered file is right-clicked, and the selected verb is passed to the app as the IFileActivatedEventArgs.Verb property. - The path to the executable to be activated. If you pass an empty string, the current exectuable will be activated by default. Typically this parameter is specified if the caller of this method is the app's installer rather than the app itself. - - - Registers to activate the app when the specified URI scheme is executed via ShellExecute, or the command-line. - The URI scheme to register for activations, such as https. - The path to the image or resource used by Windows for the URI scheme. For packaged apps, this parameter is a package-relative path to an image file. For unpackaged, this parameter is a literal filepath to a binary file (DLL, EXE) plus a resource index. - This display name used by Windows for the URI scheme. - The path to the executable to be activated. If you pass an empty string, the current exectuable will be activated by default. Typically this parameter is specified if the caller of this method is the app's installer rather than the app itself. - - - Registers to activate the app when when the app is started by the user logging into the Windows OS, either because of a registry key, or because of a shortcut in a well-known startup folder. - An app-defined ID that can be used to unregister for startup activations later by using the UnregisterForStartupActivation method. - The path to the executable to be activated. If you pass an empty string, the current exectuable will be activated by default. Typically this parameter is specified if the caller of this method is the app's installer rather than the app itself. - - - Unregisters a file type activation that was registered earlier by using the RegisterForFileTypeActivation method. - The file type that was previously registered for protocol activation. - The path to the executable that was previously registered for protocol activation. - - - Unregisters a protocol activation that was registered earlier by using the RegisterForProtocolActivation method. - The URI scheme that was previously registered for protocol activation. - The path to the executable that was previously registered for protocol activation. - - - Unregisters a startup activation that was registered earlier by using the RegisterForStartupActivation method. - The task ID that was previously registered for protocol activation. - - - Contains information about the type and data payload for an app activation that was registered by using one of the static methods of the ActivationRegistrationManager class. - - - Gets the data payload for a registered activation. - The data payload for a registered activation. For more information about the type of this object, see the remarks. - - - Gets the type of a registered activation. - The type of a registered activation. - - - Represents an instance of an app. - - - Raised when an app activation is triggered that was registered by using one of the static methods of the ActivationRegistrationManager class. - - - Registers an app instance with the platform, or finds an existing instance if another instance has already registered this key. - A non-empty string as a key for the instance. - An app instance that represents the first app that registered the key. The caller can determine whether that instance is the current instance. - - - Retrieves the event args for an app activation that was registered by using one of the static methods of the ActivationRegistrationManager class. - An object that contains the activation type and the data payload. - - - Retrieves the current running instance of the app. - The current running instance of the app. - - - Retrieves a collection of all running instances of the app. - The collection of all running instances of the app. - - - Redirects the current activation request to another app instance. - The activation arguments to pass to the other app instance. - An object that represents the results of the asynchronous operation. - - - Unregisters a given key for this app instance. - - - Gets a value that indicates whether this AppInstance object represents the current instance of the app or a different instance. - true indicates that this AppInstance object represents the current instance of the app; false indicates it represents a different instance. - - - Gets an app-defined string value that identifies the current app instance for redirection purposes. - An app-defined string value that identifies the current app instance for redirection purposes. - - - Gets the process ID of the app instance. - The process ID of the app instance. - - - Defines values that represent activation types. - - - The user wants to manage appointments that are provided by the app. - - - The app was activated as a barcode scanner provider. - - - The user wants to save a file that the app provides content management for. - - - The app captures photos or video from an attached camera. - - - The app was launched from the command line. - - - Reserved for system use. - - - The user wants to handle calls or messages for the phone number of a contact that is provided by the app. - - - The app was launched from the My People UI. - - - The user wants to pick contacts. - - - The app handles AutoPlay. - - - This app was activated as a result of pairing a device. - - - This app was launched by another app on a different device by using the DIAL protocol. - - - An app launched a file whose file type this app is registered to handle. - - - The user wants to pick files that are provided by the app. - - - Reserved for system use. - - - The user wants to save a file and selected the app as the location. - - - The app was activated because it was launched by the OS due to a game's request for Xbox-specific UI. - - - The user launched the app or tapped a content tile. - - - The app was activated as the lock screen. - - - The app launches a call from the lock screen. If the user wants to accept the call, the app displays its call UI directly on the lock screen without requiring the user to unlock. A lock-screen call is a special type of launch activation. - - - Reserved for system use. - - - The app was activated by a phone call. - - - Windows Phone only. The app was activated after the completion of a picker. - - - Windows Phone only. The app was activated after the app was suspended for a file picker operation. - - - Windows Phone only. The app was activated after the app was suspended for a folder picker operation. - - - Windows Phone only. The app was activated after the app was suspended for a file save picker operation. - - - This app was launched by another app to provide a customized printing experience for a 3D printer. - - - The app was activated as print support job UI. - - - The app was activated as print support settings UI. - - - The app handles print tasks. - - - The app was activated because the user is printing to a printer that has a Print Workflow App associated with it which has requested user input. - - - An app launched a URI whose scheme name this app is registered to handle. - - - The app was launched by another app with the expectation that it will return a result back to the caller. - - - - The user launched the restricted app. - - - The user wants to search with the app. - - - The app is activated as a target for share operations. - - - The app was activated because the app is specified to launch at system startup or user log-in. - - - The app was activated when a user tapped on the body of a toast notification or performed an action inside a toast notification. - - - The app was launched to handle the user interface for account management. In circumstances where the system would have shown the default system user interface, it instead has invoked your app with the UserDataAccountProvider contract. The activation payload contains information about the type of operation being requested and all the information necessary to replicate the system-provided user interface. This activation kind is limited to 1st party apps. To use this field, you must add the userDataAccountsProvider capability in your app's package manifest. For more info see App capability declarations. - - - The app was activated as the result of a voice command. - - - The app was activated as a VPN app in the foreground. - - - Windows Phone only. The app was activated to perform a Wallet operation. - - - The app was activated by a web account provider. - - - Windows Phone only. The app was activated after the app was suspended for a web authentication broker operation. - - - \ No newline at end of file diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.ApplicationModel.DynamicDependency.winmd Binary file make/vs/x64/Debug/Microsoft.Windows.ApplicationModel.DynamicDependency.winmd has changed diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.ApplicationModel.DynamicDependency.xml --- a/make/vs/x64/Debug/Microsoft.Windows.ApplicationModel.DynamicDependency.xml Wed Nov 13 22:10:03 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ - - - - Microsoft.Windows.ApplicationModel.DynamicDependency - - - - Defines options that can be applied when adding a run-time reference to a framework package by using the PackageDependency.Add" method. - - - Creates a new instance of the AddPackageDependencyOptions class. - - - When you call the PackageDependency.Add" method and multiple packages are present in the package graph with the same rank as specified by the Rank property, this property indicates whether the resolved package is added before others of the same rank. - If true, the resolved package is added before others of the same rank. If false, the resolved package is not added before others of the same rank. - - - The rank to use to add the resolved package to the caller's package graph. - - - Defines criteria that can be applied when creating an install-time reference to a framework package by using the PackageDependency.Create" method. This informs the OS that your unpackaged app has a dependency upon a framework package that meets the specified criteria. - - - Creates a new instance of the CreatePackageDependencyOptions class. - - - Gets or sets the processor architectures of the framework package on which your unpackaged app has a dependency. - A bitwise combination of values that indicates the processor architectures of the framework package on which your unpackaged app has a dependency. - - - Gets or sets the name of the artifact used to define the lifetime of the package dependency, if the LifetimeArtifactKind property is set to PackageDependencyLifetimeArtifactKind.FilePath or PackageDependencyLifetimeArtifactKind.RegistryKey. - - - Gets or sets the type of artifact to use to define the lifetime of the package dependency. - The type of artifact to use to define the lifetime of the package dependency. - - - Gets or sets a value that indicates whether to disable dependency resolution when pinning a package dependency. This is useful for installers running as user contexts other than the target user (for example, installers running as LocalSystem). - Specify true to verify dependency resolution when pinning a package dependency; specify false to disable dependency resolution. - - - Represents a framework package on which the current app has a dependency, and includes members you can use to manage the lifetime of the dependency. - - - Adds a run-time reference for the framework package dependency you created earlier by using the Create method. After this method successfully returns, your app may activate types and use content from the framework package. - An object that provides context info about the framework package dependency and enables you to remove the run-time reference. - - - Adds a run-time reference for the framework package dependency you created earlier by using the Create method, with the specified options. After this method successfully returns, your app can activate types and use content from the framework package. - Defines additional options to specify the framework package reference. - An object that provides context info about the framework package dependency and enables you to remove the run-time reference. - - - Creates an install-time reference for a framework package dependency for the current app, using the specified package family name and minimum version. When you use this method, the framework package dependency is accessible to the current user only. To create a framework package dependency that is accessible to all users, use the CreateForSystem method instead. - The package family name of the framework package on which to take dependency. - The minimum version of the framework package on which to take dependency. - The object that represents the package dependency, and provides members you can use to manage the lifetime of the dependency. - - - Creates an install-time reference for a framework package dependency for the current app, using the specified package family name and minimum version and the specified options. When you use this method, the framework package dependency is accessible to the current user only. To create a framework package dependency that is accessible to all users, use the CreateForSystem method instead. - The package family name of the framework package on which to take dependency. - The minimum version of the framework package on which to take dependency. - Defines additional criteria to specify the framework package you want to use in your app. - The object that represents the package dependency, and provides members you can use to manage the lifetime of the dependency. - - - Creates an install-time reference for a framework package dependency for the current app, using the specified package family name and minimum version and the specified options. This method creates a framework package dependency that is accessible to all users, and this method requires that the caller has administrative privileges. To create a framework package dependency that is accessible only to the current user, use the Create method instead. - The package family name of the framework package on which to take dependency. - The minimum version of the framework package on which to take dependency. - Defines additional criteria to specify the framework package you want to use in your app. - The object that represents the package dependency, and provides members you can use to manage the lifetime of the dependency. - - - Deletes the install-time reference for the framework package dependency you created earlier by using the Create method. This method informs the OS that it is safe to remove the framework package if no other apps have a dependency on it. - - - Creates a new package dependency instance from the specified package dependency ID. - The existing package dependency ID from which to create the new package dependency object. - The object that represents the new package dependency, and provides members you can use to manage the lifetime of the dependency. - - - Creates a new package dependency instance from the specified package dependency ID. The package dependency is accessible to all users, , and this method requires that the caller has administrative privileges. - The existing package dependency ID from which to create the new package dependency object. - The object that represents the new package dependency, and provides members you can use to manage the lifetime of the dependency. - - - Gets the package graph's current generation ID. - The package graph's current generation ID. - - - Gets the ID of the package dependency. This value is available after successful calls to the Create and CreateForSystem methods. - The ID of the package dependency. - - - Provides context info about a resolved framework package dependency that was created by using the PackageDependency.Add method. - - - Creates a new instance of the PackageDependencyContext class based on the specified context ID. - The context ID on which to base the new PackageDependencyContext. - - - Removes a resolved package dependency from the current process' package graph (that is, a run-time reference for a framework package dependency that was added by using the PackageDependency.Add. - - - Gets the context ID of the resolved framework package dependency for the current context PackageDependencyContext object. - The context ID of the resolved framework package dependency for the current context PackageDependencyContext object. - - - Gets the ID of the resolved framework package dependency for the current context PackageDependencyContext object. - The ID of the resolved framework package dependency for the current context PackageDependencyContext object. - - - Gets the package full name for the resolved framework package dependency for the current context PackageDependencyContext object. - The package full name for the resolved framework package dependency for the current context PackageDependencyContext object. - - - Encapsulates a unique ID for a resolved framework package dependency that is described by a PackageDependencyContext object. - - - The unique ID for a resolved framework package dependency. - - - Defines the type of artifacts you can assign to the LifetimeArtifactKind property to define the lifetime of a package dependency. - - - The lifetime artifact is an absolute filename or path. The package dependency is implicitly deleted when this is deleted. - - - The current process is the lifetime artifact. The package dependency is implicitly deleted when the process terminates. - - - The lifetime artifact is a registry key in the format root\subkey, where root is one of the following: HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, HKEY_CLASSES_ROOT, or HKEY_USERS. The package dependency is implicitly deleted when this is deleted. - - - Defines the processor architectures for a framework package dependency that you create by using the PackageDependency.Create" method. - - - Specifies the ARM architecture. - - - Specifies the ARM64 architecture. - - - Specifies the neutral architecture. - - - No processor architecture is specified. - - - Specifies the x64 architecture. - - - Specifies the x86 architecture. - - - Specifies the x86/A64 architecture. - - - Represents the default rank value to use to resolve a framework package dependency when using the PackageDependency.Add" method. - - - Gets the default rank value to use to resolve a framework package dependency when using the PackageDependency.Add" method. - The default rank value (currently this value is 0). - - - \ No newline at end of file diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd Binary file make/vs/x64/Debug/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd has changed diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.xml --- a/make/vs/x64/Debug/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.xml Wed Nov 13 22:10:03 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ - - - - Microsoft.Windows.ApplicationModel.WindowsAppRuntime - - - - Provides access to deployment information for the Windows App SDK runtime. - - - Returns the current deployment status of the Windows App SDK runtime that is currently loaded. Use this method to identify if there is work required to install Windows App SDK runtime packages before the current app can use Windows App SDK features. - An object that provides deployment status and error information for the Windows App SDK runtime referenced by the current package. - - - Checks the status of the Windows App SDK runtime referenced by the current package and attempts to register any missing packages that can be registered. - An object that provides deployment status and error information for the Windows App SDK runtime referenced by the current package. - - - Provides deployment status and error information for the Windows App SDK runtime referenced by the current package. - - - Initializes a new instance of the DeploymentResult class. - The deployment status of the Windows App SDK runtime that is currently loaded. - The first encountered error if there was an error initializing the Windows App SDK runtime or getting the status of the runtime. - - - Gets the first encountered error if there was an error initializing the Windows App SDK runtime or getting the status of the runtime. - The first encountered error if there was an error initializing the Windows App SDK runtime or getting the status of the runtime. If there is no error, this property returns S_OK. - - - Gets the deployment status of the Windows App SDK runtime that is currently loaded. - The deployment status of the Windows App SDK runtime that is currently loaded. - - - Represents the deployment status of the Windows App SDK runtime that is currently loaded. - - - The Windows App SDK runtime is in a good deployment state. - - - The installation of a package for the Windows App SDK runtime failed. - - - A package install is required in order for the Windows App SDK runtime to be in a good deployment state. - - - The Windows App SDK runtime is in an unknown deployment state. - - - \ No newline at end of file diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.PushNotifications.winmd Binary file make/vs/x64/Debug/Microsoft.Windows.PushNotifications.winmd has changed diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.PushNotifications.xml --- a/make/vs/x64/Debug/Microsoft.Windows.PushNotifications.xml Wed Nov 13 22:10:03 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - Microsoft.Windows.PushNotifications - - - - diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.Security.AccessControl.winmd Binary file make/vs/x64/Debug/Microsoft.Windows.Security.AccessControl.winmd has changed diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.System.Power.winmd Binary file make/vs/x64/Debug/Microsoft.Windows.System.Power.winmd has changed diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.System.Power.xml --- a/make/vs/x64/Debug/Microsoft.Windows.System.Power.xml Wed Nov 13 22:10:03 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,194 +0,0 @@ - - - - Microsoft.Windows.System.Power - - - - Defines values that represent the status of the battery on the device. - - - The battery is charging. - - - The battery is discharging. - - - The battery is idle. - - - The battery is not present. - - - Defines values that represent the status of the display that is associated with the app's session. - - - The display is dimmed. - - - The display is off. - - - The display is on. - - - Defines values that represent the effective power mode of the device. - - - The device is in the balanced effective power mode. - - - The device is in battery saver mode. - - - The device is in the better battery effective power mode. - - - The device is in game mode power mode. - - - The device is in the high performance effective power mode. - - - The device is in the maximum performance effective power mode. - - - The device is in the windows mixed reality power mode. - - - Defines values that represent the battery saver states of the device. - - - Battery saver is disabled. - - - Battery saver is off. - - - Battery saver is on. - - - Battery saver is uninitialized. - - - Provides static events that notify your app of changes to the devices power state and static properties that provide access to current power state information. - - - Raised when the status of the battery on the device has changed. - - - Raised when the status of the display that is associated with the app's session. - - - Raised when the effective power mode of the device has changed. - - - Raised when battery saver has been turned off or on in response to changing power conditions. - - - Raised when the power source of the device has changed. - - - Raised when the power supply status of the device has changed. - - - Raised when the remaining charge percentage of the battery on the device has changed. - - - Raised when the remaining discharge time of the battery on the device has changed. - - - Raised when the system is busy. This indicates that the system will not be moving into an idle state in the near future and that the current time is a good time for components to perform background or idle tasks that would otherwise prevent the computer from entering an idle state. - - - Raised when the suspend status of the device has changed. - - - Raised when the user status associated with the app's session has changed. - - - Gets the current status of the battery on the device. - The current status of the battery. - - - Gets the current status of the display that is associated with the app's session. - The current status of the display that is associated with the app's session. - - - Gets the current effective power mode of the device. - The current effective power mode of the device. - - - Gets the current state of battery saver on the device. - - - Gets the current power source of the device. - The current power source of the device. - - - Gets the current power supply status of the device. - The current power supply status of the device. - - - Gets the remaining charge percentage of the battery on the device. - The remaining charge percentage of the battery. - - - Gets the remaining discharge time of the battery on the device. - The remaining discharge time of the battery. - - - Gets the current suspend status of the device. - The current suspend status of the device. - - - Gets the current user status associated with the app's session. - The current user present status of the device. - - - Defines values that represent the power source of the device. - - - The computer is powered by an AC power source (or similar, such as a laptop powered by a 12V automotive adapter). - - - The computer is powered by an onboard battery power source. - - - Defines values that represent the power supply status of the device. - - - Power supply is adequate. - - - Power supply is not adequate. - - - Power supply is not present. - - - Defines values that represent the suspend status of the device. - - - The device is automatically resuming from suspend state. - - - The device is entering suspend state. - - - The user has manually resumed the device from suspend state. - - - The suspend status is not initialized. - - - Defines values that represent the user status associated with the app's session. - - - The user is absent. - - - The user is present. - - - \ No newline at end of file diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.System.winmd Binary file make/vs/x64/Debug/Microsoft.Windows.System.winmd has changed diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.Windows.System.xml --- a/make/vs/x64/Debug/Microsoft.Windows.System.xml Wed Nov 13 22:10:03 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - Microsoft.Windows.System - - - - diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/Microsoft.WindowsAppRuntime.Bootstrap.dll Binary file make/vs/x64/Debug/Microsoft.WindowsAppRuntime.Bootstrap.dll has changed diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/idav.exe Binary file make/vs/x64/Debug/idav.exe has changed diff -r 6727ea0f8fbe -r a612adaee43d make/vs/x64/Debug/idav.pdb Binary file make/vs/x64/Debug/idav.pdb has changed diff -r 6727ea0f8fbe -r a612adaee43d ui/winui/button.cpp --- a/ui/winui/button.cpp Wed Nov 13 22:10:03 2024 +0100 +++ b/ui/winui/button.cpp Thu Nov 14 17:25:23 2024 +0100 @@ -98,6 +98,7 @@ UIElement elm = button; UiWidget* widget = new UiWidget(elm); ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); // register callback if (args.onclick) { @@ -175,6 +176,24 @@ } } +static void togglebutton_changed(UiObject *obj, bool checked, ui_callback onchange, void *onchangedata, int enable_state) { + if (onchange) { + UiEvent evt; + evt.obj = obj; + evt.window = obj->window; + evt.document = obj->ctx->document; + evt.eventdata = nullptr; + evt.intval = checked; + onchange(&evt, onchangedata); + } + if (enable_state > 0) { + if (checked) { + ui_set_group(obj->ctx, enable_state); + } else { + ui_unset_group(obj->ctx, enable_state); + } + } +} static UIWIDGET create_togglebutton(UiObject *obj, ToggleButton button, UiToggleArgs args) { UiObject* current = uic_current_obj(obj); @@ -187,6 +206,7 @@ UIElement elm = button; UiWidget* widget = new UiWidget(elm); ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); // bind variable UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_INTEGER); @@ -201,6 +221,15 @@ togglebutton_register_unchecked_observers(button, obj, var); } + if (args.enable_group > 0 || args.onchange) { + button.Checked([obj, args](IInspectable const& sender, RoutedEventArgs) { + togglebutton_changed(obj, true, args.onchange, args.onchangedata, args.enable_group); + }); + button.Unchecked([obj, args](IInspectable const& sender, RoutedEventArgs) { + togglebutton_changed(obj, false, args.onchange, args.onchangedata, args.enable_group); + }); + } + // add button to current container UI_APPLY_LAYOUT1(current, args); @@ -234,6 +263,7 @@ UIElement elm = button; UiWidget* widget = new UiWidget(elm); ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); // bind variable UiVar* var = nullptr; @@ -274,6 +304,7 @@ UIElement elm = button; UiWidget* widget = new UiWidget(elm); ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); UiVar* var = nullptr; if (args.value) { diff -r 6727ea0f8fbe -r a612adaee43d ui/winui/commandbar.cpp --- a/ui/winui/commandbar.cpp Wed Nov 13 22:10:03 2024 +0100 +++ b/ui/winui/commandbar.cpp Thu Nov 14 17:25:23 2024 +0100 @@ -136,6 +136,11 @@ button.Icon(ui_get_icon(item->args.icon)); } + UIElement elm = button; + UiWidget* widget = new UiWidget(elm); + ui_context_add_widget_destructor(obj->ctx, widget); + ui_set_widget_groups(obj->ctx, widget, item->args.groups); + // register callback if (item->args.onclick) { ui_callback cbfunc = item->args.onclick; @@ -170,6 +175,7 @@ UIElement elm = button; UiWidget* widget = new UiWidget(elm); ui_context_add_widget_destructor(obj->ctx, widget); + ui_set_widget_groups(obj->ctx, widget, item->args.groups); UiInteger* value = (UiInteger*)var->value; int64_t i = value->value; diff -r 6727ea0f8fbe -r a612adaee43d ui/winui/list.cpp --- a/ui/winui/list.cpp Wed Nov 13 22:10:03 2024 +0100 +++ b/ui/winui/list.cpp Thu Nov 14 17:25:23 2024 +0100 @@ -64,6 +64,7 @@ widget->data1 = args.model; widget->data2 = args.getvalue; ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); // bind var UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.list, args.varname, UI_VAR_LIST); @@ -135,6 +136,7 @@ widget->data1 = args.model; widget->data2 = args.getvalue; ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); // bind var UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.list, args.varname, UI_VAR_LIST); @@ -230,6 +232,7 @@ widget->data1 = args.model; widget->data2 = args.getvalue; ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); // bind var UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.list, args.varname, UI_VAR_LIST); diff -r 6727ea0f8fbe -r a612adaee43d ui/winui/text.cpp --- a/ui/winui/text.cpp Wed Nov 13 22:10:03 2024 +0100 +++ b/ui/winui/text.cpp Thu Nov 14 17:25:23 2024 +0100 @@ -62,6 +62,7 @@ UIElement elm = textarea; UiWidget* widget = new UiWidget(elm); ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_TEXT); if (var) { @@ -180,6 +181,7 @@ UIElement elm = textfield; UiWidget* widget = new UiWidget(elm); ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_STRING); if (var) { @@ -212,6 +214,7 @@ UIElement elm = textfield; UiWidget* widget = new UiWidget(elm); ui_context_add_widget_destructor(current->ctx, widget); + ui_set_widget_groups(current->ctx, widget, args.groups); UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.value, args.varname, UI_VAR_STRING); if (var) { diff -r 6727ea0f8fbe -r a612adaee43d ui/winui/toolkit.cpp --- a/ui/winui/toolkit.cpp Wed Nov 13 22:10:03 2024 +0100 +++ b/ui/winui/toolkit.cpp Thu Nov 14 17:25:23 2024 +0100 @@ -355,3 +355,27 @@ pool->EnqueueJob(job); } + + +void ui_set_widget_groups(UiContext *ctx, UIWIDGET widget, const int *groups) { + if(!groups) { + return; + } + size_t ngroups = uic_group_array_size(groups); + ui_set_widget_ngroups(ctx, widget, groups, ngroups); +} + +void ui_set_widget_ngroups(UiContext *ctx, UIWIDGET widget, const int *groups, size_t ngroups) { + if(ngroups > 0) { + uic_add_group_widget_i(ctx, widget, (ui_enablefunc)ui_set_enabled, groups, ngroups); + ui_set_enabled(widget, FALSE); + } +} + + +UIEXPORT void ui_set_enabled(UIWIDGET widget, int enabled) { + Control ctrl = widget->uielement.as(); + if (ctrl) { + ctrl.IsEnabled(enabled); + } +} diff -r 6727ea0f8fbe -r a612adaee43d ui/winui/toolkit.h --- a/ui/winui/toolkit.h Wed Nov 13 22:10:03 2024 +0100 +++ b/ui/winui/toolkit.h Thu Nov 14 17:25:23 2024 +0100 @@ -66,4 +66,7 @@ void ui_context_add_widget_destructor(UiContext* ctx, UiWidget* widget); void ui_context_add_container_destructor(UiContext* ctx, UiContainer *container); -UiEvent ui_create_int_event(UiObject* obj, int64_t i); \ No newline at end of file +UiEvent ui_create_int_event(UiObject* obj, int64_t i); + +void ui_set_widget_groups(UiContext *ctx, UIWIDGET widget, const int *groups); +void ui_set_widget_ngroups(UiContext *ctx, UIWIDGET widget, const int *groups, size_t ngroups); diff -r 6727ea0f8fbe -r a612adaee43d ui/winui/winui.vcxproj --- a/ui/winui/winui.vcxproj Wed Nov 13 22:10:03 2024 +0100 +++ b/ui/winui/winui.vcxproj Thu Nov 14 17:25:23 2024 +0100 @@ -68,7 +68,7 @@ false true - false + true @@ -91,6 +91,7 @@ _DEBUG;DISABLE_XAML_GENERATED_MAIN__;UI_WINUI;UI_WINUI_PCH;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) $(SolutionDir)..\..\ucx;%(AdditionalIncludeDirectories) stdc17 + MultiThreadedDebugDLL shell32.lib;gdi32.lib;%(AdditionalDependencies) @@ -98,11 +99,15 @@ - NDEBUG;%(PreprocessorDefinitions) + DISABLE_XAML_GENERATED_MAIN__;UI_WINUI;UI_WINUI_PCH;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + $(SolutionDir)..\..\ucx;%(AdditionalIncludeDirectories) + false + stdc17 true true + shell32.lib;gdi32.lib;%(AdditionalDependencies) @@ -171,27 +176,35 @@ NotUsing + NotUsing NotUsing + NotUsing NotUsing + NotUsing NotUsing + NotUsing NotUsing + NotUsing NotUsing + NotUsing NotUsing + NotUsing NotUsing + NotUsing @@ -272,6 +285,10 @@ $(SolutionDir)..\..\build\vs\$(Platform)\$(Configuration)\ ..\..\build\vs\winui\$(Platform)\$(Configuration)\ + + $(SolutionDir)..\..\build\vs\$(Platform)\$(Configuration)\ + ..\..\build\vs\winui\$(Platform)\$(Configuration)\ +