// File: eiskalteschatten[P]developersnotebook/src/windows/ReleaseNotesWindow.cpp
// Function: ReleaseNotesWindow::activate(_GtkWidget*, void*)
void ReleaseNotesWindow::activate(GtkWidget *menu_item, void *main_window_obj) {
    MainWindow *mw                  = (MainWindow*)main_window_obj;
    std::string path_to_exec_str    = mw->get_path_to_exec();
    GtkWidget *release_notes_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

    gtk_window_set_position(GTK_WINDOW(release_notes_window), GTK_WIN_POS_CENTER);
    gtk_window_set_default_size(GTK_WINDOW(release_notes_window), 800, 500);
    gtk_window_set_title(GTK_WINDOW(release_notes_window), "Release Notes");

    #ifndef __APPLE__
        Image logo("icon", "svg", path_to_exec_str, 32, 32);
        std::string path = logo.get_path();
        gtk_window_set_icon_from_file(GTK_WINDOW(release_notes_window), path.c_str(), NULL);
    #endif

    GtkWidget *release_notes_text_view = gtk_text_view_new();
    gtk_text_view_set_editable(GTK_TEXT_VIEW(release_notes_text_view), false);
    gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(release_notes_text_view), GTK_WRAP_WORD);

    GtkWidget *release_notes_scrolled_window = gtk_scrolled_window_new(NULL, NULL);
    gtk_container_add(GTK_CONTAINER(release_notes_scrolled_window), release_notes_text_view);

    GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(release_notes_text_view));

    ReleaseNotesWindow rnw(path_to_exec_str);
    rnw.fill_release_notes(buffer);

    gtk_container_add(GTK_CONTAINER(release_notes_window), release_notes_scrolled_window);

    gtk_widget_show_all(release_notes_window);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1f2a0
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0xa230
xorl %edi, %edi
callq 0xb010
movq %rax, -0x1e8(%rbp)
jmp 0x20200
movq -0x1e8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x1f8(%rbp)
callq 0xb270
movq -0x1f8(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x1f0(%rbp)
jmp 0x20233
movq -0x1f0(%rbp), %rdi
movl $0x1, %esi
callq 0xa9d0
jmp 0x20246
movq -0x40(%rbp), %rax
movq %rax, -0x208(%rbp)
callq 0xb270
movq -0x208(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x200(%rbp)
jmp 0x2026e
movq -0x200(%rbp), %rdi
movl $0x320, %esi            # imm = 0x320
movl $0x1f4, %edx            # imm = 0x1F4
callq 0xb0a0
jmp 0x20286
movq -0x40(%rbp), %rax
movq %rax, -0x218(%rbp)
callq 0xb270
movq -0x218(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x210(%rbp)
jmp 0x202ae
movq -0x210(%rbp), %rdi
leaq 0x33610(%rip), %rsi     # 0x538cc
callq 0xa3c0
jmp 0x202c3
leaq -0x119(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0xaf80
movq -0x220(%rbp), %rdx
leaq 0x33587(%rip), %rsi     # 0x5386b
leaq -0x118(%rbp), %rdi
callq 0x10f00
jmp 0x202f2
leaq -0x141(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0xaf80
movq -0x228(%rbp), %rdx
leaq 0x32d56(%rip), %rsi     # 0x53069
leaq -0x140(%rbp), %rdi
callq 0x10f00
jmp 0x20321
leaq -0x168(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xa230
jmp 0x20333
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0x140(%rbp), %rdx
leaq -0x168(%rbp), %rcx
movl $0x20, %r9d
movl %r9d, %r8d
callq 0x138c0
jmp 0x2035f
leaq -0x168(%rbp), %rdi
callq 0xb430
leaq -0x140(%rbp), %rdi
callq 0xb430
leaq -0x141(%rbp), %rdi
callq 0xb410
leaq -0x118(%rbp), %rdi
callq 0xb430
leaq -0x119(%rbp), %rdi
callq 0xb410
leaq -0x188(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x20150
jmp 0x203b0
movq -0x40(%rbp), %rax
movq %rax, -0x238(%rbp)
callq 0xb270
movq -0x238(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x230(%rbp)
jmp 0x203d8
leaq -0x188(%rbp), %rdi
callq 0xa1d0
movq -0x230(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xac50
jmp 0x203f9
callq 0xb2f0
movq %rax, -0x240(%rbp)
jmp 0x20407
movq -0x240(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x250(%rbp)
callq 0xaaf0
movq -0x250(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x248(%rbp)
jmp 0x20440
movq -0x248(%rbp), %rdi
xorl %esi, %esi
callq 0xb070
jmp 0x20450
movq -0x190(%rbp), %rax
movq %rax, -0x260(%rbp)
callq 0xaaf0
movq -0x260(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x258(%rbp)
jmp 0x2047b
movq -0x258(%rbp), %rdi
movl $0x2, %esi
callq 0xb100
jmp 0x2048e
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0xab80
movq %rax, -0x268(%rbp)
jmp 0x204a3
movq -0x268(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0x278(%rbp)
callq 0xac10
movq -0x278(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x270(%rbp)
jmp 0x204dc
movq -0x270(%rbp), %rdi
movq -0x190(%rbp), %rsi
callq 0xb1e0
jmp 0x204f1
movq -0x190(%rbp), %rax
movq %rax, -0x288(%rbp)
callq 0xaaf0
movq -0x288(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x280(%rbp)
jmp 0x2051c
movq -0x280(%rbp), %rdi
callq 0xa450
movq %rax, -0x290(%rbp)
jmp 0x20531
movq -0x290(%rbp), %rax
movq %rax, -0x1a0(%rbp)
leaq -0x1e0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xa230
jmp 0x20551
leaq -0x1c0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x20a50
jmp 0x20566
leaq -0x1e0(%rbp), %rdi
callq 0xb430
movq -0x1a0(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x20710
jmp 0x20587
movq -0x40(%rbp), %rax
movq %rax, -0x2a0(%rbp)
callq 0xac10
movq -0x2a0(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, -0x298(%rbp)
jmp 0x205af
movq -0x298(%rbp), %rdi
movq -0x198(%rbp), %rsi
callq 0xb1e0
jmp 0x205c4
movq -0x40(%rbp), %rdi
callq 0xaf30
jmp 0x205cf
leaq -0x1c0(%rbp), %rdi
callq 0x20ab0
leaq -0x188(%rbp), %rdi
callq 0xb430
leaq -0xf8(%rbp), %rdi
callq 0x13a50
leaq -0x38(%rbp), %rdi
callq 0xb430
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x206f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2067c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x20664
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x20658
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0xb430
leaq -0x140(%rbp), %rdi
callq 0xb430
leaq -0x141(%rbp), %rdi
callq 0xb410
leaq -0x118(%rbp), %rdi
callq 0xb430
leaq -0x119(%rbp), %rdi
callq 0xb410
jmp 0x206f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x206e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x206d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0xb430
jmp 0x206d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x20ab0
leaq -0x188(%rbp), %rdi
callq 0xb430
leaq -0xf8(%rbp), %rdi
callq 0x13a50
leaq -0x38(%rbp), %rdi
callq 0xb430
movq -0x48(%rbp), %rdi
callq 0xaa00
nopw %cs:(%rax,%rax)