Source language: Translate to:

FreeBasic Plug-ins SDK work in progress

Questions about NeoBook PlugIns

Moderator: Neosoft Support

FreeBasic Plug-ins SDK work in progress

Postby Khappa » Fri Jan 12, 2007 11:28 am

Hi, I'm a developer and I wanna do the Plug-ins SDK for FreeBasi or Ibasic, but my favorite language is FreeBasic for her power graphic functions.
:( :( :( :(

This is the code

_____________________________________

Option Explicit
'Option Private


'#Include Once "Lib/window.bi"
'#Include Once "Lib/commctrl.bi"
'#Include Once "Lib/shellapi.bi"

' Setup our booleans
Const FALSE = 0
Const TRUE = Not FALSE


' ***************** NeoBook Interface Functions Do Not MODIFY *****************}
'
' Const Action Command Parameter Types...
Const ACTIONPARAM_NONE = 0 ' None
Const ACTIONPARAM_ALPHA = 1 ' May contain Alpha, numeric, punctuation, etc.
Const ACTIONPARAM_ALPHASP = 2 ' Contains aplha text that can be spell checked.
Const ACTIONPARAM_NUMERIC = 3 ' Must be numeric value 0..9
Const ACTIONPARAM_MIXED = 4 ' May be either numeric Or Alpha. May contain math expression
Const ACTIONPARAM_FILENAME = 5 ' Parameter Is a file Name
Const ACTIONPARAM_VARIABLE = 6 ' Parameter Is a variable Name

Const MaxActionParams = 10 ' Maximum number of parameters per action

Type TAddActionProc
IDNum As Integer
NameAct As String
Hint As String
Params As Byte
NumParams As Byte
End Type

Type TAddFileProc
FileName As String
AddFlag As Integer
End Type

Type TVarGetProc
VarName As String
Value As String
End Type

Type TVarSetProc
VarName As String
Value As String
End Type

Dim Shared nbGetVar As TVarGetProc
Dim Shared nbSetVar As TVarSetProc
Dim Shared nbAddFile As TAddFileProc
Dim Shared nbAddAction As TAddActionProc
Dim Shared nbWinHandle As HWND
Dim Shared SaveExit As Single Pointer

' Used To free memory allocated To PChars. You must use this If you create Any
' PChars To send between NeoBook And your Plug-In DLL. Failure To use this
' procedure may result in memory allocation errors, memory leaks, crashes, etc...
' PROCEDURE FreeStr( VAR S : PChar );
' }BEGIN
' } If S <> NIL Then GlobalFree( HGLOBAL( S ) );
' } S := NIL;
' }End;
' }
' Used To modify PChar parameteres. You must use this If you modify Any
' PChars sent between NeoBook And your Plug-In DLL. Failure To use this
' procedure may result in memory allocation errors, crashes, etc... }
' }PROCEDURE SetStr( VAR Dest : PChar; Const Source : String );
' }BEGIN
' } If Dest <> NIL Then GlobalFree( HGLOBAL( Dest ) );
' } Dest := Pointer( GlobalAlloc( GMEM_FIXED, Length( Source )+1 ) );
' } StrCopy( Dest, PChar( Source ) );
' }End;
' }
' ******************* End of NeoBook Interface Functions **********************}


' Dichiaro le funzioni di NeoBook
Declare Function nbEditAction CDECL Alias "nbEditAction" (ByVal IDNum As Integer, ByVal Params As String) As Integer
Declare Function nbExecAction CDECL Alias "nbExecAction" (ByVal IDNum As Integer, ByVal Params As String) As Integer
Declare Sub nbMessage (ByVal MsgCode As String, ByVal Reserved As Integer)
Declare Sub nbInitPlugIn CDECL Alias "nbInitPlugIn" (ByVal WinHandle As Long, ByVal PlugInTitle As String, ByVal PlugInPublisher As String, ByVal PlugInHint As String)
Declare Sub nbRegisterPlugIn CDECL Alias "nbRegisterPlugIn" (ByVal AddActionProc As TAddActionProc, ByVal AddFileProc As TAddFileProc, ByVal VarGetFunc As TVarGetProc, ByVal VarSetFunc As TVarSetProc Pointer)
Declare Sub Shutdown()


' Dichiaro le funzioni del mio propgramma
Declare Function Myfunction CDECL Alias "Myfunction" (ByVal returnStr As String) As String




'--- Myfunction
Function Myfunction CDECL Alias "Myfunction" (ByVal returnStr As String) As String Export
returnStr = "Hi this is my function!"
Print returnStr
Return returnStr
'Return retCopyr
End Function


' nbEditAction - called by NeoBook To edit/define On of the Plug-In's commands.
' Plug-In may display a dialog box With fields For user To fill in. Return
' TRUE If successful, FALSE If Not..
Function nbEditAction CDECL Alias "nbEditAction" (ByVal IDNum As Integer, ByVal Params As String) As Integer Export

' Examine the Action String To determine which Plug-In command To execute...
Select Case IDNum
Case 1
End Select

Return (FALSE)
End Function


' nbExecAction - called by NeoBook To execute one of the Plug-In's commands... }
Function nbExecAction CDECL Alias "nbExecAction" (ByVal IDNum As Integer, ByVal Params As String) As Integer Export

' Examine the Action String To determine which Plug-In command To execute...
Select Case IDNum
Case 1
End Select

Return (FALSE)
End Function


' nbMessage - sent by NeoBook To inform plug-in of important NeoBook activities...
Sub nbMessage(ByVal MsgCode As String, ByVal Reserved As Integer)
' Not all types of plug-ins will care about these messages,
' so they can be ignored If Not needed. This procedure must be present even If
' none of the messages are used.
' Possible MsgCode values are:
' 1 = Pub has entered Run mode
' 2 = Pub Is about To Exit Run mode And Return To design mode.
' 3 = Pub Window has been deactivated
' 4 = Pub Window has been activated
' 5 = Pub Window has been moved Or sized
' 6 = Pub Is about To display another page

' Reserved value Is Not currently used

Select Case MsgCode
Case ""
Case ""
Case ""
Case ""
Case ""
Case ""
End Select

End Sub


' nbInitPlugIn - called by NeoBook To request information about the Plug-In...
Sub nbInitPlugIn CDECL Alias "nbInitPlugIn" (ByVal WinHandle As Long,ByVal PlugInTitle As String, ByVal PlugInPublisher As String, ByVal PlugInHint As String) Export

' Save handle of Parent NeoBook App Or compiled pub Window - may be required by some Windows functions
nbWinHandle = WinHandle

' Title of this Plug-In (appears As heading in NeoBook's action list)
' SetStr(PlugInTitle, 'Sample Plug-In')

' Publisher of this Plug-In
' SetStr(PlugInPublisher, 'John Doe')

' Description of this Plug-In
' SetStr(PlugInHint, 'Use this plug-in to display a Windows message box')

End Sub


' nbRegisterPlugIn - called by NeoBook when it wants you To register your plug-in's actions...
Sub nbRegisterPlugIn CDECL Alias "nbRegisterPlugIn" (ByVal AddActionProc As TAddActionProc, ByVal AddFileProc As TAddFileProc, ByVal VarGetFunc As TVarGetProc, ByVal VarSetFunc As TVarSetProc Pointer) Export

'***************************** Do Not MODIFY ********************************}
' nbGetVar := @TVarGetProc( VarGetFunc );
' nbSetVar := @TVarSetProc( VarSetFunc );
' nbAddAction := @TAddActionProc( AddActionProc );
' nbAddFile := @TAddFileProc( AddFileProc );
'****************************************************************************}

' Call the AddAction procedure For each of Plug-In command.

' Parameters For the ndAddAction procedure:

' Item 1 = Action ID number - must use a unique identifier For each of your actions.
' Item 2 = Action Name
' Item 3 = Action Description
' Item 4 = Array describing each of the Action's parameters - choose from the following:

' ACTIONPARAM_NONE = Use If action contains no parameters.
' ACTIONPARAM_ALPHA = Parameter Is a String. May contain Alpha, numeric, punctuation, etc.
' ACTIONPARAM_ALPHASP = Parameter Is a String that can be spell checked.
' ACTIONPARAM_NUMERIC = Parameter Is a number.
' ACTIONPARAM_MIXED = May be either numeric Or Alpha. May contain math expression
' ACTIONPARAM_FILENAME = Parameter Is a file Name
' ACTIONPARAM_VARIABLE = Parameter Is a variable Name

' Item 5 = Number of parameters required by this action
'
'******************* Enter your Plug-In's actions below *********************}



' Next, If necessary, tell NeoBook what extra files are required For your plug-in.
' These are the files that NeoBook will collect when compiling publications that
' use this plug-in. If your plug-in uses Any Data files, drivers Or special DLLs
' this Is where you will tell NeoBook about it. It Is Not necessary To include
' the Name of the plug-in itself since NeoBook will automatically assume that
' it Is required.
'
' Parameters For the ndAddFile procedure:
'
' Item 1 = File Name including correct drive And path
' Item 2 = TRUE To add the file, FALSE To remove the file
'
' For example:
'
' nbAddFile( 'c:\path\somefile.xyz', TRUE )

End Sub


Sub Shutdown

' If this plug-in requires Any special processing before being unloaded from
' memory, Do that here. Leave blank If no special processing Is needed.

' Restore old Exit procedure procedure...
ExitProc = SaveExit
End Sub


' *** Export the required functions For NeoBook interface. Do Not modify *****
' EXPORTS nbEditAction;
' EXPORTS nbExecAction;
' EXPORTS nbInitPlugIn;
' EXPORTS nbRegisterPlugIn;
' ****************************************************************************

'BEGIN
' SaveExit := ExitProc; // save Exit procedure Chain
' ExitProc := @Shutdown; // install LibExit Exit procedure
'End

____________________________________________

This is the plug SDK translate from Delphi to FreeBasic

You can help me to develop?

Thank you so much buddys!!!
:) :) :) :) :) :) :)
Khappa
 
