-rw-r--r-- | library/custom-sharp.h | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/library/custom-sharp.h b/library/custom-sharp.h index 08f8a6f..3dab34f 100644 --- a/library/custom-sharp.h +++ b/library/custom-sharp.h | |||
@@ -27,81 +27,28 @@ | |||
27 | #define APM_IOC_BATTERY_BACK_CHK _IO(APM_IOC_MAGIC, 32) | 27 | #define APM_IOC_BATTERY_BACK_CHK _IO(APM_IOC_MAGIC, 32) |
28 | #endif | 28 | #endif |
29 | #ifndef APM_IOC_BATTERY_MAIN_CHK | 29 | #ifndef APM_IOC_BATTERY_MAIN_CHK |
30 | #define APM_IOC_BATTERY_MAIN_CHK _IO(APM_IOC_MAGIC, 33) | 30 | #define APM_IOC_BATTERY_MAIN_CHK _IO(APM_IOC_MAGIC, 33) |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #include <unistd.h> | 33 | #include <unistd.h> |
34 | #include <stdio.h> | 34 | #include <stdio.h> |
35 | #include <signal.h> | 35 | #include <signal.h> |
36 | #include <fcntl.h> | 36 | #include <fcntl.h> |
37 | #include <sys/ioctl.h> | 37 | #include <sys/ioctl.h> |
38 | 38 | ||
39 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 | ||
40 | |||
41 | /* --- for SHARP_BUZZER device --- */ | ||
42 | #define SHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | ||
43 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) | ||
44 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) | ||
45 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) | ||
46 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) | ||
47 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) | ||
48 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) | ||
49 | |||
50 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ | ||
51 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ | ||
52 | #define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */ | ||
53 | #define SHARP_PDA_WARNSOUND 4 /* warning occurred */ | ||
54 | #define SHARP_PDA_ERRORSOUND 5 /* error occurred */ | ||
55 | #define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */ | ||
56 | #define SHARP_PDA_SYSSTARTSOUND 7 /* system start */ | ||
57 | #define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */ | ||
58 | #define SHARP_PDA_APPSTART 9 /* application start */ | ||
59 | #define SHARP_PDA_APPQUIT 10 /* application ends */ | ||
60 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ | ||
61 | #define SHARP_BUZ_DAILY_ALARM 12 /* daily alarm */ | ||
62 | #define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */ | ||
63 | #define SHARP_BUZ_GOT_MAIL 14 /* mail sound */ | ||
64 | |||
65 | |||
66 | #define CUSTOM_BUZZER( sound ) \ | ||
67 | { \ | ||
68 | static int fd = open( "/dev/sharp_buz", O_RDWR|O_NONBLOCK ); \ | ||
69 | ioctl( fd, SHARP_BUZZER_MAKESOUND, sound ); \ | ||
70 | } | ||
71 | |||
72 | #define CUSTOM_SOUND_ALARM CUSTOM_BUZZER( SHARP_BUZ_SCHEDULE_ALARM ) | ||
73 | #define CUSTOM_SOUND_KEYCLICK CUSTOM_BUZZER( SHARP_BUZ_KEYSOUND ) | ||
74 | #define CUSTOM_SOUND_TOUCH CUSTOM_BUZZER( SHARP_BUZ_TOUCHSOUND ) | ||
75 | |||
76 | 39 | ||
77 | #include <sys/ioctl.h> | 40 | #include <sys/ioctl.h> |
78 | #include <asm/sharp_char.h> | 41 | #include <asm/sharp_char.h> |
79 | 42 | ||
80 | // a bit awkward, as this value is defined in emailclient.cpp aswell... | ||
81 | #define LED_MAIL 0 | ||
82 | #define SHARP_LED_MAIL 9 | ||
83 | |||
84 | #define CUSTOM_LEDS( led, status ) \ | ||
85 | { \ | ||
86 | if ( led == LED_MAIL ) \ | ||
87 | led = SHARP_LED_MAIL; \ | ||
88 | static int fd = open( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); \ | ||
89 | sharp_led_status leds; \ | ||
90 | memset(&leds, 0, sizeof(leds)); \ | ||
91 | leds.which = led; \ | ||
92 | leds.status = status; \ | ||
93 | ioctl( fd, SHARP_LED_SETSTATUS, (char*)&leds ); \ | ||
94 | } | ||
95 | |||
96 | #define QPE_HAVE_MEMALERTER | 43 | #define QPE_HAVE_MEMALERTER |
97 | 44 | ||
98 | #define QPE_MEMALERTER_IMPL \ | 45 | #define QPE_MEMALERTER_IMPL \ |
99 | static void sig_handler(int sig) \ | 46 | static void sig_handler(int sig) \ |
100 | { \ | 47 | { \ |
101 | switch (sig) { \ | 48 | switch (sig) { \ |
102 | case SIGHUP: \ | 49 | case SIGHUP: \ |
103 | memstate = VeryLow; \ | 50 | memstate = VeryLow; \ |
104 | break; \ | 51 | break; \ |
105 | case SIGUSR1: \ | 52 | case SIGUSR1: \ |
106 | memstate = Normal; \ | 53 | memstate = Normal; \ |
107 | break; \ | 54 | break; \ |