Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
58a8eb07
Commit
58a8eb07
authored
6 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[gui] bullet restored in lablgtk3
parent
567bf97a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/gui/GSourceView2.ml.in
+14
-0
14 additions, 0 deletions
src/plugins/gui/GSourceView2.ml.in
src/plugins/gui/GSourceView2.mli.in
+10
-0
10 additions, 0 deletions
src/plugins/gui/GSourceView2.mli.in
src/plugins/gui/design.ml
+23
-19
23 additions, 19 deletions
src/plugins/gui/design.ml
with
47 additions
and
19 deletions
src/plugins/gui/GSourceView2.ml.in
+
14
−
0
View file @
58a8eb07
(** compatibility layer between gtksourceview 2 and 3. *)
include GSourceView3
let make_marker_attributes
~(source:source_view)
~(category:string)
~(priority: int)
?(background: Gdk.rgba option)
?(pixbuf:GdkPixbuf.pixbuf option)
?(icon_name:string option)
() =
let my_attributes = GSourceView3.source_mark_attributes () in
Extlib.may my_attributes#set_background background;
Extlib.may my_attributes#set_pixbuf pixbuf;
Extlib.may my_attributes#set_icon_name icon_name;
source#set_mark_attributes ~category my_attributes priority
This diff is collapsed.
Click to expand it.
src/plugins/gui/GSourceView2.mli.in
+
10
−
0
View file @
58a8eb07
(* compatibility between gtksourceview 2 and 3. *)
include module type of GSourceView3
val make_marker_attributes:
source:source_view ->
category:string ->
priority: int ->
?background: Gdk.rgba ->
?pixbuf:GdkPixbuf.pixbuf ->
?icon_name:string ->
unit ->
unit
This diff is collapsed.
Click to expand it.
src/plugins/gui/design.ml
+
23
−
19
View file @
58a8eb07
...
...
@@ -658,20 +658,18 @@ struct
let
unfold_category
=
"unfold"
(*GTK3 does not exist anymore in gsourceview3. *)
let
declare_markers
(
_source
:
GSourceView2
.
source_view
)
=
()
(* source#set_mark_category_pixbuf
~category:fold_category (Some Gtk_helper.Icon.(get Fold));
source#set_mark_category_pixbuf
~category:unfold_category (Some Gtk_helper.Icon.(get Unfold));
(* Sets a high prioriy so that the icon for folding and unfolding are
printed on top of the status bullets. *)
source#set_mark_category_priority ~category:fold_category 2;
source#set_mark_category_priority ~category:unfold_category 2;
let
declare_markers
(
source
:
GSourceView2
.
source_view
)
=
GSourceView2
.
make_marker_attributes
~
source
~
category
:
fold_category
~
priority
:
2
~
pixbuf
:
(
Gtk_helper
.
Icon
.(
get
Fold
))
()
;
GSourceView2
.
make_marker_attributes
~
source
~
category
:
unfold_category
~
priority
:
2
~
pixbuf
:
(
Gtk_helper
.
Icon
.(
get
Unfold
))
()
;
List
.
iter
(
fun
v
->
s
ource
#set_mark_category_pixbuf
~category:(category v)
(Some
(Gtk_helper.Icon.get (Gtk_helper.Icon.Feedback v))))
GS
ource
View2
.
make_marker_attributes
~
source
~
category
:
(
category
v
)
~
priority
:
1
~
pixbuf
:
(
Gtk_helper
.
Icon
.
get
(
Gtk_helper
.
Icon
.
Feedback
v
))
(
)
)
[
F
.
Never_tried
;
F
.
Considered_valid
;
F
.
Valid
;
...
...
@@ -683,7 +681,7 @@ struct
F
.
Valid_under_hyp
;
F
.
Invalid_under_hyp
;
F
.
Inconsistent
]
*)
(* tooltip marks are recreated whenever the buffer changes *)
let
tooltip_marks
:
(
int
,
string
)
Hashtbl
.
t
=
Hashtbl
.
create
8
...
...
@@ -698,17 +696,18 @@ struct
let
mark
(
source
:
GSourceView2
.
source_buffer
)
?
call_site
~
offset
validity
=
let
iter
=
source
#
get_iter_at_char
offset
in
let
mark
=
iter
#
set_line_offset
0
in
let
category
=
category
validity
in
source
#
remove_source_marks
iter
iter
()
;
ignore
(
source
#
create_source_mark
~
category
iter
)
;
source
#
remove_source_marks
mark
mark
()
;
ignore
(
source
#
create_source_mark
~
category
mark
)
;
Hashtbl
.
replace
tooltip_marks
iter
#
line
(
long_category
validity
);
match
call_site
with
|
None
->
()
|
Some
stmt
->
Hashtbl
.
replace
call_sites
iter
#
line
stmt
;
if
Pretty_source
.
are_preconds_unfolded
stmt
then
ignore
(
source
#
create_source_mark
~
category
:
fold_category
iter
)
else
ignore
(
source
#
create_source_mark
~
category
:
unfold_category
iter
)
then
ignore
(
source
#
create_source_mark
~
category
:
fold_category
mark
)
else
ignore
(
source
#
create_source_mark
~
category
:
unfold_category
mark
)
end
...
...
@@ -1501,7 +1500,10 @@ class main_window () : main_window_extension_points =
(* Relative position of the source_viewer in the main windows. *)
let
viewer_rel_x
=
get_x
source_viewer
in
(* Width of the bullet column in the source viewer. *)
if
abs_x
-
(
window_abs_x
+
viewer_rel_x
)
<
20
then
Format
.
printf
"viewer_rel_x: %d@."
viewer_rel_x
;
Format
.
printf
"window_abs_x: %d@."
window_abs_x
;
Format
.
printf
"abs_x: %d@."
abs_x
;
if
abs_x
-
(
window_abs_x
+
viewer_rel_x
)
<
20
then
begin
let
x
,
y
=
GdkEvent
.
Button
.(
x
ev
,
y
ev
)
in
let
(
xbuf
,
ybuf
)
=
source_viewer
#
window_to_buffer_coords
...
...
@@ -1509,13 +1511,15 @@ class main_window () : main_window_extension_points =
in
let
iterpos
=
source_viewer
#
get_iter_at_location
xbuf
ybuf
in
let
line
=
iterpos
#
line
in
Format
.
printf
"line is %d@."
line
;
try
let
stmt
=
Hashtbl
.
find
Feedback
.
call_sites
line
in
Format
.
printf
"stmt found@."
;
let
kf
=
Kernel_function
.
find_englobing_kf
stmt
in
Pretty_source
.
fold_preconds_at_callsite
stmt
;
self
#
reactive_buffer
#
redisplay
;
self
#
scroll
(
PStmt
(
kf
,
stmt
))
with
Not_found
->
()
with
Not_found
->
Format
.
printf
"call not found@."
end
;
false
)
in
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment