Skip to content

Commit

Permalink
#DECLARE & var - part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelachaux committed Sep 20, 2024
1 parent c57fa42 commit ec0fdae
Show file tree
Hide file tree
Showing 37 changed files with 1,778 additions and 2,446 deletions.
6 changes: 6 additions & 0 deletions Project/Sources/Methods/00_test.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ $Dom_svg:=SVG_New

Case of

//______________________________________________________
: (True:C214)

$Dom_picture:=SVG_New_image($Dom_svg; "#4DPop.png")
SVG_FADE_TO_GREY_SCALE($Dom_picture)

//______________________________________________________
: (True:C214) //ACI0104291

Expand Down
6 changes: 0 additions & 6 deletions Project/Sources/Methods/COMPILER_4DPop.4dm

This file was deleted.

116 changes: 23 additions & 93 deletions Project/Sources/Methods/COMPILER_Not_Thread_Safe.4dm
Original file line number Diff line number Diff line change
@@ -1,107 +1,37 @@
//%attributes = {"invisible":true}
C_TEXT:C284(<>SVG_viewerSource)
C_PICTURE:C286(<>SVG_viewerPicture)
C_PICTURE:C286(<>SVG_viewerPictureBackup)
C_TEXT:C284(<>SVG_Txt_Viewer_Callback_Method)
var <>SVG_viewerSource : Text
var <>SVG_viewerPicture : Picture
var <>SVG_viewerPictureBackup : Picture
var <>SVG_Txt_Viewer_Callback_Method : Text

C_BOOLEAN:C305(<>showColoredBackground)
C_LONGINT:C283(<>backgroundColor)
C_LONGINT:C283(<>sourceFontSize)
C_BOOLEAN:C305(<>automaticallyResize)
var <>showColoredBackground : Boolean
var <>backgroundColor : Integer
var <>sourceFontSize : Integer
var <>automaticallyResize : Boolean

C_LONGINT:C283(<>Lon_tabID)
C_PICTURE:C286(<>Pic_viewerTab)
var <>Lon_tabID : Integer
var <>Pic_viewerTab : Picture

C_TEXT:C284(<>svg_recentMenuRef)
var <>svg_recentMenuRef : Text

C_LONGINT:C283(<>Lon_viewerTimerEvent)
var <>Lon_viewerTimerEvent : Integer

C_LONGINT:C283(<>svg_tabID)
C_LONGINT:C283(<>Lon_tabList)
var <>svg_tabID : Integer
var <>Lon_tabList : Integer

C_LONGINT:C283(<>lst_syntax;<>Lon_currentElement)
C_TEXT:C284(<>Txt_Name)
C_LONGINT:C283(<>Lon_timerEvent)
C_LONGINT:C283(<>bDocumentation)
var <>lst_syntax; <>Lon_currentElement : Integer
var <>Txt_Name : Text
var <>Lon_timerEvent : Integer
var <>bDocumentation : Integer

C_LONGINT:C283(<>Lon_opacity)
var <>Lon_opacity : Integer

C_POINTER:C301(<>Ptr_Document) // Pointer to the Document variable of the host database
var <>Ptr_Document : Pointer // Pointer to the Document variable of the host database

If (False:C215)

ARRAY BOOLEAN:C223(<>tBoo_listbox;0)
ARRAY PICTURE:C279(<>tPic_Colors;0x0000)
ARRAY TEXT:C222(<>tTxt_colorNames;0x0000)
ARRAY BOOLEAN:C223(<>tBoo_listbox; 0)
ARRAY PICTURE:C279(<>tPic_Colors; 0x0000)
ARRAY TEXT:C222(<>tTxt_colorNames; 0x0000)

// ----------------------------------------------------
C_OBJECT:C1216(fallBack_Not_thread_safe ;$1)

// ----------------------------------------------------
C_BOOLEAN:C305(syntax_EXPAND ;$1)

// ----------------------------------------------------
C_TEXT:C284(Syntax_help ;$1)

// ----------------------------------------------------
C_LONGINT:C283(syntax_List ;$0)

