int main(char *argv, int argc) { uSynergyContext context; uSynergyInit(&context); context.m_connectFunc = &s_connect; context.m_sendFunc = &s_send; context.m_receiveFunc = &s_receive; context.m_sleepFunc = &s_sleep; context.m_getTimeFunc = &s_getTime; context.m_traceFunc = &s_trace; context.m_screenActiveCallback = &s_screenActive; context.m_mouseCallback = &s_mouse; context.m_mouseRelativeCallback = &s_mouserel; context.m_keyboardCallback = &s_keyboard; context.m_joystickCallback = &s_joystick; context.m_clipboardCallback = &s_clipboard; context.m_clientName = name; context.m_clientWidth = 1000; context.m_clientHeight = 1000; init(); for (;;) { uSynergyUpdate(&context); } }
// TODO: implement callbacks. int main(int argc, char** argv) { uSynergyContext context; uSynergyInit(&context); for(;;) { uSynergyUpdate(&context); } }
// TODO: implement callbacks. int main(char* argv, int argc) { uSynergyContext context; uSynergyInit(&context); context.m_connectFunc = &connect; context.m_sendFunc = &send; context.m_receiveFunc = &receive; context.m_sleepFunc = &sleep; context.m_getTimeFunc = &getTime; context.m_traceFunc = &trace; context.m_screenActiveCallback = &screenActive; context.m_mouseCallback = &mouse; context.m_keyboardCallback = &keyboard; context.m_joystickCallback = &joystick; context.m_clipboardCallback = &clipboard; for(;;) { uSynergyUpdate(&context); } }
int main(int argc, char **argv) { uSynergyContext context; char *synergyClientName = "amiga"; int keyCodesFromStdin = 0; int listUsbDevices = 1; int option = 0; while ((option = getopt(argc, argv,"n:t:s:x:y:d:h")) != -1) { switch (option) { case 'n': synergyClientName = optarg; break; case 't': serverType = getServerType(optarg); break; case 's': usbSerialNum = optarg; break; case 'x': amigaMouseResWidth = atoi(optarg); break; case 'y': amigaMouseResHeight = atoi(optarg); break; case 'd': debugLevel = atoi(optarg); break; case 'h': default: fprintf(stderr, "Usage: %s [-n synergyClientName] [-t synergyServerType linux/mac/windows] [-s usbSerialNum] [-x amigaMouseResolutionWidth] [-y amigaMouseResulutionHeight] [-d debugLevel] [-]\n", argv[0]); exit(EXIT_FAILURE); } } if (optind < argc && strcmp(argv[optind], "-") == 0) { keyCodesFromStdin = 1; } int libusbResult = libusb_init(NULL); if(0 != libusbResult) { fprintf(stderr, "Initializing libusb: %s\n", libusb_strerror(libusbResult)); } atexit(usb_cleanup); if(listUsbDevices) listUsbDeviceMatches(VENDOR_ID, PRODUCT_ID); usbhandle = find_device(VENDOR_ID, PRODUCT_ID, usbSerialNum); if (keyCodesFromStdin) { int c; fprintf(stderr, "Will send stdin as raw amiga keycodes to the avr\n"); while((c = getchar())) { if (c < 0 || c == EOF) return 0; usb_send_amiga_key(c, c & 0x80); } } if(UnknownType == serverType) { fprintf(stderr, "Unknown server type!\n"); return 1; } keycodes = getKeycodes(serverType); fprintf(stderr, "Server type: %s\n", getServerTypeName(serverType)); fprintf(stderr, "Amiga mouse resolution: %dx%d\n", amigaMouseResWidth, amigaMouseResHeight); uSynergyInit(&context); context.m_connectFunc = &s_connect; context.m_sendFunc = &s_send; context.m_receiveFunc = &s_receive; context.m_sleepFunc = &s_sleep; context.m_getTimeFunc = &s_getTime; context.m_traceFunc = &s_trace; context.m_screenActiveCallback = &s_screenActive; context.m_mouseCallback = &s_mouse; context.m_mouseRelativeCallback = &s_mouserel; context.m_keyboardCallback = &s_keyboard; context.m_joystickCallback = &s_joystick; context.m_clipboardCallback = &s_clipboard; context.m_clientName = synergyClientName; context.m_clientWidth = amigaMouseResWidth; context.m_clientHeight = amigaMouseResHeight; for (;;) { uSynergyUpdate(&context); } }