summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2014-12-22 18:08:48 +1300
committerLeith Bade <leith@mapbox.com>2014-12-23 09:29:45 +1300
commit0771e5046064875d323245873f457b87e8c4b447 (patch)
tree3d493f764a393afb3c4e934281aff519612bc966 /include
parent2731b582f24063e339c047635c6d7b2316eb8037 (diff)
downloadqtlocation-mapboxgl-0771e5046064875d323245873f457b87e8c4b447.tar.gz
Rename View functions to match conventions. Also tidy up view classes and remove C style casts. Closes #656
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/view.hpp6
-rw-r--r--include/mbgl/platform/default/glfw_view.hpp16
-rw-r--r--include/mbgl/platform/default/headless_view.hpp8
3 files changed, 15 insertions, 15 deletions
diff --git a/include/mbgl/map/view.hpp b/include/mbgl/map/view.hpp
index 513c73b483..75fcb4e641 100644
--- a/include/mbgl/map/view.hpp
+++ b/include/mbgl/map/view.hpp
@@ -33,18 +33,18 @@ public:
// Called from the render thread. Makes the GL context active in the current
// thread. This is typically just called once at the beginning of the
// renderer setup since the render thread doesn't switch the contexts.
- virtual void make_active() = 0;
+ virtual void activate() = 0;
// Called from the render thread. Makes the GL context inactive in the current
// thread. This is called once just before the rendering thread terminates.
- virtual void make_inactive() = 0;
+ virtual void deactivate() = 0;
virtual void notify() = 0;
// Notifies a watcher of map x/y/scale/rotation changes.
// Must only be called from the same thread that caused the change.
// Must not be called from the render thread.
- virtual void notify_map_change(MapChange change, timestamp delay = 0) = 0;
+ virtual void notifyMapChange(MapChange change, timestamp delay = 0) = 0;
protected:
mbgl::Map *map = nullptr;
diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp
index 6e91c1125e..8ec282891a 100644
--- a/include/mbgl/platform/default/glfw_view.hpp
+++ b/include/mbgl/platform/default/glfw_view.hpp
@@ -16,16 +16,16 @@ public:
void initialize(mbgl::Map *map);
void swap();
- void make_active();
- void make_inactive();
+ void activate();
+ void deactivate();
void notify();
- void notify_map_change(mbgl::MapChange change, mbgl::timestamp delay = 0);
+ void notifyMapChange(mbgl::MapChange change, mbgl::timestamp delay = 0);
static void key(GLFWwindow *window, int key, int scancode, int action, int mods);
static void scroll(GLFWwindow *window, double xoffset, double yoffset);
- static void resize(GLFWwindow *window, int, int);
- static void mouseclick(GLFWwindow *window, int button, int action, int modifiers);
- static void mousemove(GLFWwindow *window, double x, double y);
+ static void resize(GLFWwindow *window, int width, int height);
+ static void mouseClick(GLFWwindow *window, int button, int action, int modifiers);
+ static void mouseMove(GLFWwindow *window, double x, double y);
static void eventloop(void *arg);
@@ -35,12 +35,12 @@ public:
public:
bool fullscreen = false;
- double last_x = 0, last_y = 0;
+ double lastX = 0, lastY = 0;
bool tracking = false;
bool rotating = false;
- double last_click = -1;
+ double lastClick = -1;
GLFWwindow *window = nullptr;
};
diff --git a/include/mbgl/platform/default/headless_view.hpp b/include/mbgl/platform/default/headless_view.hpp
index a521cff547..387011aa0b 100644
--- a/include/mbgl/platform/default/headless_view.hpp
+++ b/include/mbgl/platform/default/headless_view.hpp
@@ -31,13 +31,13 @@ public:
std::unique_ptr<uint32_t[]> readPixels();
void notify();
- void notify_map_change(MapChange change, timestamp delay = 0);
- void make_active();
- void make_inactive();
+ void notifyMapChange(MapChange change, timestamp delay = 0);
+ void activate();
+ void deactivate();
void swap();
private:
- void clear_buffers();
+ void clearBuffers();
private:
std::shared_ptr<HeadlessDisplay> display_;