Permalink
Browse files

Whitespace normalization

  • Loading branch information...
1 parent 7072b9e commit c4e212c26d2035762b46f07b2f39a9e47a41e64c @toton committed Jul 26, 2011
Showing with 60 additions and 60 deletions.
  1. +28 −28 src/gdk.ml
  2. +10 −10 src/gdk.mli
  3. +12 −12 src/glib.ml
  4. +10 −10 src/ml_gdk.c
View
@@ -91,7 +91,7 @@ module Tags = struct
type notify_type =
[ `ANCESTOR | `VIRTUAL | `INFERIOR | `NONLINEAR
- | `NONLINEAR_VIRTUAL | `UNKNOWN ]
+ | `NONLINEAR_VIRTUAL | `UNKNOWN ]
type crossing_mode = [ `NORMAL | `GRAB | `UNGRAB ]
@@ -107,7 +107,7 @@ module Tags = struct
type drag_action =
[ `DEFAULT | `COPY | `MOVE | `LINK | `PRIVATE | `ASK ]
- type rgb_dither =
+ type rgb_dither =
[ `NONE | `NORMAL | `MAX]
type property_state = [ `NEW_VALUE | `DELETE ]
@@ -221,7 +221,7 @@ module Image = struct
let cast w : image = Gobject.try_cast w "GdkImage"
let destroy = Gobject.unsafe_unref
- external create : kind: image_type -> visual: visual ->
+ external create : kind: image_type -> visual: visual ->
width: int -> height: int -> image
= "ml_gdk_image_new"
external get :
@@ -301,25 +301,25 @@ module Window = struct
external get_pointer_location : window -> int * int =
"ml_gdk_window_get_pointer_location"
external root_parent : unit -> window = "ml_GDK_ROOT_PARENT"
- external set_back_pixmap : window -> pixmap -> int -> unit =
+ external set_back_pixmap : window -> pixmap -> int -> unit =
"ml_gdk_window_set_back_pixmap"
- external set_cursor : window -> cursor -> unit =
+ external set_cursor : window -> cursor -> unit =
"ml_gdk_window_set_cursor"
external clear : window -> unit = "ml_gdk_window_clear"
external clear_area :
window -> x:int -> y:int -> width:int -> height:int -> unit
= "ml_gdk_window_clear"
external get_xwindow : [>`drawable] obj -> xid = "ml_GDK_WINDOW_XWINDOW"
- let set_back_pixmap w pix =
+ let set_back_pixmap w pix =
let null_pixmap = (Obj.magic Gpointer.boxed_null : pixmap) in
match pix with
`NONE -> set_back_pixmap w null_pixmap 0
| `PARENT_RELATIVE -> set_back_pixmap w null_pixmap 1
- | `PIXMAP(pixmap) -> set_back_pixmap w pixmap 0
- (* anything OK, Maybe... *)
+ | `PIXMAP(pixmap) -> set_back_pixmap w pixmap 0
+ (* anything OK, Maybe... *)
- (* for backward compatibility for lablgtk1 programs *)
+ (* for backward compatibility for lablgtk1 programs *)
let get_visual = Drawable.get_visual
end
@@ -346,7 +346,7 @@ module Region = struct
type gdkOverlapType = [ `IN|`OUT|`PART ]
external create : unit -> region = "ml_gdk_region_new"
external destroy : region -> unit = "ml_gdk_region_destroy"
- external polygon : PointArray.t -> gdkFillRule -> region
+ external polygon : PointArray.t -> gdkFillRule -> region
= "ml_gdk_region_polygon"
let polygon l =
let len = List.length l in
@@ -358,11 +358,11 @@ module Region = struct
= "ml_gdk_region_copy"
external intersect : region -> region -> region
= "ml_gdk_region_intersect"
- external union : region -> region -> region
+ external union : region -> region -> region
= "ml_gdk_region_union"
- external subtract : region -> region -> region
+ external subtract : region -> region -> region
= "ml_gdk_region_subtract"
- external xor : region -> region -> region
+ external xor : region -> region -> region
= "ml_gdk_region_xor"
external union_with_rect : region -> Rectangle.t -> region
= "ml_gdk_region_union_with_rect"
@@ -375,14 +375,14 @@ module Region = struct
external shrink : region -> x:int -> y:int -> unit = "ml_gdk_region_shrink"
external empty : region -> bool = "ml_gdk_region_empty"
external equal : region -> region -> bool = "ml_gdk_region_equal"
- external point_in : region -> x:int -> y:int -> bool
+ external point_in : region -> x:int -> y:int -> bool
= "ml_gdk_region_point_in"
external rect_in : region -> Rectangle.t -> gdkOverlapType
= "ml_gdk_region_rect_in"
external get_clipbox : region -> Rectangle.t -> unit
= "ml_gdk_region_get_clipbox"
end
-
+
module GC = struct
type gdkFunction = [ `COPY|`INVERT|`XOR ]
@@ -520,7 +520,7 @@ module Draw = struct
~start:(truncate(start *. 64.))
~angle:(truncate(angle *. 64.))
- let f_pointarray f l =
+ let f_pointarray f l =
let array_of_points l =
let len = List.length l in
let arr = PointArray.create ~len in
@@ -530,12 +530,12 @@ module Draw = struct
in
f (array_of_points l)
- let f_segmentarray f l =
+ let f_segmentarray f l =
let array_of_segments l =
let len = List.length l in
let arr = SegmentArray.create ~len in
List.fold_left l ~init:0
- ~f:(fun pos ((x1,y1),(x2,y2)) ->
+ ~f:(fun pos ((x1,y1),(x2,y2)) ->
SegmentArray.set arr ~pos ~x1 ~y1 ~x2 ~y2; pos+1);
arr
in
@@ -549,26 +549,26 @@ module Draw = struct
| l -> f_pointarray (polygon w gc ~filled) l
external string :
[>`drawable] obj -> font: font -> gc -> x: int -> y: int -> string -> unit
- = "ml_gdk_draw_string_bc" "ml_gdk_draw_string"
+ = "ml_gdk_draw_string_bc" "ml_gdk_draw_string"
external layout :
[>`drawable] obj -> gc -> x: int -> y: int -> Pango.layout ->
?fore:color -> ?back:color -> unit
= "ml_gdk_draw_layout_with_colors_bc" "ml_gdk_draw_layout_with_colors"
- external image_ : [>`drawable] obj -> gc -> image ->
- xsrc: int -> ysrc: int -> xdest: int -> ydest: int ->
+ external image_ : [>`drawable] obj -> gc -> image ->
+ xsrc: int -> ysrc: int -> xdest: int -> ydest: int ->
width: int -> height: int -> unit
= "ml_gdk_draw_image_bc" "ml_gdk_draw_image"
let image w gc ?(xsrc=0) ?(ysrc=0) ?(xdest=0) ?(ydest=0)
?(width= -1) ?(height= -1) image =
image_ w gc image ~xsrc ~ysrc ~xdest ~ydest ~width ~height
(*
- external bitmap : [>`drawable] obj -> gc -> bitmap: bitmap ->
- xsrc: int -> ysrc: int -> xdest: int -> ydest: int ->
+ external bitmap : [>`drawable] obj -> gc -> bitmap: bitmap ->
+ xsrc: int -> ysrc: int -> xdest: int -> ydest: int ->
width: int -> height: int -> unit
= "ml_gdk_draw_bitmap_bc" "ml_gdk_draw_bitmap"
*)
- external pixmap_ : [>`drawable] obj -> gc -> pixmap ->
- xsrc: int -> ysrc: int -> xdest: int -> ydest: int ->
+ external pixmap_ : [>`drawable] obj -> gc -> pixmap ->
+ xsrc: int -> ysrc: int -> xdest: int -> ydest: int ->
width: int -> height: int -> unit
= "ml_gdk_draw_pixmap_bc" "ml_gdk_draw_pixmap"
let pixmap w gc ?(xsrc=0) ?(ysrc=0) ?(xdest=0) ?(ydest=0)
@@ -614,7 +614,7 @@ module DnD = struct
end
module Truecolor = struct
- (* Truecolor quick color query *)
+ (* Truecolor quick color query *)
type visual_shift_prec = {
red_shift : int;
@@ -624,7 +624,7 @@ module Truecolor = struct
blue_shift : int;
blue_prec : int
}
-
+
let shift_prec visual = {
red_shift = Visual.red_shift visual;
red_prec = Visual.red_prec visual;
@@ -649,7 +649,7 @@ module Truecolor = struct
and green_lsr = 16 - shift_prec.green_prec
and blue_lsr = 16 - shift_prec.blue_prec in
fun ~red: red ~green: green ~blue: blue ->
- (((red lsr red_lsr) lsl shift_prec.red_shift) lor
+ (((red lsr red_lsr) lsl shift_prec.red_shift) lor
((green lsr green_lsr) lsl shift_prec.green_shift) lor
((blue lsr blue_lsr) lsl shift_prec.blue_shift))
| _ -> raise (Invalid_argument "Gdk.Truecolor.color_creator")
View
@@ -75,7 +75,7 @@ module Tags : sig
type scroll_direction = [ `UP | `DOWN | `LEFT | `RIGHT ]
type notify_type =
[ `ANCESTOR | `VIRTUAL | `INFERIOR | `NONLINEAR
- | `NONLINEAR_VIRTUAL | `UNKNOWN ]
+ | `NONLINEAR_VIRTUAL | `UNKNOWN ]
type crossing_mode = [ `NORMAL | `GRAB | `UNGRAB ]
type setting_action = [ `NEW | `CHANGED | `DELETED ]
type window_state = [ `WITHDRAWN | `ICONIFIED | `MAXIMIZED | `STICKY ]
@@ -228,7 +228,7 @@ module Window :
val set_back_pixmap : window -> background_pixmap -> unit
val set_cursor : window -> cursor -> unit
- (* for backward compatibility for lablgtk1 programs *)
+ (* for backward compatibility for lablgtk1 programs *)
val get_visual : window -> visual
end
@@ -245,17 +245,17 @@ module Region :
type gdkOverlapType = [ `IN|`OUT|`PART ]
val create : unit -> region
val destroy : region -> unit
- val polygon : (int * int) list -> gdkFillRule -> region
+ val polygon : (int * int) list -> gdkFillRule -> region
val intersect : region -> region -> region
- val union : region -> region -> region
- val subtract : region -> region -> region
- val xor : region -> region -> region
+ val union : region -> region -> region
+ val subtract : region -> region -> region
+ val xor : region -> region -> region
val union_with_rect : region -> Rectangle.t -> region
val offset : region -> x:int -> y:int -> unit
val shrink : region -> x:int -> y:int -> unit
val empty : region -> bool
val equal : region -> region -> bool
- val point_in : region -> x:int -> y:int -> bool
+ val point_in : region -> x:int -> y:int -> bool
val rect_in : region -> Rectangle.t -> gdkOverlapType
val get_clipbox : region -> Rectangle.t -> unit
end
@@ -406,9 +406,9 @@ module DnD :
module Truecolor :
sig
val color_creator : visual -> (red: int -> green: int -> blue: int -> int)
- (* [color_creator visual] creates a function to calculate
- the pixel color id for given red, green and blue component
- value ([0..65535]) at the client side. [visual] must have
+ (* [color_creator visual] creates a function to calculate
+ the pixel color id for given red, green and blue component
+ value ([0..65535]) at the client side. [visual] must have
`TRUE_COLOR or `DIRECT_COLOR type. This function improves
the speed of the color query of true color visual greatly. *)
(* WARN: this approach is not theoretically correct for true color
View
@@ -39,7 +39,7 @@ module Main = struct
external destroy : t -> unit = "ml_g_main_destroy"
type locale_category =
[ `ALL | `COLLATE | `CTYPE | `MESSAGES | `MONETARY | `NUMERIC | `TIME ]
- external setlocale : locale_category -> string option -> string
+ external setlocale : locale_category -> string option -> string
= "ml_setlocale"
end
@@ -104,7 +104,7 @@ module Message = struct
= "ml_g_log_remove_handler"
external _set_always_fatal : int -> unit = "ml_g_log_set_always_fatal"
- let set_always_fatal (levels : log_level list) =
+ let set_always_fatal (levels : log_level list) =
_set_always_fatal (int_of_log_levels levels)
external _set_fatal_mask : ?domain:string -> int -> unit = "ml_g_log_set_fatal_mask"
@@ -116,7 +116,7 @@ module Message = struct
Printf.kprintf (_log domain (log_level level)) fmt
end
-(*
+(*
module Thread = struct
external init : unit -> unit = "ml_g_thread_init"
(* Call only once! *)
@@ -126,7 +126,7 @@ end
*)
module Convert = struct
- type error =
+ type error =
| NO_CONVERSION
| ILLEGAL_SEQUENCE
| FAILED
@@ -148,23 +148,23 @@ module Convert = struct
external utf8_validate : string -> bool = "ml_g_utf8_validate"
- let raise_bad_utf8 () =
+ let raise_bad_utf8 () =
raise (Error (ILLEGAL_SEQUENCE, "Invalid byte sequence for UTF-8 string"))
let locale_from_utf8 s =
match get_charset () with
- | (true, _) ->
- if utf8_validate s
- then s
+ | (true, _) ->
+ if utf8_validate s
+ then s
else raise_bad_utf8 ()
| (false, to_codeset) ->
convert s ~to_codeset ~from_codeset:"UTF-8"
let locale_to_utf8 s =
match get_charset () with
- | (true, _) ->
- if utf8_validate s
- then s
+ | (true, _) ->
+ if utf8_validate s
+ then s
else raise_bad_utf8 ()
| (false, from_codeset) ->
convert s ~to_codeset:"UTF-8" ~from_codeset
@@ -173,7 +173,7 @@ module Convert = struct
= "ml_g_filename_from_utf8"
external filename_to_utf8 : string -> string
= "ml_g_filename_to_utf8"
-
+
external filename_from_uri : string -> string option * string
= "ml_g_filename_from_uri"
external filename_to_uri : ?hostname:string -> string -> string
View
@@ -192,7 +192,7 @@ CAMLprim value ml_gdk_color_white (value cmap)
gdk_color_white (GdkColormap_val(cmap), &color);
return Val_copy(color);
}
-
+
CAMLprim value ml_gdk_color_black (value cmap)
{
GdkColor color;
@@ -254,7 +254,7 @@ CAMLprim value ml_gdk_drawable_get_size (value drawable)
value ret;
gdk_drawable_get_size (GdkDrawable_val(drawable), &x, &y);
-
+
ret = alloc_small (2,0);
Field(ret,0) = Val_int(x);
Field(ret,1) = Val_int(y);
@@ -276,7 +276,7 @@ CAMLprim value ml_GDK_WINDOW_XWINDOW(value v)
{
ml_raise_gdk ("Not available for Win32");
return Val_unit;
-}
+}
#else
ML_1 (GDK_WINDOW_XWINDOW, GdkDrawable_val, Val_XID)
@@ -287,7 +287,7 @@ CAMLprim value ml_gdk_window_get_position (value window)
value ret;
gdk_window_get_position (GdkWindow_val(window), &x, &y);
-
+
ret = alloc_small (2,0);
Field(ret,0) = Val_int(x);
Field(ret,1) = Val_int(y);
@@ -447,14 +447,14 @@ CAMLprim value ml_gdk_property_change (value window, value property, value type,
int i;
switch (format) {
case 16:
- sdata = calloc(nelems, sizeof(short));
+ sdata = calloc(nelems, sizeof(short));
for (i=0; i<nelems; i++)
((gushort*)sdata)[i] = Int_val(Field(data,i));
break;
case 32:
sdata = calloc(nelems, sizeof(long));
for (i=0; i<nelems; i++)
- ((gulong*)sdata)[i] = Int32_val(Field(data,i));
+ ((gulong*)sdata)[i] = Int32_val(Field(data,i));
break;
default:
sdata = (guchar*)data;
@@ -618,7 +618,7 @@ CAMLprim value ml_gdk_gc_set_dashes(value gc, value offset, value dashes)
/* stat_free (cdashes); ? */
CAMLreturn(Val_unit);
}
-
+
ML_2 (gdk_gc_copy, GdkGC_val, GdkGC_val, Unit)
CAMLprim value ml_gdk_gc_get_values (value gc)
@@ -741,11 +741,11 @@ ML_9 (gdk_draw_pixmap, GdkDrawable_val, GdkGC_val, GdkPixmap_val, Int_val, Int_v
ML_bc9 (ml_gdk_draw_pixmap)
ML_9 (gdk_draw_image, GdkDrawable_val, GdkGC_val, GdkImage_val, Int_val, Int_val, Int_val, Int_val, Int_val, Int_val, Unit)
ML_bc9 (ml_gdk_draw_image)
-ML_3 (gdk_draw_points, GdkDrawable_val, GdkGC_val,
+ML_3 (gdk_draw_points, GdkDrawable_val, GdkGC_val,
Insert(PointArray_val(arg3)) PointArrayLen_val, Unit)
-ML_3 (gdk_draw_segments, GdkDrawable_val, GdkGC_val,
+ML_3 (gdk_draw_segments, GdkDrawable_val, GdkGC_val,
Insert(SegmentArray_val(arg3)) SegmentArrayLen_val, Unit)
-ML_3 (gdk_draw_lines, GdkDrawable_val, GdkGC_val,
+ML_3 (gdk_draw_lines, GdkDrawable_val, GdkGC_val,
Insert(PointArray_val(arg3)) PointArrayLen_val, Unit)
/* RGB */

0 comments on commit c4e212c

Please sign in to comment.