- 3ds - Remove Gfx values that are present in Backend Tamplate - Move to default Palladium Namespace - Set the Input Flags - Desktop - Move to PD Namespace - Comment out old keyboard stuff - HidDriver needs a rewrite but is functional enough - Core - Add u128 class (only used in input driver so far - Drivers (Core) - Move Gfx to PD namespace - Move Vertex/Index Pos and Projection Mtx to Gfx template - Add Keyboard support with u128 to Hid - Add a Update func if no hiddriver is specified (to prevent crashes when requestign inputs) - Image - Add RGBA -> BGRA support (used in windows bitmaps iirc) - Lithium - Add Vertex/Index counters to drawlist - Add a LoadTTF from Mem func and let the loadfile func use PD::IO::LoadFile2Mem (looks cleaner) - Add LoadDefaultFont (which loads one of the integrated fonts if the PD_LI_INCLUDE_FONTS flag was passed on palaldium build) !!! Note that there are no fonts integrated yet due to i dont know how to handle licensing... - UI7 - Add MouseLeft support to Input handler - Use xy coords of the Viewport to create Menus inside it - Get num of Vertices/Indices out of FinalDrawList - Add some Palladium Info to metrics Menu - Readd Compiler string - pdfm - New tool that creates fonts.cpp/fonts.hpp
87 lines
2.6 KiB
C++
Executable File
87 lines
2.6 KiB
C++
Executable File
#pragma once
|
|
|
|
/*
|
|
MIT License
|
|
|
|
Copyright (c) 2024 - 2025 tobid7
|
|
|
|
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.
|
|
*/
|
|
|
|
#include <pd/core/core.hpp>
|
|
#include <pd/ui7/io.hpp>
|
|
#include <pd/ui7/menu.hpp>
|
|
#include <pd/ui7/pd_p_api.hpp>
|
|
|
|
#include "pd/ui7/flags.hpp"
|
|
|
|
/**
|
|
* Declare UI7 Version
|
|
* Format: 00 00 00 00
|
|
* Major Minor Patch Build
|
|
* 0x01010000 -> 1.1.0-0
|
|
*/
|
|
#define UI7_VERSION 0x00050100
|
|
|
|
namespace PD {
|
|
namespace UI7 {
|
|
/**
|
|
* Get UI7 Version String
|
|
* @param show_build Show build num (mostly unused)
|
|
* @return Version String (1.0.0-1 for example)
|
|
*/
|
|
PD_UI7_API std::string GetVersion(bool show_build = false);
|
|
/** Base Context for UI7 */
|
|
class PD_UI7_API Context {
|
|
public:
|
|
Context() { pIO = IO::New(); }
|
|
~Context() = default;
|
|
|
|
PD_SHARED(Context);
|
|
|
|
void AddViewPort(const ID &id, const ivec4 &vp);
|
|
void UseViewPort(const ID &id);
|
|
void Update();
|
|
bool BeginMenu(const ID &id, UI7MenuFlags flags = 0, bool *pShow = nullptr);
|
|
void EndMenu();
|
|
void AboutMenu(bool *show = nullptr);
|
|
void MetricsMenu(bool *show = nullptr);
|
|
void StyleEditor(bool *show = nullptr);
|
|
|
|
Li::DrawList::Ref GetDrawData() { return pIO->FDL; }
|
|
|
|
Menu::Ref pGetOrCreateMenu(const ID &id) {
|
|
auto menu = pMenus.find(id);
|
|
if (menu == pMenus.end()) {
|
|
pMenus[id] = Menu::New(id, pIO);
|
|
menu = pMenus.find(id);
|
|
}
|
|
return menu->second;
|
|
}
|
|
|
|
IO::Ref pIO;
|
|
/** Current Menu */
|
|
Menu::Ref pCurrent = nullptr;
|
|
std::vector<u32> pCurrentMenus;
|
|
std::vector<u32> pDFO; /** Debug Final Order */
|
|
std::unordered_map<u32, Menu::Ref> pMenus;
|
|
};
|
|
} // namespace UI7
|
|
} // namespace PD
|