Code

Try harder to fix the tablet configuration problem
[inkscape.git] / src / dialogs / object-attributes.cpp
index ee355a7740c0c2a7db18ad00a72edbaeb60c797a..320840f76bc5387188c819367a6a9b0974c963c4 100644 (file)
@@ -1,9 +1,7 @@
-#define __SP_OBJECT_ATTRIBUTES_C__
-
-/**
- * \brief  Generic properties editor
- *
- * Authors:
+/** @file
+ * @brief  Generic properties editor
+ */
+/* Authors:
  *   Lauris Kaplinski <lauris@kaplinski.com>
  *   bulia byak <buliabyak@users.sf.net>
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
 #include <glibmm/i18n.h>
-#include "helper/window.h"
-#include "macros.h"
-#include "sp-anchor.h"
-#include "sp-attribute-widget.h"
-
+#include <string>
+#include <cstring>
 #include <sigc++/connection.h>
 #include <sigc++/functors/ptr_fun.h>
 #include <sigc++/adaptors/bind.h>
 
+#include "helper/window.h"
+#include "macros.h"
+#include "sp-anchor.h"
+#include "widgets/sp-attribute-widget.h"
+#include "../xml/repr.h"
+
 struct SPAttrDesc {
     gchar const *label;
     gchar const *attribute;
@@ -57,6 +55,14 @@ static const SPAttrDesc image_desc[] = {
     { NULL, NULL}
 };
 
+static const SPAttrDesc image_nohref_desc[] = {
+    { N_("X:"), "x"},
+    { N_("Y:"), "y"},
+    { N_("Width:"), "width"},
+    { N_("Height:"), "height"},
+    { NULL, NULL}
+};
+
 
 static void
 object_released( SPObject */*object*/, GtkWidget *widget )
@@ -128,13 +134,16 @@ sp_object_attributes_dialog (SPObject *object, const gchar *tag)
     if (!strcmp (tag, "Link")) {
         sp_object_attr_show_dialog (object, anchor_desc, tag);
     } else if (!strcmp (tag, "Image")) {
-        sp_object_attr_show_dialog (object, image_desc, tag);
+        Inkscape::XML::Node *ir = SP_OBJECT_REPR(object);
+        const gchar *href = ir->attribute("xlink:href");
+        if ( (!href) || ((strncmp(href, "data:", 5) == 0)) ) {
+            sp_object_attr_show_dialog (object, image_nohref_desc, tag);
+        } else {
+            sp_object_attr_show_dialog (object, image_desc, tag);
+        }
     } 
-
 } // end of sp_object_attributes_dialog()
 
-
-
 /*
   Local Variables:
   mode:c++