working on scrollbar, wip

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@163 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-04 16:34:24 +00:00
parent c2246783f8
commit 4452531d90
18 changed files with 140 additions and 36 deletions

View File

@@ -0,0 +1,25 @@
/* $Id$ */
/*!
* %file Mw/Widget/Button.h
* %brief Button widget
*/
#ifndef __MW_WIDGET_BUTTON_H__
#define __MW_WIDGET_BUTTON_H__
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* %brief Button widget class
*/
MWDECL MwClass MwButtonClass;
#ifdef __cplusplus
}
#endif
#endif

25
include/Mw/Widget/Frame.h Normal file
View File

@@ -0,0 +1,25 @@
/* $Id$ */
/*!
* %file Mw/Widget/Frame.h
* %brief Frame widget
*/
#ifndef __MW_WIDGET_FRAME_H__
#define __MW_WIDGET_FRAME_H__
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* %brief Frame widget class
*/
MWDECL MwClass MwFrameClass;
#ifdef __cplusplus
}
#endif
#endif

25
include/Mw/Widget/Image.h Normal file
View File

@@ -0,0 +1,25 @@
/* $Id$ */
/*!
* %file Mw/Widget/Image.h
* %brief Image widget
*/
#ifndef __MW_WIDGET_IMAGE_H__
#define __MW_WIDGET_IMAGE_H__
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* %brief Image widget class
*/
MWDECL MwClass MwImageClass;
#ifdef __cplusplus
}
#endif
#endif

34
include/Mw/Widget/Menu.h Normal file
View File

@@ -0,0 +1,34 @@
/* $Id$ */
/*!
* %file Mw/Widget/Menu.h
* %brief Menu widget
*/
#ifndef __MW_WIDGET_MENU_H__
#define __MW_WIDGET_MENU_H__
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* %brief Menu widget class
*/
MWDECL MwClass MwMenuClass;
/*!
* %brief Adds a menu
* %param handle Widget
* %param menu Menu
* %param name Menu name
* %return Menu
*/
MWDECL MwMenu MwMenuAdd(MwWidget handle, MwMenu menu, const char* name);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,45 @@
/* $Id$ */
/*!
* %file Mw/Widget/OpenGL.h
* %brief OpenGL widget
*/
#ifndef __MW_WIDGET_OPENGL_H__
#define __MW_WIDGET_OPENGL_H__
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* %brief OpenGL widget class
*/
MWDECL MwClass MwOpenGLClass;
/*!
* %brief Make a widget current OpenGL context
* %param handle Widget
*/
MWDECL void MwOpenGLMakeCurrent(MwWidget handle);
/*!
* %brief Get a procedure from OpenGL
* %param handle Widget
* %param name Name
* %return Procedure
*/
MWDECL void* MwOpenGLGetProcAddress(MwWidget handle, const char* name);
/*!
* %brief Swaps the buffer of OpenGL context
* %param handle Widget
*/
MWDECL void MwOpenGLSwapBuffer(MwWidget handle);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,25 @@
/* $Id$ */
/*!
* %file Mw/Widget/ScrollBar.h
* %brief ScrollBar widget
*/
#ifndef __MW_WIDGET_SCROLLBAR_H__
#define __MW_WIDGET_SCROLLBAR_H__
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* %brief ScrollBar widget class
*/
MWDECL MwClass MwScrollBarClass;
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,27 @@
/* $Id$ */
/*!
* %file Mw/Widget/SubMenu.h
* %brief SubMenu widget
*/
#ifndef __MW_WIDGET_SUBMENU_H__
#define __MW_WIDGET_SUBMENU_H__
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* %brief SubMenu widget class
*/
MWDECL MwClass MwSubMenuClass;
MWDECL void MwSubMenuAppear(MwWidget handle, MwMenu menu, MwPoint* point);
#ifdef __cplusplus
}
#endif
#endif

129
include/Mw/Widget/Vulkan.h Normal file
View File

