2
0

symnot.pas 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {
  2. Copyright (c) 2002 by Daniel Mantione
  3. This unit contains support routines for the variable access
  4. notifier.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit symnot;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses cclasses,symtype;
  22. type Tnotification_flag=(vn_onread,vn_onwrite,vn_unknown);
  23. Tnotification_flags=set of Tnotification_flag;
  24. Tnotification_callback=procedure(not_type:Tnotification_flag;
  25. symbol:Tsym) of object;
  26. Tnotification=class(Tlinkedlistitem)
  27. flags:Tnotification_flags;
  28. callback:Tnotification_callback;
  29. id:cardinal;
  30. constructor create(Aflags:Tnotification_flags;
  31. Acallback:Tnotification_callback);
  32. end;
  33. implementation
  34. var notification_counter:cardinal;
  35. constructor Tnotification.create(Aflags:Tnotification_flags;
  36. Acallback:Tnotification_callback);
  37. begin
  38. inherited create;
  39. flags:=Aflags;
  40. callback:=Acallback;
  41. id:=notification_counter;
  42. inc(notification_counter);
  43. end;
  44. begin
  45. notification_counter:=0;
  46. end.