File: clock_global.ads

package info (click to toggle)
libadabindx 0.7.2-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,136 kB
  • ctags: 32
  • sloc: ada: 35,597; makefile: 556; sh: 10
file content (121 lines) | stat: -rw-r--r-- 5,046 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
-------------------------------------------------------------------------------
--                                                                           --
--  Ada Interface to the X Window System and Motif(tm)/Lesstif               --
--  Copyright (c) 1996-2002 Hans-Frieder Vogt                                --
--                                                                           --
--  This program is free software; you can redistribute it and/or modify     --
--  it under the terms of the GNU General Public License as published by     --
--  the Free Software Foundation; either version 2 of the License, or        --
--  (at your option) any later version.                                      --
--                                                                           --
--  This program is distributed in the hope that it will be useful,          --
--  but WITHOUT ANY WARRANTY; without even the implied warranty of           --
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     --
--  See the GNU General Public License for more details.                     --
--                                                                           --
--  You should have received a copy of the GNU General Public License        --
--  along with this program; if not, write to the                            --
--  Free Software Foundation, Inc.,                                          --
--  59 Temple Place - Suite 330,                                             --
--  Boston, MA 02111-1307, USA.                                              --
--                                                                           --
--                                                                           --
--  X Window System is copyrighted by the X Consortium                       --
--  Motif(tm)       is copyrighted by the Open Software Foundation, Inc.     --
--                                                                           --
--                                                                           --
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--
-- HISTORY:
--          June 20, 1998 begin of history
--          20 Jan 2002 H.-F. Vogt: add popup menu as an alternative to the
--                                  menu bar (Popup_Menu, Input_CB, Menu_CB)
--                                  comment out X_Lib.Tasking, because it seems
--                                  not to be necessary
--
-------------------------------------------------------------------------------

with Ada.Numerics.Generic_Elementary_Functions,
     X_Lib,
     X_Toolkit,
     Xm_Widgets;
use  X_Lib,
     X_Toolkit,
     Xm_Widgets;
package Clock_Global is

   type Real is digits 6; -- that's surely enough

   package Real_Functions is
      new Ada.Numerics.Generic_Elementary_Functions (Real);


   Appshell,
   The_Main, The_Menu_Bar, The_Draw : Widget := Null_Widget;
   About_Dialog          : Widget := Null_Widget;
   Popup_Menu            : Widget := Null_Widget;
   App_Con               : Xt_App_Context;

   Display               : X_Lib.Display_Pointer;

   GC_Marks, GC_Sec, GC_Min, GC_Hour, GC_Shadow : GC_Pointer;
   Width, Height         : Dimension;
   Mid_X, Mid_Y,
   Radius                : Real;
   Hour, Minute, Second  : Natural := 0;

   Timer_ID              : X_Toolkit.Interval_ID
                         := X_Toolkit.Null_Interval_ID;
   Argl                  : Arg_List := Null_Arg_List;

   Leave_Program         : exception;


   procedure Redraw_Clock;
   procedure Resize_Clock;


   procedure About_CB (W         : in Widget;
                       Closure   : in Xt_Pointer;
                       Call_Data : in Xt_Pointer);
   pragma Convention (C, About_CB);


   procedure Quit_CB (W         : in Widget;
                      Closure   : in Xt_Pointer;
                      Call_Data : in Xt_Pointer);
   pragma Convention (C, Quit_CB);


   procedure Expose_Clock_CB (W         : in Widget;
                              Closure   : in Xt_Pointer;
                              Call_Data : in Xt_Pointer);
   pragma Convention (C, Expose_Clock_CB);


   procedure Resize_Clock_CB (W         : in Widget;
                              Closure   : in Xt_Pointer;
                              Call_Data : in Xt_Pointer);
   pragma Convention (C, Resize_Clock_CB);


   procedure Input_CB (W         : in Widget;
                       Closure   : in Xt_Pointer;
                       Call_Data : in Xt_Pointer);
   pragma Convention (C, Input_CB);


   procedure Menu_CB (W         : in Widget;
                      Closure	: in Xt_Pointer;
                      Call_Data : in Xt_Pointer);
   pragma Convention (C, Menu_CB);


   procedure Timeout_CB (Client_Data : in     X_Toolkit.Xt_Pointer;
                         ID          : in out X_Toolkit.Interval_ID);
   pragma Convention (C, Timeout_CB);


end Clock_Global;