~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to packages/extra/gtk/gtk/gtktext.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{
2
 
   $Id: gtktext.pp,v 1.3 2003/08/06 07:28:21 michael Exp $
3
 
}
4
 
 
5
 
{****************************************************************************
6
 
                                 Interface
7
 
****************************************************************************}
8
 
 
9
 
{$ifdef read_interface}
10
 
 
11
 
  type
12
 
     PGtkTextFont = pointer;
13
 
 
14
 
     PGtkPropertyMark = ^TGtkPropertyMark;
15
 
     TGtkPropertyMark = record
16
 
          theproperty : PGList;
17
 
          theoffset : guint;
18
 
          theindex : guint;
19
 
       end;
20
 
 
21
 
     PGtkText = ^TGtkText;
22
 
     TGtkText = record
23
 
          editable : TGtkEditable;
24
 
          text_area : PGdkWindow;
25
 
          hadj : PGtkAdjustment;
26
 
          vadj : PGtkAdjustment;
27
 
          gc : PGdkGC;
28
 
          line_wrap_bitmap : PGdkPixmap;
29
 
          line_arrow_bitmap : PGdkPixmap;
30
 
          text : record
31
 
              case longint of
32
 
                 0 : ( wc : PGdkWChar );
33
 
                 1 : ( ch : Pguchar );
34
 
              end;
35
 
          text_len : guint;
36
 
          gap_position : guint;
37
 
          gap_size : guint;
38
 
          text_end : guint;
39
 
          line_start_cache : PGList;
40
 
          first_line_start_index : guint;
41
 
          first_cut_pixels : guint;
42
 
          first_onscreen_hor_pixel : guint;
43
 
          first_onscreen_ver_pixel : guint;
44
 
          flag0 : {$ifdef win32}longint{$else}word{$endif};
45
 
          freeze_count : guint;
46
 
          text_properties : PGList;
47
 
          text_properties_end : PGList;
48
 
          point : TGtkPropertyMark;
49
 
          scratch_buffer : record
50
 
              case longint of
51
 
                 0 : ( wc : PGdkWChar );
52
 
                 1 : ( ch : Pguchar );
53
 
              end;
54
 
          scratch_buffer_len : guint;
55
 
          last_ver_value : gint;
56
 
          cursor_pos_x : gint;
57
 
          cursor_pos_y : gint;
58
 
          cursor_mark : TGtkPropertyMark;
59
 
          cursor_char : TGdkWChar;
60
 
          cursor_char_offset : gchar;
61
 
          cursor_virtual_x : gint;
62
 
          cursor_drawn_level : gint;
63
 
          current_line : PGList;
64
 
          tab_stops : PGList;
65
 
          default_tab_width : gint;
66
 
          current_font : PGtkTextFont;
67
 
          timer : gint;
68
 
          button : guint;
69
 
          bg_gc : PGdkGC;
70
 
       end;
71
 
 
72
 
  const
73
 
     bm_TGtkText_line_wrap = $1;
74
 
     bp_TGtkText_line_wrap = 0;
75
 
     bm_TGtkText_word_wrap = $2;
76
 
     bp_TGtkText_word_wrap = 1;
77
 
     bm_TGtkText_use_wchar = $4;
78
 
     bp_TGtkText_use_wchar = 2;
79
 
function  line_wrap(var a : TGtkText) : guint;
80
 
procedure set_line_wrap(var a : TGtkText; __line_wrap : guint);
81
 
function  word_wrap(var a : TGtkText) : guint;
82
 
procedure set_word_wrap(var a : TGtkText; __word_wrap : guint);
83
 
function  use_wchar(var a : TGtkText) : guint;
84
 
procedure set_use_wchar(var a : TGtkText; __use_wchar : guint);
85
 
 
86
 
  type
87
 
     PGtkTextClass = ^TGtkTextClass;
88
 
     TGtkTextClass = record
89
 
          parent_class : TGtkEditableClass;
90
 
          set_scroll_adjustments : procedure (text:PGtkText; hadjustment:PGtkAdjustment; vadjustment:PGtkAdjustment);cdecl;
91
 
       end;
92
 
 
93
 
Type
94
 
  GTK_TEXT=PGtkText;
95
 
  GTK_TEXT_CLASS=PGtkTextClass;
96
 
 
97
 
function  GTK_TEXT_INDEX(t:PGtkText; index:longint):char;
98
 
 
99
 
function  GTK_TEXT_TYPE:TGtkType;cdecl;external gtkdll name 'gtk_text_get_type';
100
 
function  GTK_IS_TEXT(obj:pointer):boolean;
101
 
function  GTK_IS_TEXT_CLASS(klass:pointer):boolean;
102
 
 
103
 
function  gtk_text_get_type:TGtkType;cdecl;external gtkdll name 'gtk_text_get_type';
104
 
function  gtk_text_new(hadj:PGtkAdjustment; vadj:PGtkAdjustment):PGtkWidget;cdecl;external gtkdll name 'gtk_text_new';
105
 
procedure gtk_text_set_editable(text:PGtkText; editable:gboolean);cdecl;external gtkdll name 'gtk_text_set_editable';
106
 
procedure gtk_text_set_word_wrap(text:PGtkText; word_wrap:gint);cdecl;external gtkdll name 'gtk_text_set_word_wrap';
107
 
