Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
saeed
odb_view
Commits
a8d8762f
Commit
a8d8762f
authored
Oct 04, 2019
by
saeed
Browse files
moving window
parent
58c04880
Changes
2
Hide whitespace changes
Inline
Side-by-side
renderer.c
View file @
a8d8762f
static
void
movewindow
(
struct
Vis
*
vis
,
int
x
,
int
y
){
XMoveWindow
(
vis
->
dsp
,
vis
->
win
,
x
,
y
);
}
static
void
colortoRGBA
(
uint32
color
,
uint8
*
red
,
uint8
*
green
,
uint8
*
blue
,
uint8
*
alpha
){
*
red
=
0x0
;
...
...
@@ -80,9 +84,12 @@ static struct Vis init_x(int w, int h){
result
.
fontinfo
=
XLoadQueryFont
(
result
.
dsp
,
fontname
);
if
(
!
result
.
fontinfo
)
{
fprintf
(
stderr
,
"unable to load font %s: using fixed
\n
"
,
fontname
);
fontname
=
"10x20"
;
result
.
fontinfo
=
XLoadQueryFont
(
result
.
dsp
,
"10x20"
);
if
(
!
result
.
fontinfo
){
result
.
fontinfo
=
XLoadQueryFont
(
result
.
dsp
,
"fixed"
);
fprintf
(
stderr
,
"unable to load font %s: using
\n
"
,
fontname
);
fontname
=
"fixed"
;
result
.
fontinfo
=
XLoadQueryFont
(
result
.
dsp
,
fontname
);
}
}
result
.
gr_values
.
font
=
result
.
fontinfo
->
fid
;
...
...
@@ -98,7 +105,7 @@ static struct Vis init_x(int w, int h){
// say window manager which position we would prefer
XSizeHints
sizehints
;
sizehints
.
flags
=
USPosition
|
USSize
;
sizehints
.
x
=
2
00
;
sizehints
.
y
=
2
00
;
sizehints
.
x
=
1
00
;
sizehints
.
y
=
1
00
;
sizehints
.
width
=
w
;
sizehints
.
height
=
h
;
XSetWMNormalHints
(
result
.
dsp
,
result
.
win
,
&
sizehints
)
;
return
result
;
...
...
rita.c
View file @
a8d8762f
...
...
@@ -177,6 +177,8 @@ int main(int argc, char *argv[]){
map_window
(
&
visu_1
);
map_window
(
&
visu
);
movewindow
(
&
visu
,(
int
)(
WIDTH_TR1
*
1
.
01
),
0
);
pthread_t
thread_id
[
NUM_THREADS
];
for
(
int
i
=
0
;
i
<
NUM_THREADS
;
++
i
){
pthread_create
(
&
thread_id
[
i
],
NULL
,
handle_event_thread
,
(
void
*
)
&
visu_1
);
...
...
Write
Preview
Supports
Markdown
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