Posts: 3
Joined: Thu Jan 11, 2007 4:51 am

Postby WinMacLyn » Sat Feb 10, 2007 6:16 pm

Hi Kappa,

Please tell me how you are doing in your research work using FreeBasic as a SDK for NeoBooK plug-ins?
I am very interested.

If you are planning to open a research and development team for this, please count me in!
If you do things with love, passion and common sense everything in life will be returned to you the same way.
User avatar
WinMacLyn
 
Posts: 110
Joined: Wed Jan 17, 2007 7:30 pm

Postby Khappa » Sun Feb 11, 2007 3:40 am

Hi WinMacLyn, Im so happy that You reply me.

My question is develop a powerfull graphic plug-in for Neobook. Freebasic is exellent software to create graphic functins, but to write plug SDK translate from Delphi code is very hard operations.

I was believed that some neobook team developer could be help me.

Can You reason the freebasic sdk for me?
Bye...
:) :) :) :) :)
Khappa
 
Posts: 3
Joined: Thu Jan 11, 2007 4:51 am

Postby Neosoft Support » Mon Feb 12, 2007 1:08 pm

The plug-in SDK includes a template for PowerBasic. Would that be compatible with FreeBasic?

The SDK is available from:

http://www.neosoftware.com/software/nbwpluginsdk.zip
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Khappa » Wed Feb 14, 2007 2:57 am

WOW!!!! Thank You so much Neosoft!!! Yeas would be so simile to freebasic... Now I work
:D :D :D :D :D
Khappa
 
Posts: 3
Joined: Thu Jan 11, 2007 4:51 am


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 2 guests