summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-19 15:11:19 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2018-06-20 09:51:42 +0000
commitaf7e9ecd1fdd9a3499da7fc2721c4e4a74d8542f (patch)
tree1cd0e24fa031a9231b800b0b41102a5d95e7082c /src/extension
parentReplace functions with methods in SPColor. (diff)
downloadinkscape-af7e9ecd1fdd9a3499da7fc2721c4e4a74d8542f.tar.gz
inkscape-af7e9ecd1fdd9a3499da7fc2721c4e4a74d8542f.zip
Replace typedef struct with struct in POD type declarations.
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/internal/emf-inout.h48
-rw-r--r--src/extension/internal/metafile-inout.h13
-rw-r--r--src/extension/internal/wmf-inout.h48
3 files changed, 49 insertions, 60 deletions
diff --git a/src/extension/internal/emf-inout.h b/src/extension/internal/emf-inout.h
index 8c732404c..c365495d5 100644
--- a/src/extension/internal/emf-inout.h
+++ b/src/extension/internal/emf-inout.h
@@ -29,30 +29,22 @@ namespace Internal {
#define DIRTY_FILL 0x02
#define DIRTY_STROKE 0x04
-typedef struct emf_object {
- emf_object() :
- type(0),
- level(0),
- lpEMFR(nullptr)
- {};
- int type;
- int level;
- char *lpEMFR;
-} EMF_OBJECT, *PEMF_OBJECT;
-
-typedef struct emf_strings {
- emf_strings() :
- size(0),
- count(0),
- strings(nullptr)
- {};
- int size; // number of slots allocated in strings
- int count; // number of slots used in strings
- char **strings; // place to store strings
-} EMF_STRINGS, *PEMF_STRINGS;
+struct EMF_OBJECT {
+ int type = 0;
+ int level = 0;
+ char *lpEMFR = nullptr;
+};
+using PEMF_OBJECT = EMF_OBJECT *;
-typedef struct emf_device_context {
- emf_device_context() :
+struct EMF_STRINGS {
+ int size = 0; // number of slots allocated in strings
+ int count = 0; // number of slots used in strings
+ char **strings = nullptr; // place to store strings
+};
+using PEMF_STRINGS = EMF_STRINGS *;
+
+struct EMF_DEVICE_CONTEXT {
+ EMF_DEVICE_CONTEXT() :
// SPStyle: class with constructor
font_name(nullptr),
clip_id(0),
@@ -106,13 +98,14 @@ typedef struct emf_device_context {
uint32_t textAlign;
U_XFORM worldTransform;
U_POINTL cur;
-} EMF_DEVICE_CONTEXT, *PEMF_DEVICE_CONTEXT;
+};
+using PEMF_DEVICE_CONTEXT = EMF_DEVICE_CONTEXT *;
#define EMF_MAX_DC 128
-typedef struct emf_callback_data {
+struct EMF_CALLBACK_DATA {
- emf_callback_data() :
+ EMF_CALLBACK_DATA() :
// dc: array, structure w/ constructor
level(0),
E2IdirY(1.0),
@@ -170,7 +163,8 @@ typedef struct emf_callback_data {
int n_obj;
PEMF_OBJECT emf_obj;
-} EMF_CALLBACK_DATA, *PEMF_CALLBACK_DATA;
+};
+using PEMF_CALLBACK_DATA = EMF_CALLBACK_DATA *;
class Emf : public Metafile
{
diff --git a/src/extension/internal/metafile-inout.h b/src/extension/internal/metafile-inout.h
index c3cda0954..a69b1acee 100644
--- a/src/extension/internal/metafile-inout.h
+++ b/src/extension/internal/metafile-inout.h
@@ -38,25 +38,26 @@ namespace Extension {
namespace Internal {
/* A coloured pixel. */
-typedef struct {
+struct pixel_t {
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t opacity;
-} pixel_t;
+};
/* A picture. */
- typedef struct {
+struct bitmap_t {
pixel_t *pixels;
size_t width;
size_t height;
-} bitmap_t;
+};
/* structure to store PNG image bytes */
-typedef struct {
+struct MEMPNG {
char *buffer;
size_t size;
-} MEMPNG, *PMEMPNG;
+};
+using PMEMPNG = MEMPNG *;
class Metafile
: public Inkscape::Extension::Implementation::Implementation
diff --git a/src/extension/internal/wmf-inout.h b/src/extension/internal/wmf-inout.h
index fbd7fff3a..4ec3a98eb 100644
--- a/src/extension/internal/wmf-inout.h
+++ b/src/extension/internal/wmf-inout.h
@@ -26,30 +26,22 @@ namespace Internal {
#define DIRTY_FILL 0x02
#define DIRTY_STROKE 0x04 // not used currently
-typedef struct wmf_object {
- wmf_object() :
- type(0),
- level(0),
- record(nullptr)
- {};
- int type;
- int level;
- char *record;
-} WMF_OBJECT, *PWMF_OBJECT;
-
-typedef struct wmf_strings {
- wmf_strings() :
- size(0),
- count(0),
- strings(nullptr)
- {};
- int size; // number of slots allocated in strings
- int count; // number of slots used in strings
- char **strings; // place to store strings
-} WMF_STRINGS, *PWMF_STRINGS;
+struct WMF_OBJECT {
+ int type = 0;
+ int level = 0;
+ char *record = nullptr;
+};
+using PWMF_OBJECT = WMF_OBJECT *;
-typedef struct wmf_device_context {
- wmf_device_context() :
+struct WMF_STRINGS {
+ int size = 0; // number of slots allocated in strings
+ int count = 0; // number of slots used in strings
+ char **strings = nullptr; // place to store strings
+};
+using PWMF_STRINGS = WMF_STRINGS *;
+
+struct WMF_DEVICE_CONTEXT {
+ WMF_DEVICE_CONTEXT() :
// SPStyle: class with constructor
font_name(nullptr),
clip_id(0),
@@ -100,7 +92,8 @@ typedef struct wmf_device_context {
U_COLORREF textColor;
uint16_t textAlign;
U_POINT16 cur;
-} WMF_DEVICE_CONTEXT, *PWMF_DEVICE_CONTEXT;
+};
+using PWMF_DEVICE_CONTEXT = WMF_DEVICE_CONTEXT *;
#define WMF_MAX_DC 128
@@ -110,9 +103,9 @@ typedef struct wmf_device_context {
// this fixes it, so some confusion between this struct and the one in emf-inout???
//typedef struct wmf_callback_data {
// as does this
-typedef struct wmf_callback_data {
+struct WMF_CALLBACK_DATA {
- wmf_callback_data() :
+ WMF_CALLBACK_DATA() :
// dc: array, structure w/ constructor
level(0),
E2IdirY(1.0),
@@ -164,7 +157,8 @@ typedef struct wmf_callback_data {
int n_obj;
int low_water; // first object slot which _might_ be unoccupied. Everything below is filled.
PWMF_OBJECT wmf_obj;
-} WMF_CALLBACK_DATA, *PWMF_CALLBACK_DATA;
+};
+using PWMF_CALLBACK_DATA = WMF_CALLBACK_DATA *;
class Wmf : public Metafile
{