-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.c
More file actions
44 lines (35 loc) · 1.48 KB
/
init.c
File metadata and controls
44 lines (35 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "marisa.h"
void
initEditor (editorConfig *E)
{
E->frames = NULL;
E->buffers = NULL;
cursor_set_color_rgb(NORMAL_CURSOR);
char *firstName = "*first*";
char *secondName = "*second*";
char *thirdName = "*third*";
newBuffer(&firstName, NULL);
newBuffer(&secondName, NULL);
newBuffer(&thirdName, NULL);
newFrame(createNewWin(LINES - 2, COLS/2 - 1, 0, 0, TEXTWINDOW_COLOR), (textEditorBuffer *) g_ptr_array_index(E->buffers, 0));
newFrame(createNewWin(LINES/2, COLS/2 - 1, 0, COLS/2, TEXTWINDOW_COLOR), (textEditorBuffer *) g_ptr_array_index(E->buffers, 1));
newFrame(createNewWin(LINES/2 - 1, COLS/2 - 1, LINES/2, COLS/2, TEXTWINDOW_COLOR), (textEditorBuffer *) g_ptr_array_index(E->buffers, 2));
E->currentFrame = (frame *) g_ptr_array_index(E->frames, 0);
E->bar = malloc(sizeof(statusBar) * 1);
E->bar->statusBarFrame = createNewWin(1, COLS, LINES - 2, 0, STATUSBAR_COLOR);
E->bar->statusmsg[0] = L'\0';
E->bar->statusmsgSize = (size_t) (sizeof(char) * 80);
E->bar->statusmsg_time = 0;
E->mes = malloc(sizeof(messageBar) * 1);
E->mes->messageBarFrame = createNewWin(1, COLS, LINES - 1, 0, TEXTWINDOW_COLOR);
E->mes->message[0] = L'\0';
E->mes->messageLen = (size_t) (sizeof(char) * 80);
E->mes->messageTime = 0;
E->numOfFrames = 0;
E->numOfBuffer = 0;
E->regionMarked[0] = 0;
E->regionMarked[1] = 0;
E->regionMarked[2] = 0;
E->regionMarked[3] = 0;
((frame *) g_ptr_array_index(E->frames, 0))->currentBuffer = (textEditorBuffer *) g_ptr_array_index(E->buffers, 0);
}