summaryrefslogtreecommitdiff
path: root/packages/gtk1/src/gtk/gtklabel.pp
blob: 139f64a17acbb9041fac3571d998b4b6b4b1b35b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
}

{****************************************************************************
                                 Interface
****************************************************************************}

{$ifdef read_interface}

    type
       PGtkLabelWord = pointer;

       PGtkLabel = ^TGtkLabel;
       TGtkLabel = record
          misc : TGtkMisc;
          thelabel : Pgchar;
          label_wc : PGdkWChar;
          pattern : Pgchar;
          words : PGtkLabelWord;
          flag0 : longint;
          wrap : gboolean;
        end;

  const
     bm_TGtkLabel_max_width = $FFFF;
     bp_TGtkLabel_max_width = 0;
     bm_TGtkLabel_jtype = $30000;
     bp_TGtkLabel_jtype = 16;
function  max_width(var a : TGtkLabel) : guint;
procedure set_max_width(var a : TGtkLabel; __max_width : guint);
function  jtype(var a : TGtkLabel) : guint;
procedure set_jtype(var a : TGtkLabel; __jtype : guint);

    type
       PGtkLabelClass = ^TGtkLabelClass;
       TGtkLabelClass = record
            parent_class : TGtkMiscClass;
         end;

Type
  GTK_LABEL=PGtkLabel;
  GTK_LABEL_CLASS=PGtkLabelClass;

function  GTK_LABEL_TYPE:TGtkType;cdecl;external gtkdll name 'gtk_label_get_type';
function  GTK_IS_LABEL(obj:pointer):boolean;
function  GTK_IS_LABEL_CLASS(klass:pointer):boolean;

function  gtk_label_get_type:TGtkType;cdecl;external gtkdll name 'gtk_label_get_type';
function  gtk_label_new (str:pchar):PGtkWidget;cdecl;external gtkdll name 'gtk_label_new';
procedure gtk_label_set_text(theLabel: PGtkLabel; str:pchar);cdecl;external gtkdll name 'gtk_label_set_text';
procedure gtk_label_set_justify(thelabel:PGtkLabel; jtype:TGtkJustification);cdecl;external gtkdll name 'gtk_label_set_justify';
procedure gtk_label_set_pattern(thelabel:PGtkLabel; pattern:Pgchar);cdecl;external gtkdll name 'gtk_label_set_pattern';
procedure gtk_label_set_line_wrap(thelabel:PGtkLabel; wrap:gboolean);cdecl;external gtkdll name 'gtk_label_set_line_wrap';
procedure gtk_label_get(thelabel:PGtkLabel; str:ppchar);cdecl;external gtkdll name 'gtk_label_get';
function  gtk_label_parse_uline(thelabel:PGtkLabel;thestring:Pgchar):guint;cdecl;external gtkdll name 'gtk_label_parse_uline';

{$endif read_interface}


{****************************************************************************
                              Implementation
****************************************************************************}

{$ifdef read_implementation}

function  max_width(var a : TGtkLabel) : guint;
    begin
       max_width:=(a.flag0 and bm_TGtkLabel_max_width) shr bp_TGtkLabel_max_width;
    end;

procedure set_max_width(var a : TGtkLabel; __max_width : guint);
    begin
       a.flag0:=a.flag0 or ((__max_width shl bp_TGtkLabel_max_width) and bm_TGtkLabel_max_width);
    end;

function  jtype(var a : TGtkLabel) : guint;
    begin
       jtype:=(a.flag0 and bm_TGtkLabel_jtype) shr bp_TGtkLabel_jtype;
    end;

procedure set_jtype(var a : TGtkLabel; __jtype : guint);
    begin
       a.flag0:=a.flag0 or ((__jtype shl bp_TGtkLabel_jtype) and bm_TGtkLabel_jtype);
    end;

function  GTK_IS_LABEL(obj:pointer):boolean;
begin
  GTK_IS_LABEL:=(obj<>nil) and GTK_IS_LABEL_CLASS(PGtkTypeObject(obj)^.klass);
end;

function  GTK_IS_LABEL_CLASS(klass:pointer):boolean;
begin
  GTK_IS_LABEL_CLASS:=(klass<>nil) and (PGtkTypeClass(klass)^.thetype=GTK_LABEL_TYPE);
end;

{$endif read_implementation}