Mercurial > emacs
comparison src/xterm.h @ 49322:2cbb0b823e83
GTK version
author | Jan Djärv <jan.h.d@swipnet.se> |
---|---|
date | Sun, 19 Jan 2003 21:50:03 +0000 |
parents | f8288cd7d1cd |
children | a4d0ee33dcce |
comparison
equal
deleted
inserted
replaced
49321:2b92ca3f78f6 | 49322:2cbb0b823e83 |
---|---|
31 #include <X11/IntrinsicP.h> /* CoreP.h needs this */ | 31 #include <X11/IntrinsicP.h> /* CoreP.h needs this */ |
32 #include <X11/CoreP.h> /* foul, but we need this to use our own | 32 #include <X11/CoreP.h> /* foul, but we need this to use our own |
33 window inside a widget instead of one | 33 window inside a widget instead of one |
34 that Xt creates... */ | 34 that Xt creates... */ |
35 #include <X11/StringDefs.h> | 35 #include <X11/StringDefs.h> |
36 | |
37 typedef Widget xt_or_gtk_widget; | |
38 #endif | |
39 | |
40 #ifdef USE_GTK | |
41 #include <gtk/gtk.h> | |
42 #include <gdk/gdkx.h> | |
43 | |
44 /* Some definitions to reduce conditionals. */ | |
45 typedef GtkWidget *xt_or_gtk_widget; | |
46 #define XtParent(x) (gtk_widget_get_parent (x)) | |
47 | |
36 #endif | 48 #endif |
37 | 49 |
38 /* The class of this X application. */ | 50 /* The class of this X application. */ |
39 #define EMACS_CLASS "Emacs" | 51 #define EMACS_CLASS "Emacs" |
40 | 52 |
346 /* This checks to make sure we have a display. */ | 358 /* This checks to make sure we have a display. */ |
347 extern void check_x P_ ((void)); | 359 extern void check_x P_ ((void)); |
348 | 360 |
349 extern struct frame *x_window_to_frame P_ ((struct x_display_info *, int)); | 361 extern struct frame *x_window_to_frame P_ ((struct x_display_info *, int)); |
350 | 362 |
351 #ifdef USE_X_TOOLKIT | 363 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
352 extern struct frame *x_any_window_to_frame P_ ((struct x_display_info *, int)); | 364 extern struct frame *x_any_window_to_frame P_ ((struct x_display_info *, int)); |
353 extern struct frame *x_non_menubar_window_to_frame P_ ((struct x_display_info *, int)); | 365 extern struct frame *x_non_menubar_window_to_frame P_ ((struct x_display_info *, int)); |
354 extern struct frame *x_top_window_to_frame P_ ((struct x_display_info *, int)); | 366 extern struct frame *x_top_window_to_frame P_ ((struct x_display_info *, int)); |
355 #endif | 367 #endif |
356 | 368 |
401 Zero if not using the X toolkit. | 413 Zero if not using the X toolkit. |
402 When using the toolkit, this value is not meaningful | 414 When using the toolkit, this value is not meaningful |
403 if the menubar is turned off. */ | 415 if the menubar is turned off. */ |
404 int menubar_height; | 416 int menubar_height; |
405 | 417 |
418 /* Height of tool bar widget, in pixels. | |
419 Zero if not using an external tool bar. */ | |
420 int toolbar_height; | |
421 | |
406 /* Height of a line, in pixels. */ | 422 /* Height of a line, in pixels. */ |
407 int line_height; | 423 int line_height; |
408 | 424 |
409 /* The tiled border used when the mouse is out of the frame. */ | 425 /* The tiled border used when the mouse is out of the frame. */ |
410 Pixmap border_tile; | 426 Pixmap border_tile; |
442 /* The widget of the edit portion of this screen; the window in | 458 /* The widget of the edit portion of this screen; the window in |
443 "window_desc" is inside of this. */ | 459 "window_desc" is inside of this. */ |
444 Widget edit_widget; | 460 Widget edit_widget; |
445 | 461 |
446 Widget menubar_widget; | 462 Widget menubar_widget; |
463 #endif | |
464 | |
465 #ifdef USE_GTK | |
466 /* The widget of this screen. This is the window of a top widget. */ | |
467 GtkWidget *widget; | |
468 /* The widget of the edit portion of this screen; the window in | |
469 "window_desc" is inside of this. */ | |
470 GtkWidget *edit_widget; | |
471 /* The widget used for laying out widgets vertically. */ | |
472 GtkWidget *vbox_widget; | |
473 /* The menubar in this frame. */ | |
474 GtkWidget *menubar_widget; | |
475 /* The tool bar in this frame */ | |
476 GtkWidget *toolbar_widget; | |
477 /* The handle box that makes the tool bar detachable. */ | |
478 GtkWidget *handlebox_widget; | |
479 | |
480 /* The last size hints set. */ | |
481 GdkGeometry size_hints; | |
482 long hint_flags; | |
447 #endif | 483 #endif |
448 | 484 |
449 /* If >=0, a bitmap index. The indicated bitmap is used for the | 485 /* If >=0, a bitmap index. The indicated bitmap is used for the |
450 icon. */ | 486 icon. */ |
451 int icon_bitmap; | 487 int icon_bitmap; |
636 #ifdef USE_X_TOOLKIT | 672 #ifdef USE_X_TOOLKIT |
637 #define FRAME_OUTER_WINDOW(f) ((f)->output_data.x->widget ? \ | 673 #define FRAME_OUTER_WINDOW(f) ((f)->output_data.x->widget ? \ |
638 XtWindow ((f)->output_data.x->widget) : \ | 674 XtWindow ((f)->output_data.x->widget) : \ |
639 FRAME_X_WINDOW (f)) | 675 FRAME_X_WINDOW (f)) |
640 #else | 676 #else |
677 #ifdef USE_GTK | |
678 #define GTK_WIDGET_TO_X_WIN(w) \ | |
679 ((w) && (w)->window ? GDK_WINDOW_XWINDOW ((w)->window) : 0) | |
680 | |
681 #define FRAME_GTK_OUTER_WIDGET(f) ((f)->output_data.x->widget) | |
682 #define FRAME_GTK_WIDGET(f) ((f)->output_data.x->edit_widget) | |
683 #define FRAME_OUTER_WINDOW(f) \ | |
684 (FRAME_GTK_OUTER_WIDGET (f) ? \ | |
685 GTK_WIDGET_TO_X_WIN (FRAME_GTK_OUTER_WIDGET (f)) : \ | |
686 FRAME_X_WINDOW (f)) | |
687 | |
688 #else /* !USE_GTK */ | |
641 #define FRAME_OUTER_WINDOW(f) (FRAME_X_WINDOW (f)) | 689 #define FRAME_OUTER_WINDOW(f) (FRAME_X_WINDOW (f)) |
642 #endif | 690 #endif /* !USE_GTK */ |
691 #endif | |
692 | |
643 | 693 |
644 #define FRAME_FONT(f) ((f)->output_data.x->font) | 694 #define FRAME_FONT(f) ((f)->output_data.x->font) |
645 #define FRAME_FONTSET(f) ((f)->output_data.x->fontset) | 695 #define FRAME_FONTSET(f) ((f)->output_data.x->fontset) |
646 #define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->output_data.x->internal_border_width) | 696 #define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->output_data.x->internal_border_width) |
647 #define FRAME_MENUBAR_HEIGHT(f) ((f)->output_data.x->menubar_height) | 697 #define FRAME_MENUBAR_HEIGHT(f) ((f)->output_data.x->menubar_height) |
698 #define FRAME_TOOLBAR_HEIGHT(f) ((f)->output_data.x->toolbar_height) | |
648 #define FRAME_LINE_HEIGHT(f) ((f)->output_data.x->line_height) | 699 #define FRAME_LINE_HEIGHT(f) ((f)->output_data.x->line_height) |
649 | 700 |
650 /* Width of the default font of frame F. Must be defined by each | 701 /* Width of the default font of frame F. Must be defined by each |
651 terminal specific header. */ | 702 terminal specific header. */ |
652 #define FRAME_DEFAULT_FONT_WIDTH(F) FONT_WIDTH (FRAME_FONT (F)) | 703 #define FRAME_DEFAULT_FONT_WIDTH(F) FONT_WIDTH (FRAME_FONT (F)) |
679 and FRAME_X_WINDOW (f). */ | 730 and FRAME_X_WINDOW (f). */ |
680 #define FRAME_OUTER_TO_INNER_DIFF_X(f) \ | 731 #define FRAME_OUTER_TO_INNER_DIFF_X(f) \ |
681 ((f)->output_data.x->x_pixels_outer_diff) | 732 ((f)->output_data.x->x_pixels_outer_diff) |
682 #define FRAME_OUTER_TO_INNER_DIFF_Y(f) \ | 733 #define FRAME_OUTER_TO_INNER_DIFF_Y(f) \ |
683 ((f)->output_data.x->y_pixels_outer_diff \ | 734 ((f)->output_data.x->y_pixels_outer_diff \ |
684 + (f)->output_data.x->menubar_height) | 735 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f)) |
685 | 736 |
686 | 737 |
687 #define FRAME_XIC(f) ((f)->output_data.x->xic) | 738 #define FRAME_XIC(f) ((f)->output_data.x->xic) |
688 #define FRAME_X_XIM(f) (FRAME_X_DISPLAY_INFO (f)->xim) | 739 #define FRAME_X_XIM(f) (FRAME_X_DISPLAY_INFO (f)->xim) |
689 #define FRAME_X_XIM_STYLES(f) (FRAME_X_DISPLAY_INFO (f)->xim_styles) | 740 #define FRAME_X_XIM_STYLES(f) (FRAME_X_DISPLAY_INFO (f)->xim_styles) |