Browse Source

Fix build without blendish stuff

pull/6/head
falkTX 8 years ago
parent
commit
bb05e224bf
3 changed files with 5 additions and 14 deletions
  1. +0
    -4
      dgl/Makefile
  2. +4
    -9
      dgl/src/Common.hpp
  3. +1
    -1
      dgl/src/ImageWidgets.cpp

+ 0
- 4
dgl/Makefile View File

@@ -12,9 +12,6 @@ BUILD_C_FLAGS += $(DGL_FLAGS) -I. -Isrc
BUILD_CXX_FLAGS += $(DGL_FLAGS) -I. -Isrc
LINK_FLAGS += $(DGL_LIBS)

# needed by oui-blendish
BUILD_CXX_FLAGS += -Wno-unused-parameter

# --------------------------------------------------------------

OBJS = \
@@ -24,7 +21,6 @@ OBJS = \
src/Image.cpp.o \
src/ImageWidgets.cpp.o \
src/NanoVG.cpp.o \
src/NanoWidgets.cpp.o \
src/Resources.cpp.o \
src/Widget.cpp.o



+ 4
- 9
dgl/src/Common.hpp View File

@@ -18,7 +18,6 @@
#define DGL_COMMON_HPP_INCLUDED

#include "../ImageWidgets.hpp"
#include "../NanoWidgets.hpp"

START_NAMESPACE_DGL

@@ -35,15 +34,13 @@ struct ButtonImpl {
int state;
Widget* self;

BlendishButton::Callback* callback_b;
ImageButton::Callback* callback_i;
ImageButton::Callback* callback_img;

ButtonImpl(Widget* const s) noexcept
: button(-1),
state(kStateNormal),
self(s),
callback_b(nullptr),
callback_i(nullptr) {}
callback_img(nullptr) {}

bool onMouse(const Widget::MouseEvent& ev)
{
@@ -68,10 +65,8 @@ struct ButtonImpl {
state = kStateHover;
self->repaint();

if (callback_b != nullptr)
callback_b->blendishButtonClicked((BlendishButton*)self, button2);
if (callback_i != nullptr)
callback_i->imageButtonClicked((ImageButton*)self, button2);
if (callback_img != nullptr)
callback_img->imageButtonClicked((ImageButton*)self, button2);

return true;
}


+ 1
- 1
dgl/src/ImageWidgets.cpp View File

@@ -159,7 +159,7 @@ ImageButton::~ImageButton()

void ImageButton::setCallback(Callback* callback) noexcept
{
pData->impl.callback_i = callback;
pData->impl.callback_img = callback;
}

void ImageButton::onDisplay()


Loading…
Cancel
Save