summaryrefslogtreecommitdiff
path: root/macosx
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-01-20 11:50:45 +0100
committerKonstantin Käfer <mail@kkaefer.com>2014-01-20 11:50:45 +0100
commit22178d6832115112656f145359d4acbd55770e43 (patch)
tree2979c739872ceff93de86beeaf36b2703e0563b1 /macosx
parentef15a1d1dcc10748a78694eb7347c72674279d3f (diff)
downloadqtlocation-mapboxgl-22178d6832115112656f145359d4acbd55770e43.tar.gz
rename settings => Settings
Diffstat (limited to 'macosx')
-rw-r--r--macosx/main.mm39
-rw-r--r--macosx/settings.hpp4
-rw-r--r--macosx/settings.mm8
3 files changed, 25 insertions, 26 deletions
diff --git a/macosx/main.mm b/macosx/main.mm
index 3f8d8a54f5..b053da148c 100644
--- a/macosx/main.mm
+++ b/macosx/main.mm
@@ -13,8 +13,8 @@ public:
tracking(false),
rotating(false),
last_click(-1),
- settings(new llmr::macosx_settings()),
- map(new llmr::map(settings)) {
+ settings(),
+ map(settings) {
}
void init() {
@@ -35,16 +35,16 @@ public:
glfwMakeContextCurrent(window);
- settings->load();
- map->setup();
+ settings.load();
+ map.setup();
int width, height;
glfwGetWindowSize(window, &width, &height);
- map->resize(width, height);
+ map.resize(width, height);
glfwSwapInterval(1);
- map->loadSettings();
+ map.loadSettings();
glfwSetCursorPosCallback(window, mousemove);
glfwSetMouseButtonCallback(window, mouseclick);
@@ -70,13 +70,13 @@ public:
glfwSetWindowShouldClose(window, true);
break;
case GLFW_KEY_TAB:
- view->map->toggleDebug();
+ view->map.toggleDebug();
break;
case GLFW_KEY_R:
- if (!mods) view->map->resetPosition();
+ if (!mods) view->map.resetPosition();
break;
case GLFW_KEY_N:
- if (!mods) view->map->resetNorth();
+ if (!mods) view->map.resetNorth();
break;
}
}
@@ -102,12 +102,12 @@ public:
scale = 1.0 / scale;
}
- view->map->scaleBy(scale, view->last_x, view->last_y);
+ view->map.scaleBy(scale, view->last_x, view->last_y);
}
static void resize(GLFWwindow *window, int width, int height) {
MapView *view = (MapView *)glfwGetWindowUserPointer(window);
- view->map->resize(width, height);
+ view->map.resize(width, height);
}
static void mouseclick(GLFWwindow *window, int button, int action, int modifiers) {
@@ -125,7 +125,7 @@ public:
if (action == GLFW_RELEASE) {
double now = glfwGetTime();
if (now - view->last_click < 0.4) {
- view->map->scaleBy(2.0, view->last_x, view->last_y);
+ view->map.scaleBy(2.0, view->last_x, view->last_y);
}
view->last_click = now;
}
@@ -135,9 +135,9 @@ public:
static void mousemove(GLFWwindow *window, double x, double y) {
MapView *view = (MapView *)glfwGetWindowUserPointer(window);
if (view->tracking) {
- view->map->moveBy(x - view->last_x, y - view->last_y);
+ view->map.moveBy(x - view->last_x, y - view->last_y);
} else if (view->rotating) {
- view->map->rotateBy(view->start_x, view->start_y, view->last_x, view->last_y, x, y);
+ view->map.rotateBy(view->start_x, view->start_y, view->last_x, view->last_y, x, y);
}
view->last_x = x;
view->last_y = y;
@@ -162,7 +162,7 @@ public:
}
bool render() {
- return map->render();
+ return map.render();
}
void fps() {
@@ -180,7 +180,6 @@ public:
}
~MapView() {
- delete map;
glfwTerminate();
}
@@ -195,8 +194,8 @@ public:
double last_click;
GLFWwindow *window;
- llmr::macosx_settings *settings;
- llmr::map *map;
+ llmr::Settings_MacOSX settings;
+ llmr::map map;
};
NSOperationQueue *queue = NULL;
@@ -242,7 +241,7 @@ void request(void *, tile::ptr tile) {
tile->setData((uint8_t *)[data bytes], [data length]);
if (tile->parse()) {
dispatch_async(dispatch_get_main_queue(), ^ {
- view->map->tileLoaded(tile);
+ view->map.tileLoaded(tile);
});
return;
}
@@ -250,7 +249,7 @@ void request(void *, tile::ptr tile) {
}
dispatch_async(dispatch_get_main_queue(), ^ {
- view->map->tileFailed(tile);
+ view->map.tileFailed(tile);
});
}];
}
diff --git a/macosx/settings.hpp b/macosx/settings.hpp
index 7c23f829ea..7f5866c501 100644
--- a/macosx/settings.hpp
+++ b/macosx/settings.hpp
@@ -5,9 +5,9 @@
namespace llmr {
-class macosx_settings : public settings {
+class Settings_MacOSX : public Settings {
public:
- macosx_settings();
+ Settings_MacOSX();
virtual void save();
virtual void load();
virtual void clear();
diff --git a/macosx/settings.mm b/macosx/settings.mm
index 31395781ff..7b7d294f6b 100644
--- a/macosx/settings.mm
+++ b/macosx/settings.mm
@@ -5,7 +5,7 @@
using namespace llmr;
-macosx_settings::macosx_settings() {
+Settings_MacOSX::Settings_MacOSX() {
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
// position
@@ -23,7 +23,7 @@ macosx_settings::macosx_settings() {
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
}
-void macosx_settings::load() {
+void Settings_MacOSX::load() {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
// position
@@ -36,7 +36,7 @@ void macosx_settings::load() {
debug = [defaults boolForKey:@"debug"];
}
-void macosx_settings::save() {
+void Settings_MacOSX::save() {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
@@ -57,6 +57,6 @@ void macosx_settings::save() {
[defaults synchronize];
}
-void macosx_settings::clear() {
+void Settings_MacOSX::clear() {
// TODO
}