Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
Esteban Blanc
proview
Commits
ded83272
Commit
ded83272
authored
Apr 21, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Visibility check more sofisticated
parent
dc7bd27b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
10 deletions
+93
-10
xtt/lib/flow/src/flow.h
xtt/lib/flow/src/flow.h
+7
-0
xtt/lib/flow/src/flow_browapi.cpp
xtt/lib/flow/src/flow_browapi.cpp
+12
-2
xtt/lib/flow/src/flow_browapi.h
xtt/lib/flow/src/flow_browapi.h
+3
-1
xtt/lib/flow/src/flow_browctx.cpp
xtt/lib/flow/src/flow_browctx.cpp
+65
-5
xtt/lib/flow/src/flow_browctx.h
xtt/lib/flow/src/flow_browctx.h
+3
-1
xtt/lib/flow/src/flow_draw.cpp
xtt/lib/flow/src/flow_draw.cpp
+3
-1
No files found.
xtt/lib/flow/src/flow.h
View file @
ded83272
...
...
@@ -42,6 +42,13 @@ typedef enum {
flow_eSelectPolicy_Partial
}
flow_eSelectPolicy
;
typedef
enum
{
flow_eVisible_Full
,
flow_eVisible_Partial
,
flow_eVisible_Top
,
flow_eVisible_Bottom
}
flow_eVisible
;
typedef
enum
{
flow_eObjectType_NoObject
,
flow_eObjectType_Node
,
...
...
xtt/lib/flow/src/flow_browapi.cpp
View file @
ded83272
...
...
@@ -674,9 +674,19 @@ int brow_GetPreviousSibling( brow_tCtx ctx, brow_tObject object,
return
ctx
->
get_previous_sibling
(
(
FlowArrayElem
*
)
object
,
(
FlowArrayElem
**
)
sibling
);
}
int
brow_IsVisible
(
brow_tCtx
ctx
,
brow_tObject
object
)
int
brow_IsVisible
(
brow_tCtx
ctx
,
brow_tObject
object
,
flow_eVisible
type
)
{
return
ctx
->
is_visible
(
(
FlowArrayElem
*
)
object
);
return
ctx
->
is_visible
(
(
FlowArrayElem
*
)
object
,
type
);
}
int
brow_GetFirstVisible
(
brow_tCtx
ctx
,
brow_tObject
*
object
)
{
return
ctx
->
get_first_visible
(
(
FlowArrayElem
**
)
object
);
}
int
brow_GetLastVisible
(
brow_tCtx
ctx
,
brow_tObject
*
object
)
{
return
ctx
->
get_last_visible
(
(
FlowArrayElem
**
)
object
);
}
int
brow_Page
(
brow_tCtx
ctx
,
double
factor
)
...
...
xtt/lib/flow/src/flow_browapi.h
View file @
ded83272
...
...
@@ -198,7 +198,9 @@ int brow_GetNextSibling( brow_tCtx ctx, brow_tObject object,
brow_tObject
*
sibling
);
int
brow_GetPreviousSibling
(
brow_tCtx
ctx
,
brow_tObject
object
,
brow_tObject
*
sibling
);
int
brow_IsVisible
(
brow_tCtx
ctx
,
brow_tObject
object
);
int
brow_IsVisible
(
brow_tCtx
ctx
,
brow_tObject
object
,
flow_eVisible
type
);
int
brow_GetFirstVisible
(
brow_tCtx
ctx
,
brow_tObject
*
object
);
int
brow_GetLastVisible
(
brow_tCtx
ctx
,
brow_tObject
*
object
);
int
brow_Page
(
brow_tCtx
ctx
,
double
factor
);
int
brow_CreateSecondaryCtx
(
brow_tCtx
ctx
,
brow_tCtx
*
secondary_ctx
,
int
(
*
init_proc
)(
brow_tCtx
ctx
,
void
*
client_data
),
...
...
xtt/lib/flow/src/flow_browctx.cpp
View file @
ded83272
...
...
@@ -185,7 +185,7 @@ int BrowCtx::print( char *filename)
}
int
BrowCtx
::
is_visible
(
FlowArrayElem
*
element
)
int
BrowCtx
::
is_visible
(
FlowArrayElem
*
element
,
flow_eVisible
type
)
{
double
ll_x
,
ll_y
,
ur_x
,
ur_y
;
double
window_low
,
window_high
;
...
...
@@ -193,10 +193,32 @@ int BrowCtx::is_visible( FlowArrayElem *element)
((
FlowNode
*
)
element
)
->
measure
(
&
ll_x
,
&
ll_y
,
&
ur_x
,
&
ur_y
);
window_low
=
double
(
offset_y
)
/
zoom_factor
;
window_high
=
double
(
offset_y
+
window_height
)
/
zoom_factor
;
if
(
ll_y
>=
window_low
&&
ur_y
<=
window_high
)
return
1
;
else
return
0
;
switch
(
type
)
{
case
flow_eVisible_Full
:
if
(
ll_y
>=
window_low
&&
ur_y
<=
window_high
)
return
1
;
else
return
0
;
case
flow_eVisible_Partial
:
if
(
(
ll_y
>=
window_low
&&
ll_y
<=
window_high
)
||
(
ur_y
>=
window_low
&&
ur_y
<=
window_high
)
||
(
ll_y
<=
window_low
&&
ur_y
>=
window_high
))
return
1
;
else
return
0
;
case
flow_eVisible_Top
:
if
(
ur_y
>=
window_low
&&
ur_y
<=
window_high
)
return
1
;
else
return
0
;
case
flow_eVisible_Bottom
:
if
(
ll_y
>=
window_low
&&
ll_y
<=
window_high
)
return
1
;
else
return
0
;
default:
;
}
return
0
;
}
void
BrowCtx
::
center_object
(
FlowArrayElem
*
object
,
double
factor
)
...
...
@@ -215,6 +237,44 @@ void BrowCtx::center_object( FlowArrayElem *object, double factor)
change_scrollbar
();
}
int
BrowCtx
::
get_first_visible
(
FlowArrayElem
**
element
)
{
double
ll_x
,
ll_y
,
ur_x
,
ur_y
;
double
window_low
,
window_high
;
int
i
;
window_low
=
double
(
offset_y
)
/
zoom_factor
;
window_high
=
double
(
offset_y
+
window_height
)
/
zoom_factor
;
for
(
i
=
0
;
i
<
a
.
size
();
i
++
)
{
((
FlowNode
*
)
a
[
i
])
->
measure
(
&
ll_x
,
&
ll_y
,
&
ur_x
,
&
ur_y
);
if
(
ll_y
>=
window_low
||
ur_y
>=
window_high
)
{
*
element
=
a
[
i
];
return
1
;
}
}
return
0
;
}
int
BrowCtx
::
get_last_visible
(
FlowArrayElem
**
element
)
{
double
ll_x
,
ll_y
,
ur_x
,
ur_y
;
double
window_low
,
window_high
;
int
i
;
window_low
=
double
(
offset_y
)
/
zoom_factor
;
window_high
=
double
(
offset_y
+
window_height
)
/
zoom_factor
;
for
(
i
=
a
.
size
()
-
1
;
i
>=
0
;
i
--
)
{
((
FlowNode
*
)
a
[
i
])
->
measure
(
&
ll_x
,
&
ll_y
,
&
ur_x
,
&
ur_y
);
if
(
ur_y
<=
window_high
||
ll_y
<=
window_low
)
{
*
element
=
a
[
i
];
return
1
;
}
}
return
0
;
}
int
BrowCtx
::
page
(
double
factor
)
{
double
ll_x
,
ll_y
,
ur_x
,
ur_y
;
...
...
xtt/lib/flow/src/flow_browctx.h
View file @
ded83272
...
...
@@ -37,7 +37,9 @@ class BrowCtx : public FlowCtx {
{
return
a
.
brow_get_next_sibling
(
element
,
sibling
);};
int
get_previous_sibling
(
FlowArrayElem
*
element
,
FlowArrayElem
**
sibling
)
{
return
a
.
brow_get_previous_sibling
(
element
,
sibling
);};
int
is_visible
(
FlowArrayElem
*
element
);
int
is_visible
(
FlowArrayElem
*
element
,
flow_eVisible
type
);
int
get_first_visible
(
FlowArrayElem
**
element
);
int
get_last_visible
(
FlowArrayElem
**
element
);
void
center_object
(
FlowArrayElem
*
object
,
double
factor
);
int
page
(
double
factor
);
...
...
xtt/lib/flow/src/flow_draw.cpp
View file @
ded83272
...
...
@@ -1601,8 +1601,10 @@ static void event_timer_cb( FlowCtx *ctx)
static
void
cancel_event_timer
(
FlowCtx
*
ctx
)
{
draw_tCtx
draw_ctx
=
(
draw_tCtx
)
ctx
->
draw_ctx
;
if
(
draw_ctx
->
timer_id
)
if
(
draw_ctx
->
timer_id
)
{
XtRemoveTimeOut
(
draw_ctx
->
timer_id
);
draw_ctx
->
timer_id
=
0
;
}
// printf( "Timer removed\n");
// sys$cantim( ctx, 0);
}
...
...
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