71 lines
1.8 KiB
C
71 lines
1.8 KiB
C
/*
|
|
Copyright 2013 Peter Nelson
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
#ifndef PUI_H
|
|
#define PUI_H
|
|
|
|
#include <FTGL/ftgl.h>
|
|
|
|
#include "textures.h"
|
|
#include "widget.h"
|
|
#include "button.h"
|
|
#include "container.h"
|
|
#include "label.h"
|
|
#include "knob.h"
|
|
#include "slider.h"
|
|
|
|
struct PUi : PTextures {
|
|
PuglView *view;
|
|
Container *widget;
|
|
|
|
Label *tooltip;
|
|
Widget *active;
|
|
int mx, my, mb, mm;
|
|
float scale;
|
|
bool close;
|
|
|
|
PUi() : view(NULL), widget(NULL), tooltip(NULL), active(NULL), mx(0), my(0), mb(0), mm(0), scale(1.f), close(false) {}
|
|
|
|
virtual ~PUi();
|
|
|
|
virtual void InitWidgets() = 0;
|
|
|
|
inline void Repaint() { puglPostRedisplay(this->view); }
|
|
|
|
void OnReshape(int w, int h);
|
|
|
|
void OnDisplay();
|
|
|
|
virtual void OnKeyboard(bool press, uint32_t key);
|
|
|
|
virtual void OnSpecial(bool press, PuglKey key);
|
|
|
|
void OnMotion(int x, int y);
|
|
|
|
void OnMouse(int button, bool press, int x, int y);
|
|
|
|
void OnScroll(float dx, float dy);
|
|
|
|
void OnClose();
|
|
|
|
virtual void ParameterChanged(const Widget *widget) = 0;
|
|
|
|
void SetFunc();
|
|
|
|
virtual void WidgetGrabbed(const Widget *widget, bool grabbed) {}
|
|
};
|
|
|
|
#endif /* PUI_H */
|