diff options
| author | Adrian Robert | 2009-10-12 00:27:52 +0000 |
|---|---|---|
| committer | Adrian Robert | 2009-10-12 00:27:52 +0000 |
| commit | e7b90afd6578bab1274627f107150c5393049d71 (patch) | |
| tree | bad71ab5e0e5f5b79087d3fc85038053257881a4 /src | |
| parent | e28db5bc73c02a05b82a536c98fc95968faed54e (diff) | |
| download | emacs-e7b90afd6578bab1274627f107150c5393049d71.tar.gz emacs-e7b90afd6578bab1274627f107150c5393049d71.zip | |
* nsterm.m (ns_color_to_lisp): Use CGFloat where appropriate. Fix
printf format.
(ns_query_color): Use CGFloat where appropriate.
(EmacsView<NSTextInput>, EmacsScroller): Fix method signatures.
(EmacsScroller-mouseDown:) Use long format in printf, and cast
argument.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsterm.m | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index 008860f94fb..604b9e88779 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -1449,7 +1449,7 @@ ns_color_to_lisp (NSColor *col) | |||
| 1449 | Convert a color to a lisp string with the RGB equivalent | 1449 | Convert a color to a lisp string with the RGB equivalent |
| 1450 | -------------------------------------------------------------------------- */ | 1450 | -------------------------------------------------------------------------- */ |
| 1451 | { | 1451 | { |
| 1452 | float red, green, blue, alpha, gray; | 1452 | CGFloat red, green, blue, alpha, gray; |
| 1453 | char buf[1024]; | 1453 | char buf[1024]; |
| 1454 | const char *str; | 1454 | const char *str; |
| 1455 | NSTRACE (ns_color_to_lisp); | 1455 | NSTRACE (ns_color_to_lisp); |
| @@ -1469,13 +1469,13 @@ ns_color_to_lisp (NSColor *col) | |||
| 1469 | { | 1469 | { |
| 1470 | [[col colorUsingColorSpaceName: NSCalibratedWhiteColorSpace] | 1470 | [[col colorUsingColorSpaceName: NSCalibratedWhiteColorSpace] |
| 1471 | getWhite: &gray alpha: &alpha]; | 1471 | getWhite: &gray alpha: &alpha]; |
| 1472 | snprintf (buf, sizeof (buf), "#%02.2lx%02.2lx%02.2lx", | 1472 | snprintf (buf, sizeof (buf), "#%2.2lx%2.2lx%2.2lx", |
| 1473 | lrint (gray * 0xff), lrint (gray * 0xff), lrint (gray * 0xff)); | 1473 | lrint (gray * 0xff), lrint (gray * 0xff), lrint (gray * 0xff)); |
| 1474 | UNBLOCK_INPUT; | 1474 | UNBLOCK_INPUT; |
| 1475 | return build_string (buf); | 1475 | return build_string (buf); |
| 1476 | } | 1476 | } |
| 1477 | 1477 | ||
| 1478 | snprintf (buf, sizeof (buf), "#%02.2lx%02.2lx%02.2lx", | 1478 | snprintf (buf, sizeof (buf), "#%2.2lx%2.2lx%2.2lx", |
| 1479 | lrint (red*0xff), lrint (green*0xff), lrint (blue*0xff)); | 1479 | lrint (red*0xff), lrint (green*0xff), lrint (blue*0xff)); |
| 1480 | 1480 | ||
| 1481 | UNBLOCK_INPUT; | 1481 | UNBLOCK_INPUT; |
| @@ -1491,7 +1491,7 @@ ns_query_color(void *col, XColor *color_def, int setPixel) | |||
| 1491 | and set color_def pixel to the resulting index. | 1491 | and set color_def pixel to the resulting index. |
| 1492 | -------------------------------------------------------------------------- */ | 1492 | -------------------------------------------------------------------------- */ |
| 1493 | { | 1493 | { |
| 1494 | float r, g, b, a; | 1494 | CGFloat r, g, b, a; |
| 1495 | 1495 | ||
| 1496 | [((NSColor *)col) getRed: &r green: &g blue: &b alpha: &a]; | 1496 | [((NSColor *)col) getRed: &r green: &g blue: &b alpha: &a]; |
| 1497 | color_def->red = r * 65535; | 1497 | color_def->red = r * 65535; |
| @@ -4705,7 +4705,7 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 4705 | return NSMakeRange (NSNotFound, 0); | 4705 | return NSMakeRange (NSNotFound, 0); |
| 4706 | } | 4706 | } |
| 4707 | 4707 | ||
| 4708 | - (unsigned int)characterIndexForPoint: (NSPoint)thePoint | 4708 | - (NSUInteger)characterIndexForPoint: (NSPoint)thePoint |
| 4709 | { | 4709 | { |
| 4710 | if (NS_KEYLOG) | 4710 | if (NS_KEYLOG) |
| 4711 | NSLog (@"characterIndexForPoint request"); | 4711 | NSLog (@"characterIndexForPoint request"); |
| @@ -5395,7 +5395,7 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 5395 | /* NSDraggingDestination protocol methods. Actually this is not really a | 5395 | /* NSDraggingDestination protocol methods. Actually this is not really a |
| 5396 | protocol, but a category of Object. O well... */ | 5396 | protocol, but a category of Object. O well... */ |
| 5397 | 5397 | ||
| 5398 | -(unsigned int) draggingEntered: (id <NSDraggingInfo>) sender | 5398 | -(NSUInteger) draggingEntered: (id <NSDraggingInfo>) sender |
| 5399 | { | 5399 | { |
| 5400 | NSTRACE (draggingEntered); | 5400 | NSTRACE (draggingEntered); |
| 5401 | return NSDragOperationGeneric; | 5401 | return NSDragOperationGeneric; |
| @@ -5680,7 +5680,7 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 5680 | #define SCROLL_BAR_FIRST_DELAY 0.5 | 5680 | #define SCROLL_BAR_FIRST_DELAY 0.5 |
| 5681 | #define SCROLL_BAR_CONTINUOUS_DELAY (1.0 / 15) | 5681 | #define SCROLL_BAR_CONTINUOUS_DELAY (1.0 / 15) |
| 5682 | 5682 | ||
| 5683 | + (float) scrollerWidth | 5683 | + (CGFloat) scrollerWidth |
| 5684 | { | 5684 | { |
| 5685 | /* TODO: if we want to allow variable widths, this is the place to do it, | 5685 | /* TODO: if we want to allow variable widths, this is the place to do it, |
| 5686 | however neither GNUstep nor Cocoa support it very well */ | 5686 | however neither GNUstep nor Cocoa support it very well */ |
| @@ -5925,7 +5925,8 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 5925 | case NSScrollerKnobSlot: /* GNUstep-only */ | 5925 | case NSScrollerKnobSlot: /* GNUstep-only */ |
| 5926 | last_hit_part = scroll_bar_move_ratio; break; | 5926 | last_hit_part = scroll_bar_move_ratio; break; |
| 5927 | default: /* NSScrollerNoPart? */ | 5927 | default: /* NSScrollerNoPart? */ |
| 5928 | fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %d\n", part); | 5928 | fprintf (stderr, "EmacsScoller-mouseDown: unexpected part %ld\n", |
| 5929 | (long)part); | ||
| 5929 | return; | 5930 | return; |
| 5930 | } | 5931 | } |
| 5931 | 5932 | ||