Stub for OleLoadPictureEx.
[wine.git] / tools / winapi_check / output.pm
blobf5241aff72a537b8b1328bff0fc0d3058237cfb6
1 package output;
3 use strict;
5 sub new {
6 my $proto = shift;
7 my $class = ref($proto) || $proto;
8 my $self = {};
9 bless ($self, $class);
11 my $progress = \${$self->{PROGRESS}};
12 my $last_progress = \${$self->{LAST_PROGRESS}};
13 my $progress_count = \${$self->{PROGRESS_COUNT}};
14 my $prefix = \${$self->{PREFIX}};
16 $$progress = "";
17 $$last_progress = "";
18 $$progress_count = 0;
19 $$prefix = "";
21 return $self;
25 sub show_progress {
26 my $self = shift;
27 my $progress = \${$self->{PROGRESS}};
28 my $last_progress = \${$self->{LAST_PROGRESS}};
29 my $progress_count = \${$self->{PROGRESS_COUNT}};
31 $$progress_count++;
33 if($$progress_count > 0 && $$progress) {
34 print STDERR $$progress;
35 $$last_progress = $$progress;
39 sub hide_progress {
40 my $self = shift;
41 my $progress = \${$self->{PROGRESS}};
42 my $last_progress = \${$self->{LAST_PROGRESS}};
43 my $progress_count = \${$self->{PROGRESS_COUNT}};
45 $$progress_count--;
47 if($$last_progress) {
48 my $message;
49 for (1..length($$last_progress)) {
50 $message .= "\b \b";
52 print STDERR $message;
53 undef $$last_progress;
57 sub update_progress {
58 my $self = shift;
59 my $progress = \${$self->{PROGRESS}};
60 my $last_progress = \${$self->{LAST_PROGRESS}};
62 my $prefix = "";
63 my $suffix = "";
64 if($$last_progress) {
65 for (1..length($$last_progress)) {
66 $prefix .= "\b";
69 my $diff = length($$last_progress)-length($$progress);
70 if($diff > 0) {
71 for (1..$diff) {
72 $suffix .= " ";
74 for (1..$diff) {
75 $suffix .= "\b";
79 print STDERR $prefix . $$progress . $suffix;
80 $$last_progress = $$progress;
83 sub progress {
84 my $self = shift;
85 my $progress = \${$self->{PROGRESS}};
87 $$progress = shift;
89 $self->update_progress;
92 sub prefix {
93 my $self = shift;
94 my $prefix = \${$self->{PREFIX}};
96 $$prefix = shift;
99 sub write {
100 my $self = shift;
102 my $message = shift;
104 my $prefix = \${$self->{PREFIX}};
106 $self->hide_progress;
107 print $$prefix . $message;
108 $self->show_progress;