// ----------------------------------------------------
C_TEXT:C284(Syntax_main ;$1)

// ----------------------------------------------------
C_TEXT:C284(Viewer_main ;$1)
C_TEXT:C284(Viewer_main ;$2)

// ----------------------------------------------------
C_TEXT:C284(viewer_sources ;$0)
C_TEXT:C284(viewer_sources ;$1)

// ----------------------------------------------------
C_TEXT:C284(Color_main ;$1)

// ----------------------------------------------------
C_POINTER:C301(SVG_ABOUT ;$1)

// ----------------------------------------------------
C_POINTER:C301(SVGTool_Display_syntax ;$1)

// ----------------------------------------------------
C_POINTER:C301(SVGTool_Display_viewer ;$1)

// ----------------------------------------------------
C_POINTER:C301(SVGTool_Display_colors ;$1)

// ----------------------------------------------------
C_TEXT:C284(SVGTool_SHOW_IN_VIEWER ;$1)
C_TEXT:C284(SVGTool_SHOW_IN_VIEWER ;$2)

// ----------------------------------------------------
C_TEXT:C284(SVGTool_SET_VIEWER_CALLBACK ;$1)

// ----------------------------------------------------
C_LONGINT:C283(xToolBox_tabCreate ;$0)
C_POINTER:C301(xToolBox_tabCreate ;$1)
C_POINTER:C301(xToolBox_tabCreate ;$2)
C_TEXT:C284(xToolBox_tabCreate ;$3)

// ----------------------------------------------------
C_LONGINT:C283(xToolBox_tabHandler ;$0)
C_LONGINT:C283(xToolBox_tabHandler ;$1)
C_POINTER:C301(xToolBox_tabHandler ;$2)
C_LONGINT:C283(xToolBox_tabHandler ;$3)
C_LONGINT:C283(xToolBox_tabHandler ;$4)

// ----------------------------------------------------
C_TEXT:C284(xToolBox_BytesToString ;$0)
C_REAL:C285(xToolBox_BytesToString ;$1)
C_TEXT:C284(xToolBox_BytesToString ;$2)
C_TEXT:C284(xToolBox_BytesToString ;$3)
C_TEXT:C284(xToolBox_BytesToString ;$4)
C_LONGINT:C283(xToolBox_BytesToString ;$5)

// ----------------------------------------------------
xToolBox_NO_ERROR

// ----------------------------------------------------
End if
74 changes: 37 additions & 37 deletions Project/Sources/Methods/COMPILER_Rgx.4dm
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
//%attributes = {"invisible":true}
// ----------------------------------------------------
// Method : Compiler_Rgx
// Created 28/09/07 by Vincent de Lachaux
// ----------------------------------------------------
// Description
//
// ----------------------------------------------------
// ----------------------------------------------------
// Method : Compiler_Rgx
// Created 28/09/07 by Vincent de Lachaux
// ----------------------------------------------------
// Description
//
// ----------------------------------------------------

C_LONGINT:C283(rgx_Lon_Error)
var rgx_Lon_Error : Integer

If (False:C215)

//Public ----------------------------
C_LONGINT:C283(Rgx_ExtractText ;$0)
C_TEXT:C284(Rgx_ExtractText ;$1)
C_TEXT:C284(Rgx_ExtractText ;$2)
C_TEXT:C284(Rgx_ExtractText ;$3)
C_POINTER:C301(Rgx_ExtractText ;$4)
C_LONGINT:C283(Rgx_ExtractText ;$5)
// Public ----------------------------
_O_C_LONGINT:C283(Rgx_ExtractText; $0)
_O_C_TEXT:C284(Rgx_ExtractText; $1)
_O_C_TEXT:C284(Rgx_ExtractText; $2)
_O_C_TEXT:C284(Rgx_ExtractText; $3)
_O_C_POINTER:C301(Rgx_ExtractText; $4)
_O_C_LONGINT:C283(Rgx_ExtractText; $5)

