1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 19:50:22 +00:00

Merge branch 'QB64-Phoenix-Edition:main' into audio-enhancements

This commit is contained in:
Samuel Gomes 2023-05-08 19:12:51 +05:30 committed by GitHub
commit 3fc585241a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14395 additions and 14528 deletions

View file

@ -8,29 +8,15 @@
// QB64-PE GUI Library
// Powered by tinyfiledialogs (http://tinyfiledialogs.sourceforge.net)
//
// Copyright (c) 2022 Samuel Gomes
// https://github.com/a740g
//
//-----------------------------------------------------------------------------------------------------
#pragma once
//-----------------------------------------------------------------------------------------------------
// HEADER FILES
//-----------------------------------------------------------------------------------------------------
#include <stdarg.h>
#include <stdint.h>
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------
// FORWARD DECLARATIONS
//-----------------------------------------------------------------------------------------------------
struct qbs;
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------
// FUNCTIONS
//-----------------------------------------------------------------------------------------------------
void sub__guiNotifyPopup(qbs *qbsTitle, qbs *qbsMessage, qbs *qbsIconType, int32_t passed);
int32_t func__guiMessageBox(qbs *qbsTitle, qbs *qbsMessage, qbs *qbsDialogType, qbs *qbsIconType, int32_t nDefaultButton, int32_t passed);
void sub__guiMessageBox(qbs *qbsTitle, qbs *qbsMessage, qbs *qbsIconType, int32_t passed);
@ -39,8 +25,7 @@ qbs *func__guiSelectFolderDialog(qbs *qbsTitle, qbs *qbsDefaultPath, int32_t pas
uint32_t func__guiColorChooserDialog(qbs *qbsTitle, uint32_t nDefaultRGB, int32_t passed);
qbs *func__guiOpenFileDialog(qbs *qbsTitle, qbs *qbsDefaultPathAndFile, qbs *qbsFilterPatterns, qbs *qbsSingleFilterDescription, int32_t nAllowMultipleSelects,
int32_t passed);
qbs *func__guiSaveFileDialog(qbs *qbsTitle, qbs *qbsDefaultPathAndFile, qbs *qbsFilterPatterns, qbs *qbsSingleFilterDescription);
qbs *func__guiSaveFileDialog(qbs *qbsTitle, qbs *qbsDefaultPathAndFile, qbs *qbsFilterPatterns, qbs *qbsSingleFilterDescription, int32_t passed);
int gui_alert(const char *message, const char *title, const char *type);
bool gui_alert(const char *fmt, ...);
//-----------------------------------------------------------------------------------------------------

View file

@ -8,29 +8,15 @@
// QB64-PE GUI Library
// Powered by tinyfiledialogs (http://tinyfiledialogs.sourceforge.net)
//
// Copyright (c) 2022 Samuel Gomes
// https://github.com/a740g
//
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------
// HEADER FILES
//-----------------------------------------------------------------------------------------------------
#include "gui.h"
// We need the IMAGE_... macros from here
#include "../../libqb.h"
#include "image.h"
#include "tinyfiledialogs.h"
// The below include is a bad idea because of reasons mentioned in https://github.com/QB64-Phoenix-Edition/QB64pe/issues/172
// However, we need a bunch of things like the 'qbs' structs and some more
// We'll likely keep the 'include' this way because I do not want to duplicate stuff and cause issues
// Matt is already doing work to separate and modularize libqb
// So, this will be replaced with relevant stuff once that work is done
#include "../../libqb.h"
//-----------------------------------------------------------------------------------------------------
#include <algorithm>
#include <string>
//-----------------------------------------------------------------------------------------------------
// FUNCTIONS
//-----------------------------------------------------------------------------------------------------
/// @brief Splits a string delimted by '|' into an array of strings
/// @param input The string to be parsed
/// @param count Point to an integer that will hold the count of tokens. This cannot be NULL
@ -76,153 +62,123 @@ static void gui_free_tokens(char **tokens) {
/// @param qbsTitle [OPTIONAL] Title of the notification
/// @param qbsMessage [OPTIONAL] The message that will be displayed
/// @param qbsIconType [OPTIONAL] Icon type ("info" "warning" "error")
/// @param passed How many parameters were passed?
/// @param passed Optional parameter mask
void sub__guiNotifyPopup(qbs *qbsTitle, qbs *qbsMessage, qbs *qbsIconType, int32_t passed) {
static qbs *aTitle = nullptr;
static qbs *aMessage = nullptr;
static qbs *aIconType = nullptr;
if (!aTitle)
aTitle = qbs_new(0, 0);
if (!aMessage)
aMessage = qbs_new(0, 0);
if (!aIconType)
aIconType = qbs_new(0, 0);
std::string aTitle;
std::string aMessage;
std::string aIconType;
if (passed & 1)
qbs_set(aTitle, qbs_add(qbsTitle, qbs_new_txt_len("\0", 1)));
else
qbs_set(aTitle, qbs_new_txt_len("\0", 1));
aTitle.assign((const char *)qbsTitle->chr, qbsTitle->len);
if (passed & 2)
qbs_set(aMessage, qbs_add(qbsMessage, qbs_new_txt_len("\0", 1)));
else
qbs_set(aMessage, qbs_new_txt_len("\0", 1));
aMessage.assign((const char *)qbsMessage->chr, qbsMessage->len);
if (passed & 4)
qbs_set(aIconType, qbs_add(qbsIconType, qbs_new_txt_len("\0", 1)));
else
qbs_set(aIconType, qbs_new_txt("info")); // info if not passed
if (passed & 4) {
aIconType.assign((const char *)qbsIconType->chr, qbsIconType->len);
std::transform(aIconType.begin(), aIconType.end(), aIconType.begin(), [](unsigned char c) { return std::tolower(c); });
} else {
aIconType.assign("info");
}
tinyfd_notifyPopup((const char *)aTitle->chr, (const char *)aMessage->chr, (const char *)aIconType->chr);
}
/// @brief Shows a standard system message dialog box
/// @param qbsTitle Title of the dialog box
/// @param qbsMessage The message that will be displayed
/// @param qbsDialogType The dialog type ("ok" "okcancel" "yesno" "yesnocancel")
/// @param qbsIconType The dialog icon type ("info" "warning" "error" "question")
/// @param nDefaultButon [OPTIONAL] The default button that will be selected
/// @param passed How many parameters were passed?
/// @return 0 for cancel/no, 1 for ok/yes, 2 for no in yesnocancel
int32_t func__guiMessageBox(qbs *qbsTitle, qbs *qbsMessage, qbs *qbsDialogType, qbs *qbsIconType, int32_t nDefaultButton, int32_t passed) {
static qbs *aTitle = nullptr;
static qbs *aMessage = nullptr;
static qbs *aDialogType = nullptr;
static qbs *aIconType = nullptr;
if (!aTitle)
aTitle = qbs_new(0, 0);
if (!aMessage)
aMessage = qbs_new(0, 0);
if (!aDialogType)
aDialogType = qbs_new(0, 0);
if (!aIconType)
aIconType = qbs_new(0, 0);
qbs_set(aTitle, qbs_add(qbsTitle, qbs_new_txt_len("\0", 1)));
qbs_set(aMessage, qbs_add(qbsMessage, qbs_new_txt_len("\0", 1)));
qbs_set(aDialogType, qbs_add(qbsDialogType, qbs_new_txt_len("\0", 1)));
qbs_set(aIconType, qbs_add(qbsIconType, qbs_new_txt_len("\0", 1)));
if (!passed)
nDefaultButton = 1; // 1 for ok/yes
return tinyfd_messageBox((const char *)aTitle->chr, (const char *)aMessage->chr, (const char *)aDialogType->chr, (const char *)aIconType->chr,
nDefaultButton);
tinyfd_notifyPopup(aTitle.c_str(), aMessage.c_str(), aIconType.c_str());
}
/// @brief Shows a standard system message dialog box
/// @param qbsTitle [OPTIONAL] Title of the dialog box
/// @param qbsMessage [OPTIONAL] The message that will be displayed
/// @param qbsIconType [OPTIONAL] The dialog icon type ("info" "warning" "error")
/// @param passed How many parameters were passed?
/// @param passed Optional parameter mask
void sub__guiMessageBox(qbs *qbsTitle, qbs *qbsMessage, qbs *qbsIconType, int32_t passed) {
static qbs *aTitle = nullptr;
static qbs *aMessage = nullptr;
static qbs *aIconType = nullptr;
if (!aTitle)
aTitle = qbs_new(0, 0);
if (!aMessage)
aMessage = qbs_new(0, 0);
if (!aIconType)
aIconType = qbs_new(0, 0);
std::string aTitle;
std::string aMessage;
std::string aIconType;
if (passed & 1)
qbs_set(aTitle, qbs_add(qbsTitle, qbs_new_txt_len("\0", 1)));
else
qbs_set(aTitle, qbs_new_txt_len("\0", 1));
aTitle.assign((const char *)qbsTitle->chr, qbsTitle->len);
if (passed & 2)
qbs_set(aMessage, qbs_add(qbsMessage, qbs_new_txt_len("\0", 1)));
else
qbs_set(aMessage, qbs_new_txt_len("\0", 1));
aMessage.assign((const char *)qbsMessage->chr, qbsMessage->len);
if (passed & 4)
qbs_set(aIconType, qbs_add(qbsIconType, qbs_new_txt_len("\0", 1)));
else
qbs_set(aIconType, qbs_new_txt("info")); // info if not passed
if (passed & 4) {
aIconType.assign((const char *)qbsIconType->chr, qbsIconType->len);
std::transform(aIconType.begin(), aIconType.end(), aIconType.begin(), [](unsigned char c) { return std::tolower(c); });
} else {
aIconType.assign("info");
}
tinyfd_messageBox((const char *)aTitle->chr, (const char *)aMessage->chr, "ok", (const char *)aIconType->chr, 1);
tinyfd_messageBox(aTitle.c_str(), aMessage.c_str(), "ok", aIconType.c_str(), 1);
}
/// @brief Shows a standard system message dialog box
/// @param qbsTitle [OPTIONAL] Title of the dialog box
/// @param qbsMessage [OPTIONAL] The message that will be displayed
/// @param qbsDialogType [OPTIONAL] The dialog type ("ok" "okcancel" "yesno" "yesnocancel")
/// @param qbsIconType [OPTIONAL] The dialog icon type ("info" "warning" "error" "question")
/// @param nDefaultButon [OPTIONAL] The default button that will be selected
/// @param passed Optional parameter mask
/// @return 0 for cancel/no, 1 for ok/yes, 2 for no in yesnocancel
int32_t func__guiMessageBox(qbs *qbsTitle, qbs *qbsMessage, qbs *qbsDialogType, qbs *qbsIconType, int32_t nDefaultButton, int32_t passed) {
std::string aTitle;
std::string aMessage;
std::string aDialogType;
std::string aIconType;
if (passed & 1)
aTitle.assign((const char *)qbsTitle->chr, qbsTitle->len);
if (passed & 2)
aMessage.assign((const char *)qbsMessage->chr, qbsMessage->len);
if (passed & 4) {
aDialogType.assign((const char *)qbsDialogType->chr, qbsDialogType->len);
std::transform(aDialogType.begin(), aDialogType.end(), aDialogType.begin(), [](unsigned char c) { return std::tolower(c); });
} else {
aDialogType.assign("ok");
}
if (passed & 8) {
aIconType.assign((const char *)qbsIconType->chr, qbsIconType->len);
std::transform(aIconType.begin(), aIconType.end(), aIconType.begin(), [](unsigned char c) { return std::tolower(c); });
} else {
aIconType.assign("info");
}
if (!(passed & 16))
nDefaultButton = 1;
return tinyfd_messageBox(aTitle.c_str(), aMessage.c_str(), aDialogType.c_str(), aIconType.c_str(), nDefaultButton);
}
/// @brief Shows an input box for getting a string from the user
/// @param qbsTitle Title of the dialog box
/// @param qbsMessage The message or prompt that will be displayed
/// @param qbsTitle [OPTIONAL] Title of the dialog box
/// @param qbsMessage [OPTIONAL] The message or prompt that will be displayed
/// @param qbsDefaultInput [OPTIONAL] The default response that can be changed by the user
/// @param passed How many parameters were passed?
/// @param passed Optional parameter mask
/// @return The user response or an empty string if the user cancelled
qbs *func__guiInputBox(qbs *qbsTitle, qbs *qbsMessage, qbs *qbsDefaultInput, int32_t passed) {
static qbs *aTitle = nullptr;
static qbs *aMessage = nullptr;
static qbs *aDefaultInput = nullptr;
static qbs *qbsInput;
std::string aTitle;
std::string aMessage;
std::string aDefaultInput;
if (!aTitle)
aTitle = qbs_new(0, 0);
if (passed & 1)
aTitle.assign((const char *)qbsTitle->chr, qbsTitle->len);
if (!aMessage)
aMessage = qbs_new(0, 0);
if (passed & 2)
aMessage.assign((const char *)qbsMessage->chr, qbsMessage->len);
if (!aDefaultInput)
aDefaultInput = qbs_new(0, 0);
qbs_set(aTitle, qbs_add(qbsTitle, qbs_new_txt_len("\0", 1)));
qbs_set(aMessage, qbs_add(qbsMessage, qbs_new_txt_len("\0", 1)));
char *sDefaultInput;
if (passed) {
qbs_set(aDefaultInput, qbs_add(qbsDefaultInput, qbs_new_txt_len("\0", 1)));
sDefaultInput =
aDefaultInput->len == 1 ? nullptr : (char *)aDefaultInput->chr; // if string is "" then password box, else we pass the default input as is
const char *sDefaultInput;
if (passed & 4) {
aDefaultInput.assign((const char *)qbsDefaultInput->chr, qbsDefaultInput->len);
sDefaultInput = !qbsDefaultInput->len ? nullptr : aDefaultInput.c_str(); // if string is "" then password box, else we pass the default input as is
} else {
qbs_set(aDefaultInput, qbs_new_txt_len("\0", 1)); // input box by default
sDefaultInput = (char *)aDefaultInput->chr;
sDefaultInput = aDefaultInput.c_str();
}
auto sInput = tinyfd_inputBox((const char *)aTitle->chr, (const char *)aMessage->chr, (const char *)sDefaultInput);
auto sInput = tinyfd_inputBox(aTitle.c_str(), aMessage.c_str(), sDefaultInput);
// Create a new qbs and then copy the string to it
qbsInput = qbs_new(sInput ? strlen(sInput) : 0, 1);
auto qbsInput = qbs_new(sInput ? strlen(sInput) : 0, 1);
if (qbsInput->len)
memcpy(qbsInput->chr, sInput, qbsInput->len);
@ -230,32 +186,24 @@ qbs *func__guiInputBox(qbs *qbsTitle, qbs *qbsMessage, qbs *qbsDefaultInput, int
}
/// @brief Shows the browse for folder dialog box
/// @param qbsTitle Title of the dialog box
/// @param qbsTitle [OPTIONAL] Title of the dialog box
/// @param qbsDefaultPath [OPTIONAL] The default path from where to start browsing
/// @param passed How many parameters were passed?
/// @param passed Optional parameter mask
/// @return The path selected by the user or an empty string if the user cancelled
qbs *func__guiSelectFolderDialog(qbs *qbsTitle, qbs *qbsDefaultPath, int32_t passed) {
static qbs *aTitle = nullptr;
static qbs *aDefaultPath = nullptr;
static qbs *qbsFolder;
std::string aTitle;
std::string aDefaultPath;
if (!aTitle)
aTitle = qbs_new(0, 0);
if (passed & 1)
aTitle.assign((const char *)qbsTitle->chr, qbsTitle->len);
if (!aDefaultPath)
aDefaultPath = qbs_new(0, 0);
if (passed & 2)
aDefaultPath.assign((const char *)qbsDefaultPath->chr, qbsDefaultPath->len);
qbs_set(aTitle, qbs_add(qbsTitle, qbs_new_txt_len("\0", 1)));
if (passed)
qbs_set(aDefaultPath, qbs_add(qbsDefaultPath, qbs_new_txt_len("\0", 1)));
else
qbs_set(aDefaultPath, qbs_new_txt_len("\0", 1));
auto sFolder = tinyfd_selectFolderDialog((const char *)aTitle->chr, (const char *)aDefaultPath->chr);
auto sFolder = tinyfd_selectFolderDialog(aTitle.c_str(), aDefaultPath.c_str());
// Create a new qbs and then copy the string to it
qbsFolder = qbs_new(sFolder ? strlen(sFolder) : 0, 1);
auto qbsFolder = qbs_new(sFolder ? strlen(sFolder) : 0, 1);
if (qbsFolder->chr)
memcpy(qbsFolder->chr, sFolder, qbsFolder->len);
@ -263,83 +211,74 @@ qbs *func__guiSelectFolderDialog(qbs *qbsTitle, qbs *qbsDefaultPath, int32_t pas
}
/// @brief Shows the color picker dialog box
/// @param qbsTitle Title of the dialog box
/// @param qbsTitle [OPTIONAL] Title of the dialog box
/// @param nDefaultRGB [OPTIONAL] Default selected color
/// @param passed How many parameters were passed?
/// @param passed Optional parameter mask
/// @return 0 on cancel (i.e. no color, no alpha, nothing). Else, returns color with alpha set to 255
uint32_t func__guiColorChooserDialog(qbs *qbsTitle, uint32_t nDefaultRGB, int32_t passed) {
static qbs *aTitle = nullptr;
std::string aTitle;
if (!aTitle)
aTitle = qbs_new(0, 0);
if (passed & 1)
aTitle.assign((const char *)qbsTitle->chr, qbsTitle->len);
qbs_set(aTitle, qbs_add(qbsTitle, qbs_new_txt_len("\0", 1)));
if (!passed)
if (!(passed & 2))
nDefaultRGB = 0;
// Break the color into RGB components
uint8_t lRGB[3];
lRGB[0] = IMAGE_GET_BGRA_RED(nDefaultRGB);
lRGB[1] = IMAGE_GET_BGRA_GREEN(nDefaultRGB);
lRGB[2] = IMAGE_GET_BGRA_BLUE(nDefaultRGB);
uint8_t lRGB[3] = {IMAGE_GET_BGRA_RED(nDefaultRGB), IMAGE_GET_BGRA_GREEN(nDefaultRGB), IMAGE_GET_BGRA_BLUE(nDefaultRGB)};
// On cancel, return 0 (i.e. no color, no alpha, nothing). Else, return color with alpha set to 255
return !tinyfd_colorChooser((const char *)aTitle->chr, nullptr, lRGB, lRGB) ? 0 : IMAGE_MAKE_BGRA(lRGB[0], lRGB[1], lRGB[2], 0xFF);
return !tinyfd_colorChooser(aTitle.c_str(), nullptr, lRGB, lRGB) ? 0 : IMAGE_MAKE_BGRA(lRGB[0], lRGB[1], lRGB[2], 0xFF);
}
/// @brief Shows the system file open dialog box
/// @param qbsTitle Title of the dialog box
/// @param qbsDefaultPathAndFile The default path (and filename) that will be pre-populated
/// @param qbsFilterPatterns File filters separated using '|' (e.g. "*.png|*.jpg")
/// @param qbsSingleFilterDescription Single filter description (e.g. "Image files")
/// @param qbsTitle [OPTIONAL] Title of the dialog box
/// @param qbsDefaultPathAndFile [OPTIONAL] The default path (and filename) that will be pre-populated
/// @param qbsFilterPatterns [OPTIONAL] File filters separated using '|' (e.g. "*.png|*.jpg")
/// @param qbsSingleFilterDescription [OPTIONAL] Single filter description (e.g. "Image files")
/// @param nAllowMultipleSelects [OPTIONAL] Should multiple file selection be allowed?
/// @param passed How many parameters were passed?
/// @param passed Optional parameter mask
/// @return The file name (or names separated by '|' if multiselect was on) selected by the user or an empty string if the user cancelled
qbs *func__guiOpenFileDialog(qbs *qbsTitle, qbs *qbsDefaultPathAndFile, qbs *qbsFilterPatterns, qbs *qbsSingleFilterDescription, int32_t nAllowMultipleSelects,
int32_t passed) {
static qbs *aTitle = nullptr;
static qbs *aDefaultPathAndFile = nullptr;
static qbs *aFilterPatterns = nullptr;
static qbs *aSingleFilterDescription = nullptr;
static qbs *qbsFileName;
std::string aTitle;
std::string aDefaultPathAndFile;
std::string aFilterPatterns;
std::string aSingleFilterDescription;
if (!aTitle)
aTitle = qbs_new(0, 0);
if (passed & 1)
aTitle.assign((const char *)qbsTitle->chr, qbsTitle->len);
if (!aDefaultPathAndFile)
aDefaultPathAndFile = qbs_new(0, 0);
if (passed & 2)
aDefaultPathAndFile.assign((const char *)qbsDefaultPathAndFile->chr, qbsDefaultPathAndFile->len);
if (!aFilterPatterns)
aFilterPatterns = qbs_new(0, 0);
if (passed & 4)
aFilterPatterns.assign((const char *)qbsFilterPatterns->chr, qbsFilterPatterns->len);
if (!aSingleFilterDescription)
aSingleFilterDescription = qbs_new(0, 0);
const char *sSingleFilterDescription;
if (passed & 8) {
aSingleFilterDescription.assign((const char *)qbsSingleFilterDescription->chr, qbsSingleFilterDescription->len);
sSingleFilterDescription = !qbsSingleFilterDescription->len ? nullptr : aSingleFilterDescription.c_str();
} else {
sSingleFilterDescription = nullptr;
}
qbs_set(aTitle, qbs_add(qbsTitle, qbs_new_txt_len("\0", 1)));
qbs_set(aDefaultPathAndFile, qbs_add(qbsDefaultPathAndFile, qbs_new_txt_len("\0", 1)));
qbs_set(aFilterPatterns, qbs_add(qbsFilterPatterns, qbs_new_txt_len("\0", 1)));
qbs_set(aSingleFilterDescription, qbs_add(qbsSingleFilterDescription, qbs_new_txt_len("\0", 1)));
// If nAllowMultipleSelects is < 0 tinyfd_openFileDialog allows a program to force-free any working memory that it may be using and returns NULL
// This is really not an issue even if it is not done because tinyfd_openFileDialog 'recycles' it working memory and anything not feed will be taken care of
// by the OS on program exit
// Unfortunately in case of QB64, true is -1 and this does not blend well with the spirit of BASIC (is that even a thing? XD)
// To work around this, we trap any non-zero values and re-interpret those as 1
nAllowMultipleSelects = !passed || !nAllowMultipleSelects ? false : true;
char *sSingleFilterDescription = aSingleFilterDescription->len == 1 ? nullptr : (char *)aSingleFilterDescription->chr;
// If nAllowMultipleSelects is < 0 tinyfd_openFileDialog allows a program to force-free any working memory that it
// may be using and returns NULL. This is really not an issue even if it is not done because tinyfd_openFileDialog
// 'recycles' it working memory and anything not feed will be taken care of by the OS on program exit. Unfortunately
// in case of QB64, true is -1. To work around this, we trap any non-zero values and re-interpret those as 1
nAllowMultipleSelects = !(passed & 16) || !nAllowMultipleSelects ? false : true;
int32_t aNumOfFilterPatterns;
auto psaFilterPatterns = gui_tokenize((const char *)aFilterPatterns->chr, &aNumOfFilterPatterns); // get the number of file filters & count
auto psaFilterPatterns = gui_tokenize(aFilterPatterns.c_str(), &aNumOfFilterPatterns); // get the number of file filters & count
auto sFileName = tinyfd_openFileDialog((const char *)aTitle->chr, (const char *)aDefaultPathAndFile->chr, aNumOfFilterPatterns, psaFilterPatterns,
(const char *)sSingleFilterDescription, nAllowMultipleSelects);
auto sFileName = tinyfd_openFileDialog(aTitle.c_str(), aDefaultPathAndFile.c_str(), aNumOfFilterPatterns, psaFilterPatterns, sSingleFilterDescription,
nAllowMultipleSelects);
gui_free_tokens(psaFilterPatterns); // free memory used by tokenizer
// Create a new qbs and then copy the string to it
qbsFileName = qbs_new(sFileName ? strlen(sFileName) : 0, 1);
auto qbsFileName = qbs_new(sFileName ? strlen(sFileName) : 0, 1);
if (qbsFileName->len)
memcpy(qbsFileName->chr, sFileName, qbsFileName->len);
@ -347,47 +286,43 @@ qbs *func__guiOpenFileDialog(qbs *qbsTitle, qbs *qbsDefaultPathAndFile, qbs *qbs
}
/// @brief Shows the system file save dialog box
/// @param qbsTitle Title of the dialog box
/// @param qbsDefaultPathAndFile The default path (and filename) that will be pre-populated
/// @param qbsFilterPatterns File filters separated using '|' (e.g. "*.png|*.jpg")
/// @param qbsSingleFilterDescription Single filter description (e.g. "Image files")
/// @param qbsTitle [OPTIONAL] Title of the dialog box
/// @param qbsDefaultPathAndFile [OPTIONAL] The default path (and filename) that will be pre-populated
/// @param qbsFilterPatterns [OPTIONAL] File filters separated using '|' (e.g. "*.png|*.jpg")
/// @param qbsSingleFilterDescription [OPTIONAL] Single filter description (e.g. "Image files")
/// @return The file name selected by the user or an empty string if the user cancelled
qbs *func__guiSaveFileDialog(qbs *qbsTitle, qbs *qbsDefaultPathAndFile, qbs *qbsFilterPatterns, qbs *qbsSingleFilterDescription) {
static qbs *aTitle = nullptr;
static qbs *aDefaultPathAndFile = nullptr;
static qbs *aFilterPatterns = nullptr;
static qbs *aSingleFilterDescription = nullptr;
static qbs *qbsFileName;
qbs *func__guiSaveFileDialog(qbs *qbsTitle, qbs *qbsDefaultPathAndFile, qbs *qbsFilterPatterns, qbs *qbsSingleFilterDescription, int32_t passed) {
std::string aTitle;
std::string aDefaultPathAndFile;
std::string aFilterPatterns;
std::string aSingleFilterDescription;
if (!aTitle)
aTitle = qbs_new(0, 0);
if (passed & 1)
aTitle.assign((const char *)qbsTitle->chr, qbsTitle->len);
if (!aDefaultPathAndFile)
aDefaultPathAndFile = qbs_new(0, 0);
if (passed & 2)
aDefaultPathAndFile.assign((const char *)qbsDefaultPathAndFile->chr, qbsDefaultPathAndFile->len);
if (!aFilterPatterns)
aFilterPatterns = qbs_new(0, 0);
if (passed & 4)
aFilterPatterns.assign((const char *)qbsFilterPatterns->chr, qbsFilterPatterns->len);
if (!aSingleFilterDescription)
aSingleFilterDescription = qbs_new(0, 0);
qbs_set(aTitle, qbs_add(qbsTitle, qbs_new_txt_len("\0", 1)));
qbs_set(aDefaultPathAndFile, qbs_add(qbsDefaultPathAndFile, qbs_new_txt_len("\0", 1)));
qbs_set(aFilterPatterns, qbs_add(qbsFilterPatterns, qbs_new_txt_len("\0", 1)));
qbs_set(aSingleFilterDescription, qbs_add(qbsSingleFilterDescription, qbs_new_txt_len("\0", 1)));
char *sSingleFilterDescription = aSingleFilterDescription->len == 1 ? nullptr : (char *)aSingleFilterDescription->chr;
const char *sSingleFilterDescription;
if (passed & 8) {
aSingleFilterDescription.assign((const char *)qbsSingleFilterDescription->chr, qbsSingleFilterDescription->len);
sSingleFilterDescription = !qbsSingleFilterDescription->len ? nullptr : aSingleFilterDescription.c_str();
} else {
sSingleFilterDescription = nullptr;
}
int32_t aNumOfFilterPatterns;
auto psaFilterPatterns = gui_tokenize((const char *)aFilterPatterns->chr, &aNumOfFilterPatterns); // get the number of file filters & count
auto psaFilterPatterns = gui_tokenize(aFilterPatterns.c_str(), &aNumOfFilterPatterns); // get the number of file filters & count
auto sFileName = tinyfd_saveFileDialog((const char *)aTitle->chr, (const char *)aDefaultPathAndFile->chr, aNumOfFilterPatterns, psaFilterPatterns,
(const char *)sSingleFilterDescription);
auto sFileName = tinyfd_saveFileDialog(aTitle.c_str(), aDefaultPathAndFile.c_str(), aNumOfFilterPatterns, psaFilterPatterns, sSingleFilterDescription);
gui_free_tokens(psaFilterPatterns); // free memory used by tokenizer
// Create a new qbs and then copy the string to it
qbsFileName = qbs_new(sFileName ? strlen(sFileName) : 0, 1);
auto qbsFileName = qbs_new(sFileName ? strlen(sFileName) : 0, 1);
if (qbsFileName->len)
memcpy(qbsFileName->chr, sFileName, qbsFileName->len);
@ -433,57 +368,3 @@ bool gui_alert(const char *fmt, ...) {
return true;
}
#ifndef QB64_WINDOWS
# define IDOK 1
# define IDCANCEL 2
# define IDABORT 3
# define IDRETRY 4
# define IDIGNORE 5
# define IDYES 6
# define IDNO 7
# define MB_OK 0x00000000L
# define MB_OKCANCEL 0x00000001L
# define MB_ABORTRETRYIGNORE 0x00000002L
# define MB_YESNOCANCEL 0x00000003L
# define MB_YESNO 0x00000004L
# define MB_RETRYCANCEL 0x00000005L
# define MB_SYSTEMMODAL 0x00001000L
// This exists because InForm calls it directly.
// It only supports the "MB_OK" and "MB_YESNO" options
int MessageBox(int ignore, char *message, char *title, int type) {
const char *msgType;
const char *icon;
int yesret;
switch (type & 0b00000111) {
case MB_YESNO:
msgType = "yesno";
icon = "question";
yesret = IDYES;
break;
case MB_OK:
default:
msgType = "ok";
icon = "info";
yesret = IDOK;
break;
}
int result = tinyfd_messageBox(title, message, msgType, icon, 1 /* OK/Yes */);
switch (result) {
case 1:
return yesret;
case 0:
default:
return IDNO;
}
}
#endif
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------

File diff suppressed because it is too large Load diff

View file

@ -1447,7 +1447,7 @@ id.subfunc = 1
id.callname = "func__UPrintWidth"
id.args = 3
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER)
id.specialformat = "?[,[?][,[?]]]"
id.specialformat = "?[,[?][,?]]"
id.ret = LONGTYPE - ISPOINTER
id.hr_syntax = "_UPRINTWIDTH&(text$[, utfEncoding&][, fontHandle&])"
regid
@ -3929,94 +3929,92 @@ id.ret = UINTEGER64TYPE - ISPOINTER
id.hr_syntax = "_TOGGLEBIT(numericalVariable, numericalValue)"
regid
' a740g: Common dialog support using tiny file dialogs
clearid
id.n = qb64prefix$ + "NotifyPopup" ' Name in CaMeL case
id.n = qb64prefix$ + "NotifyPopup"
id.subfunc = 2 ' 1 = function, 2 = sub
id.callname = "sub__guiNotifyPopup" ' C/C++ function name
id.args = 3 ' number of arguments - "passed"
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) ' arguments & types
id.specialformat = "[?][,[?][,?]]" ' special format (optional in [])
id.hr_syntax = "_NOTIFYPOPUP [title$][, message$][, iconType$]" ' syntax help
id.callname = "sub__guiNotifyPopup"
id.args = 3
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER)
id.specialformat = "[?][,[?][,?]]"
id.hr_syntax = "_NOTIFYPOPUP [title$][, message$][, iconType$]"
regid
clearid
id.n = qb64prefix$ + "MessageBox" ' Name in CaMeL case
id.n = qb64prefix$ + "MessageBox"
id.subfunc = 2 ' 1 = function, 2 = sub
id.callname = "sub__guiMessageBox" ' C/C++ function name
id.args = 3 ' number of arguments - "passed"
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) ' arguments & types
id.specialformat = "[?][,[?][,?]]" ' special format (optional in [])
id.hr_syntax = "_MESSAGEBOX [title$][, message$][, iconType$]" ' syntax help
id.callname = "sub__guiMessageBox"
id.args = 3
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER)
id.specialformat = "[?][,[?][,?]]"
id.hr_syntax = "_MESSAGEBOX [title$][, message$][, iconType$]"
regid
clearid
id.n = qb64prefix$ + "SelectFolderDialog" ' Name in CaMeL case
id.n = qb64prefix$ + "SelectFolderDialog"
id.musthave = "$"
id.subfunc = 1 ' 1 = function, 2 = sub
id.callname = "func__guiSelectFolderDialog" ' C/C++ function name
id.args = 2 ' number of arguments - "passed"
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) ' arguments & types
id.specialformat = "?[,?]" ' special format (optional in [])
id.callname = "func__guiSelectFolderDialog"
id.args = 2
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER)
id.specialformat = "[?][,?]"
id.ret = STRINGTYPE - ISPOINTER ' return type for functions
id.hr_syntax = "_SELECTFOLDERDIALOG$(title$[, defaultPath$])" ' syntax help
id.hr_syntax = "_SELECTFOLDERDIALOG$([title$][, defaultPath$])"
regid
clearid
id.n = qb64prefix$ + "ColorChooserDialog" ' Name in CaMeL case
id.n = qb64prefix$ + "ColorChooserDialog"
id.subfunc = 1 ' 1 = function, 2 = sub
id.callname = "func__guiColorChooserDialog" ' C/C++ function name
id.args = 2 ' number of arguments - "passed"
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(ULONGTYPE - ISPOINTER) ' arguments & types
id.specialformat = "?[,?]" ' special format (optional in [])
id.callname = "func__guiColorChooserDialog"
id.args = 2
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(ULONGTYPE - ISPOINTER)
id.specialformat = "[?][,?]"
id.ret = ULONGTYPE - ISPOINTER ' return type for functions
id.hr_syntax = "_COLORCHOOSERDIALOG&(title$[, defaultRGB&])" ' syntax help
id.hr_syntax = "_COLORCHOOSERDIALOG&([title$][, defaultRGB&])"
regid
clearid
id.n = qb64prefix$ + "MessageBox" ' Name in CaMeL case
id.n = qb64prefix$ + "MessageBox"
id.subfunc = 1 ' 1 = function, 2 = sub
id.callname = "func__guiMessageBox" ' C/C++ function name
id.args = 5 ' number of arguments - "passed"
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) ' arguments & types
id.specialformat = "?,?,?,?[,?]" ' special format (optional in [])
id.callname = "func__guiMessageBox"
id.args = 5
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER)
id.specialformat = "[?][,[?][,[?][,[?][,?]]]]"
id.ret = LONGTYPE - ISPOINTER ' return type for functions
id.hr_syntax = "_MESSAGEBOX&(title$, message$, dialogType$, iconType$[, defaultButton&])" ' syntax help
id.hr_syntax = "_MESSAGEBOX&([title$][, message$][, dialogType$][, iconType$][, defaultButton&])"
regid
clearid
id.n = qb64prefix$ + "InputBox" ' Name in CaMeL case
id.n = qb64prefix$ + "InputBox"
id.musthave = "$"
id.subfunc = 1 ' 1 = function, 2 = sub
id.callname = "func__guiInputBox" ' C/C++ function name
id.args = 3 ' number of arguments - "passed"
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) ' arguments & types
id.specialformat = "?,?[,?]" ' special format (optional in [])
id.callname = "func__guiInputBox"
id.args = 3
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER)
id.specialformat = "[?][,[?][,?]]"
id.ret = STRINGTYPE - ISPOINTER ' return type for functions
id.hr_syntax = "_INPUTBOX$(title$, message$[, defaultInput$])" ' syntax help
id.hr_syntax = "_INPUTBOX$([title$][, message$][, defaultInput$])"
regid
clearid
id.n = qb64prefix$ + "OpenFileDialog" ' Name in CaMeL case
id.n = qb64prefix$ + "OpenFileDialog"
id.musthave = "$"
id.subfunc = 1 ' 1 = function, 2 = sub
id.callname = "func__guiOpenFileDialog" ' C/C++ function name
id.args = 5 ' number of arguments - "passed"
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) ' arguments & types
id.specialformat = "?,?,?,?[,?]" ' special format (optional in [])
id.callname = "func__guiOpenFileDialog"
id.args = 5
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER)
id.specialformat = "[?][,[?][,[?][,[?][,?]]]]"
id.ret = STRINGTYPE - ISPOINTER ' return type for functions
id.hr_syntax = "_OPENFILEDIALOG$(title$, defaultPathAndFile$, filterPatterns$, singleFilterDescription$[, allowMultipleSelects&])" ' syntax help
id.hr_syntax = "_OPENFILEDIALOG$([title$][, defaultPathAndFile$][, filterPatterns$][, singleFilterDescription$][, allowMultipleSelects&])"
regid
clearid
id.n = qb64prefix$ + "SaveFileDialog" ' Name in CaMeL case
id.n = qb64prefix$ + "SaveFileDialog"
id.musthave = "$"
id.subfunc = 1 ' 1 = function, 2 = sub
id.callname = "func__guiSaveFileDialog" ' C/C++ function name
id.args = 4 ' number of arguments - "passed"
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) ' arguments & types
id.callname = "func__guiSaveFileDialog"
id.args = 4
id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER)
id.specialformat = "[?][,[?][,[?][,?]]]"
id.ret = STRINGTYPE - ISPOINTER ' return type for functions
id.hr_syntax = "_SAVEFILEDIALOG$(title$, defaultPathAndFile$, filterPatterns$, singleFilterDescription$)" ' syntax help
id.hr_syntax = "_SAVEFILEDIALOG$([title$][, defaultPathAndFile$][, filterPatterns$][, singleFilterDescription$])"
regid
' a740g: Common dialog support using tiny file dialogs

