Changeset 7


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
Files:
5 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Studio/LibreDevelopStudio.lpi

    r5 r7  
    3333      </local>
    3434    </RunParams>
    35     <RequiredPackages Count="3">
     35    <RequiredPackages Count="4">
    3636      <Item1>
    37         <PackageName Value="LDModuleDebug"/>
     37        <PackageName Value="LDModuleBrainfuck"/>
    3838      </Item1>
    3939      <Item2>
    40         <PackageName Value="LibreDevelopStudio"/>
     40        <PackageName Value="LDModuleDebug"/>
    4141      </Item2>
    4242      <Item3>
     43        <PackageName Value="LibreDevelopStudio"/>
     44      </Item3>
     45      <Item4>
    4346        <PackageName Value="LCL"/>
    44       </Item3>
     47      </Item4>
    4548    </RequiredPackages>
    4649    <Units Count="2">
  • trunk/Studio/UCore.pas

    r6 r7  
    3131
    3232uses
    33   ULDModuleDebug, UFormMain;
     33  ULDModuleDebug, UFormMain, ULDModuleBrainfuck, UDataModule;
    3434
    3535{ TCore }
     
    5151begin
    5252  ModuleManager.RegisterModule(TLDModuleDebug.Create, True);
     53  ModuleManager.RegisterModule(TLDModuleBrainfuck.Create, True);
    5354  ModuleManager.InstallMarked;
    5455end;
     
    5859  TLDStudioAPI(ModuleManager.API).MainForm := FormMain;
    5960  TLDStudioAPI(ModuleManager.API).MainMenu := FormMain.MainMenu;
     61  TLDStudioAPI(ModuleManager.API).FileTypes := DataModule1.FileTypes;
    6062  RegisterModules;
    6163end;
  • 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
  • trunk/StudioModules/LDModuleBrainfuck

    • Property svn:ignore set to
      lib
  • trunk/StudioPackage/Forms/UFormMain.lfm

    r6 r7  
    11object FormMain: TFormMain
    2   Left = 266
     2  Left = 265
    33  Height = 520
    4   Top = 113
     4  Top = 144
    55  Width = 747
    66  Caption = 'LibreDevelop Studio'
     
    118118    left = 80
    119119    top = 48
     120    object MenuItem26: TMenuItem
     121      Caption = 'File'
     122      object MenuItem27: TMenuItem
     123        Action = AFileNew
     124      end
     125      object MenuItem28: TMenuItem
     126        Action = AFileOpen
     127      end
     128      object MenuItem29: TMenuItem
     129        Action = AFileOpenRecent
     130      end
     131      object MenuItem30: TMenuItem
     132        Action = AFileSave
     133      end
     134      object MenuItem31: TMenuItem
     135        Action = AFileSaveAs
     136      end
     137      object MenuItem32: TMenuItem
     138        Action = AFileClose
     139      end
     140      object MenuItem33: TMenuItem
     141        Caption = '-'
     142      end
     143      object MenuItem34: TMenuItem
     144        Action = AExit
     145      end
     146    end
    120147    object MenuItem1: TMenuItem
    121148      Caption = 'Project'
     
    358385      end
    359386      object MenuItem14: TMenuItem
    360         Action = AExit
    361         Bitmap.Data = {
    362           36040000424D3604000000000000360000002800000010000000100000000100
    363           2000000000000004000064000000640000000000000000000000000000000000
    364           0000000000000000000000000000000000FF0000000000000000000000000000
    365           0000000000000000000000000000000000000000000000000000000000000000
    366           00000000000000000000000000FF000000FF0000000000000000000000000000
    367           0000000000000000000000000000000000000000000000000000000000000000
    368           000000000000000000FF008484FF000000FF0000000000000000000000000000
    369           0000000000000000000000000000000000000000000000000000000000000000
    370           0000000000FF008484FF008484FF000000FF0000000000000000000000000000
    371           0000000000000000000000000000000000000000000000000000000000FF0000
    372           00FF008484FF008484FF008484FF000000FF000000FF000000FF000000FF0000
    373           00FF000000FF000000FF000000FF000000000000000000000000000000000000
    374           00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
    375           0000000000000000000000000000000000000000000000000000000000000000
    376           00FF008484FF008484FF000000FF000000FFFFFFFFFFFFFFFFFF000000FF0000
    377           0000000000000000000000000000840000FF0000000000000000000000000000
    378           00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
    379           00000000000000000000840000FF840000FF0000000000000000000000000000
    380           00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
    381           000000000000840000FF840000FF840000FF840000FF840000FF000000000000
    382           00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
    383           0000840000FF840000FF840000FF840000FF840000FF840000FF000000000000
    384           00FF008484FF008484FF008484FF000000FFFFFFFFFFFFFFFFFF000000FF0000
    385           000000000000840000FF840000FF840000FF840000FF840000FF000000000000
    386           00FF008484FF008484FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
    387           00000000000000000000840000FF840000FF0000000000000000000000000000
    388           00FF008484FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
    389           0000000000000000000000000000840000FF0000000000000000000000000000
    390           00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
    391           0000000000000000000000000000000000000000000000000000000000000000
    392           00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
    393           0000000000000000000000000000000000000000000000000000000000000000
    394           0000000000000000000000000000000000000000000000000000000000000000
    395           0000000000000000000000000000000000000000000000000000
    396         }
     387        Action = AViewProjectManager
    397388      end
    398389    end
     
    542533      object MenuItem19: TMenuItem
    543534        Action = AViewSettings
     535        Bitmap.Data = {
     536          36040000424D3604000000000000360000002800000010000000100000000100
     537          2000000000000004000064000000640000000000000000000000986B37FF976A
     538          36FF966935FF966734FF956633FF946532FF946531FF936430FF92622FFF9261
     539          2EFF91602DFF90602CFF905F2BFF8F5D2AFF8E5C29FF8D5B28FF996C38FFF8F7
     540          F6FFF8F7F5FFF7F6F5FFF6F6F4FFF6F5F3FFF5F5F3FFF5F4F2FFF4F3F1FFF4F3
     541          F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F0EEFFF1F0EDFF8E5D29FF996D3AFFF9F8
     542          F7FF959594FF878787FF9B9A9AFFF7F6F4FFF6F5F3FFF6F5F3FFF5F4F2FFF4F3
     543          F1FFF4F3F1FFF3F2F0FFF3F2EFFFF2F1EFFFF2F1EEFF8F5E2AFF9A6E3BFFF9F9
     544          F8FF7C7C7CFFC4C4C4FF878787FFF7F6F5FF7A7A7AFF787878FF747474FF7171
     545          70FF6D6D6CFF696968FF656565FF616161FFF2F1EFFF905F2BFF9B6F3CFFFAF9
     546          F8FFBEBEBDFF929292FFBCBCBBFFF8F7F6FFF7F7F5FFF7F6F4FFF6F5F4FFF6F5
     547          F3FFF5F4F2FFF5F4F2FFF4F3F1FFF4F2F0FFF3F2F0FF91602DFF9C703DFFFAFA
     548          F9FFFAF9F9FFF9F9F8FFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6F5FFF6F5
     549          F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FFF4F3F0FF92612EFF9D723EFFFBFB
     550          FAFF9F9F9EFF7F7F7FFFAEAEADFFF9F8F7FFF8F8F7FFF8F7F6FFF7F7F5FFF7F6
     551          F5FFF6F6F4FFF6F5F3FFF5F4F3FFF5F4F2FFF4F3F1FF92622FFF9D7340FFFCFB
     552          FBFF818181FFC4C4C4FF8F8F8FFFFAF9F8FF7B7B7AFF797979FF757574FF7271
     553          71FF6D6D6DFF696969FF666665FF626261FFF5F4F2FF936430FF9E7441FFFCFC
     554          FCFFB5B5B5FF848484FFBEBDBDFFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FFF8F8
     555          F6FFF8F7F5FFF7F6F5FFF7F6F4FFF6F5F3FFF6F5F3FF946531FF9F7542FFFDFD
     556          FCFFFCFCFCFFFCFCFBFFFBFBFAFFFBFAFAFFFAFAF9FFFAF9F8FFF9F9F8FFF9F8
     557          F7FFF8F8F6FFF8F7F6FFF7F6F5FFF7F6F4FFF6F5F4FF956633FFA07643FFFEFD
     558          FDFF8C8C8CFF525252FFA4A4A4FFFBFBFAFFFBFBFAFFFAFAF9FFFAF9F8FFF9F9
     559          F8FFF9F8F7FFF8F8F6FFF8F7F6FFF7F7F5FFF7F6F4FF966734FFA17844FFFEFE
     560          FEFF5F5F5FFF949494FF535353FFFCFCFBFF7B7B7BFF797979FF757575FF7272
     561          72FF6E6E6EFF6A6A69FF666666FF626262FFF7F7F5FF966935FFA17946FFFFFF
     562          FFFF878787FF5D5D5DFFA0A0A0FFFDFCFCFFFCFCFBFFFCFBFBFFFBFBFAFFFBFA
     563          F9FFFAFAF9FFFAF9F8FFF9F8F7FFF8F8F7FFF8F7F6FF976A36FFA27A47FFFFFF
     564          FFFFFFFFFFFFFEFEFEFFFEFEFEFFFDFDFDFFFDFDFCFFFCFCFBFFFCFBFBFFFBFB
     565          FAFFFBFAF9FFFAFAF9FFFAF9F8FFF9F9F7FFF9F8F7FF986B37FFA37B48FFBEA2
     566          7FFFBEA17EFFBDA17DFFBDA07CFFBD9F7CFFBC9F7BFFBB9E7AFFBB9D7AFFBB9D
     567          79FFBA9C78FFB99B78FFB99A77FFB89A76FFB89975FF996C39FFA37B48FFA37B
     568          48FFA27A47FFA27946FFA17845FFA07744FFA07643FF9F7542FF9E7441FF9E73
     569          40FF9D723FFF9C713EFF9C703DFF9B6F3CFF9A6E3BFF9A6D3AFF
     570        }
    544571      end
    545572    end
    546573    object MenuItem17: TMenuItem
    547574      Caption = 'View'
    548       object MenuItem18: TMenuItem
    549         Action = AViewProjectManager
    550       end
    551575    end
    552576    object MenuItem15: TMenuItem
     
    563587      Hint = 'New project'
    564588      ImageIndex = 4
    565       ShortCut = 16462
    566589    end
    567590    object AProjectOpen: TAction
     
    570593      Hint = 'Open project'
    571594      ImageIndex = 8
    572       ShortCut = 16463
     595    end
     596    object AProjectOpenRecent: TAction
     597      Category = 'Project'
     598      Caption = 'Open recent'
     599      Hint = 'Open recent project'
     600      ImageIndex = 8
     601    end
     602    object AProjectSave: TAction
     603      Category = 'Project'
     604      Caption = 'Save'
     605      Hint = 'Save project'
     606      ImageIndex = 13
     607    end
     608    object AProjectSaveAs: TAction
     609      Category = 'Project'
     610      Caption = 'Save as...'
     611      Hint = 'Save project as'
     612      ImageIndex = 13
    573613    end
    574614    object AProjectClose: TAction
     
    577617      Hint = 'Close project'
    578618      ImageIndex = 3
    579     end
    580     object AProjectSave: TAction
    581       Category = 'Project'
    582       Caption = 'Save'
    583       Hint = 'Save project'
    584       ImageIndex = 13
    585       ShortCut = 16467
    586     end
    587     object AProjectSaveAs: TAction
    588       Category = 'Project'
    589       Caption = 'Save as...'
    590       Hint = 'Save project as'
    591       ImageIndex = 13
    592       ShortCut = 24659
    593     end
    594     object AProjectOpenRecent: TAction
    595       Category = 'Project'
    596       Caption = 'Open recent'
    597       Hint = 'Open recent project'
    598       ImageIndex = 8
    599619    end
    600620    object AClipboardCopy: TAction
     
    662682      Category = 'Build'
    663683      Caption = 'Clean'
     684    end
     685    object AFileNew: TAction
     686      Category = 'File'
     687      Caption = 'New...'
     688      ImageIndex = 4
     689      ShortCut = 16462
     690    end
     691    object AFileOpen: TAction
     692      Category = 'File'
     693      Caption = 'Open...'
     694      ImageIndex = 8
     695      OnExecute = AFileOpenExecute
     696      ShortCut = 16463
     697    end
     698    object AFileOpenRecent: TAction
     699      Category = 'File'
     700      Caption = 'Open recent'
     701      ImageIndex = 8
     702    end
     703    object AFileSave: TAction
     704      Category = 'File'
     705      Caption = 'Save'
     706      ImageIndex = 13
     707      ShortCut = 16467
     708    end
     709    object AFileSaveAs: TAction
     710      Category = 'File'
     711      Caption = 'Save as...'
     712      ImageIndex = 13
     713      ShortCut = 24659
     714    end
     715    object AFileClose: TAction
     716      Category = 'File'
     717      Caption = 'Close'
     718      ImageIndex = 3
    664719    end
    665720  end
     
    13751430    }
    13761431  end
     1432  object OpenDialogFile: TOpenDialog
     1433    Filter = 'kkk|.kk|jj|.jj'
     1434    left = 82
     1435    top = 210
     1436  end
     1437  object SaveDialogFile: TSaveDialog
     1438    left = 82
     1439    top = 264
     1440  end
    13771441end
  • trunk/StudioPackage/Forms/UFormMain.lrt

    r6 r7  
    55TFORMMAIN.TABSHEET3.CAPTION=TabSheet3
    66TFORMMAIN.TABSHEETSOURCE.CAPTION=TabSheetSource
     7TFORMMAIN.MENUITEM26.CAPTION=File
     8TFORMMAIN.MENUITEM33.CAPTION=-
    79TFORMMAIN.MENUITEM1.CAPTION=Project
    810TFORMMAIN.MENUITEM13.CAPTION=-
     
    1618TFORMMAIN.APROJECTOPEN.CAPTION=Open...
    1719TFORMMAIN.APROJECTOPEN.HINT=Open project
    18 TFORMMAIN.APROJECTCLOSE.CAPTION=Close
    19 TFORMMAIN.APROJECTCLOSE.HINT=Close project
     20TFORMMAIN.APROJECTOPENRECENT.CAPTION=Open recent
     21TFORMMAIN.APROJECTOPENRECENT.HINT=Open recent project
    2022TFORMMAIN.APROJECTSAVE.CAPTION=Save
    2123TFORMMAIN.APROJECTSAVE.HINT=Save project
    2224TFORMMAIN.APROJECTSAVEAS.CAPTION=Save as...
    2325TFORMMAIN.APROJECTSAVEAS.HINT=Save project as
    24 TFORMMAIN.APROJECTOPENRECENT.CAPTION=Open recent
    25 TFORMMAIN.APROJECTOPENRECENT.HINT=Open recent project
     26TFORMMAIN.APROJECTCLOSE.CAPTION=Close
     27TFORMMAIN.APROJECTCLOSE.HINT=Close project
    2628TFORMMAIN.ACLIPBOARDCOPY.CAPTION=Copy
    2729TFORMMAIN.ACLIPBOARDCOPY.HINT=Copy to clipboard
     
    4143TFORMMAIN.AREBUILD.CAPTION=Rebuild
    4244TFORMMAIN.ABUILDCLEAN.CAPTION=Clean
     45TFORMMAIN.AFILENEW.CAPTION=New...
     46TFORMMAIN.AFILEOPEN.CAPTION=Open...
     47TFORMMAIN.AFILEOPENRECENT.CAPTION=Open recent
     48TFORMMAIN.AFILESAVE.CAPTION=Save
     49TFORMMAIN.AFILESAVEAS.CAPTION=Save as...
     50TFORMMAIN.AFILECLOSE.CAPTION=Close
  • trunk/StudioPackage/Forms/UFormMain.pas

    r6 r7  
    1818    ABuild: TAction;
    1919    ABuildClean: TAction;
     20    AFileOpenRecent: TAction;
     21    AFileNew: TAction;
     22    AFileSaveAs: TAction;
     23    AFileSave: TAction;
     24    AFileClose: TAction;
     25    AFileOpen: TAction;
    2026    ARebuild: TAction;
    2127    AStop: TAction;
     
    4450    MenuItem16: TMenuItem;
    4551    MenuItem17: TMenuItem;
    46     MenuItem18: TMenuItem;
    4752    MenuItem19: TMenuItem;
    4853    MenuItem2: TMenuItem;
     
    5358    MenuItem24: TMenuItem;
    5459    MenuItem25: TMenuItem;
     60    MenuItem26: TMenuItem;
     61    MenuItem27: TMenuItem;
     62    MenuItem28: TMenuItem;
     63    MenuItem29: TMenuItem;
    5564    MenuItem3: TMenuItem;
     65    MenuItem30: TMenuItem;
     66    MenuItem31: TMenuItem;
     67    MenuItem32: TMenuItem;
     68    MenuItem33: TMenuItem;
     69    MenuItem34: TMenuItem;
    5670    MenuItem4: TMenuItem;
    5771    MenuItem5: TMenuItem;
     
    6074    MenuItem8: TMenuItem;
    6175    MenuItem9: TMenuItem;
     76    OpenDialogFile: TOpenDialog;
    6277    PageControl1: TPageControl;
    6378    PageControl2: TPageControl;
    6479    PageControl3: TPageControl;
    6580    PageControl4: TPageControl;
     81    SaveDialogFile: TSaveDialog;
    6682    Splitter1: TSplitter;
    6783    Splitter2: TSplitter;
     
    7793    ToolButton4: TToolButton;
    7894    procedure AExitExecute(Sender: TObject);
     95    procedure AFileOpenExecute(Sender: TObject);
    7996    procedure AViewProjectManagerExecute(Sender: TObject);
    8097    procedure AViewSettingsExecute(Sender: TObject);
     
    94111
    95112uses
    96   UFormProject, UFormSourceCode, UFormSettings;
     113  UFormProject, UFormSourceCode, UFormSettings, UDataModule;
    97114
    98115{ TFormMain }
     
    101118begin
    102119  Application.Terminate;
     120end;
     121
     122procedure TFormMain.AFileOpenExecute(Sender: TObject);
     123begin
     124  OpenDialogFile.Filter := DataModule1.FileTypes.GetDialogFilter;
     125  if OpenDialogFile.Execute then ;
    103126end;
    104127
  • trunk/StudioPackage/UDataModule.lfm

    r6 r7  
    11object DataModule1: TDataModule1
    22  OnCreate = DataModuleCreate
     3  OnDestroy = DataModuleDestroy
    34  OldCreateOrder = False
    45  Height = 297
  • trunk/StudioPackage/UDataModule.pas

    r6 r7  
    11unit UDataModule;
    22
    3 {$mode objfpc}{$H+}
     3{$mode delphi}{$H+}
    44
    55interface
    66
    77uses
    8   Classes, SysUtils, FileUtil, UProject, Forms;
     8  Classes, SysUtils, FileUtil, UProject, Forms, SpecializedList, USource;
    99
    1010type
    11 
    1211  { TDataModule1 }
    1312
    1413  TDataModule1 = class(TDataModule)
    1514    procedure DataModuleCreate(Sender: TObject);
     15    procedure DataModuleDestroy(Sender: TObject);
    1616  private
    1717    { private declarations }
    1818  public
    1919    Project: TProject;
     20    FileTypes: TFileTypes;
    2021  end;
    2122
     
    3940  Application.CreateForm(TFormSourceCode, FormSourceCode);
    4041  Application.CreateForm(TFormSettings, FormSettings);
     42  FileTypes := TFileTypes.Create;
     43end;
     44
     45procedure TDataModule1.DataModuleDestroy(Sender: TObject);
     46begin
     47  FreeAndNil(FileTypes);
    4148end;
    4249
Note: See TracChangeset for help on using the changeset viewer.