aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Antipov <[email protected]>2013-08-30 16:17:44 +0400
committerDmitry Antipov <[email protected]>2013-08-30 16:17:44 +0400
commit9d7693d74c4ec73c01d03d990d552e1480ec2739 (patch)
tree9b3862361d8d0ca7ca8456321e8eda3e4ac5c54c
parent112798c18dbbb095a34ace257767ae6f57643468 (diff)
Minor cleanup to avoid forward declarations.
* coding.h (struct ccl_spec): Remove forward declaration. * composite.h (toplevel): Include font.h. (struct composition_it, struct face, struct font_metrics): Remove forward declaration. * dispextern.h (struct image, struct atimer): Likewise. * emacsgtkfixed.h (struct frame): Likewise. * emacsgtkfixed.c (toplevel): Reorder headers and drop stdio.h. * font.h (struct font_driver, struct font, struct glyph_string) (struct face): Remove forward declaration. * fontset.h (struct face, struct font): Likewise. * frame.h (toplevel): Style cleanup. (enum output_method): Move to... * termhooks.h (enum output_method): ...here. (struct glyph, struct frame, struct ns_display_info) (struct x_display_info, struct w32_display_info): Remove forward declaration. * xterm.h (toplevel): Include termhooks.h. (struct font, struct window, struct glyph_matrix, struct frame) (struct input_event, struct face, struct image): Remove forward declaration. * gtkutil.h (struct _widget_value): Likewise. * keyboard.h (toplevel): Include termhooks.h. (struct input_event): Remove forward declaration.
-rw-r--r--src/ChangeLog27
-rw-r--r--src/coding.h2
-rw-r--r--src/composite.h6
-rw-r--r--src/dispextern.h7
-rw-r--r--src/emacsgtkfixed.c4
-rw-r--r--src/emacsgtkfixed.h2
-rw-r--r--src/font.h7
-rw-r--r--src/fontset.h3
-rw-r--r--src/frame.h31
-rw-r--r--src/gtkutil.h2
-rw-r--r--src/keyboard.h4
-rw-r--r--src/termhooks.h28
-rw-r--r--src/xterm.h22
13 files changed, 60 insertions, 85 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c605c5ec4d..e11587450e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,30 @@
+2013-08-30 Dmitry Antipov <[email protected]>
+
+ Minor cleanup to avoid forward declarations.
+ * coding.h (struct ccl_spec): Remove forward declaration.
+ * composite.h (toplevel): Include font.h.
+ (struct composition_it, struct face, struct font_metrics):
+ Remove forward declaration.
+ * dispextern.h (struct image, struct atimer): Likewise.
+ * emacsgtkfixed.h (struct frame): Likewise.
+ * emacsgtkfixed.c (toplevel): Reorder headers and drop stdio.h.
+ * font.h (struct font_driver, struct font, struct glyph_string)
+ (struct face): Remove forward declaration.
+ * fontset.h (struct face, struct font): Likewise.
+ * frame.h (toplevel): Style cleanup.
+ (enum output_method): Move to...
+ * termhooks.h (enum output_method): ...here.
+ (struct glyph, struct frame, struct ns_display_info)
+ (struct x_display_info, struct w32_display_info):
+ Remove forward declaration.
+ * xterm.h (toplevel): Include termhooks.h.
+ (struct font, struct window, struct glyph_matrix, struct frame)
+ (struct input_event, struct face, struct image): Remove forward
+ declaration.
+ * gtkutil.h (struct _widget_value): Likewise.
+ * keyboard.h (toplevel): Include termhooks.h.
+ (struct input_event): Remove forward declaration.
+
2013-08-29 Dmitry Antipov <[email protected]>
* intervals.c (set_point_from_marker): New function.
diff --git a/src/coding.h b/src/coding.h
index 7b7078e06f..2c01a05d19 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -378,8 +378,6 @@ struct emacs_mule_spec
struct composition_status cmp_status;
};
-struct ccl_spec;
-
struct undecided_spec
{
/* Inhibit null byte detection. 1 means always inhibit,
diff --git a/src/composite.h b/src/composite.h
index 53665b36bd..df17009379 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -25,6 +25,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef EMACS_COMPOSITE_H
#define EMACS_COMPOSITE_H
+#include "font.h"
+
INLINE_HEADER_BEGIN
#ifndef COMPOSITE_INLINE
# define COMPOSITE_INLINE INLINE
@@ -312,10 +314,6 @@ enum lglyph_indices
#define LGLYPH_WADJUST(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \
? XINT (AREF (LGLYPH_ADJUSTMENT (g), 2)) : 0)
-struct composition_it;
-struct face;
-struct font_metrics;
-
extern Lisp_Object composition_gstring_put_cache (Lisp_Object, ptrdiff_t);
extern Lisp_Object composition_gstring_from_id (ptrdiff_t);
extern bool composition_gstring_p (Lisp_Object);
diff --git a/src/dispextern.h b/src/dispextern.h
index b327250a88..ce9a34a2e7 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2869,11 +2869,6 @@ struct redisplay_interface
#ifdef HAVE_WINDOW_SYSTEM
-/* Structure forward declarations. */
-
-struct image;
-
-
/* Each image format (JPEG, TIFF, ...) supported is described by
a structure of the type below. */
@@ -3401,8 +3396,6 @@ extern frame_parm_handler x_frame_parm_handlers[];
extern void start_hourglass (void);
extern void cancel_hourglass (void);
extern int hourglass_shown_p;
-
-struct atimer; /* Defined in atimer.h. */
/* If non-null, an asynchronous timer that, when it expires, displays
an hourglass cursor on all frames. */
extern struct atimer *hourglass_atimer;
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index 8b19d89f3a..44f5cde1b0 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -20,12 +20,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
-#include "emacsgtkfixed.h"
-#include <stdio.h>
-
#include "lisp.h"
#include "frame.h"
#include "xterm.h"
+#include "emacsgtkfixed.h"
/* Silence a bogus diagnostic; see GNOME bug 683906. */
#if 4 < __GNUC__ + (7 <= __GNUC_MINOR__)
diff --git a/src/emacsgtkfixed.h b/src/emacsgtkfixed.h
index d987797a93..773ca26b14 100644
--- a/src/emacsgtkfixed.h
+++ b/src/emacsgtkfixed.h
@@ -25,8 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
G_BEGIN_DECLS
-struct frame;
-
extern GtkWidget *emacs_fixed_new (struct frame *f);
G_END_DECLS
diff --git a/src/font.h b/src/font.h
index adb4a582fd..3ee579aba2 100644
--- a/src/font.h
+++ b/src/font.h
@@ -56,11 +56,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
-
-struct font_driver;
-struct font;
-struct glyph_string;
-
/* An enumerator for each font property. This is used as an index to
the vector of FONT-SPEC and FONT-ENTITY.
@@ -487,8 +482,6 @@ struct font_bitmap
this value. */
#define FONT_PIXEL_SIZE_QUANTUM 1
-struct face;
-
#define FONT_INVALID_CODE 0xFFFFFFFF
/* Font driver. Members specified as "optional" can be NULL. */
diff --git a/src/fontset.h b/src/fontset.h
index fd16c7178f..b8ef4789e7 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -26,8 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef EMACS_FONTSET_H
#define EMACS_FONTSET_H
-struct face;
-
extern void free_face_fontset (struct frame *, struct face *);
extern int face_for_char (struct frame *, struct face *, int,
int, Lisp_Object);
@@ -42,7 +40,6 @@ extern Lisp_Object Qlatin;
extern Lisp_Object fontset_name (int);
extern Lisp_Object fontset_ascii (int);
-struct font;
extern int face_for_font (struct frame *, Lisp_Object, struct face *);
#endif /* EMACS_FONTSET_H */
diff --git a/src/frame.h b/src/frame.h
index 2dcb756252..17b6089120 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -24,31 +24,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define EMACS_FRAME_H
#include "dispextern.h"
+#include "termhooks.h"
INLINE_HEADER_BEGIN
#ifndef FRAME_INLINE
# define FRAME_INLINE INLINE
#endif
-
-/* Miscellanea. */
-
-/* Nonzero means there is at least one garbaged frame. */
-extern bool frame_garbaged;
-
-
-/* The structure representing a frame. */
-
-enum output_method
-{
- output_initial,
- output_termcap,
- output_x_window,
- output_msdos_raw,
- output_w32,
- output_ns
-};
-
enum vertical_scroll_bar_type
{
vertical_scroll_bar_none,
@@ -66,10 +48,7 @@ enum fullscreen_type
FULLSCREEN_WAIT = 0x100
};
-
-#define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
-#define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
-
+/* The structure representing a frame. */
struct frame
{
@@ -884,6 +863,9 @@ default_pixels_per_inch_y (void)
#define FRAME_CURSOR_WIDTH(f) ((f)->cursor_width)
#define FRAME_BLINK_OFF_CURSOR_WIDTH(f) ((f)->blink_off_cursor_width)
+#define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
+#define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
+
/* Return a pointer to the face cache of frame F. */
#define FRAME_FACE_CACHE(F) (F)->face_cache
@@ -950,6 +932,9 @@ extern Lisp_Object Qtty_color_mode;
extern Lisp_Object Qterminal;
extern Lisp_Object Qnoelisp;
+/* Nonzero means there is at least one garbaged frame. */
+extern bool frame_garbaged;
+
extern struct frame *last_nonminibuf_frame;
extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 482331a893..fc959862fd 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -74,8 +74,6 @@ typedef struct xg_menu_item_cb_data_
} xg_menu_item_cb_data;
-struct _widget_value;
-
extern struct _widget_value *malloc_widget_value (void);
extern void free_widget_value (struct _widget_value *);
diff --git a/src/keyboard.h b/src/keyboard.h
index 0953f1b7cf..1ee4a97c5c 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "systime.h" /* for struct timespec, Time */
#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */
+#include "termhooks.h"
INLINE_HEADER_BEGIN
#ifndef KEYBOARD_INLINE
@@ -477,9 +478,6 @@ extern bool ignore_mouse_drag_p;
/* The primary selection. */
extern Lisp_Object QPRIMARY;
-/* Forward declaration for prototypes. */
-struct input_event;
-
extern Lisp_Object parse_modifiers (Lisp_Object);
extern Lisp_Object reorder_modifiers (Lisp_Object);
extern Lisp_Object read_char (int, Lisp_Object, Lisp_Object,
diff --git a/src/termhooks.h b/src/termhooks.h
index b49a7bc706..77f98938ed 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -18,7 +18,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
+#ifndef EMACS_TERMHOOKS_H
+#define EMACS_TERMHOOKS_H
+
/* Miscellanea. */
#include "systime.h" /* for Time */
@@ -28,10 +30,6 @@ INLINE_HEADER_BEGIN
# define TERMHOOKS_INLINE INLINE
#endif
-struct glyph;
-struct frame;
-
-
enum scroll_bar_part {
scroll_bar_above_handle,
scroll_bar_handle,
@@ -49,7 +47,18 @@ enum scroll_bar_part {
may do something OS dependent, like extended window manager hints on X11. */
extern void (*fullscreen_hook) (struct frame *f);
-
+/* Output method of a terminal (and frames on this terminal, respectively). */
+
+enum output_method
+{
+ output_initial,
+ output_termcap,
+ output_x_window,
+ output_msdos_raw,
+ output_w32,
+ output_ns
+};
+
/* Input queue declarations and hooks. */
enum event_kind
@@ -321,11 +330,6 @@ extern void term_mouse_moveto (int, int);
extern struct tty_display_info *gpm_tty;
#endif
-
-struct ns_display_info;
-struct x_display_info;
-struct w32_display_info;
-
/* Terminal-local parameters. */
struct terminal
{
@@ -660,3 +664,5 @@ extern void close_gpm (int gpm_fd);
#endif
INLINE_HEADER_END
+
+#endif /* EMACS_TERMHOOKS_H */
diff --git a/src/xterm.h b/src/xterm.h
index 26f6095d72..39e40002d4 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -20,8 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef XTERM_H
#define XTERM_H
-#include "dispextern.h"
-
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
@@ -73,14 +71,13 @@ typedef GtkWidget *xt_or_gtk_widget;
#define USE_GTK_TOOLTIP
#endif
-
-/* Bookkeeping to distinguish X versions. */
-
-
#ifdef HAVE_X_I18N
#include <X11/Xlocale.h>
#endif
-
+
+#include "dispextern.h"
+#include "termhooks.h"
+
#define BLACK_PIX_DEFAULT(f) BlackPixel (FRAME_X_DISPLAY (f), \
XScreenNumberOfScreen (FRAME_X_SCREEN (f)))
#define WHITE_PIX_DEFAULT(f) WhitePixel (FRAME_X_DISPLAY (f), \
@@ -409,9 +406,6 @@ extern bool x_display_ok (const char *);
extern void select_visual (struct x_display_info *);
-
-struct font;
-
/* Each X frame object points to its own struct x_output object
in the output_data.x field. The x_output structure contains
the information that is specific to X windows. */
@@ -919,14 +913,6 @@ struct selection_input_event
#define SELECTION_EVENT_TIME(eventp) \
(((struct selection_input_event *) (eventp))->time)
-
-struct window;
-struct glyph_matrix;
-struct frame;
-struct input_event;
-struct face;
-struct image;
-
/* From xselect.c. */
void x_handle_selection_notify (XSelectionEvent *);