SWILIB API (X75)    
Loading...
Searching...
No Matches
misc.h
Go to the documentation of this file.
1#pragma once
2
3#ifndef __IN_SWILIB__
4#include "base.h"
5#include "wstring.h"
6#include "csm.h"
7#endif
8
10
19typedef int(*shortcut_func)(void);
20typedef struct shortcut shortcut;
21typedef struct LIGHT_PARAM LIGHT_PARAM;
22#ifdef NEWSGOLD
23typedef struct SEXIT_RECORD SEXIT_RECORD;
24typedef struct SEXIT_HOOKS SEXIT_HOOKS;
25typedef struct SEXIT_STATE SEXIT_STATE;
26typedef struct SEXIT_RECORDS SEXIT_RECORDS;
27#endif
28
38
46
50struct shortcut {
51#ifdef NEWSGOLD
52 char name[16];
54 void *get_status;
55 int unk_1;
56 int lgp_full_name;
57 int unk_2;
58 int unk_3;
59 int lgp_short_name;
60 int unk_4;
61 int lgp_comment_msg;
62#else
64#endif
65};
66
71 char timeout;
72 char unk0;
75 char max_illum;
76};
77
82
101#ifdef NEWSGOLD
102#ifdef ELKA
103 ACC_USB_RS232_CABLE = 0xF,
104 ACC_USB_CABLE = 0x10,
105 ACC_USB_CABLE_DOWN = 0x11,
106 ACC_USB_CABLE_NC = 0x12,
107 ACC_HEADSET_MONO = 0x14,
108 ACC_HEADSET_STEREO = 0x15,
109 ACC_CLIP_ON_FLASH = 0x16,
110 ACC_TTY_X55 = 0x17,
111 ACC_TTY = 0x18,
112 ACC_JAVA_DEVICE = 0x19,
113 ACC_EMO_DEVICE = 0x1A,
114 ACC_CLIP_IT_LED = 0x1B,
115 ACC_FM_RADIO = 0x1C,
116 ACC_MP3_PLAYER = 0x1D,
117 ACC_MOBILE_MUSIC_SET = 0x1F,
118 ACC_MUSIC_CABLE = 0x20,
119 ACC_BOOT_BOX = 0x22,
120 ACC_UNSUPPORTED_DEVICE = 0x2F,
121 ACC_UNKNOWN_DEVICE = 0x30
122#else
123 ACC_USB_DATA_CABLE = 0xF,
124 ACC_DATA_CABLE_USB_USB = 0x10,
125 ACC_HEADSET_MONO = 0x12,
126 ACC_HEADSET_STEREO = 0x13,
127 ACC_CLIP_ON_FLASH = 0x14,
128 ACC_TTY_X55 = 0x15,
129 ACC_TTY = 0x16,
130 ACC_JAVA_DEVICE = 0x17,
131 ACC_EMO_DEVICE = 0x18,
132 ACC_CLIP_IT_LED = 0x19,
133 ACC_FM_RADIO = 0x1A,
134 ACC_MP3_PLAYER = 0x1B,
135 ACC_MOBILE_MUSIC_SET = 0x1D,
136 ACC_MUSIC_CABLE = 0x1E,
137 ACC_BOOT_BOX = 0x20,
138 ACC_UNSUPPORTED_ACCESSORY = 0x2D,
139 ACC_UNKNOWN_ACCESSORY = 0x2E
140#endif
141#endif
142};
143
144#ifdef NEWSGOLD
149struct SEXIT_RECORD {
150 uint8_t type;
151 uint8_t unk1;
152 uint16_t code;
153 uint16_t module;
154 uint16_t param;
155 uint32_t pc;
156 char text[32];
157 char name[32];
158 uint32_t stack[16];
159 struct {
160 uint32_t r[13], sp, lr, pc, cpsr, spsr;
161 } regs;
162};
163
168typedef void (*SEXIT_HANDLER)(SEXIT_RECORD *record);
169
175struct SEXIT_HOOKS {
176 SEXIT_HANDLER *fatal;
177 SEXIT_HANDLER *warning;
178 void *unk;
179#ifdef ELKA
180 void (**pre)(void);
181#endif
182 int blacklist;
183};
184
188struct SEXIT_STATE {
189 uint8_t fatal_depth;
190 uint8_t warning_depth;
191 uint16_t unk;
192 int fatal;
193 int enabled;
194 int no_hooks;
195 int unk2;
196};
197
201struct SEXIT_RECORDS {
202 SEXIT_RECORD *fatal;
203 SEXIT_RECORD *warning;
204 SEXIT_RECORD fatal_slot[2];
205 SEXIT_RECORD warning_slot[2];
206};
207#endif
208
217__swi_begin(0x009)
219__swi_end(0x009, SwitchPhoneOff, ());
220
224__swi_begin(0x093)
226__swi_end(0x093, RebootPhone, ());
227
233__swi_begin(0x036)
234void SLI_SetState(uint8_t state)
235__swi_end(0x036, SLI_SetState, (state));
236
248__swi_begin(0x17F)
250__swi_end(0x17F, DisableIDLETMR, ());
251
258__swi_begin(0x17D)
259void SetIDLETMR(int timeout, int msg)
260__swi_end(0x17D, SetIDLETMR, (timeout, msg));
261
265__swi_begin(0x17E)
267__swi_end(0x17E, RestartIDLETMR, ());
268
280__swi_begin(0x05A)
281void KeypressOn(int keycode)
282__swi_end(0x05A, KeypressOn, (keycode));
283
288__swi_begin(0x05B)
289void KeypressOff(int keycode)
290__swi_end(0x05B, KeypressOff, (keycode));
291
296__swi_begin(0x043)
297int IsUnlocked(void)
298__swi_end(0x043, IsUnlocked, ());
299
305__swi_begin(0x80D5)
306int *RamIsLocked(void)
307__swi_end(0x80D5, RamIsLocked, ());
308
312__swi_begin(0x0A9)
313void KbdLock(void)
314__swi_end(0x0A9, KbdLock, ());
315
319__swi_begin(0x0B9)
320void KbdUnlock(void)
321__swi_end(0x0B9, KbdUnlock, ());
322
326__swi_begin(0x3D0)
328__swi_end(0x3D0, RestartLockTimers, ());
329
341#ifdef NEWSGOLD
342__swi_begin(0x8052)
345#else
346__swi_begin(0x052)
349#endif
350
355__swi_begin(0x80D7)
357__swi_end(0x80D7, RamScreenBrightness, ());
358
367__swi_begin(0x008)
368long SetIllumination(uint8_t dev, unsigned long unk, uint16_t level, unsigned long delay)
369__swi_end(0x008, SetIllumination, (dev, unk, level, delay));
370
389__swi_begin(0x2DE)
390void IllumTimeRequest(int time_mode, int counter)
391__swi_end(0x2DE, IllumTimeRequest, (time_mode, counter));
392
398__swi_begin(0x2DF)
399void IllumTimeRelease(int time_mode, int counter)
400__swi_end(0x2DF, IllumTimeRelease, (time_mode, counter));
401
407__swi_begin(0x3FA)
408void SetMaxIllumIntensity(int unk3, uint32_t level)
409__swi_end(0x3FA, SetMaxIllumIntensity, (unk3, level));
410
416__swi_begin(0x044)
417void TempLightOn(int flags, int unk)
418__swi_end(0x044, TempLightOn, (flags, unk));
419
425__swi_begin(0x3D3)
426void IllumFilterSet(int flags, int unk)
427__swi_end(0x3D3, IllumFilterSet, (flags, unk));
428
440__swi_begin(0x040)
442__swi_end(0x040, GetVibraStatus, ());
443
448__swi_begin(0x062)
449void SetVibraStatus(int status)
450__swi_end(0x062, SetVibraStatus, (status));
451
457__swi_begin(0x07C)
458uint32_t SetVibration(uint32_t power)
459__swi_end(0x07C, SetVibration, (power));
460
472__swi_begin(0x380)
474__swi_end(0x380, GetClipBoard, ());
475
482__swi_begin(0x381)
483void CopyTextToClipboard(const WSHDR *text, int pos, int len)
484__swi_end(0x381, CopyTextToClipboard, (text, pos, len));
485
490__swi_begin(0x382)
491void ClearClipboard(char unk)
492__swi_end(0x382, ClearClipboard, (unk));
493
505__swi_begin(0x035)
507__swi_end(0x035, AlarmClockRing, ());
508
514__swi_begin(0x2A0)
515int GetAlarmClockState(int state)
516__swi_end(0x2A0, GetAlarmClockState, (state));
517
523__swi_begin(0x80CF)
525__swi_end(0x80CF, RamAlarmClockState, ());
526
531__swi_begin(0x291)
533__swi_end(0x291, RefreshAlarmClock, ());
534
539__swi_begin(0x8292)
542
547__swi_begin(0x8293)
549__swi_end(0x8293, RamAlarmClockHours, ());
550
555__swi_begin(0x8294)
558
569__swi_begin(0x3F0)
571__swi_end(0x3F0, Countdown_Start, ());
572
576__swi_begin(0x3F1)
578__swi_end(0x3F1, Countdown_Stop, ());
579
584__swi_begin(0x3F2)
587
592__swi_begin(0x3F3)
595
600__swi_begin(0x3F4)
601void Countdown_PlaySound(long tone_type)
602__swi_end(0x3F4, Countdown_PlaySound, (tone_type));
603
608__swi_begin(0x83F5)
611
623__swi_begin(0x80D0)
624void *RamAccPoint(void)
625__swi_end(0x80D0, RamAccPoint, ());
626
634__swi_begin(0x3F9)
635int IsAnyOfAccessoriesConnected(const enum Accessory *accessory_ids, uint8_t count)
636__swi_end(0x3F9, IsAnyOfAccessoriesConnected, (accessory_ids, count));
637
645#ifdef NEWSGOLD
654__swi_begin(0x845B)
655SEXIT_HOOKS *RamSExitHooks(void)
656__swi_end(0x845B, RamSExitHooks, ());
657
665__swi_begin(0x845C)
666SEXIT_STATE *RamSExitState(void)
667__swi_end(0x845C, RamSExitState, ());
668
674__swi_begin(0x845D)
675SEXIT_RECORDS *RamSExitRecords(void)
676__swi_end(0x845D, RamSExitRecords, ());
677
689__swi_begin(0x45E)
690void SExit(int code, const uint8_t *module, int type, int param)
691__swi_end(0x45E, SExit, (code, module, type, param));
692#endif
693
697__swi_begin(0x060)
699__swi_end(0x060, ShowMainMenu, ());
700
704__swi_begin(0x061)
706__swi_end(0x061, ShowNativeMenu, ());
707
713__swi_begin(0x1F2)
715__swi_end(0x1F2, Devmenu_Config_IsCheckboxOff, (checkbox_id));
716
726__swi_begin(0x074)
728__swi_end(0x074, GetShortcutRecordByName, (shortcut_name));
729
734__swi_begin(0x074)
735const shortcut *GetFunctionPointer(char *shortcut_name)
736__swi_end(0x074, GetFunctionPointer, (shortcut_name));
737
742__swi_begin(0x2D2)
745
749
#define __swilib_begin
Definition doxygen.h:29
#define __swi_end(number, func, call)
Definition doxygen.h:33
#define __swi_begin(number)
Definition doxygen.h:32
#define __swilib_end
Definition doxygen.h:30
char timeout
Lightness off timeout.
Definition misc.h:71
char unk0
Something mysterious, sometimes 0 or 5.
Definition misc.h:72
char max_illum
Lightness level.
Definition misc.h:75
shortcut_func pointer
Function which is called by shortcut.
Definition misc.h:63
char perm_illum
It’s not entirely clear, it seems that the level that will be held when calling IllumTimeRequest is o...
Definition misc.h:73
int RefreshAlarmClock()
Re-read changed alarmclock.pd.
void SetIDLETMR(int timeout, int msg)
Set custom IDLE timer.
void IllumFilterSet(int flags, int unk)
Trigger backlight (temporary set OFF).
int(* shortcut_func)(void)
Definition misc.h:19
char * RamAlarmClockMinutes()
AlarmClock scheduled time (minutes).
char * GetIlluminationDataTable()
Pointer to the illumination table.
int * RamIsLocked(void)
Get keyboard lock status.
void Countdown_PlaySound(long tone_type)
Play sound for the countdown.
void Countdown_Stop()
Stop the countdown.
void SetVibraStatus(int status)
Enable or disable vibration.
void StartNativeBrowserCore()
initialize Openwave browser.
int IsUnlocked(void)
Get keyboard lock status.
void AlarmClockRing(void)
Run AlarmClock ringing.
void ShowMainMenu()
Open FlexMenu.
void RestartIDLETMR(void)
Restart the default idle timer.
const shortcut * GetShortcutRecordByName(char *shortcut_name)
Get shortcut by shortcut name.
void SwitchPhoneOff()
Switchoff phone.
CountdownToneType
Definition misc.h:78
void KeypressOff(int keycode)
Release key (simulation).
void KeypressOn(int keycode)
Press key (simulation).
void TempLightOn(int flags, int unk)
Trigger backlight (temporary set ON).
int IsAnyOfAccessoriesConnected(const enum Accessory *accessory_ids, uint8_t count)
Checks if any accessory from the list is connected.
void IllumTimeRequest(int time_mode, int counter)
Keep the backlight on.
char * RamAlarmClockState()
Pointer to the AlarmClock state.
long SetIllumination(uint8_t dev, unsigned long unk, uint16_t level, unsigned long delay)
Change illumination level for keyboard or LCD.
uint32_t SetVibration(uint32_t power)
Start vibration.
char * RamIsAlarmClockAutorepeatOn()
Check if auto-repeat is enabled in AlarmClock.
void SLI_SetState(uint8_t state)
Set state for SLI indicator.
int Countdown_GetRemainingTime()
Get the remaining time of the countdown.
void ShowNativeMenu()
Open NativeMenu.
IlluminationDeviceID
Illumination device.
Definition misc.h:32
void * RamAccPoint(void)
Get a pointer to the current accessory connected to the phone.
void RestartLockTimers()
Restart screensaver and keyboard lock timers.
const shortcut * GetFunctionPointer(char *shortcut_name)
Get shortcut by shortcut name.
void Countdown_Start()
Read countdown.pd and start the countdown.
SetLightFlags
Set light flags.
Definition misc.h:42
void ClearClipboard(char unk)
Clear clipboard content.
void RebootPhone()
Reboot phone.
void DisableIDLETMR(void)
Disable the IDLE timer - the phone never goes to the IDLE screen.
WSHDR * GetClipBoard(void)
Get clipboard content.
void CopyTextToClipboard(const WSHDR *text, int pos, int len)
Copy the text to the clipboard.
int GetAlarmClockState(int state)
Get AlarmClock state.
int * RamIsCountdownRingUIActive()
Check if Ring UI for the countdown is active.
void SetMaxIllumIntensity(int unk3, uint32_t level)
Sets the maximum backlight brightness.
int Devmenu_Config_IsCheckboxOff(int checkbox_id)
Get checkbox state from the devmenu.
int GetVibraStatus(void)
Check if vibration enabled.
void KbdUnlock(void)
Unlock keyboard.
Accessory
Accessories.
Definition misc.h:86
char * RamAlarmClockHours()
AlarmClock scheduled time (hours).
void KbdLock(void)
Lock keyboard.
int Countdown_IsEnabled()
Check if the countdown is enabled.
void IllumTimeRelease(int time_mode, int counter)
Allow backlight to turn off again.
LIGHT_PARAM * RamScreenBrightness(void)
Pointer to the brightness settings.
@ COUNTDOWN_TONE_ALERT
Definition misc.h:80
@ COUNTDOWN_TONE_BEEP
Definition misc.h:79
@ ILLUMINATION_DEV_DISPLAY
LCD.
Definition misc.h:33
@ ILLUMINATION_DEV_LIGHTER
Camera flashlight as lighter.
Definition misc.h:36
@ ILLUMINATION_DEV_DYNLIGHT
Dynamic Light.
Definition misc.h:35
@ ILLUMINATION_DEV_KEYBOARD
Keyboard.
Definition misc.h:34
@ SET_LIGHT_KEYBOARD
Trigger Keyboard backlight.
Definition misc.h:44
@ SET_LIGHT_DISPLAY
Trigger LCD backlight.
Definition misc.h:43
@ ACC_CARKIT_LINEFIT
Definition misc.h:92
@ ACC_CK_LINEFIT_ATC
Definition misc.h:91
@ ACC_CK_LINEFIT_MK2
Definition misc.h:93
@ ACC_CARKIT_COMFORT
Definition misc.h:87
@ ACC_CARKIT_VOICE
Definition misc.h:95
@ ACC_STANDARD_CHARGER
Definition misc.h:99
@ ACC_CARKIT_EASY
Definition misc.h:90
@ ACC_CARKIT_PORTABLE
Definition misc.h:89
@ ACC_CK_COMFORT_MK2
Definition misc.h:88
@ ACC_DESKTOP_CHARGER
Definition misc.h:98
@ ACC_CARKIT_PROFESSIONAL
Definition misc.h:94
@ ACC_CAR_DATA_ADAPTOR
Definition misc.h:97
@ ACC_DATA_CABLE
Definition misc.h:100
@ ACC_CK_VOICE_MK2
Definition misc.h:96
Lightness settings.
Definition misc.h:70
Shortcuts.
Definition misc.h:50
Wide-string header.
Definition wstring.h:35
#define const
Definition zconf.h:115