annotate src/xpm_w32.c @ 33293:42b89193ab3e v9.0.1912

patch 9.0.1912: Cirrus-CI running out of credits Commit: https://github.com/vim/vim/commit/6f00d17e8d64ed46c85625e8ac38ed0928b32c58 Author: Christian Brabandt <cb@256bit.org> Date: Tue Sep 19 20:16:46 2023 +0200 patch 9.0.1912: Cirrus-CI running out of credits Problem: Cirrus-CI running out of credits Solution: disable Cirrus-CI for now We are running out of credits for Cirrus CI already at the middle of the month and unfortunately this means our CI now consistently fails. This all hapens because cirrus ci is not enforcing the free-tier limits (see also https://cirrus-ci.org/blog/2023/07/17/limiting-free-usage-of-cirrus-ci/). Perhaps at the beginning of the next month we can revisit and enable just a build without testing it. Hopefully this is won't take too many credits and we can at least verify that building works. Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Sep 2023 20:30:10 +0200
parents 15539899a112
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10042
4aead6a9b7a9 commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents: 7837
diff changeset
1 /* vi:set ts=8 sts=4 sw=4 noet:
3322
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
2 *
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 * Load XPM image.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 * This function is placed in separate file because Xpm headers conflict with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 * Vim ones :(
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 * Written by Sergey Khorev.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 * http://iamphet.nm.ru/vim/index.html
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 #ifndef WIN32_LEAN_AND_MEAN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 # define WIN32_LEAN_AND_MEAN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 #include <windows.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 #include "xpm_w32.h"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
18816
15539899a112 patch 8.1.2396: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
19 // Engage Windows support in libXpm
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 #define FOR_MSW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 #include "xpm.h"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 /*
3322
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
25 * Tries to load an Xpm image from the file "filename".
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
26 * Returns -1 on failure.
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
27 * Returns 0 on success and stores image and mask BITMAPS in "hImage" and
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
28 * "hShape".
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 int
7837
33ba2adb6065 commit https://github.com/vim/vim/commit/b638a7be952544ceb03052c25b84224577a6494b
Christian Brabandt <cb@256bit.org>
parents: 7807
diff changeset
31 LoadXpmImage(
33ba2adb6065 commit https://github.com/vim/vim/commit/b638a7be952544ceb03052c25b84224577a6494b
Christian Brabandt <cb@256bit.org>
parents: 7807
diff changeset
32 char *filename,
33ba2adb6065 commit https://github.com/vim/vim/commit/b638a7be952544ceb03052c25b84224577a6494b
Christian Brabandt <cb@256bit.org>
parents: 7807
diff changeset
33 HBITMAP *hImage,
33ba2adb6065 commit https://github.com/vim/vim/commit/b638a7be952544ceb03052c25b84224577a6494b
Christian Brabandt <cb@256bit.org>
parents: 7807
diff changeset
34 HBITMAP *hShape)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 {
18816
15539899a112 patch 8.1.2396: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
36 XImage *img; // loaded image
15539899a112 patch 8.1.2396: using old C style comments
Bram Moolenaar <Bram@vim.org>
parents: 10042
diff changeset
37 XImage *shp; // shapeimage
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 XpmAttributes attr;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 int res;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 HDC hdc = CreateCompatibleDC(NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 attr.valuemask = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 res = XpmReadFileToImage(&hdc, filename, &img, &shp, &attr);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 DeleteDC(hdc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 if (res < 0)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 return -1;
3322
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
47 if (shp == NULL)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 {
3935
ee138f29259e updated for version 7.3.723
Bram Moolenaar <bram@vim.org>
parents: 3322
diff changeset
49 if (img)
3322
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
50 XDestroyImage(img);
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
51 return -1;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 }
3322
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
53 *hImage = img->bitmap;
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
54 *hShape = shp->bitmap;
d473f39aeadf updated for version 7.3.428
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
55 return 0;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 }