Index: brlcad/include/ged.h
===================================================================
--- brlcad/include/ged.h	(revision 53913)
+++ brlcad/include/ged.h	(working copy)
@@ -254,6 +254,13 @@
 	return (_flags); \
     }
 
+/* From include/dm.h */
+#define GED_MAX 2047.0
+#define GED_MIN -2048.0
+#define GED_RANGE 4095.0
+#define INV_GED 0.00048828125
+#define INV_4096 0.000244140625
+
 struct ged_adc_state {
     int		gas_draw;
     int		gas_dv_x;
@@ -559,6 +566,12 @@
     int (*add)(const struct ged_cmd *cmd);
     int (*del)(const char *name);
     int (*run)(int ac, char *av[]);
+
+    /* Interface to LIBDM */
+    int ged_dm_width;
+    int ged_dm_height;
+    int ged_dmp_is_null;
+    void (*ged_dm_get_display_image)();
 };
 
 typedef int (*ged_func_ptr)(struct ged *, int, const char *[]);
Index: brlcad/src/libged/adc.c
===================================================================
--- brlcad/src/libged/adc.c	(revision 53913)
+++ brlcad/src/libged/adc.c	(working copy)
@@ -32,7 +32,6 @@
 #include "bu.h"
 #include "vmath.h"
 #include "ged.h"
-#include "dm.h"
 
 static void
 adc_model_to_adc_view(struct ged_view *gvp)
Index: brlcad/src/libged/clip.c
===================================================================
--- brlcad/src/libged/clip.c	(revision 53913)
+++ brlcad/src/libged/clip.c	(working copy)
@@ -37,7 +37,6 @@
 #include "bio.h"
 
 #include "vmath.h"
-#include "dm.h"
 
 #include "./ged_private.h"
 
Index: brlcad/src/libged/png.c
===================================================================
--- brlcad/src/libged/png.c	(revision 53913)
+++ brlcad/src/libged/png.c	(working copy)
@@ -36,7 +36,6 @@
 #include "vmath.h"
 #include "bn.h"
 #include "solid.h"
-#include "dm.h"
 
 #include "./ged_private.h"
 
Index: brlcad/src/libged/rect.c
===================================================================
--- brlcad/src/libged/rect.c	(revision 53913)
+++ brlcad/src/libged/rect.c	(working copy)
@@ -32,7 +32,6 @@
 #include "bu.h"
 #include "vmath.h"
 #include "fb.h"
-#include "dm.h"
 
 #include "./ged_private.h"
 
Index: brlcad/src/libged/screengrab.c
===================================================================
--- brlcad/src/libged/screengrab.c	(revision 53913)
+++ brlcad/src/libged/screengrab.c	(working copy)
@@ -30,7 +30,6 @@
 #include <string.h>
 
 #include "bu.h"
-#include "dm.h"
 #include "icv.h"
 
 #include "./ged_private.h"
@@ -54,9 +53,8 @@
     unsigned char **rows = NULL;
     unsigned char *idata = NULL;
     struct icv_image_file *bif = NULL;	/* bu image for saving image formats */
-    struct dm *dmp = NULL;
 
-    if ((dmp = (struct dm *)gedp->ged_dmp) == NULL) {
+    if (gedp->ged_dmp_is_null) {
 	bu_vls_printf(gedp->ged_result_str, "Bad display pointer.");
 	return GED_ERROR;
     }
@@ -80,10 +78,10 @@
 	return GED_ERROR;
     }
 
-    width = dmp->dm_width;
-    height = dmp->dm_height;
+    width = gedp->ged_dm_width;
+    height = gedp->ged_dm_height;
     bytes_per_pixel = 3;
-    bytes_per_line = dmp->dm_width * bytes_per_pixel;
+    bytes_per_line = width * bytes_per_pixel;
 
     /* create image file */
     if ((bif = icv_image_save_open(argv[1], ICV_IMAGE_AUTO, width, height, bytes_per_pixel)) == NULL) {
@@ -93,7 +91,7 @@
 
     rows = (unsigned char **)bu_calloc(height, sizeof(unsigned char *), "rows");
 
-    DM_GET_DISPLAY_IMAGE(dmp, &idata);
+    gedp->ged_dm_get_display_image(gedp, &idata);
 
     for (i = 0; i < height; ++i) {
 	rows[i] = (unsigned char *)(idata + ((height-i-1)*bytes_per_line));
Index: brlcad/src/mged/cmd.c
===================================================================
--- brlcad/src/mged/cmd.c	(revision 53913)
+++ brlcad/src/mged/cmd.c	(working copy)
@@ -82,7 +82,38 @@
  */
 static struct bu_vls tcl_output_hook = BU_VLS_INIT_ZERO;
 
+static int
+mged_dm_width(struct ged *gedpp)
+{
+    struct dm *dmpp = (struct dm *)gedpp->ged_dmp;
+    return dmpp->dm_width;
+}
 
+
+static int
+mged_dm_height(struct ged *gedpp)
+{
+    struct dm *dmpp = (struct dm *)gedpp->ged_dmp;
+    return dmpp->dm_height;
+}
+
+
+static int
+mged_dmp_is_null(struct ged *gedpp)
+{
+    struct dm *dmpp = (struct dm *)gedpp->ged_dmp;
+    return dmpp == NULL;
+}
+
+
+static void
+mged_dm_get_display_image(struct ged *gedpp, unsigned char **idata)
+{
+    struct dm *dmpp = (struct dm *)gedpp->ged_dmp;
+    DM_GET_DISPLAY_IMAGE(dmpp, idata);
+}
+
+
 /**
  * G U I _ O U T P U T
  *
@@ -624,6 +655,10 @@
     if (!gedp->ged_gvp)
 	gedp->ged_gvp = view_state->vs_gvp;
     gedp->ged_dmp = (void *)curr_dm_list->dml_dmp;
+    gedp->ged_dm_width = mged_dm_width(gedp);
+    gedp->ged_dm_height = mged_dm_height(gedp);
+    gedp->ged_dmp_is_null = mged_dmp_is_null(gedp);
+    gedp->ged_dm_get_display_image = mged_dm_get_display_image;
 
     ret = (*ctp->ged_func)(gedp, argc, (const char **)argv);
     Tcl_AppendResult(interpreter, bu_vls_addr(gedp->ged_result_str), NULL);
Index: brlcad/src/mged/mged.h
===================================================================
--- brlcad/src/mged/mged.h	(revision 53913)
+++ brlcad/src/mged/mged.h	(working copy)
@@ -654,6 +654,7 @@
 /* utility1.c */
 int editit(const char *command, const char *tempfile);
 
+
 #endif  /* __GED_H__ */
 
 /*