View file

@ -3,8 +3,7 @@ listOfKeywords$ = "@?@$CHECKING@$ERROR@$CONSOLE@ONLY@$DYNAMIC@$ELSE@$ELSEIF@$END
listOfKeywords$ = listOfKeywords$ + "_ERRORLINE@_ERRORMESSAGE$@_EXIT@_EXPLICIT@_EXPLICITARRAY@_FILEEXISTS@_FLOAT@_FONT@_FONTHEIGHT@_FONTWIDTH@_FREEFONT@_FREEIMAGE@_FREETIMER@_FULLSCREEN@_G2D@_G2R@_GLRENDER@_GREEN@_GREEN32@_HEIGHT@_HIDE@_HYPOT@_ICON@_INCLERRORFILE$@_INCLERRORLINE@_INTEGER64@_KEYCLEAR@_KEYDOWN@_KEYHIT@_LASTAXIS@_LASTBUTTON@_LASTWHEEL@_LIMIT@_LOADFONT@_LOADIMAGE@_MAPTRIANGLE@_MAPUNICODE@_MEM@_MEMCOPY@_MEMELEMENT@_MEMEXISTS@_MEMFILL@_MEMFREE@_MEMGET@_MEMIMAGE@_MEMSOUND@_MEMNEW@_MEMPUT@_MIDDLE@_MK$@_MOUSEBUTTON@_MOUSEHIDE@_MOUSEINPUT@_MOUSEMOVE@_MOUSEMOVEMENTX@_MOUSEMOVEMENTY@_MOUSEPIPEOPEN@_MOUSESHOW@_MOUSEWHEEL@_MOUSEX@_MOUSEY@_NEWIMAGE@_OFFSET@_OPENCLIENT@_OPENCONNECTION@_OPENHOST@_OS$@_PALETTECOLOR@_PI@_PIXELSIZE@_PRESERVE@_PRINTIMAGE@_PRINTMODE@_PRINTSTRING@_PRINTWIDTH@_PUTIMAGE@_R2D@_R2G@_RED@_RED32@_RESIZE@_RESIZEHEIGHT@_RESIZEWIDTH@_RGB@_RGB32@_RGBA@_RGBA32@_ROUND@_SCREENCLICK@_SCREENEXISTS@_SCREENHIDE@_SCREENICON@_SCREENIMAGE@_SCREENMOVE@_SCREENPRINT@_SCREENSHOW@_SCREENX@_SCREENY@_SEC@_SECH@_SETALPHA@_SHELLHIDE@_SINH@_SNDBAL@_SNDCLOSE@_SNDCOPY@_SNDGETPOS@_SNDLEN@_SNDLIMIT@_SNDLOOP@_SNDOPEN@_SNDOPENRAW@_SNDPAUSE@_SNDPAUSED@_SNDPLAY@_SNDPLAYCOPY@_SNDPLAYFILE@_SNDPLAYING@_SNDRATE@_SNDRAW@_SNDRAWDONE@_SNDRAWLEN@_SNDSETPOS@_SNDSTOP@_SNDVOL@_SOURCE@_STARTDIR$@_STRCMP@_STRICMP@_TANH@_TITLE@_TITLE$@_UNSIGNED@_WHEEL@_WIDTH@_WINDOWHANDLE@_WINDOWHASFOCUS@_GLACCUM@_GLALPHAFUNC@_GLARETEXTURESRESIDENT@_GLARRAYELEMENT@_GLBEGIN@_GLBINDTEXTURE@_GLBITMAP@_GLBLENDFUNC@_GLCALLLIST@_GLCALLLISTS@_GLCLEAR@_GLCLEARACCUM@_GLCLEARCOLOR@_GLCLEARDEPTH@_GLCLEARINDEX@_GLCLEARSTENCIL@_GLCLIPPLANE@_GLCOLOR3B@_GLCOLOR3BV@_GLCOLOR3D@_GLCOLOR3DV@_GLCOLOR3F@_GLCOLOR3FV@_GLCOLOR3I@_GLCOLOR3IV@_GLCOLOR3S@_GLCOLOR3SV@_GLCOLOR3UB@_GLCOLOR3UBV@_GLCOLOR3UI@_GLCOLOR3UIV@_GLCOLOR3US@_GLCOLOR3USV@_GLCOLOR4B@_GLCOLOR4BV@_GLCOLOR4D@_GLCOLOR4DV@_GLCOLOR4F@_GLCOLOR4FV@_GLCOLOR4I@_GLCOLOR4IV@_GLCOLOR4S@_GLCOLOR4SV@_GLCOLOR4UB@_GLCOLOR4UBV@_GLCOLOR4UI@_GLCOLOR4UIV@_GLCOLOR4US@_GLCOLOR4USV@_GLCOLORMASK@_GLCOLORMATERIAL@_GLCOLORPOINTER@_GLCOPYPIXELS@_GLCOPYTEXIMAGE1D@_GLCOPYTEXIMAGE2D@_GLCOPYTEXSUBIMAGE1D@"
listOfKeywords$ = listOfKeywords$ + "_GLCOPYTEXSUBIMAGE2D@_GLCULLFACE@_GLDELETELISTS@_GLDELETETEXTURES@_GLDEPTHFUNC@_GLDEPTHMASK@_GLDEPTHRANGE@_GLDISABLE@_GLDISABLECLIENTSTATE@_GLDRAWARRAYS@_GLDRAWBUFFER@_GLDRAWELEMENTS@_GLDRAWPIXELS@_GLEDGEFLAG@_GLEDGEFLAGPOINTER@_GLEDGEFLAGV@_GLENABLE@_GLENABLECLIENTSTATE@_GLEND@_GLENDLIST@_GLEVALCOORD1D@_GLEVALCOORD1DV@_GLEVALCOORD1F@_GLEVALCOORD1FV@_GLEVALCOORD2D@_GLEVALCOORD2DV@_GLEVALCOORD2F@_GLEVALCOORD2FV@_GLEVALMESH1@_GLEVALMESH2@_GLEVALPOINT1@_GLEVALPOINT2@_GLFEEDBACKBUFFER@_GLFINISH@_GLFLUSH@_GLFOGF@_GLFOGFV@_GLFOGI@_GLFOGIV@_GLFRONTFACE@_GLFRUSTUM@_GLGENLISTS@_GLGENTEXTURES@_GLGETBOOLEANV@_GLGETCLIPPLANE@_GLGETDOUBLEV@_GLGETERROR@_GLGETFLOATV@_GLGETINTEGERV@_GLGETLIGHTFV@_GLGETLIGHTIV@_GLGETMAPDV@_GLGETMAPFV@_GLGETMAPIV@_GLGETMATERIALFV@_GLGETMATERIALIV@_GLGETPIXELMAPFV@_GLGETPIXELMAPUIV@_GLGETPIXELMAPUSV@_GLGETPOINTERV@_GLGETPOLYGONSTIPPLE@_GLGETSTRING@_GLGETTEXENVFV@_GLGETTEXENVIV@_GLGETTEXGENDV@_GLGETTEXGENFV@_GLGETTEXGENIV@_GLGETTEXIMAGE@_GLGETTEXLEVELPARAMETERFV@_GLGETTEXLEVELPARAMETERIV@_GLGETTEXPARAMETERFV@_GLGETTEXPARAMETERIV@_GLHINT@_GLINDEXMASK@_GLINDEXPOINTER@_GLINDEXD@_GLINDEXDV@_GLINDEXF@_GLINDEXFV@_GLINDEXI@_GLINDEXIV@_GLINDEXS@_GLINDEXSV@_GLINDEXUB@_GLINDEXUBV@_GLINITNAMES@_GLINTERLEAVEDARRAYS@_GLISENABLED@_GLISLIST@_GLISTEXTURE@_GLLIGHTMODELF@_GLLIGHTMODELFV@_GLLIGHTMODELI@_GLLIGHTMODELIV@_GLLIGHTF@_GLLIGHTFV@_GLLIGHTI@_GLLIGHTIV@_GLLINESTIPPLE@_GLLINEWIDTH@_GLLISTBASE@_GLLOADIDENTITY@_GLLOADMATRIXD@_GLLOADMATRIXF@_GLLOADNAME@_GLLOGICOP@_GLMAP1D@_GLMAP1F@_GLMAP2D@_GLMAP2F@_GLMAPGRID1D@_GLMAPGRID1F@_GLMAPGRID2D@_GLMAPGRID2F@_GLMATERIALF@_GLMATERIALFV@_GLMATERIALI@_GLMATERIALIV@_GLMATRIXMODE@_GLMULTMATRIXD@_GLMULTMATRIXF@_GLNEWLIST@_GLNORMAL3B@_GLNORMAL3BV@_GLNORMAL3D@_GLNORMAL3DV@_GLNORMAL3F@_GLNORMAL3FV@_GLNORMAL3I@_GLNORMAL3IV@_GLNORMAL3S@_GLNORMAL3SV@_GLNORMALPOINTER@_GLORTHO@_GLPASSTHROUGH@_GLPIXELMAPFV@_GLPIXELMAPUIV@_GLPIXELMAPUSV@_GLPIXELSTOREF@_GLPIXELSTOREI@_GLPIXELTRANSFERF@_GLPIXELTRANSFERI@_GLPIXELZOOM@_GLPOINTSIZE@_GLPOLYGONMODE@_GLPOLYGONOFFSET@_GLPOLYGONSTIPPLE@"
listOfKeywords$ = listOfKeywords$ + "_GLPOPATTRIB@_GLPOPCLIENTATTRIB@_GLPOPMATRIX@_GLPOPNAME@_GLPRIORITIZETEXTURES@_GLPUSHATTRIB@_GLPUSHCLIENTATTRIB@_GLPUSHMATRIX@_GLPUSHNAME@_GLRASTERPOS2D@_GLRASTERPOS2DV@_GLRASTERPOS2F@_GLRASTERPOS2FV@_GLRASTERPOS2I@_GLRASTERPOS2IV@_GLRASTERPOS2S@_GLRASTERPOS2SV@_GLRASTERPOS3D@_GLRASTERPOS3DV@_GLRASTERPOS3F@_GLRASTERPOS3FV@_GLRASTERPOS3I@_GLRASTERPOS3IV@_GLRASTERPOS3S@_GLRASTERPOS3SV@_GLRASTERPOS4D@_GLRASTERPOS4DV@_GLRASTERPOS4F@_GLRASTERPOS4FV@_GLRASTERPOS4I@_GLRASTERPOS4IV@_GLRASTERPOS4S@_GLRASTERPOS4SV@_GLREADBUFFER@_GLREADPIXELS@_GLRECTD@_GLRECTDV@_GLRECTF@_GLRECTFV@_GLRECTI@_GLRECTIV@_GLRECTS@_GLRECTSV@_GLRENDERMODE@_GLROTATED@_GLROTATEF@_GLSCALED@_GLSCALEF@_GLSCISSOR@_GLSELECTBUFFER@_GLSHADEMODEL@_GLSTENCILFUNC@_GLSTENCILMASK@_GLSTENCILOP@_GLTEXCOORD1D@_GLTEXCOORD1DV@_GLTEXCOORD1F@_GLTEXCOORD1FV@_GLTEXCOORD1I@_GLTEXCOORD1IV@_GLTEXCOORD1S@_GLTEXCOORD1SV@_GLTEXCOORD2D@_GLTEXCOORD2DV@_GLTEXCOORD2F@_GLTEXCOORD2FV@_GLTEXCOORD2I@_GLTEXCOORD2IV@_GLTEXCOORD2S@_GLTEXCOORD2SV@_GLTEXCOORD3D@_GLTEXCOORD3DV@_GLTEXCOORD3F@_GLTEXCOORD3FV@_GLTEXCOORD3I@_GLTEXCOORD3IV@_GLTEXCOORD3S@_GLTEXCOORD3SV@_GLTEXCOORD4D@_GLTEXCOORD4DV@_GLTEXCOORD4F@_GLTEXCOORD4FV@_GLTEXCOORD4I@_GLTEXCOORD4IV@_GLTEXCOORD4S@_GLTEXCOORD4SV@_GLTEXCOORDPOINTER@_GLTEXENVF@_GLTEXENVFV@_GLTEXENVI@_GLTEXENVIV@_GLTEXGEND@_GLTEXGENDV@_GLTEXGENF@_GLTEXGENFV@_GLTEXGENI@_GLTEXGENIV@_GLTEXIMAGE1D@_GLTEXIMAGE2D@_GLTEXPARAMETERF@_GLTEXPARAMETERFV@_GLTEXPARAMETERI@_GLTEXPARAMETERIV@_GLTEXSUBIMAGE1D@_GLTEXSUBIMAGE2D@_GLTRANSLATED@_GLTRANSLATEF@_GLVERTEX2D@_GLVERTEX2DV@_GLVERTEX2F@_GLVERTEX2FV@_GLVERTEX2I@_GLVERTEX2IV@_GLVERTEX2S@_GLVERTEX2SV@_GLVERTEX3D@_GLVERTEX3DV@_GLVERTEX3F@_GLVERTEX3FV@_GLVERTEX3I@_GLVERTEX3IV@_GLVERTEX3S@_GLVERTEX3SV@_GLVERTEX4D@_GLVERTEX4DV@_GLVERTEX4F@_GLVERTEX4FV@_GLVERTEX4I@_GLVERTEX4IV@_GLVERTEX4S@_GLVERTEX4SV@_GLVERTEXPOINTER@_GLVIEWPORT@SMOOTH@STRETCH@_ANTICLOCKWISE@_BEHIND@_CLEAR@_FILLBACKGROUND@_GLUPERSPECTIVE@_HARDWARE@_HARDWARE1@_KEEPBACKGROUND@_NONE@_OFF@_ONLY@_ONLYBACKGROUND@_ONTOP@_SEAMLESS@_SMOOTH@_SMOOTHSHRUNK@_SMOOTHSTRETCHED@"
listOfKeywords$ = listOfKeywords$ + "_SOFTWARE@_SQUAREPIXELS@_STRETCH@_ALLOWFULLSCREEN@_ALL@_ECHO@_INSTRREV@_TRIM$@_ACCEPTFILEDROP@_FINISHDROP@_TOTALDROPPEDFILES@_DROPPEDFILE@_DROPPEDFILE$@_SHR@_SHL@_ROR@_ROL@" ' a740g: added ROR & ROL
listOfKeywords$ = listOfKeywords$ + "_SOFTWARE@_SQUAREPIXELS@_STRETCH@_ALLOWFULLSCREEN@_ALL@_ECHO@_INSTRREV@_TRIM$@_ACCEPTFILEDROP@_FINISHDROP@_TOTALDROPPEDFILES@_DROPPEDFILE@_DROPPEDFILE$@_SHR@_SHL@_ROR@_ROL@"
listOfKeywords$ = listOfKeywords$ + "_DEFLATE$@_INFLATE$@_READBIT@_RESETBIT@_SETBIT@_TOGGLEBIT@$ASSERTS@_ASSERT@_CAPSLOCK@_NUMLOCK@_SCROLLLOCK@_TOGGLE@_CONSOLEFONT@_CONSOLECURSOR@_CONSOLEINPUT@_CINP@$NOPREFIX@$COLOR@$DEBUG@_ENVIRONCOUNT@$UNSTABLE@$MIDISOUNDFONT@"
listOfKeywords$ = listOfKeywords$ + "_NOTIFYPOPUP@_MESSAGEBOX@_INPUTBOX$@_SELECTFOLDERDIALOG$@_COLORCHOOSERDIALOG@_OPENFILEDIALOG$@_SAVEFILEDIALOG$@" ' a740g: added common dialog keywords
listOfKeywords$ = listOfKeywords$ + "_NOTIFYPOPUP@_MESSAGEBOX@_INPUTBOX$@_SELECTFOLDERDIALOG$@_COLORCHOOSERDIALOG@_OPENFILEDIALOG$@_SAVEFILEDIALOG$@"
listOfKeywords$ = listOfKeywords$ + "_STATUSCODE@_SNDNEW@_SCALEDWIDTH@_SCALEDHEIGHT@_UFONTHEIGHT@_UPRINTWIDTH@_ULINESPACING@_UPRINTSTRING@"