PageRenderTime 25ms CodeModel.GetById 18ms app.highlight 6ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/gtk1/src/gtk/gtkruler.pp

https://github.com/slibre/freepascal
Puppet | 78 lines | 60 code | 18 blank | 0 comment | 0 complexity | 608428c49e390d2e940ae722a0ac60a1 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
 1{
 2}
 3
 4{****************************************************************************
 5                                 Interface
 6****************************************************************************}
 7
 8{$ifdef read_interface}
 9
10  type
11     PGtkRulerMetric = ^TGtkRulerMetric;
12
13     PGtkRuler = ^TGtkRuler;
14     TGtkRuler = record
15          widget : TGtkWidget;
16          backing_store : PGdkPixmap;
17          non_gr_exp_gc : PGdkGC;
18          metric : PGtkRulerMetric;
19          xsrc : gint;
20          ysrc : gint;
21          slider_size : gint;
22          lower : gfloat;
23          upper : gfloat;
24          position : gfloat;
25          max_size : gfloat;
26       end;
27
28     PGtkRulerClass = ^TGtkRulerClass;
29     TGtkRulerClass = record
30          parent_class : TGtkWidgetClass;
31          draw_ticks : procedure (ruler:PGtkRuler); cdecl;
32          draw_pos : procedure (ruler:PGtkRuler); cdecl;
33       end;
34
35     TGtkRulerMetric = record
36          metric_name : Pgchar;
37          abbrev : Pgchar;
38          pixels_per_unit : gfloat;
39          ruler_scale : array[0..9] of gfloat;
40          subdivide : array[0..4] of gint;
41       end;
42
43Type
44  GTK_RULER=PGtkRuler;
45  GTK_RULER_CLASS=PGtkRulerClass;
46
47function  GTK_RULER_TYPE:TGtkType;cdecl;external gtkdll name 'gtk_ruler_get_type';
48function  GTK_IS_RULER(obj:pointer):boolean;
49function  GTK_IS_RULER_CLASS(klass:pointer):boolean;
50
51function  gtk_ruler_get_type:TGtkType;cdecl;external gtkdll name 'gtk_ruler_get_type';
52procedure gtk_ruler_set_metric(ruler:PGtkRuler; metric:TGtkMetricType);cdecl;external gtkdll name 'gtk_ruler_set_metric';
53procedure gtk_ruler_set_range(ruler:PGtkRuler; lower:gfloat; upper:gfloat; position:gfloat; max_size:gfloat);cdecl;external gtkdll name 'gtk_ruler_set_range';
54procedure gtk_ruler_draw_ticks(ruler:PGtkRuler);cdecl;external gtkdll name 'gtk_ruler_draw_ticks';
55procedure gtk_ruler_draw_pos(ruler:PGtkRuler);cdecl;external gtkdll name 'gtk_ruler_draw_pos';
56
57{$endif read_interface}
58
59
60{****************************************************************************
61                              Implementation
62****************************************************************************}
63
64{$ifdef read_implementation}
65
66function  GTK_IS_RULER(obj:pointer):boolean;
67begin
68  GTK_IS_RULER:=(obj<>nil) and GTK_IS_RULER_CLASS(PGtkTypeObject(obj)^.klass);
69end;
70
71function  GTK_IS_RULER_CLASS(klass:pointer):boolean;
72begin
73  GTK_IS_RULER_CLASS:=(klass<>nil) and (PGtkTypeClass(klass)^.thetype=GTK_RULER_TYPE);
74end;
75
76{$endif read_implementation}
77
78