Includes
A collection of useful Include Files for PureBasic
Install / Use
/learn @kenmo-pb/IncludesREADME
PureBasic Includes
A variety of useful Include Files for PureBasic projects
Most of these come from my own projects, others were written for the PB forums, and some were never used at all. Feel free to borrow, modify, and share. No credit required.
All files are "EnableExplicit safe" and "Multiple-include safe"
7Zip.pbi
This provides an interface to the basic archive functions of 7-Zip - creation, examination, and extraction - with password support.
- Windows only
- ASCII/Unicode safe
- Demo included
- 7-Zip commandline version (7za.exe) is required
Barcode.pbi
A library for generating bar codes in various formats (eg. Code 128 or Code 39), output to image or file or CanvasGadget etc.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
Base64Lib.pbi
A set of encoder/decoder/helper functions to improve upon (or replace) PB's Base64 functions. Various conversions to/from strings, files, and memory buffers.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
CanvasDrag.pbi
Helper functions to handle CanvasGadget events and simplify mouse dragging, selection, panning, etc.
- WindowFromGadget.pbi is also required
CocoaHelper.pbi
A few helper functions for dealing with Cocoa objects.
- Mac only (compiles but has no effect on other OS)
- ASCII/Unicode safe
ColorRequesterEx.pbi
Basic improvements to the ColorRequester. On all OS, this saves your last picked color between calls, and even between program runs if the UseFile flag is specified. On Windows, it also lets you open a "full" size color chooser, and lets you specify and save the 16 "custom color" boxes.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
common.pbi
Lots of handy constants, macros, and procedures for common tasks related to: data types, time and date, dialogs, gadgets, file I/O, file paths, drawing, images, strings, etc.
- Windows/Linux/Mac
- ASCII/Unicode safe
- os.pbi is also required
Complex.pbi
Functions and macros to handle complex numbers (32-bit float precision per each component) and the usual, basic operations on them. Long-name procedures are provided (such as Complex_Imaginary()), as well as short-name macros (such as cImag()).
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
CompressHelper.pbi
Helper functions which greatly simplify the (eight) combinations of compressing/decompressing to/from memory/files. You can use the ZIP, LZMA, and BriefLZ packer plugins (default is ZIP).
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
- PB 5.10+ is required
DesktopHelper.pbi
Helper functions for dealing with multiple screens, parent and child windows, window states.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
DropdownButtonGadget.pbi
Custom canvas-based button which provides one clickable main action, plus a popup menu for secondary actions. Simulates a widget seen in some Microsoft programs.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
EnvironmentPaths.pbi
This lets you Examine() and step through a list of environment paths. On Windows, this refers to the PATH environment variable. On other OS, nothing is implemented yet.
- Windows only (compiles but has no effect on other OS)
- ASCII/Unicode safe
- Demo included
FormatDatePHP.pbi
Provides timestamp-to-string formatting with the same options and syntax as PHP's date() function.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
FTPHelper.pbi
A few functions to assist you in uploading/downloading/changing the directory in an FTP connection, by full path, instead of manually "walking" the server's directory structure.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
GadgetCommon.pbi
Helper functions for handling the selected items, checked items, and item data of ListIconGadgets, ListViewGadgets, and TreeGadgets.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
GetExifData.pbi
Reads EXIF metadata from image files (typically JPEG). Currently, it only reads the EXIF rotation (how the image should be rotated when displayed to the user).
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
- RotateImage.pbi is also required if you use
LoadImageEXIFRotated()
GZipHelper.pbi
Many helper functions to compress any data (file, string, buffer, memory range) to GZip format (file, new buffer, or existing memory range), and uncompress back again (to file, string, new buffer, or existing memory range). Uses PB "CRC32" for checksums, and PB "Zip" for DEFLATE compression/decompression.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
Hg.mod.pbi
This is a Module for interacting with Mercurial (Hg) SCM. Functionality includes creating and committing repos, examining changed files, generating a diff, examining the commit log.
- Windows only (not tested on Linux/Mac)
- ASCII/Unicode safe
- Demo included
- Mercurial (Hg) must be installed on you/the user's system
- PB 5.20+ is required
ImproveGadgets.pbi
Various small improvements to native PB gadgets
- Windows only (compiles but has no effect on other OS)
- ASCII/Unicode safe
- Demo included
- StringGadget, ComboBoxGadget: adds Ctrl+Backspace word deletion
- ContainerGadget: reduces resize flickering by disabling some redraw events
- WebGadget: Disables annoying "Script Error" popups
ini.pbi
Functions for reading/writing INI files. A replacement for PB's Preferences library, with added functionality, formatting options for the file and values, and helper functions. The similarities and differences are summarized in the comments near the top of the file.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
IntStack.pbi
Implements a simple Stack (Push + Pop, with Peek) of a fixed type (PB integer).
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
JSON.pbi
Basic JSON support (read/write/parse/modify) before PureBasic added its own JSON library in 5.30
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
- PB 5.30+: Use OJSON.pbi instead
- PB 5.20+: Compiles as a Module (
UseModule JSON) - Before 5.20: Compiles as included procedures
JSON_Helper.pbi
Handy procedures, macros, and constants for simplifying JSON code, using PB's JSON library added in 5.30.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
ListRequester.pbi
Provides a Requester-like dialog window, which presents the user with a list of options as a ListView, ListIcon, or Tree gadget. Customizations include multiple-select, icons, and button placement. This is an older include; it should be rewritten with newer PB features and without the need for a user-managed List!
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
MemGadget.pbi
Custom canvas-based gadget for displaying and editing memory blocks as hex bytes or ASCII characters.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
OJSON.pbi
A variation of JSON.pbi, renamed to OJSON ("Ordered JSON") to avoid conflicts with PB 5.30+. Preserves the order of a JSON Object's members, unlike PB's JSON library. Not a Module.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
os.pbi
Low-overhead code (constants and macros, no procedures) to simplify cross-platform programming
Convenient for handling different OS, filesystems, subsystems, ASCII vs. Unicode, x86 vs. x64
- Windows/Linux/Mac
- ASCII/Unicode safe
OSTheme.pbi
Helper functions to determine system colors for drawing. Also detect and react to OS theme changes (light or dark mode, accent colors, etc.) by callback, event, or polling.
- Windows/Mac (Linux not yet implemented)
- ASCII/Unicode safe
- Demo included
OS_Names.pbi
Two functions, to retreive the (string) name of the user's OS and OS version. (Example: "Windows" and "Windows 7")
- Windows/Linux/Mac
- ASCII/Unicode safe
PBP_Projects.pbi
Functions for parsing PureBasic's own .pbp format project files. You can iterate through a project's targets, read basic information about them, and generate a string of appropriate pbcompiler parameters.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
PBShortcuts.pbi
A very simple file which tells you a #PB_Shortcut_* constant's name string from its numeric value, or vice versa. You can also Debug all shortcut values with one Procedure call, or use the demo program to quickly map keypresses to #PB_Shortcut_* constants.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
Podcast.pbi
Procedures for generating podcast feeds (RSS/XML files) from channel and episode data.
- Windows/Linux/Mac
- ASCII/Unicode safe
- Demo included
PropertyGadget.pbi
An implementation of a PropertyGadget, a custom scrollable gadget containing many types of child gadgets, which can be read/written by numeric index or string ID. Named headers divide them into groups, which can be collapsed or expanded.
- Windows only (not tested on Linux/Mac)
- ASCII/Unicode safe
- Demo included
PSDL.pbi
Constants and function bindings for an incomplete (but growing) subset of the SDL2 API. Subsystems include Window, Texture, Renderer, Keyboard, Mouse, Joystick, GameController, Haptic. The library can be statically or dynamically linked by setting a compile switch constant.
- Windows only (not tested on Lin
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
