Skip to content

Commit 03f7d83

Browse files
committed
Bump to latest
- Apply to start adding in APIs for adding legacy renderers via assembly scanning (dotnet#1333) - Update to IMauiContext (dotnet#1357) - and so on
1 parent 813a810 commit 03f7d83

11 files changed

+45
-404
lines changed

src/Compatibility/Core/src/AppHostBuilderExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
using OpenGLViewRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer;
4141
using StreamImagesourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.StreamImageSourceHandler;
4242
using ImageLoaderSourceHandler = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.UriImageSourceHandler;
43+
using DefaultRenderer = Microsoft.Maui.Controls.Compatibility.Platform.Tizen.DefaultRenderer;
4344
#endif
4445

4546
namespace Microsoft.Maui.Controls.Compatibility.Hosting

src/Compatibility/Core/src/RendererToHandlerShim.Tizen.cs

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -29,105 +29,5 @@ public override ERect GetNativeContentGeometry()
2929
{
3030
return VisualElementRenderer?.GetNativeContentGeometry() ?? new ERect();
3131
}
32-
33-
//public static IViewHandler CreateShim(object renderer)
34-
//{
35-
// if (renderer is IViewHandler handler)
36-
// return handler;
37-
38-
// if (renderer is IVisualElementRenderer ivr)
39-
// return new RendererToHandlerShim(ivr);
40-
41-
// return new RendererToHandlerShim();
42-
//}
43-
44-
//public RendererToHandlerShim() : base(ViewHandler.ViewMapper)
45-
//{
46-
//}
47-
48-
//public RendererToHandlerShim(IVisualElementRenderer visualElementRenderer) : this()
49-
//{
50-
// if (visualElementRenderer != null)
51-
// SetupRenderer(visualElementRenderer);
52-
//}
53-
54-
//public void SetupRenderer(IVisualElementRenderer visualElementRenderer)
55-
//{
56-
// VisualElementRenderer = visualElementRenderer;
57-
// VisualElementRenderer.ElementChanged += OnElementChanged;
58-
59-
// if (VisualElementRenderer.Element is IView view)
60-
// {
61-
// view.Handler = this;
62-
// SetVirtualView(view);
63-
// }
64-
// else if (VisualElementRenderer.Element != null)
65-
// throw new Exception($"{VisualElementRenderer.Element} must implement: {nameof(IView)}");
66-
//}
67-
68-
//void OnElementChanged(object sender, VisualElementChangedEventArgs e)
69-
//{
70-
// if (e.OldElement is IView view)
71-
// view.Handler = null;
72-
73-
// if (e.NewElement is IView newView)
74-
// {
75-
// newView.Handler = this;
76-
// this.SetVirtualView(newView);
77-
// }
78-
// else if (e.NewElement != null)
79-
// throw new Exception($"{e.NewElement} must implement: {nameof(IView)}");
80-
//}
81-
82-
//protected override EvasObject CreateNativeView()
83-
//{
84-
// return VisualElementRenderer.NativeView;
85-
//}
86-
87-
//protected override void ConnectHandler(EvasObject nativeView)
88-
//{
89-
// base.ConnectHandler(nativeView);
90-
// VirtualView.Handler = this;
91-
//}
92-
93-
//protected override void DisconnectHandler(EvasObject nativeView)
94-
//{
95-
// Platform.Tizen.Platform.SetRenderer(VisualElementRenderer.Element, VisualElementRenderer);
96-
97-
// VisualElementRenderer.SetElement(null);
98-
99-
// base.DisconnectHandler(nativeView);
100-
// VirtualView.Handler = null;
101-
//}
102-
103-
//public override void SetVirtualView(IView view)
104-
//{
105-
// if (VisualElementRenderer == null)
106-
// {
107-
// var renderer = Internals.Registrar.Registered.GetHandlerForObject<IVisualElementRenderer>(view) ?? new DefaultRenderer();
108-
109-
// SetupRenderer(renderer);
110-
// }
111-
112-
// if (VisualElementRenderer.Element != view)
113-
// {
114-
// VisualElementRenderer.SetElement((VisualElement)view);
115-
// }
116-
// else
117-
// {
118-
// base.SetVirtualView(view);
119-
// }
120-
121-
// Platform.Tizen.Platform.SetRenderer(VisualElementRenderer.Element, VisualElementRenderer);
122-
//}
123-
124-
//public override void UpdateValue(string property)
125-
//{
126-
// base.UpdateValue(property);
127-
// if (property == "Frame")
128-
// {
129-
// NativeArrange(VisualElementRenderer.Element.Bounds);
130-
// }
131-
//}
13232
}
13333
}

