ASPiK SDK
x11frame.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 #pragma once
5 
6 #include "../../crect.h"
7 #include "../iplatformframe.h"
8 #include <memory>
9 #include <functional>
10 
11 //------------------------------------------------------------------------
12 namespace VSTGUI {
13 namespace X11 {
14 
15 //------------------------------------------------------------------------
17 {
18 public:
19  virtual void onEvent () = 0;
20 };
21 
22 //------------------------------------------------------------------------
24 {
25 public:
26  virtual void onTimer () = 0;
27 };
28 
29 //------------------------------------------------------------------------
31 {
32 public:
33  virtual bool registerEventHandler (int fd, IEventHandler* handler) = 0;
34  virtual bool unregisterEventHandler (IEventHandler* handler) = 0;
35 
36  virtual bool registerTimer (uint64_t interval, ITimerHandler* handler) = 0;
37  virtual bool unregisterTimer (ITimerHandler* handler) = 0;
38 };
39 
40 //------------------------------------------------------------------------
41 class FrameConfig : public IPlatformFrameConfig
42 {
43 public:
45 };
46 
47 //------------------------------------------------------------------------
48 class Frame : public IPlatformFrame, public IEventHandler
49 {
50 public:
51  Frame (IPlatformFrameCallback* frame, const CRect& size, uint32_t parent,
52  IPlatformFrameConfig* config);
53  ~Frame ();
54 
55  bool getGlobalPosition (CPoint& pos) const override;
56  bool setSize (const CRect& newSize) override;
57  bool getSize (CRect& size) const override;
58  bool getCurrentMousePosition (CPoint& mousePosition) const override;
59  bool getCurrentMouseButtons (CButtonState& buttons) const override;
60  bool setMouseCursor (CCursorType type) override;
61  bool invalidRect (const CRect& rect) override;
62  bool scrollRect (const CRect& src, const CPoint& distance) override;
63  bool showTooltip (const CRect& rect, const char* utf8Text) override;
64  bool hideTooltip () override;
65  void* getPlatformRepresentation () const override;
66  SharedPointer<IPlatformTextEdit> createPlatformTextEdit (
67  IPlatformTextEditCallback* textEdit) override;
68  SharedPointer<IPlatformOptionMenu> createPlatformOptionMenu () override;
69 #if VSTGUI_OPENGL_SUPPORT
70  SharedPointer<IPlatformOpenGLView> createPlatformOpenGLView () override;
71 #endif
72  SharedPointer<IPlatformViewLayer> createPlatformViewLayer (
73  IPlatformViewLayerDelegate* drawDelegate, IPlatformViewLayer* parentLayer) override;
74  SharedPointer<COffscreenContext> createOffscreenContext (CCoord width, CCoord height,
75  double scaleFactor) override;
76  DragResult doDrag (IDataPackage* source, const CPoint& offset, CBitmap* dragBitmap) override;
77  void setClipboard (const SharedPointer<IDataPackage>& data) override;
78  SharedPointer<IDataPackage> getClipboard () override;
79 
80  PlatformType getPlatformType () const override;
81 
82  void onEvent () override;
83 
84  void* getGtkWindow (); // return is Gtk::Window*
85 private:
86  struct Impl;
87  std::unique_ptr<Impl> impl;
88 };
89 
90 //------------------------------------------------------------------------
91 } // X11
92 } // VSTGUI
Definition: x11frame.h:16
Rect structure.
Definition: crect.h:17
Definition: vstguibase.h:299
Definition: x11frame.cpp:612
Encapsulates various platform depended kinds of bitmaps.
Definition: cbitmap.h:21
Definition: x11frame.h:23
Definition: customcontrols.cpp:8
Definition: iplatformviewlayer.h:13
Button and Modifier state.
Definition: cbuttonstate.h:34
Definition: x11frame.h:30
Definition: iplatformviewlayer.h:22
Definition: vstguibase.h:247
interface for drag&drop and clipboard data
Definition: idatapackage.h:15
Definition: x11frame.h:48
Point structure.
Definition: cpoint.h:17
Definition: x11frame.h:41