Mercurial > hg > xemacs-beta
comparison src/gtk-xemacs.c @ 5495:1f0b15040456
Merge.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 01 May 2011 18:44:03 +0100 |
parents | 4dee0387b9de |
children | 56144c8593a8 |
comparison
equal
deleted
inserted
replaced
5494:861f2601a38b | 5495:1f0b15040456 |
---|---|
2 ** | 2 ** |
3 ** Description: A widget to encapsulate a XEmacs 'text widget' | 3 ** Description: A widget to encapsulate a XEmacs 'text widget' |
4 ** | 4 ** |
5 ** Created by: William M. Perry | 5 ** Created by: William M. Perry |
6 ** Copyright (c) 2000 William M. Perry <wmperry@gnu.org> | 6 ** Copyright (c) 2000 William M. Perry <wmperry@gnu.org> |
7 ** Copyright (C) 2010 Ben Wing. | |
7 ** | 8 ** |
8 ** This file is part of XEmacs. | 9 ** This file is part of XEmacs. |
9 ** | 10 ** |
10 ** XEmacs is free software; you can redistribute it and/or modify it | 11 ** XEmacs is free software: you can redistribute it and/or modify it |
11 ** under the terms of the GNU General Public License as published by the | 12 ** under the terms of the GNU General Public License as published by the |
12 ** Free Software Foundation; either version 2, or (at your option) any | 13 ** Free Software Foundation, either version 3 of the License, or (at your |
13 ** later version. | 14 ** option) any later version. |
14 ** | 15 ** |
15 ** XEmacs is distributed in the hope that it will be useful, but WITHOUT | 16 ** XEmacs is distributed in the hope that it will be useful, but WITHOUT |
16 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 17 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
17 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | 18 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
18 ** for more details. | 19 ** for more details. |
19 ** | 20 ** |
20 ** You should have received a copy of the GNU General Public License | 21 ** You should have received a copy of the GNU General Public License |
21 ** along with XEmacs; see the file COPYING. If not, write to | 22 ** along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */ |
22 ** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, | |
23 ** Boston, MA 02111-1301, USA. */ | |
24 | 23 |
25 #include <config.h> | 24 #include <config.h> |
26 | 25 |
27 #include "lisp.h" | 26 #include "lisp.h" |
28 | 27 |
33 | 32 |
34 #include "frame-impl.h" | 33 #include "frame-impl.h" |
35 #include "console-gtk-impl.h" | 34 #include "console-gtk-impl.h" |
36 #include "device-impl.h" | 35 #include "device-impl.h" |
37 #include "gtk-xemacs.h" | 36 #include "gtk-xemacs.h" |
38 #include "objects-gtk.h" | 37 #include "fontcolor-gtk.h" |
39 | 38 |
40 extern Lisp_Object Vmodeline_face; | 39 extern Lisp_Object Vmodeline_face; |
41 extern Lisp_Object Vscrollbar_on_left_p; | 40 extern Lisp_Object Vscrollbar_on_left_p; |
42 | 41 |
43 EXFUN (Fmake_image_instance, 4); | 42 EXFUN (Fmake_image_instance, 4); |
128 there is NO flickering, etc. The downside is the XEmacs frame | 127 there is NO flickering, etc. The downside is the XEmacs frame |
129 appears as 'seethru' when XEmacs is too busy to redraw the | 128 appears as 'seethru' when XEmacs is too busy to redraw the |
130 frame. | 129 frame. |
131 | 130 |
132 Well, wait, we do... otherwise there sre weird 'seethru' areas | 131 Well, wait, we do... otherwise there sre weird 'seethru' areas |
133 even when XEmacs does a full redisplay. Most noticable in some | 132 even when XEmacs does a full redisplay. Most noticeable in some |
134 areas of the modeline, or in the right-hand-side of the window | 133 areas of the modeline, or in the right-hand-side of the window |
135 between the scrollbar ad n the edge of the window. | 134 between the scrollbar ad n the edge of the window. |
136 */ | 135 */ |
137 if (widget->window) | 136 if (widget->window) |
138 { | 137 { |
145 } | 144 } |
146 } | 145 } |
147 | 146 |
148 extern Lisp_Object xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w); | 147 extern Lisp_Object xemacs_gtk_convert_color(GdkColor *c, GtkWidget *w); |
149 | 148 |
150 /* From objects-gtk.c */ | 149 /* From fontcolor-gtk.c */ |
151 extern Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font, int expandp); | 150 extern Lisp_Object __get_gtk_font_truename (GdkFont *gdk_font, int expandp); |
152 | 151 |
153 #define convert_font(f) __get_gtk_font_truename (f, 0) | 152 #define convert_font(f) __get_gtk_font_truename (f, 0) |
154 | 153 |
155 #ifdef SMASH_FACE_FALLBACKS | 154 #ifdef SMASH_FACE_FALLBACKS |
273 struct frame *f = GTK_XEMACS_FRAME (x); | 272 struct frame *f = GTK_XEMACS_FRAME (x); |
274 int width, height; | 273 int width, height; |
275 | 274 |
276 if (f) | 275 if (f) |
277 { | 276 { |
278 char_to_pixel_size (f, FRAME_WIDTH (f), FRAME_HEIGHT (f), | 277 frame_unit_to_pixel_size (f, FRAME_WIDTH (f), FRAME_HEIGHT (f), |
279 &width, &height); | 278 &width, &height); |
280 requisition->width = width; | 279 requisition->width = width; |
281 requisition->height = height; | 280 requisition->height = height; |
282 } | 281 } |
283 else | 282 else |
342 if (f) | 341 if (f) |
343 { | 342 { |
344 f->pixwidth = allocation->width; | 343 f->pixwidth = allocation->width; |
345 f->pixheight = allocation->height; | 344 f->pixheight = allocation->height; |
346 | 345 |
347 pixel_to_char_size (f, | 346 pixel_to_frame_unit_size (f, |
348 allocation->width, | 347 allocation->width, |
349 allocation->height, &columns, &rows); | 348 allocation->height, &columns, &rows); |
350 | 349 |
351 change_frame_size (f, rows, columns, 1); | 350 change_frame_size (f, columns, rows, 1); |
352 } | 351 } |
353 } | 352 } |
354 | 353 |
355 static void | 354 static void |
356 gtk_xemacs_paint (GtkWidget *widget, GdkRectangle *area) | 355 gtk_xemacs_paint (GtkWidget *widget, GdkRectangle *area) |