SDL: Remove deprecated GTK+ debugger. [R. Belmont]

This commit is contained in:
R. Belmont 2013-10-25 02:53:57 +00:00
parent 4e8a1289bd
commit a353507925
16 changed files with 15 additions and 6146 deletions

13
.gitattributes vendored
View File

@ -8538,17 +8538,10 @@ src/osd/sdl/SDLMain_tmpl.h svneol=native#text/plain
src/osd/sdl/SDLMain_tmpl.m svneol=native#text/plain
src/osd/sdl/blit13.h svneol=native#text/plain
src/osd/sdl/build.mak svneol=native#text/plain
src/osd/sdl/debug-cb.h svneol=native#text/plain
src/osd/sdl/debug-cb.ign svneol=native#text/plain
src/osd/sdl/debug-intf.c svneol=native#text/plain
src/osd/sdl/debug-intf.h svneol=native#text/plain
src/osd/sdl/debug-sup.c svneol=native#text/plain
src/osd/sdl/debug-sup.h svneol=native#text/plain
src/osd/sdl/debug.glade svneol=native#text/plain
src/osd/sdl/debug.gladep svneol=native#text/plain
src/osd/sdl/debugosx.h svneol=native#text/plain
src/osd/sdl/debugosx.m svneol=native#text/plain
src/osd/sdl/debugqt.c svneol=native#text/plain
src/osd/sdl/debugqt.h svneol=native#text/plain
src/osd/sdl/debugqtbreakpointswindow.c svneol=native#text/plain
src/osd/sdl/debugqtbreakpointswindow.h svneol=native#text/plain
src/osd/sdl/debugqtdasmwindow.c svneol=native#text/plain
@ -8563,13 +8556,9 @@ src/osd/sdl/debugqtview.c svneol=native#text/plain
src/osd/sdl/debugqtview.h svneol=native#text/plain
src/osd/sdl/debugqtwindow.c svneol=native#text/plain
src/osd/sdl/debugqtwindow.h svneol=native#text/plain
src/osd/sdl/debugwin.c svneol=native#text/plain
src/osd/sdl/debugwin.h svneol=native#text/plain
src/osd/sdl/draw13.c svneol=native#text/plain
src/osd/sdl/drawogl.c svneol=native#text/plain
src/osd/sdl/drawsdl.c svneol=native#text/plain
src/osd/sdl/dview.c svneol=native#text/plain
src/osd/sdl/dview.h svneol=native#text/plain
src/osd/sdl/gl_shader_mgr.c svneol=native#text/plain
src/osd/sdl/gl_shader_mgr.h svneol=native#text/plain
src/osd/sdl/gl_shader_tool.c svneol=native#text/plain

View File

@ -1,109 +0,0 @@
#include <gtk/gtk.h>
void
on_new_mem_activate (GtkWidget *win);
void
on_new_disasm_activate (GtkWidget *win);
void
on_run_activate (GtkWidget *win);
void
on_run_h_activate (GtkWidget *win);
void
on_run_cpu_activate (GtkWidget *win);
void
on_run_irq_activate (GtkWidget *win);
void
on_run_vbl_activate (GtkWidget *win);
void
on_step_into_activate (GtkWidget *win);
void
on_step_over_activate (GtkWidget *win);
void
on_step_out_activate (GtkWidget *win);
GtkWidget*
debug_view_new (gchar *widget_name, gchar *string1, gchar *string2,
gint int1, gint int2);
GtkWidget*
dview_new (const gchar *widget_name, const gchar *string1, const gchar *string2,
gint int1, gint int2);
void
on_raw_opcodes_activate (GtkWidget *win);
void
on_enc_opcodes_activate (GtkWidget *win);
void
on_comments_activate (GtkWidget *win);
void
on_new_errorlog_activate (GtkWidget *win);
void
on_soft_reset_activate (GtkWidget *win);
void
on_hard_reset_activate (GtkWidget *win);
void
on_exit_activate (GtkWidget *win);
void
on_chunks_1_activate (GtkWidget *win);
void
on_chunks_2_activate (GtkWidget *win);
void
on_chunks_4_activate (GtkWidget *win);
void
on_reverse_activate (GtkWidget *win);
void
on_ibpl_activate (GtkWidget *win);
void
on_dbpl_activate (GtkWidget *win);
GtkWidget*
dview_new (const gchar *widget_name, const gchar *string1, const gchar *string2,
gint int1, gint int2);
void
on_run_to_cursor_activate (GtkWidget *win);
void
on_set_breakpoint_at_cursor_activate (GtkWidget *win);
gboolean
on_disasm_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
on_memoryview_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
on_memoryview_key_press_event (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data);
void
on_logical_addresses_group_changed (GtkWidget *win);
void
on_physical_addresses_group_changed (GtkWidget *win);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
GtkWidget* create_debugmain (void);
GtkWidget* create_memorywin (void);
GtkWidget* create_disasmwin (void);
GtkWidget* create_logwin (void);