src/Compatibility/Core/src/Tizen/ExportCellAttribute.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Compatibility/Core/src/Tizen/ExportHandlerAttribute.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Compatibility/Core/src/Tizen/ExportImageSourceHandlerAttribute.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Compatibility/Core/src/Tizen/ExportRendererAttribute.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/Compatibility/Core/src/Tizen/Forms.cs

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -467,124 +467,6 @@ static void SetupInit(IMauiContext context, InitializationOptions options = null
467467
IsInitialized = true;
468468
}
469469

470-
// Once we get essentials/cg converted to using startup.cs
471-
// we will delete all the renderer code inside this file
472-
internal static void RenderersRegistered()
473-
{
474-
IsInitializedRenderers = true;
475-
}
476-
477-
internal static void RegisterCompatRenderers(InitializationOptions options)
478-
{
479-
if (!IsInitializedRenderers)
480-
{
481-
IsInitializedRenderers = true;
482-
if (options != null)
483-
{
484-
s_platformType = options.PlatformType;
485-
s_useMessagingCenter = options.UseMessagingCenter;
486-
UseSkiaSharp = options.UseSkiaSharp;
487-
UseFastLayout = options.UseFastLayout;
488-
489-
// renderers
490-
if (options.Handlers != null)
491-
{
492-
Registrar.RegisterRenderers(options.Handlers);
493-
}
494-
else
495-
{
496-
// static registrar
497-
if (options.StaticRegistarStrategy != StaticRegistrarStrategy.None)
498-
{
499-
s_staticRegistrarStrategy = options.StaticRegistarStrategy;
500-
StaticRegistrar.RegisterHandlers(options.CustomHandlers);
501-
502-
if (options.StaticRegistarStrategy == StaticRegistrarStrategy.All)
503-
{
504-
Registrar.RegisterAll(new Type[]
505-
{
506-
typeof(ExportRendererAttribute),
507-
typeof(ExportImageSourceHandlerAttribute),
508-
typeof(ExportCellAttribute),
509-
typeof(ExportHandlerAttribute),
510-
typeof(ExportFontAttribute)
511-
});
512-
513-
if (UseSkiaSharp)
514-
RegisterSkiaSharpRenderers();
515-
}
516-
}
517-
else
518-
{
519-
Registrar.RegisterAll(new Type[]
520-
{
521-
typeof(ExportRendererAttribute),
522-
typeof(ExportImageSourceHandlerAttribute),
523-
typeof(ExportCellAttribute),
524-
typeof(ExportHandlerAttribute),
525-
typeof(ExportFontAttribute)
526-
});
527-
528-
if (UseSkiaSharp)
529-
RegisterSkiaSharpRenderers();
530-
531-
if (UseFastLayout)
532-
Registrar.Registered.Register(typeof(Layout), typeof(FastLayoutRenderer));
533-
}
534-
}
535-
536-
// effects
537-
var effectScopes = options.EffectScopes;
538-
if (effectScopes != null)
539-
{
540-
for (var i = 0; i < effectScopes.Length; i++)
541-
{
542-
var effectScope = effectScopes[0];
543-
Registrar.RegisterEffects(effectScope.Name, effectScope.Effects);
544-
}
545-
}
546-
547-
// css
548-
Registrar.RegisterStylesheets(options.Flags);
549-
}
550-
else
551-
{
552-
Registrar.RegisterAll(new Type[]
553-
{
554-
typeof(ExportRendererAttribute),
555-
typeof(ExportImageSourceHandlerAttribute),
556-
typeof(ExportCellAttribute),
557-
typeof(ExportHandlerAttribute),
558-
typeof(ExportFontAttribute)
559-
});
560-
}
561-
}
562-
}
563-
564-
internal static void RegisterCompatRenderers(
565-
Assembly[] assemblies,
566-
Assembly defaultRendererAssembly,
567-
Action<Type> viewRegistered)
568-
{
569-
if (IsInitializedRenderers)
570-
return;
571-
572-
IsInitializedRenderers = true;
573-
574-
// Only need to do this once
575-
Controls.Internals.Registrar.RegisterAll(
576-
assemblies,
577-
defaultRendererAssembly,
578-
new[] {
579-
typeof(ExportRendererAttribute),
580-
typeof(ExportImageSourceHandlerAttribute),
581-
typeof(ExportCellAttribute),
582-
typeof(ExportHandlerAttribute),
583-
typeof(ExportFontAttribute)
584-
}, default(InitializationFlags),
585-
viewRegistered);
586-
}
587-
588470
static void RegisterSkiaSharpRenderers()
589471
{
590472
// Register all skiasharp-based rednerers here.

0 commit comments

Comments
 (0)