mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Modularise src/terminal
This commit is contained in:
parent
337958d4e4
commit
a0bcf254ae
@ -287,7 +287,6 @@ terminate_all_subsystems(void)
|
||||
#endif
|
||||
free_history_lists();
|
||||
done_modules(builtin_modules);
|
||||
done_screen_drivers();
|
||||
done_saved_session_info();
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "network/ssl/ssl.h"
|
||||
#include "protocol/protocol.h"
|
||||
#include "scripting/scripting.h"
|
||||
#include "terminal/terminal.h"
|
||||
#include "viewer/text/search.h"
|
||||
#include "viewer/timer.h"
|
||||
|
||||
@ -35,6 +36,7 @@
|
||||
struct module *main_modules[] = {
|
||||
&document_module,
|
||||
&kbdbind_module,
|
||||
&terminal_module,
|
||||
NULL /* XXX: Keep this */
|
||||
};
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "config/options.h"
|
||||
#include "intl/charsets.h"
|
||||
#include "main/module.h"
|
||||
#include "osdep/ascii.h"
|
||||
#include "osdep/osdep.h"
|
||||
#include "terminal/color.h"
|
||||
@ -305,8 +306,9 @@ get_screen_driver(struct terminal *term)
|
||||
return add_screen_driver(type, term, len);
|
||||
}
|
||||
|
||||
/* Release private screen drawing utilities. */
|
||||
void
|
||||
done_screen_drivers(void)
|
||||
done_screen_drivers(struct module *xxx)
|
||||
{
|
||||
free_list(active_screen_drivers);
|
||||
}
|
||||
@ -776,3 +778,13 @@ done_screen(struct terminal_screen *screen)
|
||||
mem_free_if(screen->image);
|
||||
mem_free(screen);
|
||||
}
|
||||
|
||||
struct module terminal_screen_module = struct_module(
|
||||
/* name: */ "Terminal Screen",
|
||||
/* options: */ NULL,
|
||||
/* hooks: */ NULL,
|
||||
/* submodules: */ NULL,
|
||||
/* data: */ NULL,
|
||||
/* init: */ NULL,
|
||||
/* done: */ done_screen_drivers
|
||||
);
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define EL__TERMINAL_SCREEN_H
|
||||
|
||||
|
||||
struct module;
|
||||
struct screen_char;
|
||||
struct terminal;
|
||||
|
||||
@ -49,7 +50,6 @@ void erase_screen(struct terminal *term);
|
||||
/* Meeep! */
|
||||
void beep_terminal(struct terminal *term);
|
||||
|
||||
/* Release private screen drawing utilities. */
|
||||
void done_screen_drivers(void);
|
||||
extern struct module terminal_screen_module;
|
||||
|
||||
#endif
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "config/options.h"
|
||||
#include "intl/gettext/libintl.h"
|
||||
#include "main/main.h"
|
||||
#include "main/module.h"
|
||||
#include "main/object.h"
|
||||
#include "main/select.h"
|
||||
#include "osdep/osdep.h"
|
||||
@ -370,3 +371,18 @@ attach_terminal(int in, int out, int ctl, void *info, int len)
|
||||
|
||||
return term;
|
||||
}
|
||||
|
||||
static struct module *terminal_submodules[] = {
|
||||
&terminal_screen_module,
|
||||
NULL
|
||||
};
|
||||
|
||||
struct module terminal_module = struct_module(
|
||||
/* name: */ "Terminal",
|
||||
/* options: */ NULL,
|
||||
/* hooks: */ NULL,
|
||||
/* submodules: */ terminal_submodules,
|
||||
/* data: */ NULL,
|
||||
/* init: */ NULL,
|
||||
/* done: */ NULL
|
||||
);
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "terminal/event.h"
|
||||
#include "util/lists.h"
|
||||
|
||||
struct module;
|
||||
struct option;
|
||||
struct terminal_screen;
|
||||
struct terminal_interlink;
|
||||
@ -178,4 +179,6 @@ int check_terminal_pipes(void);
|
||||
void close_terminal_pipes(void);
|
||||
struct terminal *attach_terminal(int in, int out, int ctl, void *info, int len);
|
||||
|
||||
extern struct module terminal_module;
|
||||
|
||||
#endif /* EL__TERMINAL_TERMINAL_H */
|
||||
|
Loading…
Reference in New Issue
Block a user