Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macos mouse fix #22

Merged
merged 2 commits into from Jun 11, 2013
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -9,7 +9,7 @@

/* automatically generated by rust-bindgen */

use glut::bindgen::{glutCreateWindow, glutDestroyWindow, glutDisplayFunc, glutMouseFunc, glutMouseWheelFunc};
use glut::bindgen::{glutCreateWindow, glutDestroyWindow, glutDisplayFunc, glutMouseFunc};
use glut::bindgen::{glutKeyboardFunc, glutGetModifiers, glutMotionFunc, glutPassiveMotionFunc};
use glut::bindgen::{glutGet, glutGetWindow};
use glut::bindgen::{glutInit, glutInitDisplayMode, glutPostRedisplay, glutReshapeFunc};
@@ -22,6 +22,9 @@ use core::str::to_bytes;
use core::cast::transmute;
use core::vec::raw::to_ptr;

#[cfg(target_os="linux")]
use glut::bindgen::glutMouseWheelFunc;

/* FIXME: global variable glutStrokeRoman */

/* FIXME: global variable glutStrokeMonoRoman */
@@ -489,6 +492,7 @@ pub fn glutKeyboardFunc(func: *u8);

pub fn glutMouseFunc(func: *u8);

#[cfg(target_os="linux")]
pub fn glutMouseWheelFunc(func: *u8);

pub fn glutMotionFunc(func: *u8);
@@ -19,7 +19,7 @@ extern {
// From CarbonEvents.h.
static kEventMouseScroll: u32 = 11;

extern fn scrollWheelImpl(this: id, _cmd: SEL, event: id) {
extern fn scrollWheelImpl(_this: id, _cmd: SEL, event: id) {
unsafe {
// Get the underlying Carbon event to figure out if deviceDelta{Y,X} are available.
let sel__eventRef = sel_registerName(transmute(&"_eventRef"[0]));
@@ -67,7 +67,7 @@ extern fn scrollWheelImpl(this: id, _cmd: SEL, event: id) {
}
}

extern fn magnifyWithEvent(this: id, _cmd: SEL, event: id) {
extern fn magnifyWithEvent(_this: id, _cmd: SEL, event: id) {
unsafe {
let sel_magnification = sel_registerName(transmute(&"magnification"[0]));
let magnification = msg_send_double(event, sel_magnification) + 1.0;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.