View File

@ -1,143 +0,0 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <gtk/gtk.h>
#include "debug-sup.h"
GtkWidget*
lookup_widget (GtkWidget *widget,
const gchar *widget_name)
{
GtkWidget *parent, *found_widget;
for (;;)
{
if (GTK_IS_MENU (widget))
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
else
parent = widget->parent;
if (!parent)
parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
if (parent == NULL)
break;
widget = parent;
}
found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
widget_name);
if (!found_widget)
g_warning ("Widget not found: %s", widget_name);
return found_widget;
}
static GList *pixmaps_directories = NULL;
/* Use this function to set the directory containing installed pixmaps. */
void
add_pixmap_directory (const gchar *directory)
{
pixmaps_directories = g_list_prepend (pixmaps_directories,
g_strdup (directory));
}
/* This is an internally used function to find pixmap files. */
static gchar*
find_pixmap_file (const gchar *filename)
{
GList *elem;
/* We step through each of the pixmaps directory to find it. */
elem = pixmaps_directories;
while (elem)
{
gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
G_DIR_SEPARATOR_S, filename);
if (g_file_test (pathname, G_FILE_TEST_EXISTS))
return pathname;
g_free (pathname);
elem = elem->next;
}
return NULL;
}
/* This is an internally used function to create pixmaps. */
GtkWidget*
create_pixmap (GtkWidget *widget,
const gchar *filename)
{
gchar *pathname = NULL;
GtkWidget *pixmap;
if (!filename || !filename[0])
return gtk_image_new ();
pathname = find_pixmap_file (filename);
if (!pathname)
{
g_warning ("Couldn't find pixmap file: %s", filename);
return gtk_image_new ();
}
pixmap = gtk_image_new_from_file (pathname);
g_free (pathname);
return pixmap;
}
/* This is an internally used function to create pixmaps. */
GdkPixbuf*
create_pixbuf (const gchar *filename)
{
gchar *pathname = NULL;
GdkPixbuf *pixbuf;
GError *error = NULL;
if (!filename || !filename[0])
return NULL;
pathname = find_pixmap_file (filename);
if (!pathname)
{
g_warning ("Couldn't find pixmap file: %s", filename);
return NULL;
}
pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
if (!pixbuf)
{
fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
pathname, error->message);
g_error_free (error);
}
g_free (pathname);
return pixbuf;
}
/* This is used to set ATK action descriptions. */
void
glade_set_atk_action_description (AtkAction *action,
const gchar *action_name,
const gchar *description)
{
gint n_actions, i;
n_actions = atk_action_get_n_actions (action);
for (i = 0; i < n_actions; i++)
{
if (!strcmp (atk_action_get_name (action, i), action_name))
atk_action_set_description (action, i, description);
}
}

View File

