openEmbroider  0.1
an open source embroidery software
OE_display.h
1 /*
2  * Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr
3  *
4  * This software is provided 'as-is', without any express or implied
5  * warranty. In no event will the authors be held liable for any damages
6  * arising from the use of this software.
7  *
8  * Permission is granted to anyone to use this software for any purpose,
9  * including commercial applications, and to alter it and redistribute it
10  * freely, subject to the following restrictions:
11  *
12  * 1. The origin of this software must not be misrepresented; you must not
13  * claim that you wrote the original software. If you use this software
14  * in a product, an acknowledgment in the product documentation would be
15  * appreciated but is not required.
16  * 2. Altered source versions must be plainly marked as such, and must not be
17  * misrepresented as being the original software.
18  * 3. This notice may not be removed or altered from any source distribution.
19  *
20  */
21 
22 #ifndef OE_DISPLAY_H
23 #define OE_DISPLAY_H
24 
25 #include "OE_utils.h"
26 #include <stdint.h>
27 #include <vector>
28 //#include "OE_controller.h"
29 #include "OE_document.h"
30 #include <GLFW/glfw3.h>
31 
32 class OE_controller;
33 
35 {
36 public:
37 
38 
40  OE_display();
41  OE_display(OE_document* document,OE_controller* controller);
43  virtual ~OE_display();
44 
45  bool setDocument(OE_document * document);
46  bool setController(OE_controller* controller);
47 
48  virtual void mouse_Pos(double x, double y);
49  virtual void mouse_Button(int button, int action, int mods);
50  virtual void scroll(double xoffset, double yoffset);
51  virtual void resize(int width, int height);
52  virtual void key(int key, int scancode, int action, int mods);
53 
54  //void drawframe();
55 
56  virtual bool draw() = 0;
57  virtual void showAll();
58 
59  static float cx, cy;
60  static float zoom;
61  static int mouseX, mouseY, mouseXInit, mouseYInit;
62  static bool pan;
63  static int width, height;
64 
65  protected:
66 
67 
68  GLFWwindow* window;
69  const GLFWvidmode* mode;
70 
71 
72  OE_document * document = NULL;
73  OE_controller* controller = NULL;
74 
75  private:
76 
77 };
78 
79 #endif // OE_DISPLAY_H
OE_display()
Definition: OE_display.cpp:43
Definition: OE_display.h:34
Definition: OE_controller.h:39
Definition: OE_document.h:32
bool setDocument(OE_document *document)
draw the document on screen
Definition: OE_display.cpp:62
virtual ~OE_display()
Definition: OE_display.cpp:52
virtual void showAll()
move and zoom to see the entire document
Definition: OE_display.cpp:89