public IApplicationDisplayService(ViServiceType serviceType)
        {
            _serviceType  = serviceType;
            _displayInfo  = new List <DisplayInfo>();
            _openDisplays = new Dictionary <ulong, DisplayState>();

            void AddDisplayInfo(string name, bool layerLimitEnabled, ulong layerLimitMax, ulong width, ulong height)
            {
                DisplayInfo displayInfo = new DisplayInfo()
                {
                    Name = new Array64 <byte>(),
                    LayerLimitEnabled = layerLimitEnabled,
                    Padding           = new Array7 <byte>(),
                    LayerLimitMax     = layerLimitMax,
                    Width             = width,
                    Height            = height
                };

                Encoding.ASCII.GetBytes(name).AsSpan().CopyTo(displayInfo.Name.ToSpan());

                _displayInfo.Add(displayInfo);
            }

            AddDisplayInfo("Default", true, 1, 1920, 1080);
            AddDisplayInfo("External", true, 1, 1920, 1080);
            AddDisplayInfo("Edid", true, 1, 0, 0);
            AddDisplayInfo("Internal", true, 1, 1920, 1080);
            AddDisplayInfo("Null", false, 0, 1920, 1080);
        }
Exemple #2
0
        // GetDisplayService(u32) -> object<nn::visrv::sf::IApplicationDisplayService>
        public ResultCode GetDisplayService(ServiceCtx context)
        {
            ViServiceType serviceType = (ViServiceType)context.RequestData.ReadInt32();

            if (serviceType != ViServiceType.System)
            {
                return(ResultCode.PermissionDenied);
            }

            MakeObject(context, new IApplicationDisplayService(serviceType));

            return(ResultCode.Success);
        }
        // GetDisplayService(u32) -> object<nn::visrv::sf::IApplicationDisplayService>
        public ResultCode GetDisplayService(ServiceCtx context)
        {
            ViServiceType serviceType = (ViServiceType)context.RequestData.ReadInt32();

            if (serviceType != ViServiceType.Manager)
            {
                return(ResultCode.InvalidRange);
            }

            MakeObject(context, new IApplicationDisplayService(serviceType));

            return(ResultCode.Success);
        }