1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 01:10:23 +00:00

Merge branch 'audio-enhancements' of https://github.com/a740g/QB64pe into audio-enhancements

This commit is contained in:
Samuel Gomes 2023-06-10 02:35:28 +05:30
commit 90d3be11d3
5 changed files with 26546 additions and 26291 deletions

View file

@ -199,7 +199,13 @@ if (!_SUB_EXPORTCODEAS_STRING_ID)_SUB_EXPORTCODEAS_STRING_ID=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_UW=NULL;
if (!_SUB_EXPORTCODEAS_STRING_UW)_SUB_EXPORTCODEAS_STRING_UW=qbs_new(0,0);
static int32 sc_6734;
static qbs *sc_6737=qbs_new(0,0);
static qbs *sc_6736=qbs_new(0,0);
int16 *_SUB_EXPORTCODEAS_INTEGER_OK=NULL;
if(_SUB_EXPORTCODEAS_INTEGER_OK==NULL){
_SUB_EXPORTCODEAS_INTEGER_OK=(int16*)mem_static_malloc(2);
*_SUB_EXPORTCODEAS_INTEGER_OK=0;
}
static qbs *sc_6738=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_TMP=NULL;
if (!_SUB_EXPORTCODEAS_STRING_TMP)_SUB_EXPORTCODEAS_STRING_TMP=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_BGC=NULL;
@ -208,10 +214,6 @@ qbs *_SUB_EXPORTCODEAS_STRING_TXC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_TXC)_SUB_EXPORTCODEAS_STRING_TXC=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_RTC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_RTC)_SUB_EXPORTCODEAS_STRING_RTC=qbs_new(0,0);
byte_element_struct *byte_element_6738=NULL;
if (!byte_element_6738){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6738=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6738=(byte_element_struct*)mem_static_malloc(12);
}
byte_element_struct *byte_element_6739=NULL;
if (!byte_element_6739){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6739=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6739=(byte_element_struct*)mem_static_malloc(12);
@ -224,11 +226,11 @@ byte_element_struct *byte_element_6741=NULL;
if (!byte_element_6741){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6741=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6741=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6742=qbs_new(0,0);
byte_element_struct *byte_element_6743=NULL;
if (!byte_element_6743){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6743=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6743=(byte_element_struct*)mem_static_malloc(12);
byte_element_struct *byte_element_6742=NULL;
if (!byte_element_6742){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6742=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6742=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6743=qbs_new(0,0);
byte_element_struct *byte_element_6744=NULL;
if (!byte_element_6744){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6744=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6744=(byte_element_struct*)mem_static_malloc(12);
@ -245,35 +247,41 @@ byte_element_struct *byte_element_6747=NULL;
if (!byte_element_6747){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6747=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6747=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6748=qbs_new(0,0);
byte_element_struct *byte_element_6748=NULL;
if (!byte_element_6748){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6748=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6748=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6749=qbs_new(0,0);
static qbs *sc_6750=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_COC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_COC)_SUB_EXPORTCODEAS_STRING_COC=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_NUC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_NUC)_SUB_EXPORTCODEAS_STRING_NUC=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_QUC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_QUC)_SUB_EXPORTCODEAS_STRING_QUC=qbs_new(0,0);
static qbs *sc_6750=qbs_new(0,0);
static qbs *sc_6751=qbs_new(0,0);
byte_element_struct *byte_element_6752=NULL;
if (!byte_element_6752){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6752=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6752=(byte_element_struct*)mem_static_malloc(12);
static qbs *sc_6752=qbs_new(0,0);
static qbs *sc_6753=qbs_new(0,0);
byte_element_struct *byte_element_6754=NULL;
if (!byte_element_6754){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6754=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6754=(byte_element_struct*)mem_static_malloc(12);
}
byte_element_struct *byte_element_6753=NULL;
if (!byte_element_6753){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6753=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6753=(byte_element_struct*)mem_static_malloc(12);
byte_element_struct *byte_element_6755=NULL;
if (!byte_element_6755){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6755=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6755=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6754=qbs_new(0,0);
static qbs *sc_6755=qbs_new(0,0);
static qbs *sc_6756=qbs_new(0,0);
static qbs *sc_6757=qbs_new(0,0);
byte_element_struct *byte_element_6758=NULL;
if (!byte_element_6758){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6758=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6758=(byte_element_struct*)mem_static_malloc(12);
static qbs *sc_6758=qbs_new(0,0);
static qbs *sc_6759=qbs_new(0,0);
static qbs *sc_6760=qbs_new(0,0);
byte_element_struct *byte_element_6761=NULL;
if (!byte_element_6761){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6761=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6761=(byte_element_struct*)mem_static_malloc(12);
}
byte_element_struct *byte_element_6759=NULL;
if (!byte_element_6759){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6759=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6759=(byte_element_struct*)mem_static_malloc(12);
byte_element_struct *byte_element_6762=NULL;
if (!byte_element_6762){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6762=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6762=(byte_element_struct*)mem_static_malloc(12);
}
qbs *_SUB_EXPORTCODEAS_STRING_VERI=NULL;
if (!_SUB_EXPORTCODEAS_STRING_VERI)_SUB_EXPORTCODEAS_STRING_VERI=qbs_new(0,0);
@ -286,57 +294,57 @@ qbs *_SUB_EXPORTCODEAS_STRING_PAGE=NULL;
if (!_SUB_EXPORTCODEAS_STRING_PAGE)_SUB_EXPORTCODEAS_STRING_PAGE=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_LA=NULL;
if (!_SUB_EXPORTCODEAS_STRING_LA)_SUB_EXPORTCODEAS_STRING_LA=qbs_new(0,0);
int32 sc_6761_var;
int32 sc_6764_var;
qbs *_SUB_EXPORTCODEAS_STRING_LNK=NULL;
if (!_SUB_EXPORTCODEAS_STRING_LNK)_SUB_EXPORTCODEAS_STRING_LNK=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_LKC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_LKC)_SUB_EXPORTCODEAS_STRING_LKC=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_MEC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_MEC)_SUB_EXPORTCODEAS_STRING_MEC=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_KWC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_KWC)_SUB_EXPORTCODEAS_STRING_KWC=qbs_new(0,0);
int16 *_SUB_EXPORTCODEAS_INTEGER_PAL=NULL;
if(_SUB_EXPORTCODEAS_INTEGER_PAL==NULL){
_SUB_EXPORTCODEAS_INTEGER_PAL=(int16*)mem_static_malloc(2);
*_SUB_EXPORTCODEAS_INTEGER_PAL=0;
}
byte_element_struct *byte_element_6762=NULL;
if (!byte_element_6762){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6762=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6762=(byte_element_struct*)mem_static_malloc(12);
byte_element_struct *byte_element_6765=NULL;
if (!byte_element_6765){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6765=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6765=(byte_element_struct*)mem_static_malloc(12);
}
int16 *_SUB_EXPORTCODEAS_INTEGER_LKL=NULL;
if(_SUB_EXPORTCODEAS_INTEGER_LKL==NULL){
_SUB_EXPORTCODEAS_INTEGER_LKL=(int16*)mem_static_malloc(2);
*_SUB_EXPORTCODEAS_INTEGER_LKL=0;
}
byte_element_struct *byte_element_6763=NULL;
if (!byte_element_6763){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6763=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6763=(byte_element_struct*)mem_static_malloc(12);
byte_element_struct *byte_element_6766=NULL;
if (!byte_element_6766){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6766=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6766=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6764=qbs_new(0,0);
static qbs *sc_6767=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_LKC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_LKC)_SUB_EXPORTCODEAS_STRING_LKC=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_MEC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_MEC)_SUB_EXPORTCODEAS_STRING_MEC=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_KWC=NULL;
if (!_SUB_EXPORTCODEAS_STRING_KWC)_SUB_EXPORTCODEAS_STRING_KWC=qbs_new(0,0);
int16 *_SUB_EXPORTCODEAS_INTEGER_KWL=NULL;
if(_SUB_EXPORTCODEAS_INTEGER_KWL==NULL){
_SUB_EXPORTCODEAS_INTEGER_KWL=(int16*)mem_static_malloc(2);
*_SUB_EXPORTCODEAS_INTEGER_KWL=0;
}
byte_element_struct *byte_element_6765=NULL;
if (!byte_element_6765){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6765=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6765=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6766=qbs_new(0,0);
byte_element_struct *byte_element_6767=NULL;
if (!byte_element_6767){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6767=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6767=(byte_element_struct*)mem_static_malloc(12);
}
byte_element_struct *byte_element_6768=NULL;
if (!byte_element_6768){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6768=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6768=(byte_element_struct*)mem_static_malloc(12);
}
byte_element_struct *byte_element_6769=NULL;
if (!byte_element_6769){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6769=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6769=(byte_element_struct*)mem_static_malloc(12);
static qbs *sc_6769=qbs_new(0,0);
byte_element_struct *byte_element_6770=NULL;
if (!byte_element_6770){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6770=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6770=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6770=qbs_new(0,0);
byte_element_struct *byte_element_6771=NULL;
if (!byte_element_6771){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6771=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6771=(byte_element_struct*)mem_static_malloc(12);
}
byte_element_struct *byte_element_6772=NULL;
if (!byte_element_6772){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6772=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6772=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6773=qbs_new(0,0);
qbs *_SUB_EXPORTCODEAS_STRING_ECH=NULL;
if (!_SUB_EXPORTCODEAS_STRING_ECH)_SUB_EXPORTCODEAS_STRING_ECH=qbs_new(0,0);
int32 *_SUB_EXPORTCODEAS_LONG_UNI=NULL;
@ -344,15 +352,6 @@ if(_SUB_EXPORTCODEAS_LONG_UNI==NULL){
_SUB_EXPORTCODEAS_LONG_UNI=(int32*)mem_static_malloc(4);
*_SUB_EXPORTCODEAS_LONG_UNI=0;
}
byte_element_struct *byte_element_6774=NULL;
if (!byte_element_6774){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6774=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6774=(byte_element_struct*)mem_static_malloc(12);
}
byte_element_struct *byte_element_6775=NULL;
if (!byte_element_6775){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6775=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6775=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6776=qbs_new(0,0);
byte_element_struct *byte_element_6777=NULL;
if (!byte_element_6777){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6777=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6777=(byte_element_struct*)mem_static_malloc(12);
@ -361,3 +360,12 @@ byte_element_struct *byte_element_6778=NULL;
if (!byte_element_6778){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6778=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6778=(byte_element_struct*)mem_static_malloc(12);
}
static qbs *sc_6779=qbs_new(0,0);
byte_element_struct *byte_element_6780=NULL;
if (!byte_element_6780){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6780=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6780=(byte_element_struct*)mem_static_malloc(12);
}
byte_element_struct *byte_element_6781=NULL;
if (!byte_element_6781){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6781=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6781=(byte_element_struct*)mem_static_malloc(12);
}

View file

@ -1,14 +1,14 @@
qbs *_FUNC_ANSITEXTTOUTF8TEXT_STRING_ANSITEXTTOUTF8TEXT=NULL;
if (!_FUNC_ANSITEXTTOUTF8TEXT_STRING_ANSITEXTTOUTF8TEXT)_FUNC_ANSITEXTTOUTF8TEXT_STRING_ANSITEXTTOUTF8TEXT=qbs_new(0,0);
qbs*oldstr6780=NULL;
qbs*oldstr6783=NULL;
if(_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT->tmp||_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT->fixed||_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT->readonly){
oldstr6780=_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT;
if (oldstr6780->cmem_descriptor){
_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT=qbs_new_cmem(oldstr6780->len,0);
oldstr6783=_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT;
if (oldstr6783->cmem_descriptor){
_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT=qbs_new_cmem(oldstr6783->len,0);
}else{
_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT=qbs_new(oldstr6780->len,0);
_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT=qbs_new(oldstr6783->len,0);
}
memcpy(_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT->chr,oldstr6780->chr,oldstr6780->len);
memcpy(_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT->chr,oldstr6783->chr,oldstr6783->len);
}
qbs *_FUNC_ANSITEXTTOUTF8TEXT_STRING_UTF=NULL;
if (!_FUNC_ANSITEXTTOUTF8TEXT_STRING_UTF)_FUNC_ANSITEXTTOUTF8TEXT_STRING_UTF=qbs_new(0,0);
@ -17,13 +17,13 @@ if(_FUNC_ANSITEXTTOUTF8TEXT_LONG_CHI==NULL){
_FUNC_ANSITEXTTOUTF8TEXT_LONG_CHI=(int32*)mem_static_malloc(4);
*_FUNC_ANSITEXTTOUTF8TEXT_LONG_CHI=0;
}
int64 fornext_value6782;
int64 fornext_finalvalue6782;
int64 fornext_step6782;
uint8 fornext_step_negative6782;
byte_element_struct *byte_element_6783=NULL;
if (!byte_element_6783){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6783=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6783=(byte_element_struct*)mem_static_malloc(12);
int64 fornext_value6785;
int64 fornext_finalvalue6785;
int64 fornext_step6785;
uint8 fornext_step_negative6785;
byte_element_struct *byte_element_6786=NULL;
if (!byte_element_6786){
if ((mem_static_pointer+=12)<mem_static_limit) byte_element_6786=(byte_element_struct*)(mem_static_pointer-12); else byte_element_6786=(byte_element_struct*)mem_static_malloc(12);
}
int16 *_FUNC_ANSITEXTTOUTF8TEXT_INTEGER_ASCII=NULL;
if(_FUNC_ANSITEXTTOUTF8TEXT_INTEGER_ASCII==NULL){

View file

@ -1,5 +1,5 @@
if(oldstr6780){
if(oldstr6780->fixed)qbs_set(oldstr6780,_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT);
if(oldstr6783){
if(oldstr6783->fixed)qbs_set(oldstr6783,_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT);
qbs_free(_FUNC_ANSITEXTTOUTF8TEXT_STRING_TEXT);
}
qbs_free(_FUNC_ANSITEXTTOUTF8TEXT_STRING_UTF);

File diff suppressed because it is too large Load diff

View file

@ -531,8 +531,10 @@ FUNCTION ide2 (ignore)
menuDesc$(m, i - 1) = "Export program into a Hypertext document"
menu$(m, i) = "#Rich Text document (.rtf)": i = i + 1
menuDesc$(m, i - 1) = "Export program into a Rich Text document"
menu$(m, i) = "#Wiki prepared sample (.txt)": i = i + 1
menuDesc$(m, i - 1) = "Export program into a Wiki code example"
menu$(m, i) = "#Forum codebox (to Clipboard)": i = i + 1
menuDesc$(m, i - 1) = "Export program as Forum codebox ready to paste in"
menu$(m, i) = "#Wiki example (to Clipboard)": i = i + 1
menuDesc$(m, i - 1) = "Export program as Wiki example ready to paste in"
menusize(m) = i - 1
IF os$ = "WIN" THEN
@ -5634,7 +5636,14 @@ FUNCTION ide2 (ignore)
GOTO ideloop
END IF
IF menu$(m, s) = "#Wiki prepared sample (.txt)" THEN
IF menu$(m, s) = "#Forum codebox (to Clipboard)" THEN
PCOPY 2, 0
ExportCodeAs "foru"
PCOPY 3, 0: SCREEN , , 3, 0
GOTO ideloop
END IF
IF menu$(m, s) = "#Wiki example (to Clipboard)" THEN
PCOPY 2, 0
ExportCodeAs "wiki"
PCOPY 3, 0: SCREEN , , 3, 0
@ -20369,21 +20378,28 @@ end sub
SUB ExportCodeAs (docFormat$)
' Get the current source code, convert it to the desired document format and
' then write the result into a file (program name or "Untitled" + extension)
' The exported code is highlighted according to the internal keyword lists
' and the keywords are linked to its respective Wiki pages. Also the current
' color theme is utilized for HTML and Rich Text documents, the Wiki however
' has its own fixed blue theme.
' then write the result into a file (program name or "Untitled" + extension).
' Forum and Wiki exports are pushed directly to the Clipboard and can directy
' be pasted into the Forum post or Wiki page. The exported code is highlighted
' according to the internal keyword lists and the keywords are linked to its
' respective Wiki pages. Documents will use the current IDE colors, the Forum
' and Wiki exports use its own fixed blue theme for higlighting. Further in
' documents the extended ASCII codes (>127) are encoded as UTF-8 to get them
' displayed correctly. However, the Forum and Wiki exports keep the original
' codepage encoding. Note that this actually might cause wrong characters in
' the Forum/Wiki, but it is required so that the examples can be copied back
' from the codeboxes into the IDE, which is usually the purpose of examples.
'----------
pNam$ = ideprogname$: IF pNam$ = "" THEN pNam$ = "Untitled" + tempfolderindexstr$ + ".bas"
SELECT CASE LCASE$(docFormat$)
CASE "html": ext$ = ".htm"
CASE "rich": ext$ = ".rtf"
CASE "wiki": ext$ = ".txt"
CASE ELSE: ext$ = ""
END SELECT
IF _FILEEXISTS(idepath$ + idepathsep$ + pNam$ + ext$) THEN
IF ideyesnobox$("Export As...", "Overwrite file " + pNam$ + ext$) = "N" THEN EXIT SUB
IF ext$ <> "" THEN
IF _FILEEXISTS(idepath$ + idepathsep$ + pNam$ + ext$) THEN
IF ideyesnobox$("Export As...", "Overwrite file " + pNam$ + ext$) = "N" THEN EXIT SUB
END IF
END IF
GOSUB GetThemeColors
cEol$ = CHR$(10) ' '=> line break char(s)
@ -20589,7 +20605,7 @@ SUB ExportCodeAs (docFormat$)
END IF
END IF
CASE IS > 127 'ext. ASCII
GOSUB EscapeChar 'html, rtf, wiki
GOSUB EscapeChar 'html, rtf, forum, wiki
CASE ELSE 'control, non-semantics, type suffix w/o further meaning
nt% = 0
END SELECT
@ -20604,29 +20620,38 @@ SUB ExportCodeAs (docFormat$)
WEND
GOSUB CloseCodeBlock
'----------
ideerror = 7
OPEN idepath$ + idepathsep$ + pNam$ + ext$ FOR OUTPUT AS #151
ideerror = 1
PRINT #151, LEFT$(eTxt$, ePos& - 1);
CLOSE #151
PCOPY 2, 3
SELECT CASE LCASE$(docFormat$)
CASE "html", "rich"
ideerror = 7
OPEN idepath$ + idepathsep$ + pNam$ + ext$ FOR OUTPUT AS #151
ideerror = 1
PRINT #151, LEFT$(eTxt$, ePos& - 1);
CLOSE #151
ok% = idemessagebox("Export As...", "Export to " + pNam$ + ext$ + " completed.", "")
CASE "foru", "wiki"
_CLIPBOARD$ = LEFT$(eTxt$, ePos& - 1)
ok% = idemessagebox("Export As...", "Forum/Wiki export to Clipboard completed.", "")
END SELECT
EXIT SUB
'------------------------------
OpenCodeBlock:
SELECT CASE LCASE$(docFormat$)
CASE "html": tmp$ = "<!DOCTYPE html><html lang=" + CHR$(34) + "en" + CHR$(34) + "><head><meta charset=" + CHR$(34) + "UTF-8" + CHR$(34) + "><title>" + AnsiTextToUtf8Text$(pNam$) + "</title></head><body><pre style=" + CHR$(34) + "font-size: 18px; background-color: " + bgc$ + "; color: " + txc$ + ";" + CHR$(34) + ">"
CASE "rich": tmp$ = "{\rtf1\ansi\deff0{\fonttbl{\f0 Courier New;}}{\colortbl " + rtc$ + "}\pard\f0\fs32\cbpat6\paperh23811\paperw16838\margl142\margr142\margt142\margb142"
CASE "foru": tmp$ = "[qb=export]"
CASE "wiki": tmp$ = "{{CodeStart}}"
CASE ELSE: RETURN
END SELECT
MID$(eTxt$, ePos&, LEN(tmp$)) = tmp$: ePos& = ePos& + LEN(tmp$)
MID$(eTxt$, ePos&, LEN(cEol$)) = cEol$: ePos& = ePos& + LEN(cEol$)
IF LCASE$(docFormat$) <> "foru" THEN MID$(eTxt$, ePos&, LEN(cEol$)) = cEol$: ePos& = ePos& + LEN(cEol$)
RETURN
'----------
CloseCodeBlock:
SELECT CASE LCASE$(docFormat$)
CASE "html": tmp$ = "</pre></body></html>"
CASE "rich": tmp$ = "}": ePos& = ePos& - 4 'remove final /par
CASE "foru": tmp$ = "[/qb]"
CASE "wiki": tmp$ = "{{CodeEnd}}"
CASE ELSE: RETURN
END SELECT
@ -20652,6 +20677,13 @@ SUB ExportCodeAs (docFormat$)
CASE "qu": tmp$ = "\cf5 "
CASE ELSE: RETURN
END SELECT
CASE "foru"
SELECT CASE LCASE$(what$)
CASE "co": tmp$ = "[color=#919191]"
CASE "nu": tmp$ = "[color=#F580B1]"
CASE "qu": tmp$ = "[color=#FFB100]"
CASE ELSE: RETURN
END SELECT
CASE "wiki"
SELECT CASE LCASE$(what$)
CASE "co", "qu": tmp$ = "{{Text|<nowiki>"
@ -20676,6 +20708,11 @@ SUB ExportCodeAs (docFormat$)
CASE "co", "nu", "qu": tmp$ = "\cf0 "
CASE ELSE: RETURN
END SELECT
CASE "foru"
SELECT CASE LCASE$(what$)
CASE "co", "nu", "qu": tmp$ = "[/color]"
CASE ELSE: RETURN
END SELECT
CASE "wiki"
SELECT CASE LCASE$(what$)
CASE "co": tmp$ = "</nowiki>|#919191}}"
@ -20790,21 +20827,28 @@ SUB ExportCodeAs (docFormat$)
IF cu% GOTO CustomNoLink
GOSUB FindWikiPage
IF me% AND le% AND co% THEN post% = 0: what$ = "co": GOSUB CloseText: co% = 0
IF me% OR pc% THEN lnk$ = me$: tmp$ = "{{Cm|": lkc$ = mec$: rtc$ = "\cf2": ELSE lnk$ = kw$: tmp$ = "{{Cl|": lkc$ = kwc$: rtc$ = "\cf3"
IF me% OR pc% THEN lnk$ = me$: ELSE lnk$ = kw$
pal% = LEN(page$): lkl% = LEN(lnk$)
SELECT CASE LCASE$(docFormat$)
CASE "html"
IF me% OR pc% THEN lkc$ = mec$: ELSE lkc$ = kwc$
MID$(eTxt$, ePos&, (2 * pal%) + lkl% + 120) = "<a style=" + CHR$(34) + "text-decoration: none; color: " + lkc$ + ";" + CHR$(34) + " href=" + CHR$(34) + "https://qb64phoenix.com/qb64wiki/index.php?title=" + page$ + CHR$(34) + " title=" + CHR$(34) + page$ + CHR$(34) + ">" + lnk$ + "</a>"
ePos& = ePos& + (2 * pal%) + lkl% + 120
CASE "rich"
MID$(eTxt$, ePos&, pal% + lkl% + 108) = "{\field{\*\fldinst HYPERLINK " + CHR$(34) + "https://qb64phoenix.com/qb64wiki/index.php?title=" + page$ + CHR$(34) + "}{\fldrslt{" + rtc$ + "\ul0 " + lnk$ + "}}}\cf0 "
IF me% OR pc% THEN lkc$ = "\cf2": ELSE lkc$ = "\cf3"
MID$(eTxt$, ePos&, pal% + lkl% + 108) = "{\field{\*\fldinst HYPERLINK " + CHR$(34) + "https://qb64phoenix.com/qb64wiki/index.php?title=" + page$ + CHR$(34) + "}{\fldrslt{" + lkc$ + "\ul0 " + lnk$ + "}}}\cf0 "
ePos& = ePos& + pal% + lkl% + 108
CASE "foru"
IF me% OR pc% THEN lkc$ = "#55FF55": ELSE lkc$ = "#4593D8"
MID$(eTxt$, ePos&, pal% + lkl% + 84) = "[url=https://qb64phoenix.com/qb64wiki/index.php?title=" + page$ + "][color=" + lkc$ + "]" + lnk$ + "[/color][/url]"
ePos& = ePos& + pal% + lkl% + 84
CASE "wiki"
IF me% OR pc% THEN lkc$ = "{{Cm|": ELSE lkc$ = "{{Cl|"
IF UCASE$(page$) = UCASE$(lnk$) THEN
MID$(eTxt$, ePos&, lkl% + 7) = tmp$ + lnk$ + "}}"
MID$(eTxt$, ePos&, lkl% + 7) = lkc$ + lnk$ + "}}"
ePos& = ePos& + lkl% + 7
ELSE
MID$(eTxt$, ePos&, pal% + lkl% + 8) = tmp$ + page$ + "|" + lnk$ + "}}"
MID$(eTxt$, ePos&, pal% + lkl% + 8) = lkc$ + page$ + "|" + lnk$ + "}}"
ePos& = ePos& + pal% + lkl% + 8
END IF
CASE ELSE: RETURN
@ -20821,6 +20865,9 @@ SUB ExportCodeAs (docFormat$)
CASE "rich"
MID$(eTxt$, ePos&, kwl% + 10) = "\cf2 " + kw$ + "\cf0 "
ePos& = ePos& + kwl% + 10
CASE "foru"
MID$(eTxt$, ePos&, kwl% + 23) = "[color=#55FF55]" + kw$ + "[/color]"
ePos& = ePos& + kwl% + 23
CASE "wiki"
MID$(eTxt$, ePos&, kwl% + 17) = "{{Text|" + kw$ + "|#55FF55}}"
ePos& = ePos& + kwl% + 17
@ -20856,8 +20903,8 @@ SUB ExportCodeAs (docFormat$)
ech$ = "\u" + LTRIM$(STR$(uni&)) + "\'bf": sk% = -1
CASE ELSE: RETURN
END SELECT
CASE "wiki" ' 'Keeps the original encoding, so Wiki examples can be copied
SELECT CASE curr% 'back to the IDE. However, chars appear wrong in the Wiki.
CASE "foru", "wiki" ' 'Keeps the original encoding, so Forum/Wiki examples can be copied
SELECT CASE curr% 'back to the IDE. However, chars appear wrong in the Forum/Wiki.
CASE IS > 127: ech$ = "&#" + LTRIM$(STR$(curr%)) + ";": sk% = -1
CASE ELSE: RETURN
END SELECT