Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
97b9864e
Commit
97b9864e
authored
Jun 29, 2012
by
Alan Coopersmith
Committed by
Ulrich Sibiller
Oct 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert XCreate{Pix,Bit}map...Data to use C99 designated initializers
Signed-off-by:
Alan Coopersmith
<
alan.coopersmith@oracle.com
>
Backported-to-NX-by:
Ulrich Sibiller
<
uli42@gmx.de
>
parent
7a8721b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
47 deletions
+44
-47
CrBFData.c
nx-X11/lib/X11/CrBFData.c
+20
-22
CrPFBData.c
nx-X11/lib/X11/CrPFBData.c
+24
-25
No files found.
nx-X11/lib/X11/CrBFData.c
View file @
97b9864e
...
@@ -53,30 +53,28 @@ Pixmap XCreateBitmapFromData(
...
@@ -53,30 +53,28 @@ Pixmap XCreateBitmapFromData(
unsigned
int
width
,
unsigned
int
width
,
unsigned
int
height
)
unsigned
int
height
)
{
{
XImage
ximage
;
Pixmap
pix
=
XCreatePixmap
(
display
,
d
,
width
,
height
,
1
);
GC
gc
;
GC
gc
=
XCreateGC
(
display
,
pix
,
(
unsigned
long
)
0
,
(
XGCValues
*
)
0
);
Pixmap
pix
;
pix
=
XCreatePixmap
(
display
,
d
,
width
,
height
,
1
);
gc
=
XCreateGC
(
display
,
pix
,
(
unsigned
long
)
0
,
(
XGCValues
*
)
0
);
if
(
gc
==
NULL
)
{
if
(
gc
==
NULL
)
{
XFreePixmap
(
display
,
pix
);
XFreePixmap
(
display
,
pix
);
return
(
Pixmap
)
None
;
return
(
Pixmap
)
None
;
}
else
{
XImage
ximage
=
{
.
height
=
height
,
.
width
=
width
,
.
depth
=
1
,
.
bits_per_pixel
=
1
,
.
xoffset
=
0
,
.
format
=
XYPixmap
,
.
data
=
(
char
*
)
data
,
.
byte_order
=
LSBFirst
,
.
bitmap_unit
=
8
,
.
bitmap_bit_order
=
LSBFirst
,
.
bitmap_pad
=
8
,
.
bytes_per_line
=
(
width
+
7
)
/
8
,
};
XPutImage
(
display
,
pix
,
gc
,
&
ximage
,
0
,
0
,
0
,
0
,
width
,
height
);
XFreeGC
(
display
,
gc
);
return
(
pix
);
}
}
ximage
.
height
=
height
;
ximage
.
width
=
width
;
ximage
.
depth
=
1
;
ximage
.
bits_per_pixel
=
1
;
ximage
.
xoffset
=
0
;
ximage
.
format
=
XYPixmap
;
ximage
.
data
=
(
char
*
)
data
;
ximage
.
byte_order
=
LSBFirst
;
ximage
.
bitmap_unit
=
8
;
ximage
.
bitmap_bit_order
=
LSBFirst
;
ximage
.
bitmap_pad
=
8
;
ximage
.
bytes_per_line
=
(
width
+
7
)
/
8
;
XPutImage
(
display
,
pix
,
gc
,
&
ximage
,
0
,
0
,
0
,
0
,
width
,
height
);
XFreeGC
(
display
,
gc
);
return
(
pix
);
}
}
nx-X11/lib/X11/CrPFBData.c
View file @
97b9864e
...
@@ -58,33 +58,32 @@ Pixmap XCreatePixmapFromBitmapData(
...
@@ -58,33 +58,32 @@ Pixmap XCreatePixmapFromBitmapData(
unsigned
long
bg
,
unsigned
long
bg
,
unsigned
int
depth
)
unsigned
int
depth
)
{
{
XImage
ximage
;
Pixmap
pix
=
XCreatePixmap
(
display
,
d
,
width
,
height
,
depth
);
GC
gc
;
XGCValues
gcv
=
{
XGCValues
gcv
;
.
foreground
=
fg
,
Pixmap
pix
;
.
background
=
bg
};
pix
=
XCreatePixmap
(
display
,
d
,
width
,
height
,
depth
);
GC
gc
=
XCreateGC
(
display
,
pix
,
GCForeground
|
GCBackground
,
&
gcv
);
gcv
.
foreground
=
fg
;
gcv
.
background
=
bg
;
gc
=
XCreateGC
(
display
,
pix
,
GCForeground
|
GCBackground
,
&
gcv
);
if
(
gc
==
NULL
)
{
if
(
gc
==
NULL
)
{
XFreePixmap
(
display
,
pix
);
XFreePixmap
(
display
,
pix
);
return
(
Pixmap
)
None
;
return
(
Pixmap
)
None
;
}
else
{
XImage
ximage
=
{
.
height
=
height
,
.
width
=
width
,
.
depth
=
1
,
.
bits_per_pixel
=
1
,
.
xoffset
=
0
,
.
format
=
XYBitmap
,
.
data
=
data
,
.
byte_order
=
LSBFirst
,
.
bitmap_unit
=
8
,
.
bitmap_bit_order
=
LSBFirst
,
.
bitmap_pad
=
8
,
.
bytes_per_line
=
(
width
+
7
)
/
8
};
XPutImage
(
display
,
pix
,
gc
,
&
ximage
,
0
,
0
,
0
,
0
,
width
,
height
);
XFreeGC
(
display
,
gc
);
return
(
pix
);
}
}
ximage
.
height
=
height
;
ximage
.
width
=
width
;
ximage
.
depth
=
1
;
ximage
.
bits_per_pixel
=
1
;
ximage
.
xoffset
=
0
;
ximage
.
format
=
XYBitmap
;
ximage
.
data
=
data
;
ximage
.
byte_order
=
LSBFirst
;
ximage
.
bitmap_unit
=
8
;
ximage
.
bitmap_bit_order
=
LSBFirst
;
ximage
.
bitmap_pad
=
8
;
ximage
.
bytes_per_line
=
(
width
+
7
)
/
8
;
XPutImage
(
display
,
pix
,
gc
,
&
ximage
,
0
,
0
,
0
,
0
,
width
,
height
);
XFreeGC
(
display
,
gc
);
return
(
pix
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment