Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikita Churaev
gtk
Commits
244e4fe4
Commit
244e4fe4
authored
Dec 09, 1997
by
Owen Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to pixmap mask handling. (gtk-fortier-971122-0.patch)
-owt
parent
2e943b28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
20 deletions
+44
-20
gdk/gdkpixmap.c
gdk/gdkpixmap.c
+22
-10
gdk/x11/gdkpixmap-x11.c
gdk/x11/gdkpixmap-x11.c
+22
-10
No files found.
gdk/gdkpixmap.c
View file @
244e4fe4
...
...
@@ -429,15 +429,21 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
gc
=
NULL
;
if
(
mask
)
{
/* The pixmap mask is just a bits pattern.
* Color 0 is used for background and 1 for foreground.
* We don't care about the colormap, we just need 0 and 1.
*/
GdkColor
mask_pattern
;
*
mask
=
gdk_pixmap_new
(
window
,
width
,
height
,
1
);
gc
=
gdk_gc_new
(
*
mask
);
gdk_color_black
(
colormap
,
&
tmp_color
)
;
gdk_gc_set_foreground
(
gc
,
&
tmp_color
);
mask_pattern
.
pixel
=
0
;
gdk_gc_set_foreground
(
gc
,
&
mask_pattern
);
gdk_draw_rectangle
(
*
mask
,
gc
,
TRUE
,
0
,
0
,
-
1
,
-
1
);
gdk_color_white
(
colormap
,
&
tmp_color
)
;
gdk_gc_set_foreground
(
gc
,
&
tmp_color
);
mask_pattern
.
pixel
=
1
;
gdk_gc_set_foreground
(
gc
,
&
mask_pattern
);
}
for
(
ycnt
=
0
;
ycnt
<
height
;
ycnt
++
)
...
...
@@ -573,15 +579,21 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
gc
=
NULL
;
if
(
mask
)
{
/* The pixmap mask is just a bits pattern.
* Color 0 is used for background and 1 for foreground.
* We don't care about the colormap, we just need 0 and 1.
*/
GdkColor
mask_pattern
;
*
mask
=
gdk_pixmap_new
(
window
,
width
,
height
,
1
);
gc
=
gdk_gc_new
(
*
mask
);
gdk_color_black
(
colormap
,
&
tmp_color
)
;
gdk_gc_set_foreground
(
gc
,
&
tmp_color
);
mask_pattern
.
pixel
=
0
;
gdk_gc_set_foreground
(
gc
,
&
mask_pattern
);
gdk_draw_rectangle
(
*
mask
,
gc
,
TRUE
,
0
,
0
,
-
1
,
-
1
);
gdk_color_white
(
colormap
,
&
tmp_color
)
;
gdk_gc_set_foreground
(
gc
,
&
tmp_color
);
mask_pattern
.
pixel
=
1
;
gdk_gc_set_foreground
(
gc
,
&
mask_pattern
);
}
for
(
ycnt
=
0
;
ycnt
<
height
;
ycnt
++
)
...
...
gdk/x11/gdkpixmap-x11.c
View file @
244e4fe4
...
...
@@ -429,15 +429,21 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
gc
=
NULL
;
if
(
mask
)
{
/* The pixmap mask is just a bits pattern.
* Color 0 is used for background and 1 for foreground.
* We don't care about the colormap, we just need 0 and 1.
*/
GdkColor
mask_pattern
;
*
mask
=
gdk_pixmap_new
(
window
,
width
,
height
,
1
);
gc
=
gdk_gc_new
(
*
mask
);
gdk_color_black
(
colormap
,
&
tmp_color
)
;
gdk_gc_set_foreground
(
gc
,
&
tmp_color
);
mask_pattern
.
pixel
=
0
;
gdk_gc_set_foreground
(
gc
,
&
mask_pattern
);
gdk_draw_rectangle
(
*
mask
,
gc
,
TRUE
,
0
,
0
,
-
1
,
-
1
);
gdk_color_white
(
colormap
,
&
tmp_color
)
;
gdk_gc_set_foreground
(
gc
,
&
tmp_color
);
mask_pattern
.
pixel
=
1
;
gdk_gc_set_foreground
(
gc
,
&
mask_pattern
);
}
for
(
ycnt
=
0
;
ycnt
<
height
;
ycnt
++
)
...
...
@@ -573,15 +579,21 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
gc
=
NULL
;
if
(
mask
)
{
/* The pixmap mask is just a bits pattern.
* Color 0 is used for background and 1 for foreground.
* We don't care about the colormap, we just need 0 and 1.
*/
GdkColor
mask_pattern
;
*
mask
=
gdk_pixmap_new
(
window
,
width
,
height
,
1
);
gc
=
gdk_gc_new
(
*
mask
);
gdk_color_black
(
colormap
,
&
tmp_color
)
;
gdk_gc_set_foreground
(
gc
,
&
tmp_color
);
mask_pattern
.
pixel
=
0
;
gdk_gc_set_foreground
(
gc
,
&
mask_pattern
);
gdk_draw_rectangle
(
*
mask
,
gc
,
TRUE
,
0
,
0
,
-
1
,
-
1
);
gdk_color_white
(
colormap
,
&
tmp_color
)
;
gdk_gc_set_foreground
(
gc
,
&
tmp_color
);
mask_pattern
.
pixel
=
1
;
gdk_gc_set_foreground
(
gc
,
&
mask_pattern
);
}
for
(
ycnt
=
0
;
ycnt
<
height
;
ycnt
++
)
...
...
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