X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fcanvas%2FCanvasEvent.hxx;h=c3121269e90c90435e16eab424bac5f34c3ab5d1;hb=efbec8b3671f4f909461f458fb9aa96bb86d6164;hp=88cb42161551029c8432fd2b49d48a712659bdcd;hpb=77946585b1c9b54c4848b604eb1549e2ec55df12;p=simgear.git diff --git a/simgear/canvas/CanvasEvent.hxx b/simgear/canvas/CanvasEvent.hxx index 88cb4216..c3121269 100644 --- a/simgear/canvas/CanvasEvent.hxx +++ b/simgear/canvas/CanvasEvent.hxx @@ -1,4 +1,4 @@ -// Canvas Event for event model similar to DOM Level 2 Event Model +// Canvas Event for event model similar to DOM Level 3 Event Model // // Copyright (C) 2012 Thomas Geymayer // @@ -26,7 +26,7 @@ namespace simgear namespace canvas { - struct Event + class Event { public: @@ -41,12 +41,28 @@ namespace canvas }; Type type; - ElementWeakPtr target; + ElementWeakPtr target, + current_target; + double time; + bool propagation_stopped; Event(); + + // We need a vtable to allow nasal::Ghost to determine the dynamic type + // of the actual event instances. + virtual ~Event(); + Type getType() const; std::string getTypeString() const; + ElementWeakPtr getTarget() const; + ElementWeakPtr getCurrentTarget() const; + + double getTime() const; + + void stopPropagation(); + + static Type strToType(const std::string& str); };