@ -1,43 +0,0 @@
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtk.h>
/*
* Public Functions.
*/
/*
* This function returns a widget in a component created by Glade.
* Call it with the toplevel widget in the component (i.e. a window/dialog),
* or alternatively any widget in the component, and the name of the widget
* you want returned.
*/
GtkWidget* lookup_widget (GtkWidget *widget,
const gchar *widget_name);
/* Use this function to set the directory containing installed pixmaps. */
void add_pixmap_directory (const gchar *directory);
/*
* Private Functions.
*/
/* This is used to create the pixmaps used in the interface. */
GtkWidget* create_pixmap (GtkWidget *widget,
const gchar *filename);
/* This is used to create the pixbufs used in the interface. */
GdkPixbuf* create_pixbuf (const gchar *filename);
/* This is used to set ATK action descriptions. */
void glade_set_atk_action_description (AtkAction *action,
const gchar *action_name,
const gchar *description);

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +0,0 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
<glade-project>
<name>Debug</name>
<program_name>debug</program_name>
<source_directory>.</source_directory>
<gnome_support>FALSE</gnome_support>
<gettext_support>FALSE</gettext_support>
<use_widget_names>TRUE</use_widget_names>
<output_main_file>FALSE</output_main_file>
<output_build_files>FALSE</output_build_files>
<backup_source_files>FALSE</backup_source_files>
<main_source_file>debug-intf.c</main_source_file>
<main_header_file>debug-intf.h</main_header_file>
<handler_source_file>debug-cb.ign</handler_source_file>
<handler_header_file>debug-cb.h</handler_header_file>
<support_source_file>debug-sup.c</support_source_file>
<support_header_file>debug-sup.h</support_header_file>
</glade-project>

View File

@ -35,6 +35,8 @@
#include "debugqtmemorywindow.h"
#include "debugqtbreakpointswindow.h"
#include "debugqt.h"
//============================================================
// "Global" variables to make QT happy

6
src/osd/sdl/debugqt.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef _DEBUGQT_H_
#define _DEBUGQT_H_
void debugwin_update_during_game(running_machine &machine);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
//============================================================
//
// debugwin.h - SDL/GTK+ debug window handling
//
// Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
// Visit http://mamedev.org for licensing and usage restrictions.
//
// SDLMAME by Olivier Galibert and R. Belmont
//
//============================================================
#ifndef __WIN_DEBUGWIN__
#define __WIN_DEBUGWIN__
//============================================================
// PROTOTYPES
//============================================================
void debugwin_update_during_game(running_machine &machine);
#endif

View File

