aboutsummaryrefslogtreecommitdiffstats
path: root/support/magicleap/Servo2D/code/inc/Servo2D.h
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-10-31 21:45:28 -0400
committerGitHub <noreply@github.com>2018-10-31 21:45:28 -0400
commitace632493552f903acbd76e4786a523b4a68d4ee (patch)
tree69c3af0a290a522bf9fed0d38ef17f7140d53421 /support/magicleap/Servo2D/code/inc/Servo2D.h
parenteea3c5d10e9e5d383402a43d8137728d08f1be80 (diff)
parentc2f33709d158eaf489a2eae848b6eec21a312e37 (diff)
downloadservo-ace632493552f903acbd76e4786a523b4a68d4ee.tar.gz
servo-ace632493552f903acbd76e4786a523b4a68d4ee.zip
Auto merge of #22066 - asajeffrey:magicleap-url-bar, r=jdm
Magic Leap URL bar <!-- Please describe your changes on the following line: --> This PR gets the URL bar in the Servo2D magic leap app to function: it shows the current URL, and navigates Servo when edited. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes do not require tests because we can't test on ML <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22066) <!-- Reviewable:end -->
Diffstat (limited to 'support/magicleap/Servo2D/code/inc/Servo2D.h')
-rw-r--r--support/magicleap/Servo2D/code/inc/Servo2D.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/support/magicleap/Servo2D/code/inc/Servo2D.h b/support/magicleap/Servo2D/code/inc/Servo2D.h
index 490c6d60ece..29477cf3cd8 100644
--- a/support/magicleap/Servo2D/code/inc/Servo2D.h
+++ b/support/magicleap/Servo2D/code/inc/Servo2D.h
@@ -9,6 +9,9 @@
#include <lumin/event/ControlTouchPadInputEventData.h>
#include <lumin/node/QuadNode.h>
#include <lumin/resource/PlanarResource.h>
+#include <lumin/ui/KeyboardDefines.h>
+#include <lumin/ui/node/UiButton.h>
+#include <lumin/ui/node/UiTextEdit.h>
#include <SceneDescriptor.h>
typedef struct Opaque ServoInstance;
@@ -48,6 +51,11 @@ public:
*/
Servo2D& operator=(Servo2D&&) = delete;
+ /**
+ * Update the browser history UI
+ */
+ void updateHistory(bool canGoBack, const char* url, bool canGoForward);
+
protected:
/**
* Initializes the Landscape Application.
@@ -93,6 +101,7 @@ protected:
virtual bool eventListener(lumin::ServerEvent* event) override;
bool touchpadEventListener(lumin::ControlTouchPadInputEventData* event);
bool keyEventListener(lumin::KeyInputEventData* event);
+ void urlBarEventListener();
/**
* Get the current cursor position, with respect to the viewport.
@@ -104,5 +113,8 @@ private:
lumin::Prism* prism_ = nullptr; // represents the bounded space where the App renders.
lumin::PlanarResource* plane_ = nullptr; // the plane we're rendering into
lumin::QuadNode* content_node_ = nullptr; // the node containing the plane
+ lumin::ui::UiButton* back_button_ = nullptr; // the back button
+ lumin::ui::UiButton* fwd_button_ = nullptr; // the forward button
+ lumin::ui::UiTextEdit* url_bar_ = nullptr; // the URL bar
ServoInstance* servo_ = nullptr; // the servo instance we're embedding
};