home *** CD-ROM | disk | FTP | other *** search
/ Phoenix Heaven Sunny 2 / APPARE2.BIN / oh_towns / art2 / src.lzh / WAKEBTN.C < prev    next >
C/C++ Source or Header  |  1995-06-17  |  1KB  |  70 lines

  1. /*====================================================
  2.                       ARTemis
  3.                    (version 1.3)
  4.              FM-TOWNS 用ペイントツール
  5.  
  6.                  by 松内 良介 1994
  7. ====================================================*/
  8. /*
  9.     wakebtn.c  :  ウェイクボタン型部品・実現モジュール
  10.     
  11.     外部関数:
  12.         int MMI_initWakeBtn(void)
  13. */
  14.  
  15. #define    MODULE_WAKEBTN
  16.  
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <string.h>
  20. #include <winb.h>
  21. #include <te.h>
  22. #include <fntb.h>
  23. #include <gui.h>
  24. #include "art.h"
  25. #include "wakebtn.h"
  26.  
  27. int        MJ_WAKEBTN = -1;
  28.  
  29. /*    マウスにタッチされたときの処理  */
  30.  
  31.     static int ML_WAKEBTNtouch(kobj, messId, argc, pev)
  32.     int        kobj ;
  33.     int        messId ;
  34.     int        argc ;
  35.     EVENT    *pev;
  36.     {
  37.         int base;
  38.         EVENT evbuf;
  39.         base = TL_getObjectPtr(kobj)->base;
  40.       /* いま起こったイベントをそのままキューに戻す */
  41.         evbuf = *pev;
  42.         MMI_SetEvnt(evbuf);
  43.         return NOERR ;
  44.     }
  45.     
  46. /* メッセージに対する関数の対応 */
  47.  
  48.     #define    NMET_WAKEBTN    1
  49.     
  50.     static int (*MF_WAKEBTNmethod[NMET_WAKEBTN])() = {
  51.         ML_WAKEBTNtouch
  52.     } ;
  53.     
  54.     static char *MM_WAKEBTNmessage[NMET_WAKEBTN] = {
  55.         MT_MOUSEON
  56.     };
  57.  
  58. /* 初期化関数 */
  59.  
  60.     int MMI_initWakeBtn(void)
  61.     {
  62.         MJ_WAKEBTN = MMI_AddType(MJ_HYPER, NMET_WAKEBTN,
  63.                                  sizeof(WAKEBTN),
  64.                                  MF_WAKEBTNmethod,
  65.                                  MM_WAKEBTNmessage) ;
  66.         if (MJ_WAKEBTN < NOERR)
  67.             return MJ_WAKEBTN ;
  68.         return NOERR ;
  69.     }
  70.