symnot.pas 1.9 KB

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