Changeset 7 for trunk/StudioCommon


Ignore:
Timestamp:
Aug 3, 2012, 10:42:13 AM (12 years ago)
Author:
chronos
Message:
  • Added: Registration of file types for modules.
  • Added: Some Brainfuck module sample code.
Location:
trunk/StudioCommon
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/StudioCommon/LDStudioCommon.lpk

    r5 r7  
    1717      </Other>
    1818    </CompilerOptions>
    19     <Files Count="1">
     19    <Files Count="2">
    2020      <Item1>
    2121        <Filename Value="ULDStudioAPI.pas"/>
    2222        <UnitName Value="ULDStudioAPI"/>
    2323      </Item1>
     24      <Item2>
     25        <Filename Value="USource.pas"/>
     26        <UnitName Value="USource"/>
     27      </Item2>
    2428    </Files>
    2529    <Type Value="RunAndDesignTime"/>
    26     <RequiredPkgs Count="3">
     30    <RequiredPkgs Count="4">
    2731      <Item1>
    28         <PackageName Value="LCL"/>
     32        <PackageName Value="TemplateGenerics"/>
    2933      </Item1>
    3034      <Item2>
    31         <PackageName Value="ModularSystem"/>
     35        <PackageName Value="LCL"/>
    3236      </Item2>
    3337      <Item3>
     38        <PackageName Value="ModularSystem"/>
     39      </Item3>
     40      <Item4>
    3441        <PackageName Value="FCL"/>
    35       </Item3>
     42      </Item4>
    3643    </RequiredPkgs>
    3744    <UsageOptions>
  • trunk/StudioCommon/LDStudioCommon.pas

    r5 r7  
    88
    99uses
    10   ULDStudioAPI, LazarusPackageIntf;
     10  ULDStudioAPI, USource, LazarusPackageIntf;
    1111
    1212implementation
  • trunk/StudioCommon/ULDStudioAPI.pas

    r5 r7  
    66
    77uses
    8   Classes, SysUtils, UModularSystem, ActnList, Menus, Forms;
     8  Classes, SysUtils, UModularSystem, ActnList, Menus, Forms, USource,
     9  SpecializedList;
    910
    1011type
     
    1819    MainForm: TForm;
    1920    MainMenu: TMainMenu;
     21    FileTypes: TFileTypes;
    2022    constructor Create;
    2123    destructor Destroy; override;
    2224
    2325    // API functions
     26    procedure RegisterFileType(FileType: TSourceType);
     27    procedure UnregisterFileType(FileType: TSourceType);
    2428    procedure RegisterForm(Form: TForm);
    2529    procedure UnregisterForm(Form: TForm);
     
    4448  FreeAndNil(Actions);
    4549  inherited Destroy;
     50end;
     51
     52procedure TLDStudioAPI.RegisterFileType(FileType: TSourceType);
     53begin
     54  FileTypes.Add(FileType);
     55end;
     56
     57procedure TLDStudioAPI.UnregisterFileType(FileType: TSourceType);
     58begin
     59  FileTypes.Remove(FileType);
    4660end;
    4761
Note: See TracChangeset for help on using the changeset viewer.