C_TEXT:C284(Rgx_Get_Pattern ;$0)
C_TEXT:C284(Rgx_Get_Pattern ;$1)
C_TEXT:C284(Rgx_Get_Pattern ;$2)
C_POINTER:C301(Rgx_Get_Pattern ;$3)
_O_C_TEXT:C284(Rgx_Get_Pattern; $0)
_O_C_TEXT:C284(Rgx_Get_Pattern; $1)
_O_C_TEXT:C284(Rgx_Get_Pattern; $2)
_O_C_POINTER:C301(Rgx_Get_Pattern; $3)

C_LONGINT:C283(Rgx_MatchText ;$0)
C_TEXT:C284(Rgx_MatchText ;$1)
C_TEXT:C284(Rgx_MatchText ;$2)
C_POINTER:C301(Rgx_MatchText ;$3)
C_LONGINT:C283(Rgx_MatchText ;$4)
_O_C_LONGINT:C283(Rgx_MatchText; $0)
_O_C_TEXT:C284(Rgx_MatchText; $1)
_O_C_TEXT:C284(Rgx_MatchText; $2)
_O_C_POINTER:C301(Rgx_MatchText; $3)
_O_C_LONGINT:C283(Rgx_MatchText; $4)

C_LONGINT:C283(Rgx_SplitText ;$0)
C_TEXT:C284(Rgx_SplitText ;$1)
C_TEXT:C284(Rgx_SplitText ;$2)
C_POINTER:C301(Rgx_SplitText ;$3)
C_LONGINT:C283(Rgx_SplitText ;$4)
_O_C_LONGINT:C283(Rgx_SplitText; $0)
_O_C_TEXT:C284(Rgx_SplitText; $1)
_O_C_TEXT:C284(Rgx_SplitText; $2)
_O_C_POINTER:C301(Rgx_SplitText; $3)
_O_C_LONGINT:C283(Rgx_SplitText; $4)

C_LONGINT:C283(Rgx_SubstituteText ;$0)
C_TEXT:C284(Rgx_SubstituteText ;$1)
C_TEXT:C284(Rgx_SubstituteText ;$2)
C_POINTER:C301(Rgx_SubstituteText ;$3)
C_LONGINT:C283(Rgx_SubstituteText ;$4)
_O_C_LONGINT:C283(Rgx_SubstituteText; $0)
_O_C_TEXT:C284(Rgx_SubstituteText; $1)
_O_C_TEXT:C284(Rgx_SubstituteText; $2)
_O_C_POINTER:C301(Rgx_SubstituteText; $3)
_O_C_LONGINT:C283(Rgx_SubstituteText; $4)

//Private ----------------------------
C_TEXT:C284(rgx_Options ;$0)
C_LONGINT:C283(rgx_Options ;$1)
// Private ----------------------------
_O_C_TEXT:C284(rgx_Options; $0)
_O_C_LONGINT:C283(rgx_Options; $1)

End if
44 changes: 19 additions & 25 deletions Project/Sources/Methods/Color_main.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,14 @@
// Description
//
// ----------------------------------------------------
C_TEXT:C284($1)
#DECLARE($Txt_entryPoint : Text)

C_BLOB:C604($x)
C_BOOLEAN:C305($Boo_White)
C_LONGINT:C283($Lon_column; $Lon_currentPage; $Lon_formEvent; $Lon_i; $Lon_index; $Lon_line)
C_LONGINT:C283($Lon_parameters; $Lon_timerEvent; $Lon_windowRef)
C_PICTURE:C286($p)
C_TEXT:C284($Txt_color; $Txt_ColorThemeCode; $Txt_entryPoint; $Dom_svg; $t)

If (False:C215)
C_TEXT:C284(Color_main; $1)
End if

$Lon_parameters:=Count parameters:C259

If ($Lon_parameters>=1)

$Txt_entryPoint:=$1

End if
var $Dom_svg; $t; $Txt_color; $Txt_ColorThemeCode : Text
var $p : Picture
var $Boo_White : Boolean
var $Lon_column; $Lon_currentPage; $Lon_formEvent; $Lon_i; $Lon_index; $Lon_line : Integer
var $Lon_timerEvent; $Lon_windowRef : Integer
var $x : Blob