@@ -0,0 +1,129 @@
/* $Id$ */
/*!
* %file Mw/Widget/Vulkan.h
* %brief Vulkan widget
* %warning This header is not documented yet
*/
/**
* ioixd maintains this file. nishi doesn't know vulkan at all
*/
#ifndef __MW_WIDGET_VULKAN_H__
#define __MW_WIDGET_VULKAN_H__
#if !defined(_WIN32) && !defined(__linux__) && !defined(__FreeBSD__)
#error Vulkan is unsupported on the requested platform.
#endif
#include <vulkan/vulkan.h>
#include <vulkan/vulkan_core.h>
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
#include <Mw/Error.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* %brief Vulkan widget class
*/
MWDECL MwClass MwVulkanClass;
/*!
* %brief Add an extension to the list of extensions to enable prior to initialization.
* %warning This must be called before MwCreateWidget.
*/
MWDECL void MwVulkanEnableExtension(const char* ext_name);
/*!
* %brief Add an layer to the list of layers to enable prior to initialization.
* %warning This must be called before MwCreateWidget.
*/
MWDECL void MwVulkanEnableLayer(const char* ext_name);
/*!
* %brief Configuration options that can be passed to setup Vulkan before a widget is created.
*/
typedef struct MwVulkanConfig_T {
/*!
* %brief Vulkan API version (default: VK_API_VERSION_1_0)
*/
uint32_t api_version;
/*!
* %brief Vulkan version (default: VK_VERSION_1_0)
*/
uint32_t vk_version;
/*!
* %brief Whether or not to enable validation layers (default: false)
*/
VkBool32 validation_layers;
} MwVulkanConfig;
/*!
* %brief Configure Vulkan prior to initializing the widget.
* %warning This must be called before MwCreateWidget.
* %warning The configuration provided will be used for future initializations of the Vulkan widget (unless it's changed)
*/
MWDECL void MwVulkanConfigure(MwVulkanConfig cfg);
/*!
* %brief Field that can be gotten from Vulkan.
*/
typedef enum MwVulkanField_T {
/*!
* %brief The address of the vulkan widget's vkGetInstanceProcAddr function (PFN_vkGetInstanceProcAddr)
*/
MwVulkanField_GetInstanceProcAddr = 0,
/*!
* %brief The address of the vulkan widget's instance (VkInstance)
*/
MwVulkanField_Instance,
/*!
* %brief The address of the vulkan widget's surface (VkSurfaceKHR)
*/
MwVulkanField_Surface,
/*!
* %brief The address of the vulkan widget's physical device (VkPhysicalDevice)
*/
MwVulkanField_PhysicalDevice,
/*!
* %brief The address of the vulkan widget's logical device (VkDevice)
*/
MwVulkanField_LogicalDevice,
/*!
* %brief The address of the index that the vulkan widget uses for the graphics queue (uint32_t *)
*/
MwVulkanField_GraphicsQueueIndex,
/*!
* %brief The address of the index that the vulkan widget uses for the present queue (uint32_t *)
*/
MwVulkanField_PresentQueueIndex,
MwVulkanField_GraphicsQueue,
/*!
* %brief The address of the vulkan widget's graphics queue (VkQueue)
*/
MwVulkanField_PresentQueue,
/*!
* %brief The address of the vulkan widget's present queue (VkQueue)
*/
} MwVulkanField;
/*!
* %brief Function for getting a field from within Vulkan.
* %warning Consult the documentation for MwVulkanField to know what type is expected for out.
*/
MWDECL void* MwVulkanGetField(MwWidget handle, MwVulkanField field, MwErrorEnum* out);
/*!
* %brief Return whether Vulkan is installed on the target platform.
*/
MWDECL VkBool32 MwVulkanSupported(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,25 @@
/* $Id$ */
/*!
* %file Mw/Widget/Window.h
* %brief Window widget
*/
#ifndef __MW_WIDGET_WINDOW_H__
#define __MW_WIDGET_WINDOW_H__
#include <Mw/MachDep.h>
#include <Mw/TypeDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* %brief Window widget class
*/
MWDECL MwClass MwWindowClass;
#ifdef __cplusplus
}
#endif
#endif