Build with debug symbols enabled.
[oweals/cde.git] / cde / lib / DtSvc / DtUtil2 / ActIndicator.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $TOG: ActIndicator.c /main/5 1998/07/30 12:11:42 mgreess $ */
24
25 /******************************************************************************
26  *
27  * File Name: Indicator.c
28  *
29  *  This file defines the API for interacting with the activity indicator.
30  *
31  ** (c) Copyright 1993, 1994 Hewlett-Packard Company
32  ** (c) Copyright 1993, 1994 International Business Machines Corp.
33  ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
34  ** (c) Copyright 1993, 1994 Novell, Inc.
35  *
36  *****************************************************************************/
37
38 #include <X11/Intrinsic.h>
39
40 #include <Dt/DtP.h>
41 #include <Dt/IndicatorM.h>
42 #include <Tt/tttk.h>
43
44
45 /********    Public Function Declarations    ********/
46
47 extern void _DtSendActivityNotification( int ) ;
48 extern void _DtSendActivityDoneNotification( void ) ;
49
50 /********    End Public Function Declarations    ********/
51
52
53
54 /*
55  * _DtSendActivityNotification()
56  *
57  *   This function provides the client with a means for broadcasting
58  *   notification that an activity has been started.  For the present
59  *   time, this will enable the activity indicator for upto a specified 
60  *   number of seconds.
61  */
62
63 void 
64 _DtSendActivityNotification(
65         int duration )
66 {
67     Tt_message  msg;
68     Tt_status   status;
69
70     msg = tt_pnotice_create(TT_SESSION, "DtActivity_Beginning");
71     status = tt_ptr_error(msg);
72     if (status != TT_OK) {
73         return;
74     }
75     status = tt_message_send(msg);
76     if (status != TT_OK) {
77         return;
78     }
79     tt_message_destroy(msg);
80 }
81
82
83 /*
84  * _DtSendActivityDoneNotification()
85  *
86  *   This function provides the client with a means for broadcasting
87  *   notification that an activity which had earlier been started, is
88  *   now down.
89  */
90
91 void 
92 _DtSendActivityDoneNotification( void )
93 {
94     Tt_message  msg;
95     Tt_status   status;
96
97     msg = tt_pnotice_create(TT_SESSION, "DtActivity_Began");
98     status = tt_ptr_error(msg);
99     if (status != TT_OK) {
100         return;
101     }
102     status = tt_message_send(msg);
103     if (status != TT_OK) {
104         return;
105     }
106     tt_message_destroy(msg);
107 }