Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ying32 committed Oct 24, 2018
2 parents ba218d7 + d18ccba commit bec21a4
Show file tree
Hide file tree
Showing 72 changed files with 2,333 additions and 166 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
## A cross-platform Golang GUI library. Use Delphi VCL and Lazarus LCL for binding.

* [中文](README.zh-CN.md)
* [English](README.md)
* English

----

[![license](https://img.shields.io/badge/license-Apache%20License%202.0-green.svg)](https://github.com/ying32/govcl/blob/master/LICENSE)
[![License](https://img.shields.io/badge/license-Apache%20License%202.0-green.svg)](https://github.com/ying32/govcl/blob/master/LICENSE)
![Recommended Golang Version](https://img.shields.io/badge/recommended%20golang%20version->=1.9.0-green.svg)
[![screenshots](https://img.shields.io/badge/screenshots-view-green.svg)](https://github.com/ying32/govcl/tree/master/Screenshot)
[![Chinese Wiki](https://img.shields.io/badge/wiki-中文WIKI(Chinese%20WIKI)-green.svg)](https://gitee.com/ying32/govcl/wikis/pages)
[![Chinese Chat](https://img.shields.io/badge/QQ群-点击加入:263106281-red.svg)](https://jq.qq.com/?_wv=1027&k=5Sv7Qiq)
[![Screenshots](https://img.shields.io/badge/screenshots-view-green.svg)](https://github.com/ying32/govcl/tree/master/Screenshot)

![Support Platform](https://img.shields.io/badge/Platform-win--32%20%7C%20win--64%20%7C%20linux--64%20%7C%20osx--32-green.svg)
**Note: linux and macOS only part of the components, properties, events and methods are valid**


Librarys binaries
[![Librarys](https://img.shields.io/github/downloads/ying32/govcl/latest/Librarys-1.1.21.zip.svg)](https://github.com/ying32/govcl/releases/download/v1.1.21/Librarys-1.1.21.zip)
**Note: The attachment contains liblcl three platform binary, libvcl does not currently provide, you need to compile. For the compilation steps, please refer to the instructions in [UILIbSrcources](UILibSources/README.md)**
[![Librarys](https://img.shields.io/github/downloads/ying32/govcl/latest/Librarys-1.1.23.zip.svg)](https://github.com/ying32/govcl/releases/download/v1.1.23/Librarys-1.1.23.zip)
**Note: The "libvcl" library binary (libvcl. dll, libvclx64. dll) contained in the compression package is only for preview and test purposes. Please compile the "libvcl" source code for official use. please refer to the instructions in [UILIbSrcources](UILibSources/README.md).**


res2go Tool
[![res2go](https://img.shields.io/badge/downloads-res2go%201.0.5.zip-blue.svg)](https://github.com/ying32/govcl/blob/master/Tools/res2go)
[![res2go](https://img.shields.io/badge/downloads-res2go%201.0.5-blue.svg)](Tools/res2go)
**Note: Designed in Delphi/Lazarus, code written in Golang.**


Expand Down Expand Up @@ -138,7 +136,7 @@ func (f *TMainForm) OnBtn1Click(sender vcl.IObject) {
### FAQ

Q: Why is there no English WIKI?
A: My English is bad. You can try using Google Translate Chinese WIKI.
A: My English is bad. You can try using Google Translate [Chinese WIKI](https://gitee.com/ying32/govcl/wikis/pages).

---
### Note:
Expand Down
8 changes: 4 additions & 4 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 一个跨平台的Golang GUI库,底层绑定自Delphi VCL和Lazarus LCL

* [中文](README.zh-CN.md)
* 中文
* [English](README.md)

----
Expand All @@ -16,12 +16,12 @@


GUI库二进制下载:
[![Librarys](https://img.shields.io/github/downloads/ying32/govcl/latest/Librarys-1.1.21.zip.svg)](https://github.com/ying32/govcl/releases/download/v1.1.21/Librarys-1.1.21.zip)
**: 压缩包中下载的二进制只包含liblcl库,libvcl则需要你自己编译,具体编译方法参考[UILIbSrcources](UILibSources/README.zh-CN.md)中的说明。**
[![Librarys](https://img.shields.io/github/downloads/ying32/govcl/latest/Librarys-1.1.23.zip.svg)](https://github.com/ying32/govcl/releases/download/v1.1.23/Librarys-1.1.23.zip)
**:压缩包内包含的“libvcl”库二进制(libvcl.dll、libvclx64.dll)仅供预览和测试使用。正式使用请自行编译“libvcl”源代码,具体编译方法参考[UILIbSrcources](UILibSources/README.zh-CN.md)中的说明。**


res2go工具下载
[![res2go](https://img.shields.io/badge/downloads-res2go%201.0.5.zip-blue.svg)](https://github.com/ying32/govcl/blob/master/Tools/res2go)
[![res2go](https://img.shields.io/badge/downloads-res2go%201.0.5-blue.svg)](Tools/res2go)
**注:用Delphi/Lazarus设计界面,用Golang写代码。**


Expand Down
2 changes: 1 addition & 1 deletion Tools/res2go/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### res2go

* [中文](README.zh-CN.md)
* [English](README.md)
* English

----

Expand Down
2 changes: 1 addition & 1 deletion Tools/res2go/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### res2go

* [中文](README.zh-CN.md)
* 中文
* [English](README.md)

----
Expand Down
2 changes: 1 addition & 1 deletion UILibSources/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
* [中文](README.zh-CN.md)
* [English](README.md)
* English

----

Expand Down
2 changes: 1 addition & 1 deletion UILibSources/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

* [中文](README.zh-CN.md)
* 中文
* [English](README.md)

----
Expand Down
114 changes: 113 additions & 1 deletion UILibSources/liblcl/LazarusDef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,104 @@ begin
end;


//
//GUIDToString
function DGUIDToString(var AGUID: TGUID): PChar; extdecl;
begin
Result := PChar(GUIDToString(AGUID));
end;
//StringToGUID
procedure DStringToGUID(AGUIDStr: PChar; out AGUID: TGUID); extdecl;
begin
AGUID := StringToGUID(AGUIDStr);
end;

//CreateGUID
procedure DCreateGUID(out AGUID: TGUID); extdecl;
begin
CreateGUID(AGUID);//TGUID.NewGuid;
end;

// Printer
function Printer_Instance: TPrinter; extdecl;
begin
Result := Printer;
end;

//function DPrinter_SetPrinter(NewPrinter: TPrinter): TPrinter; extdecl;
//begin
// Result := SetPrinter(NewPrinter);
//end;
//
// 因参数与Delphi中不一致,这里要伪造下参数,后面 ADriver, APort, ADeviceMode 三个参数无效
procedure Printer_SetPrinter(Obj: TPrinter; aName, ADriver, APort: PChar; ADeviceMode: NativeUInt); extdecl;
begin
Obj.SetPrinter(aName);
end;



//----------------------------------------------------
// 一些lib的资源
type
TResItem = record
Name: PChar;
ValuePtr: Pointer;
end;

const
GLibResouces: array[0..26] of TResItem = (
(Name: 'SOpenFileTitle'; ValuePtr: @rsmbOpen),
(Name: 'SOKButton'; ValuePtr: @rsMbOK),
(Name: 'SCancelButton'; ValuePtr: @rsMbCancel),
(Name: 'SYesButton'; ValuePtr: @rsMbYes),
(Name: 'SNoButton'; ValuePtr: @rsMbNo),
(Name: 'SHelpButton'; ValuePtr: @rsMbHelp),
(Name: 'SCloseButton'; ValuePtr: @rsMbClose),
(Name: 'SIgnoreButton'; ValuePtr: @rsMbIgnore),
(Name: 'SRetryButton'; ValuePtr: @rsMbRetry),
(Name: 'SAbortButton'; ValuePtr: @rsMbAbort),
(Name: 'SAllButton'; ValuePtr: @rsMbAll),
(Name: 'SMsgDlgWarning'; ValuePtr: @rsMtWarning),
(Name: 'SMsgDlgError'; ValuePtr: @rsMtError),
(Name: 'SMsgDlgInformation'; ValuePtr: @rsMtInformation),
(Name: 'SMsgDlgConfirm'; ValuePtr: @rsMtConfirmation),
(Name: 'SMsgDlgYes'; ValuePtr: @rsMbYes),
(Name: 'SMsgDlgNo'; ValuePtr: @rsMbNo),
(Name: 'SMsgDlgOK'; ValuePtr: @rsMbOK),
(Name: 'SMsgDlgCancel'; ValuePtr: @rsMbCancel),
(Name: 'SMsgDlgHelp'; ValuePtr: @rsMbHelp),
//(Name: 'SMsgDlgHelpNone'; ValuePtr: @SMsgDlgHelpNone),
//(Name: 'SMsgDlgHelpHelp'; ValuePtr: @SMsgDlgHelpHelp),
(Name: 'SMsgDlgAbort'; ValuePtr: @rsMbAbort),
(Name: 'SMsgDlgRetry'; ValuePtr: @rsMbRetry),
(Name: 'SMsgDlgIgnore'; ValuePtr: @rsMbIgnore),
(Name: 'SMsgDlgAll'; ValuePtr: @rsMbAll),
(Name: 'SMsgDlgNoToAll'; ValuePtr: @rsMbNoToAll),
(Name: 'SMsgDlgYesToAll'; ValuePtr: @rsMbYesToAll),
(Name: 'SMsgDlgClose'; ValuePtr: @rsMbClose)

);

function DGetLibResouceCount: Integer; extdecl;
begin
Result := Length(GLibResouces);
end;

procedure DGetLibResouceItem(AIndex: Integer; out AResult: TResItem); extdecl;
begin
if (AIndex >= 0) and (AIndex < Length(GLibResouces)) then
AResult := GLibResouces[AIndex];
end;

// 说不好有没有内存泄露,啊,先这样呗
procedure DModifyLibResouce(APtr: Pointer; AValue: PChar); extdecl;
begin
if APtr <> nil then
PResStringRec(APtr)^ := string(AValue);
end;


// dylib
type
TSyscall0 = function: UInt64; extdecl;
Expand Down Expand Up @@ -1016,5 +1114,19 @@ exports
// Form uFormDesignerFile.pas
ResFormLoadFromStream,
ResFormLoadFromFile,
ResFormLoadFromResourceName
ResFormLoadFromResourceName,

// TGUID
DGUIDToString,
DStringToGUID,
DCreateGUID,

// Printer
Printer_Instance,
Printer_SetPrinter,

// libResouces
DGetLibResouceCount,
DGetLibResouceItem,
DModifyLibResouce
;
42 changes: 42 additions & 0 deletions UILibSources/liblcl/MyLCL_Bitmap.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ begin
AObj.Assign(Source);
end;

procedure Bitmap_FreeImage(AObj: TBitmap); extdecl;
begin
AObj.FreeImage;
end;

function Bitmap_HandleAllocated(AObj: TBitmap): LongBool; extdecl;
begin
Result := AObj.HandleAllocated;
Expand Down Expand Up @@ -117,6 +122,26 @@ begin
AObj.Handle := AValue;
end;

function Bitmap_GetHandleType(AObj: TBitmap): TBitmapHandleType; extdecl;
begin
Result := AObj.HandleType;
end;

procedure Bitmap_SetHandleType(AObj: TBitmap; AValue: TBitmapHandleType); extdecl;
begin
AObj.HandleType := AValue;
end;

function Bitmap_GetMaskHandle(AObj: TBitmap): HBITMAP; extdecl;
begin
Result := AObj.MaskHandle;
end;

procedure Bitmap_SetMaskHandle(AObj: TBitmap; AValue: HBITMAP); extdecl;
begin
AObj.MaskHandle := AValue;
end;

function Bitmap_GetPixelFormat(AObj: TBitmap): TPixelFormat; extdecl;
begin
Result := AObj.PixelFormat;
Expand Down Expand Up @@ -152,6 +177,16 @@ begin
AObj.Modified := AValue;
end;

function Bitmap_GetPalette(AObj: TBitmap): HPALETTE; extdecl;
begin
Result := AObj.Palette;
end;

procedure Bitmap_SetPalette(AObj: TBitmap; AValue: HPALETTE); extdecl;
begin
AObj.Palette := AValue;
end;

function Bitmap_GetPaletteModified(AObj: TBitmap): LongBool; extdecl;
begin
Result := AObj.PaletteModified;
Expand Down Expand Up @@ -208,6 +243,7 @@ exports
Bitmap_Create,
Bitmap_Free,
Bitmap_Assign,
Bitmap_FreeImage,
Bitmap_HandleAllocated,
Bitmap_LoadFromStream,
Bitmap_SaveToStream,
Expand All @@ -227,13 +263,19 @@ exports
Bitmap_GetCanvas,
Bitmap_GetHandle,
Bitmap_SetHandle,
Bitmap_GetHandleType,
Bitmap_SetHandleType,
Bitmap_GetMaskHandle,
Bitmap_SetMaskHandle,
Bitmap_GetPixelFormat,
Bitmap_SetPixelFormat,
Bitmap_GetEmpty,
Bitmap_GetHeight,
Bitmap_SetHeight,
Bitmap_GetModified,
Bitmap_SetModified,
Bitmap_GetPalette,
Bitmap_SetPalette,
Bitmap_GetPaletteModified,
Bitmap_SetPaletteModified,
Bitmap_GetTransparent,
Expand Down
12 changes: 12 additions & 0 deletions UILibSources/liblcl/MyLCL_GIFImage.inc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ begin
AObj.Modified := AValue;
end;

function GIFImage_GetPalette(AObj: TGIFImage): HPALETTE; extdecl;
begin
Result := AObj.Palette;
end;

procedure GIFImage_SetPalette(AObj: TGIFImage; AValue: HPALETTE); extdecl;
begin
AObj.Palette := AValue;
end;

function GIFImage_GetPaletteModified(AObj: TGIFImage): LongBool; extdecl;
begin
Result := AObj.PaletteModified;
Expand Down Expand Up @@ -186,6 +196,8 @@ exports
GIFImage_SetHeight,
GIFImage_GetModified,
GIFImage_SetModified,
GIFImage_GetPalette,
GIFImage_SetPalette,
GIFImage_GetPaletteModified,
GIFImage_SetPaletteModified,
GIFImage_GetTransparent,
Expand Down
12 changes: 12 additions & 0 deletions UILibSources/liblcl/MyLCL_Graphic.inc
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ begin
AObj.Modified := AValue;
end;

function Graphic_GetPalette(AObj: TGraphic): HPALETTE; extdecl;
begin
Result := AObj.Palette;
end;

procedure Graphic_SetPalette(AObj: TGraphic; AValue: HPALETTE); extdecl;
begin
AObj.Palette := AValue;
end;

function Graphic_GetPaletteModified(AObj: TGraphic): LongBool; extdecl;
begin
Result := AObj.PaletteModified;
Expand Down Expand Up @@ -173,6 +183,8 @@ exports
Graphic_SetHeight,
Graphic_GetModified,
Graphic_SetModified,
Graphic_GetPalette,
Graphic_SetPalette,
Graphic_GetPaletteModified,
Graphic_SetPaletteModified,
Graphic_GetTransparent,
Expand Down
12 changes: 12 additions & 0 deletions UILibSources/liblcl/MyLCL_Icon.inc
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ begin
AObj.Modified := AValue;
end;

function Icon_GetPalette(AObj: TIcon): HPALETTE; extdecl;
begin
Result := AObj.Palette;
end;

procedure Icon_SetPalette(AObj: TIcon; AValue: HPALETTE); extdecl;
begin
AObj.Palette := AValue;
end;

function Icon_GetPaletteModified(AObj: TIcon): LongBool; extdecl;
begin
Result := AObj.PaletteModified;
Expand Down Expand Up @@ -211,6 +221,8 @@ exports
Icon_SetHeight,
Icon_GetModified,
Icon_SetModified,
Icon_GetPalette,
Icon_SetPalette,
Icon_GetPaletteModified,
Icon_SetPaletteModified,
Icon_GetTransparent,
Expand Down
Loading

0 comments on commit bec21a4

Please sign in to comment.