| e8555c89 Andy McCall |
1 |
namespace eval osd { |
| 2 |
|
| 3 |
set_help_text show_osd \ |
| 4 |
{Give an overview of all currently defined OSD elements and their properties. |
| 5 |
This is mainly useful to debug a OSD related script.} |
| 6 |
|
| 7 |
proc show_osd {{widgets ""}} { |
| 8 |
set result "" |
| 9 |
if {$widgets eq ""} { |
| 10 |
|
| 11 |
set widgets [osd info] |
| 12 |
} |
| 13 |
foreach widget $widgets { |
| 14 |
append result "$widget\n" |
| 15 |
foreach property [osd info $widget] { |
| 16 |
if {[catch {set value [osd info $widget $property]}]} { |
| 17 |
set value "--error--" |
| 18 |
} |
| 19 |
append result " $property $value\n" |
| 20 |
} |
| 21 |
} |
| 22 |
return $result |
| 23 |
} |
| 24 |
|
| 25 |
proc is_cursor_in {widget} { |
| 26 |
set x 2; set y 2 |
| 27 |
catch {lassign [osd info $widget -mousecoord] x y} |
| 28 |
expr {0 <= $x && $x <= 1 && 0 <= $y && $y <= 1} |
| 29 |
} |
| 30 |
|
| 31 |
namespace export show_osd |
| 32 |
namespace export is_cursor_in |
| 33 |
|
| 34 |
}; |
| 35 |
|
| 36 |
|
| 37 |
namespace import osd::show_osd |