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
cf24c658
Unverified
Commit
cf24c658
authored
Jan 05, 2020
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/drop_icon_file_support' into 3.6.x
Attributes GH PR #888:
https://github.com/ArcticaProject/nx-libs/pull/888
parents
475961e6
3cd622cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
154 deletions
+17
-154
nxagent.install
debian/nxagent.install
+0
-1
Display.c
nx-X11/programs/Xserver/hw/nxagent/Display.c
+16
-144
xpm_nxagent.h
nx-X11/programs/Xserver/hw/nxagent/X11/include/xpm_nxagent.h
+1
-9
No files found.
debian/nxagent.install
View file @
cf24c658
...
@@ -3,6 +3,5 @@ usr/bin/nxagent
...
@@ -3,6 +3,5 @@ usr/bin/nxagent
usr
/
lib
/*/nx/X11/
usr
/
lib
/*/nx/X11/
usr/share/man/man1/nxagent.1*
usr/share/man/man1/nxagent.1*
usr/share/nx/VERSION.nxagent
usr/share/nx/VERSION.nxagent
usr/share/pixmaps/nxagent.xpm
# FIXME: compatibility symlink, drop for 3.6.0 release
# FIXME: compatibility symlink, drop for 3.6.0 release
usr/lib/*/
nx
/
bin
/
nxagent
usr/lib/*/
nx
/
bin
/
nxagent
nx-X11/programs/Xserver/hw/nxagent/Display.c
View file @
cf24c658
...
@@ -1797,89 +1797,9 @@ FIXME: Is this needed?
...
@@ -1797,89 +1797,9 @@ FIXME: Is this needed?
nxagentDisplay
=
NULL
;
nxagentDisplay
=
NULL
;
}
}
static
FILE
*
nxagentLookForIconFile
(
char
*
iconName
,
const
char
*
permission
,
char
*
return_path
,
int
return_path_size
)
{
char
*
path
;
char
singlePath
[
PATH_MAX
];
FILE
*
fptr
=
NULL
;
#ifdef WIN32
const
char
separator
=
';'
;
const
char
*
slash
=
"
\\
"
;
#else
const
char
separator
=
':'
;
const
char
*
slash
=
"/"
;
#endif
if
((
path
=
getenv
(
"PATH"
))
==
NULL
)
{
return
NULL
;
}
for
(
char
*
end
=
path
;
end
!=
NULL
&&
fptr
==
NULL
;
)
{
end
=
strchr
(
path
,
separator
);
/* separator found */
if
(
end
!=
NULL
)
{
if
((
end
-
path
)
>
sizeof
(
singlePath
)
-
1
)
{
fprintf
(
stderr
,
"Warning: PATH component too long - ignoring it.
\n
"
);
path
=
end
+
1
;
continue
;
}
snprintf
(
singlePath
,
(
unsigned
long
)(
end
-
path
+
1
),
"%s"
,
path
);
path
=
end
+
1
;
}
else
{
if
(
strlen
(
path
)
>
sizeof
(
singlePath
)
-
1
)
{
fprintf
(
stderr
,
"Warning: PATH component too long - ignoring it.
\n
"
);
return
NULL
;
}
snprintf
(
singlePath
,
sizeof
(
singlePath
),
"%s"
,
path
);
}
/* cut off trailing slashes, if any */
while
(
singlePath
[
strlen
(
singlePath
)
-
1
]
==
slash
[
0
])
{
singlePath
[
strlen
(
singlePath
)
-
1
]
=
'\0'
;
}
/* append slash and icon name */
if
(
strlen
(
singlePath
)
+
strlen
(
iconName
)
+
1
<
sizeof
(
singlePath
))
{
snprintf
(
singlePath
+
strlen
(
singlePath
),
sizeof
(
singlePath
),
"%s%s"
,
slash
,
iconName
);
if
((
fptr
=
fopen
(
singlePath
,
permission
))
!=
NULL
)
{
snprintf
(
return_path
,
return_path_size
,
"%s"
,
singlePath
);
}
}
else
{
fprintf
(
stderr
,
"Warning: Icon path too long.
\n
"
);
}
}
return
fptr
;
}
Bool
nxagentMakeIcon
(
Display
*
display
,
Pixmap
*
nxIcon
,
Pixmap
*
nxMask
)
Bool
nxagentMakeIcon
(
Display
*
display
,
Pixmap
*
nxIcon
,
Pixmap
*
nxMask
)
{
{
char
default_path
[
PATH_MAX
];
char
icon_path
[
PATH_MAX
];
FILE
*
icon_fp
;
int
status
;
Bool
success
=
False
;
XlibPixmap
IconPixmap
;
XlibPixmap
IconShape
;
char
*
agent_icon_name
;
char
**
agentIconData
;
char
**
agentIconData
;
/*
/*
...
@@ -1887,84 +1807,36 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask)
...
@@ -1887,84 +1807,36 @@ Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask)
*/
*/
if
(
nxagentX2go
)
if
(
nxagentX2go
)
{
{
agent_icon_name
=
X2GOAGENT_ICON_NAME
;
agentIconData
=
x2goagentIconData
;
agentIconData
=
x2goagentIconData
;
}
}
else
else
{
{
agent_icon_name
=
NXAGENT_ICON_NAME
;
agentIconData
=
nxagentIconData
;
agentIconData
=
nxagentIconData
;
}
}
/* FIXME: use a compile time define here, /usr/NX is a nomachine path */
XlibPixmap
IconPixmap
;
snprintf
(
default_path
,
sizeof
(
default_path
),
"/usr/NX/share/images/%s"
,
agent_icon_name
);
XlibPixmap
IconShape
;
if
(
XpmSuccess
==
XpmCreatePixmapFromData
(
display
,
if
((
icon_fp
=
fopen
(
default_path
,
"r"
))
==
NULL
)
DefaultRootWindow
(
display
),
agentIconData
,
&
IconPixmap
,
&
IconShape
,
NULL
))
{
{
icon_fp
=
nxagentLookForIconFile
(
agent_icon_name
,
"r"
,
icon_path
,
sizeof
(
icon_path
));
*
nxIcon
=
IconPixmap
;
*
nxMask
=
IconShape
;
if
(
icon_fp
!=
NULL
)
return
True
;
{
fclose
(
icon_fp
);
success
=
True
;
}
}
}
else
else
{
{
fclose
(
icon_fp
);
#ifdef TEST
success
=
True
;
fprintf
(
stderr
,
"%s: Xpm operation failed with error '%s'.
\n
"
,
__func__
,
snprintf
(
icon_path
,
sizeof
(
icon_path
),
"%s"
,
default_path
);
XpmGetErrorString
(
status
));
}
#endif
if
(
success
)
{
status
=
XpmReadFileToPixmap
(
display
,
DefaultRootWindow
(
display
),
icon_path
,
&
IconPixmap
,
&
IconShape
,
NULL
);
if
(
status
!=
XpmSuccess
)
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentMakeIcon: Xpm operation failed with error '%s'.
\n
"
,
XpmGetErrorString
(
status
));
#endif
success
=
False
;
}
}
if
(
!
success
)
{
status
=
XpmCreatePixmapFromData
(
display
,
DefaultRootWindow
(
display
),
agentIconData
,
&
IconPixmap
,
&
IconShape
,
NULL
);
if
(
status
!=
XpmSuccess
)
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentMakeIcon: Xpm operation failed with error '%s'.
\n
"
,
XpmGetErrorString
(
status
));
#endif
success
=
False
;
return
False
;
}
else
{
success
=
True
;
}
}
}
*
nxIcon
=
IconPixmap
;
*
nxMask
=
IconShape
;
return
success
;
}
}
Bool
nxagentXServerGeometryChanged
(
void
)
Bool
nxagentXServerGeometryChanged
(
void
)
...
...
nx-X11/programs/Xserver/hw/nxagent/X11/include/xpm_nxagent.h
View file @
cf24c658
...
@@ -238,21 +238,13 @@ typedef struct {
...
@@ -238,21 +238,13 @@ typedef struct {
_XFUNCPROTOBEGIN
_XFUNCPROTOBEGIN
/* Keep for hw/nxagent/
Holder
.c */
/* Keep for hw/nxagent/
Display
.c */
FUNC
(
XpmCreatePixmapFromData
,
int
,
(
Display
*
display
,
FUNC
(
XpmCreatePixmapFromData
,
int
,
(
Display
*
display
,
Drawable
d
,
Drawable
d
,
char
**
data
,
char
**
data
,
Pixmap
*
pixmap_return
,
Pixmap
*
pixmap_return
,
Pixmap
*
shapemask_return
,
Pixmap
*
shapemask_return
,
XpmAttributes
*
attributes
));
XpmAttributes
*
attributes
));
/* Keep for hw/nxagent/Display.c */
FUNC
(
XpmReadFileToPixmap
,
int
,
(
Display
*
display
,
Drawable
d
,
const
char
*
filename
,
Pixmap
*
pixmap_return
,
Pixmap
*
shapemask_return
,
XpmAttributes
*
attributes
));
_XFUNCPROTOEND
_XFUNCPROTOEND
#endif
/* XPM_NUMBERS */
#endif
/* XPM_NUMBERS */
...
...
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