forked from microsoft/react-native-windows
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes microsoft#64 - Adds UIImplementation
Adds various other stubs that we will need to implement as we move forward.
- Loading branch information
Showing
18 changed files
with
941 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace ReactNative.UIManager | ||
{ | ||
public class CatalystStylesDiffMap | ||
{ | ||
private JObject properties; | ||
|
||
public CatalystStylesDiffMap(JObject properties) | ||
{ | ||
this.properties = properties; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
|
||
namespace ReactNative.UIManager | ||
{ | ||
class NativeViewHierarchyOptimizer | ||
{ | ||
private readonly UIViewOperationQueue _uiViewOperationQueue; | ||
private readonly ShadowNodeRegistry _shadowNodeRegistry; | ||
|
||
public NativeViewHierarchyOptimizer( | ||
UIViewOperationQueue uiViewOperationQueue, | ||
ShadowNodeRegistry shadowNodeRegistry) | ||
{ | ||
_uiViewOperationQueue = uiViewOperationQueue; | ||
_shadowNodeRegistry = shadowNodeRegistry; | ||
} | ||
|
||
internal void OnBatchComplete() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
internal void HandleCreateView(ReactShadowNode cssNode, ThemedReactContext themedContext, CatalystStylesDiffMap styles) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
internal void HandleUpdateView(ReactShadowNode cssNode, string className, CatalystStylesDiffMap styles) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
internal void HandleManageChildren(ReactShadowNode cssNodeToManage, int[] indicesToRemove, int[] tagsToRemove, ViewAtIndex[] viewsToAdd, int[] tagsToDelete) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
internal void HandleRemoveNode(ReactShadowNode nodeToRemove) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Newtonsoft.Json.Linq; | ||
using ReactNative.UIManager.Events; | ||
using System; | ||
|
||
namespace ReactNative.UIManager | ||
{ | ||
class OnLayoutEvent : Event | ||
{ | ||
private int _x; | ||
private int _y; | ||
private int _width; | ||
private int _height; | ||
|
||
private OnLayoutEvent(int viewTag, int x, int y, int width, int height) | ||
: base(viewTag, TimeSpan.FromTicks(Environment.TickCount)) | ||
{ | ||
_x = x; | ||
_y = y; | ||
_width = width; | ||
_height = height; | ||
} | ||
|
||
public override string EventName | ||
{ | ||
get | ||
{ | ||
return "topLayout"; | ||
} | ||
} | ||
|
||
public override void Dispatch(RCTEventEmitter eventEmitter) | ||
{ | ||
var eventArgs = new JObject | ||
{ | ||
{ "target", ViewTag }, | ||
{ "layout", null /* TODO: create layout arguments */ }, | ||
}; | ||
|
||
eventEmitter.receiveEvent(ViewTag, EventName, eventArgs); | ||
} | ||
|
||
public static OnLayoutEvent Obtain(int viewTag, int x, int y, int width, int height) | ||
{ | ||
// TODO: Introduce pooling mechanism | ||
return new OnLayoutEvent(viewTag, x, y, width, height); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.