@ -1,435 +0,0 @@
#include "dview.h"
#ifndef SDLMAME_WIN32
#include <gconf/gconf-client.h>
#endif
G_DEFINE_TYPE(DView, dview, GTK_TYPE_CONTAINER);
static gboolean dview_expose(GtkWidget *wdv, GdkEventExpose *event)
{
const debug_view_char *viewdata;
DView *dv = DVIEW(wdv);
DViewClass *dvc = DVIEW_GET_CLASS(dv);
debug_view_xy vsize;
UINT32 i, j, k, l, xx, yy;
GdkColor bg, fg;
char s[256];
vsize = dv->view->visible_size();
bg.red = bg.green = bg.blue = 0xffff;
gdk_gc_set_rgb_fg_color(dv->gc, &bg);
gdk_draw_rectangle(GDK_DRAWABLE(wdv->window), dv->gc, TRUE, 0, 0, wdv->allocation.width - (dv->vs ? dv->vsz : 0), wdv->allocation.height - (dv->hs ? dv->hsz : 0));
if(dv->hs && dv->vs) {
gdk_gc_set_foreground(dv->gc, &wdv->style->bg[GTK_STATE_NORMAL]);
gdk_draw_rectangle(GDK_DRAWABLE(wdv->window), dv->gc, TRUE,
wdv->allocation.width - dv->vsz, wdv->allocation.height - dv->hsz,
dv->vsz, dv->hsz);
}
viewdata = dv->view->viewdata();
yy = wdv->style->ythickness;
for(j=0; j<vsize.y; j++) {
k = l = 0;
xx = wdv->style->xthickness;
for(i=0; i<vsize.x; i++) {
unsigned char attr = viewdata->attrib;
unsigned char v = viewdata->byte;
if(v < 128) {
s[k++] = v;
} else {
s[k++] = 0xc0 | (v>>6);
s[k++] = 0x80 | (v & 0x3f);
}
l++;
if ( i == 0 || attr != viewdata[-1].attrib ) {
bg.red = bg.green = bg.blue = 0xffff;
fg.red = fg.green = fg.blue = 0;
if(attr & DCA_ANCILLARY)
bg.red = bg.green = bg.blue = 0xe0e0;
if(attr & DCA_SELECTED) {
bg.red = 0xffff;
bg.green = bg.blue = 0x8080;
}
if(attr & DCA_CURRENT) {
bg.red = bg.green = 0xffff;
bg.blue = 0;
}
if(attr & DCA_CHANGED) {
fg.red = 0xffff;
fg.green = fg.blue = 0;
}
if(attr & DCA_INVALID) {
fg.red = fg.green = 0;
fg.blue = 0xffff;
}
if(attr & DCA_DISABLED) {
fg.red = (fg.red + bg.red) >> 1;
fg.green = (fg.green + bg.green) >> 1;
fg.blue = (fg.blue + bg.blue) >> 1;
}
if(attr & DCA_COMMENT) {
fg.red = fg.blue = 0;
fg.green = 0x8080;
}
}
if ( i == vsize.x - 1 || attr != viewdata[1].attrib || k >= 254 ) {
s[k++] = 0;
pango_layout_set_text(dv->playout, s, -1);
gdk_gc_set_rgb_fg_color(dv->gc, &bg);
gdk_draw_rectangle(GDK_DRAWABLE(wdv->window), dv->gc, TRUE, xx, yy, l * dvc->fixedfont_width, dvc->fixedfont_height);
gdk_gc_set_rgb_fg_color(dv->gc, &fg);
gdk_draw_layout(GDK_DRAWABLE(wdv->window), dv->gc, xx, yy, dv->playout);
xx += l * dvc->fixedfont_width;
l = k = 0;
}
viewdata++;
}
yy += dvc->fixedfont_height;
}
gtk_paint_shadow(wdv->style, wdv->window,
GTK_STATE_NORMAL, GTK_SHADOW_IN,
&event->area, wdv, "scrolled_window",
0, 0,
wdv->allocation.width - (dv->vs ? dv->vsz : 0),
wdv->allocation.height - (dv->hs ? dv->hsz : 0));
GTK_WIDGET_CLASS(g_type_class_peek_parent(dvc))->expose_event(wdv, event);
return FALSE;
}
static void dview_hadj_changed(GtkAdjustment *adj, DView *dv)
{
debug_view_xy pos;
UINT32 v = (UINT32)(adj->value);
pos = dv->view->visible_position();
if (v != pos.x)
{
pos.x = v;
dv->view->set_visible_position(pos);
gtk_widget_queue_draw(GTK_WIDGET(dv));
}
}
static void dview_vadj_changed(GtkAdjustment *adj, DView *dv)
{
debug_view_xy pos;
UINT32 v = (UINT32)(adj->value);
pos = dv->view->visible_position();
if (v != pos.y)
{
pos.y = v;
dv->view->set_visible_position(pos);
gtk_widget_queue_draw(GTK_WIDGET(dv));
}
}
static void dview_realize(GtkWidget *wdv)
{
GdkWindowAttr attributes;
gint attributes_mask;
DView *dv;
GTK_WIDGET_SET_FLAGS(wdv, GTK_REALIZED | GTK_CAN_FOCUS);
dv = DVIEW(wdv);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = wdv->allocation.x;
attributes.y = wdv->allocation.y;
attributes.width = wdv->allocation.width;
attributes.height = wdv->allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual(wdv);
attributes.colormap = gtk_widget_get_colormap(wdv);
attributes.event_mask = gtk_widget_get_events(wdv) | GDK_EXPOSURE_MASK
| GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK
| GDK_FOCUS_CHANGE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
wdv->window = gdk_window_new(gtk_widget_get_parent_window(wdv), &attributes, attributes_mask);
gdk_window_set_user_data(wdv->window, dv);
dv->gc = gdk_gc_new(GDK_DRAWABLE(wdv->window));
wdv->style = gtk_style_attach(wdv->style, wdv->window);
}
static void dview_size_allocate(GtkWidget *wdv, GtkAllocation *allocation)
{
DView *dv = DVIEW(wdv);
DViewClass *dvc = DVIEW_GET_CLASS(dv);
UINT32 ah = allocation->height-2*wdv->style->ythickness;
UINT32 aw = allocation->width-2*wdv->style->xthickness;
int ohs = dv->hs;
int ovs = dv->vs;
debug_view_xy size, pos, col, vsize;
pos = dv->view->visible_position();
size = dv->view->total_size();
dv->tr = size.y;
dv->tc = size.x;
dv->hs = (size.x*dvc->fixedfont_width > aw ? 1 : 0);
dv->vs = (size.y*dvc->fixedfont_height > ah ? 1 : 0);
if(dv->hs)
ah -= dv->hsz;
if(dv->vs)
aw -= dv->vsz;
dv->hs = (size.x*dvc->fixedfont_width > aw ? 1 : 0);
dv->vs = (size.y*dvc->fixedfont_height > ah ? 1 : 0);
ah = allocation->height - (dv->hs ? dv->hsz : 0);
aw = allocation->width - (dv->vs ? dv->vsz : 0);
col.y = (ah-2*wdv->style->ythickness+dvc->fixedfont_height-1) / dvc->fixedfont_height;
col.x = (aw-2*wdv->style->xthickness+dvc->fixedfont_width-1) / dvc->fixedfont_width;
wdv->allocation = *allocation;
vsize.y = size.y-pos.y;
vsize.x = size.x-pos.x;
if(vsize.y > col.y)
vsize.y = col.y;
else if(vsize.y < col.y) {
pos.y = size.y-col.y;
if(pos.y < 0)
pos.y = 0;
vsize.y = size.y-pos.y;
}
if(vsize.x > col.x)
vsize.x = col.x;
else if(vsize.x < col.x) {
pos.x = size.x-col.x;
if(pos.x < 0)
pos.x = 0;
vsize.x = size.x-pos.x;
}
/* FIXME: This does not really work */
{
GdkGeometry x;
x.max_width = size.x*dvc->fixedfont_width;
x.max_height = -1;
if (wdv->window)
{
gdk_window_set_geometry_hints( wdv->window,&x, GDK_HINT_MAX_SIZE );
}
}
dv->view->set_visible_position(pos);
dv->view->set_visible_size(vsize);
#ifdef GTK_WIDGET_REALIZED
if(GTK_WIDGET_REALIZED(wdv))
#else
if(gtk_widget_get_realized(wdv))
#endif
gdk_window_move_resize(wdv->window,
allocation->x, allocation->y,
allocation->width, allocation->height);
if(dv->hs) {
GtkAllocation al;
int span = (aw-2*wdv->style->xthickness) / dvc->fixedfont_width;
if(!ohs)
gtk_widget_show(dv->hscrollbar);
al.x = 0;
al.y = ah;
al.width = aw;
al.height = dv->hsz;
gtk_widget_size_allocate(dv->hscrollbar, &al);
if(pos.x+span > size.x)
pos.x = size.x-span;
if(pos.x < 0)
pos.x = 0;
dv->hadj->lower = 0;
dv->hadj->upper = size.x;
dv->hadj->value = pos.x;
dv->hadj->step_increment = 1;
dv->hadj->page_increment = span;
dv->hadj->page_size = span;
gtk_adjustment_changed(dv->hadj);
dv->view->set_visible_position(pos);
} else {
if(ohs)
gtk_widget_hide(dv->hscrollbar);
}
if(dv->vs) {
GtkAllocation al;
int span = (ah-2*wdv->style->ythickness) / dvc->fixedfont_height;
if(!ovs)
gtk_widget_show(dv->vscrollbar);
al.x = aw;
al.y = 0;
al.width = dv->vsz;
al.height = ah;
gtk_widget_size_allocate(dv->vscrollbar, &al);
if(pos.y+span > size.y)
pos.y = size.y-span;
if(pos.y < 0)
pos.y = 0;
dv->vadj->lower = 0;
dv->vadj->upper = size.y;
dv->vadj->value = pos.y;
dv->vadj->step_increment = 1;
dv->vadj->page_increment = span;
dv->vadj->page_size = span;
gtk_adjustment_changed(dv->vadj);
dv->view->set_visible_position(pos);
} else {
if(ovs)
gtk_widget_hide(dv->vscrollbar);
}
}
static void dview_size_request(GtkWidget *wdv, GtkRequisition *req)
{
GtkRequisition req2;
DView *dv = DVIEW(wdv);
DViewClass *dvc = DVIEW_GET_CLASS(dv);
int vs = 0, hs = 0;
debug_view_xy size;
size = dv->view->total_size();
if(size.x > 50) {
size.x = 50;
hs = 1;
}
if(size.y > 5) {
size.y = 5;
vs = 1;
}
req->width = size.x*dvc->fixedfont_width+2*wdv->style->xthickness;
req->height = size.y*dvc->fixedfont_height+2*wdv->style->ythickness;
gtk_widget_size_request(dv->hscrollbar, &req2);
dv->hsz = req2.height;
gtk_widget_size_request(dv->vscrollbar, &req2);
dv->vsz = req2.width;
if(hs)
req->height += dv->hsz;
if(vs)
req->width += dv->vsz;
}
static void dview_forall(GtkContainer *dvc, gboolean include_internals, GtkCallback callback, gpointer callback_data)
{
if(include_internals) {
DView *dv = DVIEW(dvc);
callback(dv->hscrollbar, callback_data);
callback(dv->vscrollbar, callback_data);
}
}
static void dview_class_init(DViewClass *dvc)
{
#ifndef SDLMAME_WIN32
GConfClient *conf = gconf_client_get_default();
char *name = 0;
dvc->fixedfont = 0;
if(conf)
name = gconf_client_get_string(conf, "/desktop/gnome/interface/monospace_font_name", 0);
if(name) {
dvc->fixedfont = pango_font_description_from_string(name);
g_free(name);
}
if(!dvc->fixedfont)
#endif
dvc->fixedfont = pango_font_description_from_string("Monospace 10");
if(!dvc->fixedfont) {
mame_printf_error("Couldn't find a monospace font, aborting\n");
abort();
}
GTK_CONTAINER_CLASS(dvc)->forall = dview_forall;
GTK_WIDGET_CLASS(dvc)->expose_event = dview_expose;
GTK_WIDGET_CLASS(dvc)->realize = dview_realize;
GTK_WIDGET_CLASS(dvc)->size_request = dview_size_request;
GTK_WIDGET_CLASS(dvc)->size_allocate = dview_size_allocate;
}
static void dview_init(DView *dv)
{
DViewClass *dvc;
dvc = DVIEW_GET_CLASS(dv);
if(!dvc->fixedfont_width) {
PangoFontMetrics *metrics;
metrics = pango_context_get_metrics(gtk_widget_get_pango_context(GTK_WIDGET(dv)), dvc->fixedfont, 0);
dvc->fixedfont_width = PANGO_PIXELS(pango_font_metrics_get_approximate_char_width(metrics));
dvc->fixedfont_height = PANGO_PIXELS(pango_font_metrics_get_ascent(metrics) +
pango_font_metrics_get_descent(metrics));
}
dv->view = 0;
gtk_widget_modify_font(GTK_WIDGET(dv), dvc->fixedfont);
dv->playout = gtk_widget_create_pango_layout(GTK_WIDGET(dv), 0);
pango_layout_set_font_description(dv->playout, dvc->fixedfont);
dv->gc = 0;
dv->hadj = GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 1, 1, 1, 1));
dv->hscrollbar = gtk_hscrollbar_new(dv->hadj);
gtk_widget_set_parent(dv->hscrollbar, GTK_WIDGET(dv));
g_object_ref(dv->hscrollbar);
g_signal_connect(dv->hadj, "value-changed", G_CALLBACK(dview_hadj_changed), dv);
dv->vadj = GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 1, 1, 1, 1));
dv->vscrollbar = gtk_vscrollbar_new(dv->vadj);
gtk_widget_set_parent(dv->vscrollbar, GTK_WIDGET(dv));
g_object_ref(dv->vscrollbar);
g_signal_connect(dv->vadj, "value-changed", G_CALLBACK(dview_vadj_changed), dv);
}
static void dview_update(debug_view &dw, void *osdprivate)
{
DView *dv = (DView *) osdprivate;
debug_view_xy size = dw.total_size();
if((dv->tr != size.y) || (dv->tc != size.x))
gtk_widget_queue_resize(GTK_WIDGET(dv));
else
gtk_widget_queue_draw(GTK_WIDGET(dv));
}
GtkWidget *dview_new(const gchar *widget_name, const gchar *string1, const gchar *string2, gint int1, gint int2)
{
GtkWidget *wdv = (GtkWidget *) g_object_new(DVIEW_TYPE, NULL);
DView *dv = DVIEW(wdv);
dv->name = (gchar *) widget_name;
return wdv;
}
void dview_set_debug_view(DView *dv, running_machine &machine, debug_view_type type)
{
dv->view = machine.debug_view().alloc_view(type, dview_update, dv);
dv->dv_type = type;
}

