Browse Source

Remove blendish and NanoWidgets code

pull/6/head
falkTX 8 years ago
parent
commit
c3e5d51999
5 changed files with 0 additions and 4674 deletions
  1. +0
    -77
      dgl/NanoWidgets.hpp
  2. +0
    -152
      dgl/src/NanoWidgets.cpp
  3. +0
    -21
      dgl/src/oui-blendish/LICENSE
  4. +0
    -2399
      dgl/src/oui-blendish/blendish.h
  5. +0
    -2025
      dgl/src/oui-blendish/oui.h

+ 0
- 77
dgl/NanoWidgets.hpp View File

@@ -1,77 +0,0 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2016 Filipe Coelho <falktx@falktx.com>
*
* 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.
*
* THE 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 DGL_NANO_WIDGETS_HPP_INCLUDED
#define DGL_NANO_WIDGETS_HPP_INCLUDED

#include "NanoVG.hpp"

START_NAMESPACE_DGL

// -----------------------------------------------------------------------

class BlendishWidget : public NanoWidget
{
public:
explicit BlendishWidget(Window& parent);
explicit BlendishWidget(NanoWidget* widget);

void loadSharedResources() override;
};

// -----------------------------------------------------------------------

class BlendishButton : public BlendishWidget
{
public:
class Callback
{
public:
virtual ~Callback() {}
virtual void blendishButtonClicked(BlendishButton* blendishButton, int button) = 0;
};

explicit BlendishButton(Window& parent, const char* text = "", int iconId = -1);
explicit BlendishButton(NanoWidget* widget, const char* text = "", int iconId = -1);
~BlendishButton() override;

int getIconId() const noexcept;
void setIconId(int iconId) noexcept;

const char* getText() const noexcept;
void setText(const char* text) noexcept;

void setCallback(Callback* callback) noexcept;

protected:
void onNanoDisplay() override;
bool onMouse(const MouseEvent&) override;
bool onMotion(const MotionEvent&) override;

private:
struct PrivateData;
PrivateData* const pData;

void _updateBounds();

DISTRHO_LEAK_DETECTOR(BlendishButton)
};

// -----------------------------------------------------------------------

END_NAMESPACE_DGL

#endif // DGL_NANO_WIDGETS_HPP_INCLUDED

+ 0
- 152
dgl/src/NanoWidgets.cpp View File

@@ -1,152 +0,0 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2016 Filipe Coelho <falktx@falktx.com>
*
* 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.
*
* THE 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.
*/

#include "Common.hpp"
#include "Resources.hpp"

#define BLENDISH_IMPLEMENTATION
#include "nanovg/nanovg.h"
#include "oui-blendish/blendish.h"
#include "../distrho/extra/String.hpp"

START_NAMESPACE_DGL

// -----------------------------------------------------------------------

BlendishWidget::BlendishWidget(Window& parent)
: NanoWidget(parent)
{
loadSharedResources();
}

BlendishWidget::BlendishWidget(NanoWidget* widget)
: NanoWidget(widget)
{
loadSharedResources();
}

void BlendishWidget::loadSharedResources()
{
if (nvgFindFont(fContext, NANOVG_DEJAVU_SANS_TTF) >= 0)
return;

using namespace dpf_resources;

bndSetFont(nvgCreateFontMem(fContext, NANOVG_DEJAVU_SANS_TTF, (const uchar*)dejavusans_ttf, dejavusans_ttf_size, 0));
bndSetIconImage(nvgCreateImageMem(fContext, 0, (const uchar*)blender_icons16_png, blender_icons16_png_size));
}

// -----------------------------------------------------------------------

struct BlendishButton::PrivateData {
ButtonImpl impl;
int iconId;
DISTRHO_NAMESPACE::String text;

PrivateData(Widget* const s, const char* const t, const int i) noexcept
: impl(s),
iconId(i),
text(t) {}

DISTRHO_DECLARE_NON_COPY_STRUCT(PrivateData)
};

// -----------------------------------------------------------------------

BlendishButton::BlendishButton(Window& parent, const char* text, int iconId)
: BlendishWidget(parent),
pData(new PrivateData(this, text, iconId))
{
_updateBounds();
}

BlendishButton::BlendishButton(NanoWidget* widget, const char* text, int iconId)
: BlendishWidget(widget),
pData(new PrivateData(this, text, iconId))
{
_updateBounds();
}

BlendishButton::~BlendishButton()
{
delete pData;
}

int BlendishButton::getIconId() const noexcept
{
return pData->iconId;
}

void BlendishButton::setIconId(int iconId) noexcept
{
if (pData->iconId == iconId)
return;

pData->iconId = iconId;
_updateBounds();
repaint();
}

const char* BlendishButton::getText() const noexcept
{
return pData->text;
}

void BlendishButton::setText(const char* text) noexcept
{
if (pData->text == text)
return;

pData->text = text;
_updateBounds();
repaint();
}

void BlendishButton::setCallback(Callback* callback) noexcept
{
pData->impl.callback_b = callback;
}

void BlendishButton::onNanoDisplay()
{
bndToolButton(getContext(),
getAbsoluteX(), getAbsoluteY(), getWidth(), getHeight(),
0, static_cast<BNDwidgetState>(pData->impl.state), pData->iconId, pData->text);
}

bool BlendishButton::onMouse(const MouseEvent& ev)
{
return pData->impl.onMouse(ev);
}

bool BlendishButton::onMotion(const MotionEvent& ev)
{
return pData->impl.onMotion(ev);
}

void BlendishButton::_updateBounds()
{
const float width = bndLabelWidth (getContext(), pData->iconId, pData->text);
const float height = bndLabelHeight(getContext(), pData->iconId, pData->text, width);

setSize(width, height);
}

// -----------------------------------------------------------------------

END_NAMESPACE_DGL

// -----------------------------------------------------------------------

+ 0
- 21
dgl/src/oui-blendish/LICENSE View File

@@ -1,21 +0,0 @@
Blendish - Blender 2.5 UI based theming functions for NanoVG

Copyright (c) 2014 Leonard Ritter <leonard.ritter@duangle.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

+ 0
- 2399
dgl/src/oui-blendish/blendish.h
File diff suppressed because it is too large
View File


+ 0
- 2025
dgl/src/oui-blendish/oui.h
File diff suppressed because it is too large
View File


Loading…
Cancel
Save