procedure gtk_text_set_line_wrap(text:PGtkText; line_wrap:gint);cdecl;external gtkdll name 'gtk_text_set_line_wrap';
108
 
procedure gtk_text_set_adjustments(text:PGtkText; hadj:PGtkAdjustment; vadj:PGtkAdjustment);cdecl;external gtkdll name 'gtk_text_set_adjustments';
109
 
procedure gtk_text_set_point(text:PGtkText; index:guint);cdecl;external gtkdll name 'gtk_text_set_point';
110
 
function  gtk_text_get_point(text:PGtkText):guint;cdecl;external gtkdll name 'gtk_text_get_point';
111
 
function  gtk_text_get_length(text:PGtkText):guint;cdecl;external gtkdll name 'gtk_text_get_length';
112
 
procedure gtk_text_freeze(text:PGtkText);cdecl;external gtkdll name 'gtk_text_freeze';
113
 
procedure gtk_text_thaw(text:PGtkText);cdecl;external gtkdll name 'gtk_text_thaw';
114
 
procedure gtk_text_insert(text:PGtkText; font:PGdkFont; fore:PGdkColor; back:PGdkColor; chars:pchar; length:gint);cdecl;external gtkdll name 'gtk_text_insert';
115
 
function  gtk_text_backward_delete(text:PGtkText; nchars:guint):gint;cdecl;external gtkdll name 'gtk_text_backward_delete';
116
 
function  gtk_text_forward_delete(text:PGtkText; nchars:guint):gint;cdecl;external gtkdll name 'gtk_text_forward_delete';
117
 
 
118
 
{$endif read_interface}
119
 
 
120
 
 
121
 
{****************************************************************************
122
 
                              Implementation
123
 
****************************************************************************}
124
 
 
125
 
{$ifdef read_implementation}
126
 
 
127
 
function  line_wrap(var a : TGtkText) : guint;
128
 
    begin
129
 
       line_wrap:=(a.flag0 and bm_TGtkText_line_wrap) shr bp_TGtkText_line_wrap;
130
 
    end;
131
 
 
132
 
procedure set_line_wrap(var a : TGtkText; __line_wrap : guint);
133
 
    begin
134
 
       a.flag0:=a.flag0 or ((__line_wrap shl bp_TGtkText_line_wrap) and bm_TGtkText_line_wrap);
135
 
    end;
136
 
 
137
 
function  word_wrap(var a : TGtkText) : guint;
138
 
    begin
139
 
       word_wrap:=(a.flag0 and bm_TGtkText_word_wrap) shr bp_TGtkText_word_wrap;
140
 
    end;
141
 
 
142
 
procedure set_word_wrap(var a : TGtkText; __word_wrap : guint);
143
 
    begin
144
 
       a.flag0:=a.flag0 or ((__word_wrap shl bp_TGtkText_word_wrap) and bm_TGtkText_word_wrap);
145
 
    end;
146
 
 
147
 
function  use_wchar(var a : TGtkText) : guint;
148
 
    begin
149
 
       use_wchar:=(a.flag0 and bm_TGtkText_use_wchar) shr bp_TGtkText_use_wchar;
150
 
    end;
151
 
 
152
 
procedure set_use_wchar(var a : TGtkText; __use_wchar : guint);
153
 
    begin
154
 
       a.flag0:=a.flag0 or ((__use_wchar shl bp_TGtkText_use_wchar) and bm_TGtkText_use_wchar);
155
 
    end;
156
 
 
157
 
function  GTK_TEXT_INDEX(t:PGtkText; index:longint):char;
158
 
begin
159
 
  if use_wchar(t^)<>0 then
160
 
   begin
161
 
     if index<t^.gap_position then
162
 
      GTK_TEXT_INDEX:=char(TGdkWchar(t^.text.wc[index]))
163
 
     else
164
 
      GTK_TEXT_INDEX:=char(TGdkWchar(t^.text.wc[index+t^.gap_position]));
165
 
   end
166
 
  else
167
 
   begin
168
 
     if index<t^.gap_position then
169
 
      GTK_TEXT_INDEX:=t^.text.ch[index]
170
 
     else
171
 
      GTK_TEXT_INDEX:=t^.text.ch[index+t^.gap_position];
172
 
   end;
173
 
end;
174
 
 
175
 
function  GTK_IS_TEXT(obj:pointer):boolean;
176
 
begin
177
 
  GTK_IS_TEXT:=(obj<>nil) and GTK_IS_TEXT_CLASS(PGtkTypeObject(obj)^.klass);
178
 
end;
179
 
 
180
 
function  GTK_IS_TEXT_CLASS(klass:pointer):boolean;
181
 
begin
182
 
  GTK_IS_TEXT_CLASS:=(klass<>nil) and (PGtkTypeClass(klass)^.thetype=GTK_TEXT_TYPE);
183
 
end;
184
 
 
185
 
{$endif read_implementation}
186
 
 
187
 
 
188
 
{
189
 
  $Log: gtktext.pp,v $
190
 
  Revision 1.3  2003/08/06 07:28:21  michael
191
 
  + Patch from Marc Weustinck to fix Win32 version
192
 
 
193
 
  Revision 1.2  2002/09/07 15:43:00  peter
194
 
    * old logs removed and tabs fixed
195
 
 
196
 
  Revision 1.1  2002/01/29 17:55:13  peter
197
 
    * splitted to base and extra
198
 
 
199
 
}