packages feed

dear-imgui-impl-null (empty) → 1.0.0

raw patch · 11 files changed

+530/−0 lines, 11 filesdep +basedep +dear-imgui-raw

Dependencies added: base, dear-imgui-raw

Files

+ CHANGELOG.md view
@@ -0,0 +1,13 @@+# Changelog for `dear-imgui-impl-null`++All notable changes to this package will be documented in this file.++The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),+and this project adheres to the+[Haskell Package Versioning Policy](https://pvp.haskell.org/).++## 1.0.0 - 2026-10-21++Initial release.++- Generated with dear_bindings `v0.26` from Dear ImGui `v1.93.0-docking`.
+ LICENSE view
@@ -0,0 +1,26 @@+Copyright 2026 IC Rainbow++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++1.  Redistributions of source code must retain the above copyright notice, this+    list of conditions and the following disclaimer.++2.  Redistributions in binary form must reproduce the above copyright notice,+    this list of conditions and the following disclaimer in the documentation+    and/or other materials provided with the distribution.++3.  Neither the name of the copyright holder nor the names of its contributors+    may be used to endorse or promote products derived from this software+    without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,5 @@+# dear-imgui-impl-null++Null platform and renderer backend for [Dear ImGui], for headless use and tests.++[Dear ImGui]: https://github.com/ocornut/imgui
+ cbits/DearImGuiWrappers.cpp view
@@ -0,0 +1,3 @@+// Generated by dear-bindings-ffi. Do not edit.+#include "DearImGuiWrappers.h"+
+ cbits/DearImGuiWrappers.h view
@@ -0,0 +1,16 @@+// Generated by dear-bindings-ffi. Do not edit.+#ifndef DEAR_IMGUI_WRAPPERS_H+#define DEAR_IMGUI_WRAPPERS_H++#include "dcimgui_impl_null.h"++#ifdef __cplusplus+extern "C" {+#endif+++#ifdef __cplusplus+}+#endif++#endif
+ cbits/dcimgui_impl_null.cpp view
@@ -0,0 +1,148 @@+// THIS FILE HAS BEEN AUTO-GENERATED BY THE 'DEAR BINDINGS' GENERATOR.+// **DO NOT EDIT DIRECTLY**+// https://github.com/dearimgui/dear_bindings++#include "imgui.h"+#include "imgui_impl_null.h"++#include <stdio.h>++// Wrap this in a namespace to keep it separate from the C++ API+// This define prevents #defines in the header getting defined again (as they are already in the normal header above),+// and thus generating redefinition warnings+#define DEAR_BINDINGS_INTERNAL_GLUE_CODE+namespace cimgui+{+#include "dcimgui_impl_null.h"+}+#undef DEAR_BINDINGS_INTERNAL_GLUE_CODE++// By-value struct conversions++static inline cimgui::ImVec2 ConvertFromCPP_ImVec2(const ::ImVec2& src)+{+    cimgui::ImVec2 dest;+    dest.x = src.x;+    dest.y = src.y;+    return dest;+}++static inline ::ImVec2 ConvertToCPP_ImVec2(const cimgui::ImVec2& src)+{+    ::ImVec2 dest;+    dest.x = src.x;+    dest.y = src.y;+    return dest;+}++static inline cimgui::ImVec4 ConvertFromCPP_ImVec4(const ::ImVec4& src)+{+    cimgui::ImVec4 dest;+    dest.x = src.x;+    dest.y = src.y;+    dest.z = src.z;+    dest.w = src.w;+    return dest;+}++static inline ::ImVec4 ConvertToCPP_ImVec4(const cimgui::ImVec4& src)+{+    ::ImVec4 dest;+    dest.x = src.x;+    dest.y = src.y;+    dest.z = src.z;+    dest.w = src.w;+    return dest;+}++static inline cimgui::ImTextureRef ConvertFromCPP_ImTextureRef(const ::ImTextureRef& src)+{+    cimgui::ImTextureRef dest;+    dest._TexData = reinterpret_cast<cimgui::ImTextureData*>(src._TexData);+    dest._TexID = src._TexID;+    return dest;+}++static inline ::ImTextureRef ConvertToCPP_ImTextureRef(const cimgui::ImTextureRef& src)+{+    ::ImTextureRef dest;+    dest._TexData = reinterpret_cast<::ImTextureData*>(src._TexData);+    dest._TexID = src._TexID;+    return dest;+}++static inline cimgui::ImColor ConvertFromCPP_ImColor(const ::ImColor& src)+{+    cimgui::ImColor dest;+    dest.Value.x = src.Value.x;+    dest.Value.y = src.Value.y;+    dest.Value.z = src.Value.z;+    dest.Value.w = src.Value.w;+    return dest;+}++static inline ::ImColor ConvertToCPP_ImColor(const cimgui::ImColor& src)+{+    ::ImColor dest;+    dest.Value.x = src.Value.x;+    dest.Value.y = src.Value.y;+    dest.Value.z = src.Value.z;+    dest.Value.w = src.Value.w;+    return dest;+}++// Function stubs++#ifndef IMGUI_DISABLE++CIMGUI_IMPL_API bool cimgui::cImGui_ImplNull_Init(void)+{+    return ::ImGui_ImplNull_Init();+}++CIMGUI_IMPL_API void cimgui::cImGui_ImplNull_Shutdown(void)+{+    ::ImGui_ImplNull_Shutdown();+}++CIMGUI_IMPL_API void cimgui::cImGui_ImplNull_NewFrame(void)+{+    ::ImGui_ImplNull_NewFrame();+}++CIMGUI_IMPL_API bool cimgui::cImGui_ImplNullPlatform_Init(void)+{+    return ::ImGui_ImplNullPlatform_Init();+}++CIMGUI_IMPL_API void cimgui::cImGui_ImplNullPlatform_Shutdown(void)+{+    ::ImGui_ImplNullPlatform_Shutdown();+}++CIMGUI_IMPL_API void cimgui::cImGui_ImplNullPlatform_NewFrame(void)+{+    ::ImGui_ImplNullPlatform_NewFrame();+}++CIMGUI_IMPL_API bool cimgui::cImGui_ImplNullRender_Init(void)+{+    return ::ImGui_ImplNullRender_Init();+}++CIMGUI_IMPL_API void cimgui::cImGui_ImplNullRender_Shutdown(void)+{+    ::ImGui_ImplNullRender_Shutdown();+}++CIMGUI_IMPL_API void cimgui::cImGui_ImplNullRender_NewFrame(void)+{+    ::ImGui_ImplNullRender_NewFrame();+}++CIMGUI_IMPL_API void cimgui::cImGui_ImplNullRender_RenderDrawData(cimgui::ImDrawData* draw_data)+{+    ::ImGui_ImplNullRender_RenderDrawData(reinterpret_cast<::ImDrawData*>(draw_data));+}++#endif // #ifndef IMGUI_DISABLE
+ cbits/dcimgui_impl_null.h view
@@ -0,0 +1,61 @@+// THIS FILE HAS BEEN AUTO-GENERATED BY THE 'DEAR BINDINGS' GENERATOR.+// **DO NOT EDIT DIRECTLY**+// https://github.com/dearimgui/dear_bindings++// Dear Bindings version as a string+#ifndef DEAR_BINDINGS_VERSION+#define DEAR_BINDINGS_VERSION "0.26"+#endif++// Dear Bindings version as an integer+#ifndef DEAR_BINDINGS_VERSION_NUMBER+#define DEAR_BINDINGS_VERSION_NUMBER 26+#endif++// dear imgui: Null Platform+Renderer Backends+// ImDrawIdx: vertex index. [Compile-time configurable type]+// - To use 16-bit indices + allow large meshes: backend need to set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset (recommended).+// - To use 32-bit indices: override with '#define ImDrawIdx unsigned int' in your imconfig.h file.+#ifndef ImDrawIdx+typedef unsigned short ImDrawIdx;  // Default: 16-bit (for maximum compatibility with renderer backends)+#endif // #ifndef ImDrawIdx+// This is designed if you need to use a blind Dear Imgui context with no input and no output.++// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.+// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.+// Learn about Dear ImGui:+// - FAQ                  https://dearimgui.com/faq+// - Getting Started      https://dearimgui.com/getting-started+// - Documentation        https://dearimgui.com/docs (same as your local docs/ folder).+// - Introduction, links and more at the top of imgui.cpp++#pragma once++#ifdef __cplusplus+extern "C"+{+#endif+#include "dcimgui.h"+#ifndef IMGUI_DISABLE+// Follow "Getting Started" link and check examples/ folder to learn about using backends!++typedef struct ImDrawData_t ImDrawData;+// Null = NullPlatform + NullRender+CIMGUI_IMPL_API bool cImGui_ImplNull_Init(void);+CIMGUI_IMPL_API void cImGui_ImplNull_Shutdown(void);+CIMGUI_IMPL_API void cImGui_ImplNull_NewFrame(void);++// Null platform only (single screen, fixed timestep, no inputs)+CIMGUI_IMPL_API bool cImGui_ImplNullPlatform_Init(void);+CIMGUI_IMPL_API void cImGui_ImplNullPlatform_Shutdown(void);+CIMGUI_IMPL_API void cImGui_ImplNullPlatform_NewFrame(void);++// Null renderer only (no output)+CIMGUI_IMPL_API bool cImGui_ImplNullRender_Init(void);+CIMGUI_IMPL_API void cImGui_ImplNullRender_Shutdown(void);+CIMGUI_IMPL_API void cImGui_ImplNullRender_NewFrame(void);+CIMGUI_IMPL_API void cImGui_ImplNullRender_RenderDrawData(ImDrawData* draw_data);+#endif// #ifndef IMGUI_DISABLE+#ifdef __cplusplus+} // End of extern "C" block+#endif
+ cbits/imgui_impl_null.cpp view
@@ -0,0 +1,102 @@+// dear imgui: Null Platform+Renderer Backends+// This is designed if you need to use a blind Dear Imgui context with no input and no output.++// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.+// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.+// Learn about Dear ImGui:+// - FAQ                  https://dearimgui.com/faq+// - Getting Started      https://dearimgui.com/getting-started+// - Documentation        https://dearimgui.com/docs (same as your local docs/ folder).+// - Introduction, links and more at the top of imgui.cpp++// CHANGELOG+// (minor and older changes stripped away, please see git history for details)+//  2025-11-17: Initial version.++#include "imgui.h"+#ifndef IMGUI_DISABLE+#include "imgui_impl_null.h"++// Clang/GCC warnings with -Weverything+#if defined(__clang__)+#pragma clang diagnostic ignored "-Wold-style-cast"         // warning: use of old-style cast                            // yes, they are more terse.+#endif++IMGUI_IMPL_API bool ImGui_ImplNull_Init()+{+    ImGui_ImplNullPlatform_Init();+    ImGui_ImplNullRender_Init();+    return true;+}++IMGUI_IMPL_API void ImGui_ImplNull_Shutdown()+{+    ImGui_ImplNullRender_Shutdown();+    ImGui_ImplNullPlatform_Shutdown();+}++IMGUI_IMPL_API void ImGui_ImplNull_NewFrame()+{+    ImGui_ImplNullPlatform_NewFrame();+    ImGui_ImplNullRender_NewFrame();+}++IMGUI_IMPL_API bool ImGui_ImplNullPlatform_Init()+{+    ImGuiIO& io = ImGui::GetIO();+    io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors;+    return true;+}++IMGUI_IMPL_API void ImGui_ImplNullPlatform_Shutdown()+{+    ImGuiIO& io = ImGui::GetIO();+    io.BackendFlags &= ~ImGuiBackendFlags_HasMouseCursors;+}++IMGUI_IMPL_API void ImGui_ImplNullPlatform_NewFrame()+{+    ImGuiIO& io = ImGui::GetIO();+    io.DisplaySize = ImVec2(1920, 1080);+    io.DeltaTime = 1.0f / 60.0f;+}++IMGUI_IMPL_API bool ImGui_ImplNullRender_Init()+{+    ImGuiIO& io = ImGui::GetIO();+    io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset;+    io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures;+    return true;+}++IMGUI_IMPL_API void ImGui_ImplNullRender_Shutdown()+{+    ImGuiIO& io = ImGui::GetIO();+    io.BackendFlags &= ~ImGuiBackendFlags_RendererHasVtxOffset;+    io.BackendFlags &= ~ImGuiBackendFlags_RendererHasTextures;+}++IMGUI_IMPL_API void ImGui_ImplNullRender_NewFrame()+{+}++static void ImGui_ImplNullRender_UpdateTexture(ImTextureData* tex)+{+    if (tex->Status == ImTextureStatus_WantCreate || tex->Status == ImTextureStatus_WantDestroy)+        tex->SetStatus(ImTextureStatus_OK);+    if (tex->Status == ImTextureStatus_WantDestroy)+    {+        tex->SetTexID(ImTextureID_Invalid);+        tex->SetStatus(ImTextureStatus_Destroyed);+    }+}++IMGUI_IMPL_API void ImGui_ImplNullRender_RenderDrawData(ImDrawData* draw_data)+{+    if (draw_data->Textures != nullptr)+        for (ImTextureData* tex : *draw_data->Textures)+            if (tex->Status != ImTextureStatus_OK)+                ImGui_ImplNullRender_UpdateTexture(tex);+}++#endif // #ifndef IMGUI_DISABLE
+ cbits/imgui_impl_null.h view
@@ -0,0 +1,34 @@+// dear imgui: Null Platform+Renderer Backends+// This is designed if you need to use a blind Dear Imgui context with no input and no output.++// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.+// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.+// Learn about Dear ImGui:+// - FAQ                  https://dearimgui.com/faq+// - Getting Started      https://dearimgui.com/getting-started+// - Documentation        https://dearimgui.com/docs (same as your local docs/ folder).+// - Introduction, links and more at the top of imgui.cpp++#pragma once+#include "imgui.h"      // IMGUI_IMPL_API+#ifndef IMGUI_DISABLE++// Follow "Getting Started" link and check examples/ folder to learn about using backends!++// Null = NullPlatform + NullRender+IMGUI_IMPL_API bool     ImGui_ImplNull_Init();+IMGUI_IMPL_API void     ImGui_ImplNull_Shutdown();+IMGUI_IMPL_API void     ImGui_ImplNull_NewFrame();++// Null platform only (single screen, fixed timestep, no inputs)+IMGUI_IMPL_API bool     ImGui_ImplNullPlatform_Init();+IMGUI_IMPL_API void     ImGui_ImplNullPlatform_Shutdown();+IMGUI_IMPL_API void     ImGui_ImplNullPlatform_NewFrame();++// Null renderer only (no output)+IMGUI_IMPL_API bool     ImGui_ImplNullRender_Init();+IMGUI_IMPL_API void     ImGui_ImplNullRender_Shutdown();+IMGUI_IMPL_API void     ImGui_ImplNullRender_NewFrame();+IMGUI_IMPL_API void     ImGui_ImplNullRender_RenderDrawData(ImDrawData* draw_data);++#endif // #ifndef IMGUI_DISABLE
+ dear-imgui-impl-null.cabal view
@@ -0,0 +1,55 @@+cabal-version: 2.2++-- This file has been generated from package.yaml by hpack version 0.39.6.+--+-- see: https://github.com/sol/hpack++name:           dear-imgui-impl-null+version:        1.0.0+synopsis:       Null platform + renderer backend bindings for dear-imgui-raw.+description:    Generated with dear_bindings from the imgui_impl_null backend that ships with Dear ImGui.+category:       GUI+maintainer:     IC Rainbow <aenor.realm@gmail.com>+license:        BSD-3-Clause+license-file:   LICENSE+build-type:     Simple+extra-source-files:+    cbits/dcimgui_impl_null.h+    cbits/DearImGuiWrappers.h+    cbits/imgui_impl_null.h+extra-doc-files:+    README.md+    CHANGELOG.md++library+  exposed-modules:+      DearImGui.Raw.Impl.Null+  other-modules:+      Paths_dear_imgui_impl_null+  autogen-modules:+      Paths_dear_imgui_impl_null+  hs-source-dirs:+      src+  default-extensions:+      BlockArguments+      DataKinds+      DuplicateRecordFields+      LambdaCase+      NoFieldSelectors+      OverloadedRecordDot+      OverloadedStrings+      StrictData+  ghc-options: -Wall -optc-Wno-discarded-qualifiers -optc-Wno-incompatible-pointer-types+  cxx-options: -std=c++11 -fpermissive+  include-dirs:+      cbits+  cxx-sources:+      cbits/dcimgui_impl_null.cpp+      cbits/DearImGuiWrappers.cpp+      cbits/imgui_impl_null.cpp+  build-tool-depends:+      hsc2hs:hsc2hs+  build-depends:+      base >=4.16 && <5+    , dear-imgui-raw ==1.0.*+  default-language: GHC2021
+ src/DearImGui/Raw/Impl/Null.hsc view
@@ -0,0 +1,67 @@+{-# LANGUAGE CApiFFI #-}+{-# LANGUAGE PatternSynonyms #-}++-- This file was generated by dear-bindings-ffi. Do not edit by hand.++module DearImGui.Raw.Impl.Null+  ( cImGui_ImplNullPlatform_Init+  , cImGui_ImplNullPlatform_NewFrame+  , cImGui_ImplNullPlatform_Shutdown+  , cImGui_ImplNullRender_Init+  , cImGui_ImplNullRender_NewFrame+  , cImGui_ImplNullRender_Shutdown+  , cImGui_ImplNull_Init+  , cImGui_ImplNull_NewFrame+  , cImGui_ImplNull_Shutdown+  , renderDrawData+  ) where++import DearImGui.Raw.ImDrawData (ImDrawData)+import Foreign.C.Types+import Foreign.Ptr (Ptr)++#include "dcimgui_impl_null.h"++-- functions++-- C: bool ImGui_ImplNullPlatform_Init()+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNullPlatform_Init"+  cImGui_ImplNullPlatform_Init :: IO CBool++-- C: void ImGui_ImplNullPlatform_NewFrame()+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNullPlatform_NewFrame"+  cImGui_ImplNullPlatform_NewFrame :: IO ()++-- C: void ImGui_ImplNullPlatform_Shutdown()+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNullPlatform_Shutdown"+  cImGui_ImplNullPlatform_Shutdown :: IO ()++-- C: bool ImGui_ImplNullRender_Init()+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNullRender_Init"+  cImGui_ImplNullRender_Init :: IO CBool++-- C: void ImGui_ImplNullRender_NewFrame()+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNullRender_NewFrame"+  cImGui_ImplNullRender_NewFrame :: IO ()++-- C: void ImGui_ImplNullRender_RenderDrawData(ImDrawData* draw_data)+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNullRender_RenderDrawData"+  renderDrawData+    :: (Ptr ImDrawData) -- ^ draw_data+    -> IO ()++-- C: void ImGui_ImplNullRender_Shutdown()+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNullRender_Shutdown"+  cImGui_ImplNullRender_Shutdown :: IO ()++-- C: bool ImGui_ImplNull_Init()+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNull_Init"+  cImGui_ImplNull_Init :: IO CBool++-- C: void ImGui_ImplNull_NewFrame()+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNull_NewFrame"+  cImGui_ImplNull_NewFrame :: IO ()++-- C: void ImGui_ImplNull_Shutdown()+foreign import capi safe "dcimgui_impl_null.h cImGui_ImplNull_Shutdown"+  cImGui_ImplNull_Shutdown :: IO ()