Case of

Expand All @@ -40,13 +28,14 @@ Case of
//……………………………………………………………………
Else

//This method must be executed in a new process
// This method must be executed in a new process
BRING TO FRONT:C326(New process:C317(Current method name:C684; 0; "$"+Current method name:C684; "_run"; *))

//……………………………………………………………………
End case

//___________________________________________________________

: ($Txt_entryPoint="onDrag")

LISTBOX GET CELL POSITION:C971(<>tBoo_listbox; $Lon_column; $Lon_line)
Expand All @@ -62,6 +51,7 @@ Case of
End if

SET TEXT TO PASTEBOARD:C523("\""+$Txt_color+"\"")

$Dom_svg:=SVG_New(40; 40)
$t:=SVG_New_rect($Dom_svg; 0; 0; 40; 40; 0; 0; "none"; $Txt_color; 0)
$p:=SVG_Export_to_picture($Dom_svg)
Expand All @@ -71,6 +61,7 @@ Case of
End if

//___________________________________________________________

: ($Txt_entryPoint="formMethod")

$Lon_formEvent:=Form event code:C388
Expand All @@ -88,7 +79,7 @@ Case of
Case of

//.....................................................
: ($Lon_timerEvent=-1) //INIT
: ($Lon_timerEvent=-1) // INIT

ARRAY PICTURE:C279(<>tPic_Colors; 0x0000)
ARRAY TEXT:C222(<>tTxt_colorNames; 0x0000)
Expand All @@ -97,20 +88,20 @@ Case of

$Dom_svg:=SVG_New(245; 30)
$t:=SVG_New_rect($Dom_svg; 0; 0; 245; 30; 0; 0; "none"; "none"; 0)
$t:=SVG_New_text($Dom_svg; Get localized string:C991("ColorTheme_"+String:C10($Lon_i)); 5; 8; "'lucida grande' 'arial'"; 12; Bold:K14:2; Align left:K42:2; "cadetblue")
$t:=SVG_New_text($Dom_svg; Localized string:C991("ColorTheme_"+String:C10($Lon_i)); 5; 8; "'lucida grande' 'arial'"; 12; Bold:K14:2; Align left:K42:2; "cadetblue")
$p:=SVG_Export_to_picture($Dom_svg)
SVG_CLEAR($Dom_svg)

APPEND TO ARRAY:C911(<>tPic_Colors; $p)
APPEND TO ARRAY:C911(<>tTxt_colorNames; "")

$Txt_ColorThemeCode:=Get localized string:C991("ColorThemeCode_"+String:C10($Lon_i))
$Txt_ColorThemeCode:=Localized string:C991("ColorThemeCode_"+String:C10($Lon_i))
$Lon_index:=0

Repeat

$Lon_index:=$Lon_index+1
$Txt_color:=Get localized string:C991($Txt_ColorThemeCode+String:C10($Lon_index; "00"))
$Txt_color:=Localized string:C991($Txt_ColorThemeCode+String:C10($Lon_index; "00"))

If (OK=1)

Expand All @@ -126,6 +117,7 @@ Case of
End if

APPEND TO ARRAY:C911(<>tTxt_colorNames; $Txt_color)

$Dom_svg:=SVG_New(245; 30)
$t:=SVG_New_rect($Dom_svg; 0; 0; 245; 28; 0; 0; $Txt_color; $Txt_color; 0)

Expand Down Expand Up @@ -157,7 +149,7 @@ Case of
<>Lon_timerEvent:=1

//.....................................................
: ($Lon_timerEvent=1) //Display
: ($Lon_timerEvent=1) // Display

//.....................................................
Else
Expand All @@ -172,6 +164,7 @@ Case of
End if

//……………………………………………………………………………

: ($Lon_formEvent=On Resize:K2:27)

//……………………………………………………………………………
Expand Down Expand Up @@ -199,6 +192,7 @@ Case of
End case

//___________________________________________________________

: ($Txt_entryPoint="_run")

// First launch of this method executed in a new process
Expand Down
Loading

0 comments on commit ec0fdae

Please sign in to comment.