2011-02-24 09:27:21 +00:00
|
|
|
static void TextEdit_change(TextEdit *self) {
|
2011-09-05 03:48:23 +00:00
|
|
|
self->state.text = self->text();
|
2011-02-24 09:27:21 +00:00
|
|
|
if(self->p.locked == false && self->onChange) self->onChange();
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::setCursorPosition(unsigned position) {
|
|
|
|
GtkTextMark *mark = gtk_text_buffer_get_mark(textBuffer, "insert");
|
|
|
|
GtkTextIter iter;
|
|
|
|
gtk_text_buffer_get_end_iter(textBuffer, &iter);
|
|
|
|
gtk_text_iter_set_offset(&iter, min(position, gtk_text_iter_get_offset(&iter)));
|
|
|
|
gtk_text_buffer_place_cursor(textBuffer, &iter);
|
|
|
|
gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(subWidget), mark);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::setEditable(bool editable) {
|
|
|
|
gtk_text_view_set_editable(GTK_TEXT_VIEW(subWidget), editable);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::setText(const string &text) {
|
|
|
|
locked = true;
|
|
|
|
gtk_text_buffer_set_text(textBuffer, text, -1);
|
|
|
|
locked = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::setWordWrap(bool wordWrap) {
|
|
|
|
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(subWidget), wordWrap ? GTK_WRAP_WORD_CHAR : GTK_WRAP_NONE);
|
Update to v085r08 release.
byuu says:
Changelog:
- follow the Laevateinn topic to get most of it
- also added NMI, IRQ step buttons to CPU debugger
- also added trace masking + trace mask reset
- also added memory export
- cartridge loading is entirely folder-based now
FitzRoy, I'll go ahead and make a second compromise with you for v086:
I'll match the following:
/path/to/SNES.sfc/*.sfc
/path/to/NES.fc/*.prg, *.chr (split format)
/path/to/NES.fc/*.fc (merged format)
/path/to/GB.gb/*.gb
/path/to/GBC.gbc/*.gbc
Condition will be that there can only be one of each file. If there's
more than one, it'll abort. That lets me name my ROMs as
"Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg,
cartridge.chr". Or whatever you want.
We'll just go with that, see what fares out as the most popular, and
then restrict it back to that method.
The folder must have the .fc, etc extension though. That will be how we
avoid false-positive folder matches.
[Editor's note - the Laevateinn topic mentions these changes for
v085r08:
Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing,
memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu,
WRAM mirroring on breakpoints, protected MMIO memory regions
(otherwise, viewing $002100 could crash your game.)
Major missing components:
- trace mask
- trace mask clear / usage map clear
- window geometry caching / sizing improvements
- VRAM viewer
- properties viewer
- working memory export button
The rest will most likely appear after v086 is released.
]
2012-02-12 05:35:40 +00:00
|
|
|
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtkWidget),
|
|
|
|
wordWrap ? GTK_POLICY_NEVER : GTK_POLICY_ALWAYS,
|
|
|
|
GTK_POLICY_ALWAYS);
|
2011-02-24 09:27:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
string pTextEdit::text() {
|
|
|
|
GtkTextIter start, end;
|
|
|
|
gtk_text_buffer_get_start_iter(textBuffer, &start);
|
|
|
|
gtk_text_buffer_get_end_iter(textBuffer, &end);
|
|
|
|
char *temp = gtk_text_buffer_get_text(textBuffer, &start, &end, true);
|
|
|
|
string text = temp;
|
|
|
|
g_free(temp);
|
|
|
|
return text;
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::constructor() {
|
|
|
|
gtkWidget = gtk_scrolled_window_new(0, 0);
|
|
|
|
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gtkWidget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
|
|
|
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(gtkWidget), GTK_SHADOW_ETCHED_IN);
|
|
|
|
subWidget = gtk_text_view_new();
|
|
|
|
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(subWidget), GTK_WRAP_WORD_CHAR);
|
|
|
|
gtk_container_add(GTK_CONTAINER(gtkWidget), subWidget);
|
|
|
|
textBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(subWidget));
|
|
|
|
g_signal_connect_swapped(G_OBJECT(textBuffer), "changed", G_CALLBACK(TextEdit_change), (gpointer)&textEdit);
|
|
|
|
gtk_widget_show(subWidget);
|
2011-09-05 03:48:23 +00:00
|
|
|
|
|
|
|
setEditable(textEdit.state.editable);
|
|
|
|
setText(textEdit.state.text);
|
|
|
|
setWordWrap(textEdit.state.wordWrap);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::destructor() {
|
|
|
|
gtk_widget_destroy(subWidget);
|
|
|
|
gtk_widget_destroy(gtkWidget);
|
|
|
|
}
|
|
|
|
|
|
|
|
void pTextEdit::orphan() {
|
|
|
|
destructor();
|
|
|
|
constructor();
|
2011-02-24 09:27:21 +00:00
|
|
|
}
|