View File

@ -1,53 +0,0 @@
#ifndef DVIEW_H
#define DVIEW_H
#include <gtk/gtk.h>
#include "emu.h"
#include "video.h"
#include "osdepend.h"
#include "debug/debugvw.h"
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
GType dview_get_type(void);
#define DVIEW_TYPE (dview_get_type())
#define DVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), DVIEW_TYPE, DView))
#define DVIEW_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST((obj), DVIEW, DViewClass))
#define IS_DVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), DVIEW_TYPE))
#define IS_DVIEW_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((obj), DVIEW_TYPE))
#define DVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), DVIEW_TYPE, DViewClass))
struct DViewClass;
struct DView;
struct DViewClass
{
GtkContainerClass parent_class;
PangoFontDescription *fixedfont;
int fixedfont_width, fixedfont_height;
};
struct DView
{
GtkContainer parent;
GtkAdjustment *hadj, *vadj;
GtkWidget *hscrollbar, *vscrollbar;
int hsz, vsz;
int hs, vs;
int tr, tc;
gchar *name;
PangoLayout *playout;
GdkGC *gc;
debug_view *view;
int dv_type;
};
GtkWidget *dview_new(const gchar *widget_name, const gchar *string1, const gchar *string2, gint int1, gint int2);
void dview_set_debug_view(DView *dv, running_machine &machine, debug_view_type type);
#endif

View File

@ -49,7 +49,10 @@
#include "video.h"
#include "window.h"
#include "input.h"
#include "debugwin.h"
#if !defined(NO_DEBUGGER)
#include "debugqt.h"
#endif
#include "osdsdl.h"
#include "sdlos.h"
@ -341,8 +344,10 @@ void sdl_osd_interface::update(bool skip_redraw)
sdlinput_poll(machine());
check_osd_inputs(machine());
#if !defined(NO_DEBUGGER)
if ((machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
debugwin_update_during_game(machine());
#endif
}