ActIndicator.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 libraries 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. * File Name: Indicator.c
  27. *
  28. * This file defines the API for interacting with the activity indicator.
  29. *
  30. ** (c) Copyright 1993, 1994 Hewlett-Packard Company
  31. ** (c) Copyright 1993, 1994 International Business Machines Corp.
  32. ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  33. ** (c) Copyright 1993, 1994 Novell, Inc.
  34. *
  35. *****************************************************************************/
  36. #include <X11/Intrinsic.h>
  37. #include <Dt/DtP.h>
  38. #include <Dt/IndicatorM.h>
  39. #include <Tt/tttk.h>
  40. /******** Public Function Declarations ********/
  41. extern void _DtSendActivityNotification( int ) ;
  42. extern void _DtSendActivityDoneNotification( void ) ;
  43. /******** End Public Function Declarations ********/
  44. /*
  45. * _DtSendActivityNotification()
  46. *
  47. * This function provides the client with a means for broadcasting
  48. * notification that an activity has been started. For the present
  49. * time, this will enable the activity indicator for upto a specified
  50. * number of seconds.
  51. */
  52. void
  53. _DtSendActivityNotification(
  54. int duration )
  55. {
  56. Tt_message msg;
  57. Tt_status status;
  58. msg = tt_pnotice_create(TT_SESSION, "DtActivity_Beginning");
  59. status = tt_ptr_error(msg);
  60. if (status != TT_OK) {
  61. return;
  62. }
  63. status = tt_message_send(msg);
  64. if (status != TT_OK) {
  65. return;
  66. }
  67. tt_message_destroy(msg);
  68. }
  69. /*
  70. * _DtSendActivityDoneNotification()
  71. *
  72. * This function provides the client with a means for broadcasting
  73. * notification that an activity which had earlier been started, is
  74. * now down.
  75. */
  76. void
  77. _DtSendActivityDoneNotification( void )
  78. {
  79. Tt_message msg;
  80. Tt_status status;
  81. msg = tt_pnotice_create(TT_SESSION, "DtActivity_Began");
  82. status = tt_ptr_error(msg);
  83. if (status != TT_OK) {
  84. return;
  85. }
  86. status = tt_message_send(msg);
  87. if (status != TT_OK) {
  88. return;
  89. }
  90. tt_message_destroy(msg);
  91. }