diff options
| author | Pietro Gagliardi <[email protected]> | 2015-02-17 17:13:40 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-02-17 17:14:09 -0500 |
| commit | 62d9ae07ade0857e838e5e10502a34501f88fd04 (patch) | |
| tree | a4bfebb7b17eb1ab5eb9ec2995c99dd61a2b69f7 /imagelist_windows.go | |
| parent | 010c989da9202f7261a98671377054867ba0d46d (diff) | |
Beginning the integration of the new Windows Table, which starts with removing ImageList. Darwin code will still be kept pending the use of its code. Windows code will be kept until I confirm nothing is used.
Diffstat (limited to 'imagelist_windows.go')
| -rw-r--r-- | imagelist_windows.go | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/imagelist_windows.go b/imagelist_windows.go deleted file mode 100644 index 087bbda..0000000 --- a/imagelist_windows.go +++ /dev/null @@ -1,45 +0,0 @@ -// 16 august 2014 - -package ui - -import ( - "image" - "unsafe" -) - -// #include "winapi_windows.h" -import "C" - -type imagelist struct { - list []C.HBITMAP - width []int - height []int -} - -func newImageList() ImageList { - return new(imagelist) -} - -func (i *imagelist) Append(img *image.RGBA) { - i.list = append(i.list, C.unscaledBitmap(unsafe.Pointer(img), C.intptr_t(img.Rect.Dx()), C.intptr_t(img.Rect.Dy()))) - i.width = append(i.width, img.Rect.Dx()) - i.height = append(i.height, img.Rect.Dy()) -} - -func (i *imagelist) Len() ImageIndex { - return ImageIndex(len(i.list)) -} - -type imageListApply interface { - apply(C.HWND, C.UINT) -} - -func (i *imagelist) apply(hwnd C.HWND, uMsg C.UINT) { - width := C.GetSystemMetrics(C.SM_CXSMICON) - height := C.GetSystemMetrics(C.SM_CYSMICON) - il := C.newImageList(width, height) - for index := range i.list { - C.addImage(il, hwnd, i.list[index], C.int(i.width[index]), C.int(i.height[index]), width, height) - } - C.SendMessageW(hwnd, uMsg, 0, C.LPARAM(uintptr(unsafe.Pointer(il)))) -} |
