[dia/zbrown/graphene-rect: 7/11] general: fix prototypes
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia/zbrown/graphene-rect: 7/11] general: fix prototypes
- Date: Sat, 1 May 2021 22:04:24 +0000 (UTC)
commit 93dce11e83f3c9db73eba8ade9cfab66880506ec
Author: Zander Brown <zbrown gnome org>
Date: Tue Apr 6 21:18:01 2021 +0100
general: fix prototypes
app/dia-line-width-area.h | 2 +-
lib/object.h | 4 +--
lib/persistence.h | 2 +-
lib/prop_sdarray_widget.c | 18 +++++++++--
lib/renderer/diacairo.h | 2 +-
plug-ins/python/pydia-property.c | 66 +++++++++++++++++++++-------------------
6 files changed, 54 insertions(+), 40 deletions(-)
---
diff --git a/app/dia-line-width-area.h b/app/dia-line-width-area.h
index dad5a8bf0..eca513ed7 100644
--- a/app/dia-line-width-area.h
+++ b/app/dia-line-width-area.h
@@ -37,6 +37,6 @@ struct _DiaLineWidthArea
GtkWidget *button;
};
-GtkWidget *dia_line_width_area_new ();
+GtkWidget *dia_line_width_area_new (void);
G_END_DECLS
diff --git a/lib/object.h b/lib/object.h
index d72448fb2..d9bb53b7e 100644
--- a/lib/object.h
+++ b/lib/object.h
@@ -160,7 +160,7 @@ typedef void (*SaveFunc) (DiaObject* obj, ObjectNode obj_node,
*
* \public \memberof _DiaObjectType
*/
-typedef GtkWidget *(*GetDefaultsFunc) ();
+typedef GtkWidget *(*GetDefaultsFunc) (void);
/*!
* \brief Apply the defaults from the default object dialog (deprecated)
@@ -170,7 +170,7 @@ typedef GtkWidget *(*GetDefaultsFunc) ();
*
* \public \memberof _DiaObjectType
*/
-typedef void *(*ApplyDefaultsFunc) ();
+typedef void *(*ApplyDefaultsFunc) (void);
/*** Object operations ***/
diff --git a/lib/persistence.h b/lib/persistence.h
index d7baa091a..131cb1677 100644
--- a/lib/persistence.h
+++ b/lib/persistence.h
@@ -24,7 +24,7 @@
G_BEGIN_DECLS
-typedef void (NullaryFunc) ();
+typedef void (NullaryFunc) (void);
void persistence_load (void);
void persistence_save (void);
diff --git a/lib/prop_sdarray_widget.c b/lib/prop_sdarray_widget.c
index 12df0b01e..6a3342123 100644
--- a/lib/prop_sdarray_widget.c
+++ b/lib/prop_sdarray_widget.c
@@ -70,9 +70,11 @@ _cell_renderer_enum_new (const Property *p, GtkTreeView *tree_view)
return cren;
}
+
+
/** Wrapper to setup ranges */
static GtkCellRenderer *
-_cell_renderer_real_new (const Property *p)
+_cell_renderer_real_new (const Property *p, GtkTreeView *view)
{
const RealProperty *prop = (RealProperty *)p;
GtkCellRenderer *cren = gtk_cell_renderer_spin_new ();
@@ -171,6 +173,16 @@ _cell_renderer_text_new (const Property *p, GtkTreeView *tree_view)
return cren;
}
+
+
+static GtkCellRenderer *
+_cell_renderer_spin_new (const Property *p, GtkTreeView *tree_view)
+{
+ return gtk_cell_renderer_spin_new ();
+}
+
+
+
static GtkCellRenderer *
_cell_renderer_multitext_new (const Property *p, GtkTreeView *tree_view)
{
@@ -195,13 +207,13 @@ static struct {
const char *type; /* the type sting */
GQuark type_quark; /* it's calculated quark */
GType gtype;
- GtkCellRenderer *(*create_renderer) ();
+ GtkCellRenderer *(*create_renderer) (const Property *p, GtkTreeView *view);
const char *bind;
DataFunc data_func;
} _dia_gtk_type_map[] = {
{ PROP_TYPE_DARRAY, 0, G_TYPE_POINTER, /* child data model */ },
{ PROP_TYPE_BOOL, 0, G_TYPE_BOOLEAN, _cell_renderer_toggle_new, "active" },
- { PROP_TYPE_INT, 0, G_TYPE_INT, gtk_cell_renderer_spin_new },
+ { PROP_TYPE_INT, 0, G_TYPE_INT, _cell_renderer_spin_new },
{ PROP_TYPE_ENUM, 0, G_TYPE_INT, _cell_renderer_enum_new, "text" },
{ PROP_TYPE_REAL, 0, G_TYPE_DOUBLE, _cell_renderer_real_new },
{ PROP_TYPE_STRING, 0, G_TYPE_STRING, _cell_renderer_text_new, "text" },
diff --git a/lib/renderer/diacairo.h b/lib/renderer/diacairo.h
index d13d1a0b3..14965f369 100644
--- a/lib/renderer/diacairo.h
+++ b/lib/renderer/diacairo.h
@@ -99,7 +99,7 @@ typedef enum OutputKind
G_DECLARE_FINAL_TYPE (DiaCairoInteractiveRenderer, dia_cairo_interactive_renderer, DIA_CAIRO,
INTERACTIVE_RENDERER, DiaCairoRenderer)
-DiaRenderer *dia_cairo_interactive_renderer_new ();
+DiaRenderer *dia_cairo_interactive_renderer_new (void);
gboolean cairo_export_data (DiagramData *data,
DiaContext *ctx,
diff --git a/plug-ins/python/pydia-property.c b/plug-ins/python/pydia-property.c
index ff7c5634f..d2f1f559b 100644
--- a/plug-ins/python/pydia-property.c
+++ b/plug-ins/python/pydia-property.c
@@ -764,41 +764,43 @@ PyDia_set_Rect (Property *prop, PyObject *val)
static int PyDia_set_Array (Property *, PyObject *);
+typedef PyObject *(*GetProp) (Property *prop);
+typedef int *(*SetProp) (Property *prop, PyObject *val);
+
struct {
char *type;
- PyObject *(*propget)();
- int (*propset)(Property*, PyObject*);
+ GetProp propget;
+ SetProp propset;
GQuark quark;
-} prop_type_map [] =
-{
- { PROP_TYPE_CHAR, PyDia_get_Char },
- { PROP_TYPE_BOOL, PyDia_get_Bool, PyDia_set_Bool },
- { PROP_TYPE_INT, PyDia_get_Int, PyDia_set_Int },
- { PROP_TYPE_INTARRAY, PyDia_get_IntArray, PyDia_set_IntArray },
- { PROP_TYPE_ENUM, PyDia_get_Enum, PyDia_set_Enum },
- { PROP_TYPE_ENUMARRAY, PyDia_get_IntArray, PyDia_set_IntArray }, /* Enum == Int */
- { PROP_TYPE_LINESTYLE, PyDia_get_LineStyle, PyDia_set_LineStyle },
- { PROP_TYPE_REAL, PyDia_get_Real, PyDia_set_Real },
- { PROP_TYPE_LENGTH, PyDia_get_Length, PyDia_set_Length },
- { PROP_TYPE_FONTSIZE, PyDia_get_Fontsize, PyDia_set_Fontsize },
- { PROP_TYPE_STRING, PyDia_get_String, PyDia_set_String },
- { PROP_TYPE_STRINGLIST, PyDia_get_StringList },
- { PROP_TYPE_FILE, PyDia_get_String, PyDia_set_String },
- { PROP_TYPE_MULTISTRING, PyDia_get_String, PyDia_set_String },
- { PROP_TYPE_TEXT, PyDia_get_Text, PyDia_set_Text },
- { PROP_TYPE_POINT, PyDia_get_Point, PyDia_set_Point },
- { PROP_TYPE_POINTARRAY, PyDia_get_PointArray, PyDia_set_PointArray },
- { PROP_TYPE_BEZPOINT, PyDia_get_BezPoint },
- { PROP_TYPE_BEZPOINTARRAY, PyDia_get_BezPointArray, PyDia_set_BezPointArray },
- { PROP_TYPE_RECT, PyDia_get_Rect, PyDia_set_Rect },
- { PROP_TYPE_ARROW, PyDia_get_Arrow, PyDia_set_Arrow },
- { PROP_TYPE_MATRIX, PyDia_get_Matrix, PyDia_set_Matrix },
- { PROP_TYPE_COLOUR, PyDia_get_Color, PyDia_set_Color },
- { PROP_TYPE_FONT, PyDia_get_Font },
- { PROP_TYPE_SARRAY, PyDia_get_Array, PyDia_set_Array },
- { PROP_TYPE_DARRAY, PyDia_get_Array, PyDia_set_Array },
- { PROP_TYPE_DICT, PyDia_get_Dict, PyDia_set_Dict },
- { PROP_TYPE_PIXBUF, PyDia_get_Pixbuf, PyDia_set_Pixbuf }
+} prop_type_map [] = {
+ { PROP_TYPE_CHAR, (GetProp) PyDia_get_Char },
+ { PROP_TYPE_BOOL, (GetProp) PyDia_get_Bool, (SetProp) PyDia_set_Bool },
+ { PROP_TYPE_INT, (GetProp) PyDia_get_Int, (SetProp) PyDia_set_Int },
+ { PROP_TYPE_INTARRAY, (GetProp) PyDia_get_IntArray, (SetProp) PyDia_set_IntArray },
+ { PROP_TYPE_ENUM, (GetProp) PyDia_get_Enum, (SetProp) PyDia_set_Enum },
+ { PROP_TYPE_ENUMARRAY, (GetProp) PyDia_get_IntArray, (SetProp) PyDia_set_IntArray }, /* Enum == Int */
+ { PROP_TYPE_LINESTYLE, (GetProp) PyDia_get_LineStyle, (SetProp) PyDia_set_LineStyle },
+ { PROP_TYPE_REAL, (GetProp) PyDia_get_Real, (SetProp) PyDia_set_Real },
+ { PROP_TYPE_LENGTH, (GetProp) PyDia_get_Length, (SetProp) PyDia_set_Length },
+ { PROP_TYPE_FONTSIZE, (GetProp) PyDia_get_Fontsize, (SetProp) PyDia_set_Fontsize },
+ { PROP_TYPE_STRING, (GetProp) PyDia_get_String, (SetProp) PyDia_set_String },
+ { PROP_TYPE_STRINGLIST, (GetProp) PyDia_get_StringList },
+ { PROP_TYPE_FILE, (GetProp) PyDia_get_String, (SetProp) PyDia_set_String },
+ { PROP_TYPE_MULTISTRING, (GetProp) PyDia_get_String, (SetProp) PyDia_set_String },
+ { PROP_TYPE_TEXT, (GetProp) PyDia_get_Text, (SetProp) PyDia_set_Text },
+ { PROP_TYPE_POINT, (GetProp) PyDia_get_Point, (SetProp) PyDia_set_Point },
+ { PROP_TYPE_POINTARRAY, (GetProp) PyDia_get_PointArray, (SetProp) PyDia_set_PointArray },
+ { PROP_TYPE_BEZPOINT, (GetProp) PyDia_get_BezPoint },
+ { PROP_TYPE_BEZPOINTARRAY, (GetProp) PyDia_get_BezPointArray, (SetProp) PyDia_set_BezPointArray },
+ { PROP_TYPE_RECT, (GetProp) PyDia_get_Rect, (SetProp) PyDia_set_Rect },
+ { PROP_TYPE_ARROW, (GetProp) PyDia_get_Arrow, (SetProp) PyDia_set_Arrow },
+ { PROP_TYPE_MATRIX, (GetProp) PyDia_get_Matrix, (SetProp) PyDia_set_Matrix },
+ { PROP_TYPE_COLOUR, (GetProp) PyDia_get_Color, (SetProp) PyDia_set_Color },
+ { PROP_TYPE_FONT, (GetProp) PyDia_get_Font },
+ { PROP_TYPE_SARRAY, (GetProp) PyDia_get_Array, (SetProp) PyDia_set_Array },
+ { PROP_TYPE_DARRAY, (GetProp) PyDia_get_Array, (SetProp) PyDia_set_Array },
+ { PROP_TYPE_DICT, (GetProp) PyDia_get_Dict, (SetProp) PyDia_set_Dict },
+ { PROP_TYPE_PIXBUF, (GetProp) PyDia_get_Pixbuf, (SetProp) PyDia_set_Pixbuf }
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]