[dia] docs: assorted fixes
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] docs: assorted fixes
- Date: Tue, 21 Jul 2020 01:07:42 +0000 (UTC)
commit 7243df04ff4d4bfc2930651c69603d28a160b81d
Author: Zander Brown <zbrown gnome org>
Date: Tue Jul 21 01:05:57 2020 +0100
docs: assorted fixes
app/app_procs.c | 10 ++
app/app_procs.h | 28 ++--
app/confirm.c | 16 +-
app/confirm.h | 8 -
app/navigation.c | 17 ++
app/navigation.h | 22 +--
lib/connpoint_line.c | 15 ++
lib/connpoint_line.h | 28 +---
lib/dia-handle.c | 48 ++++++
lib/diaarrowchooser.c | 393 ++++++++++++++++++++++++++++------------------
lib/diafontselector.c | 4 +-
lib/diagramdata.c | 2 +-
lib/focus.c | 2 +-
lib/handle.h | 141 +++++++++++------
lib/meson.build | 2 +
lib/object_defaults.c | 6 +-
lib/paper.c | 22 +++
lib/paper.h | 24 +--
lib/persistence.c | 4 +-
lib/prop_pixbuf.c | 36 +++--
lib/prop_sdarray_widget.c | 8 +-
21 files changed, 520 insertions(+), 316 deletions(-)
---
diff --git a/app/app_procs.c b/app/app_procs.c
index 4a94d3a6..6c311697 100644
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -869,6 +869,16 @@ app_init (int argc, char **argv)
}
+/**
+ * app_exit:
+ *
+ * Exit the application, but asking the user for confirmation
+ * if there are changed diagrams.
+ *
+ * Returns: %TRUE if the application exits.
+ *
+ * Since: dawn-of-time
+ */
gboolean
app_exit (void)
{
diff --git a/app/app_procs.h b/app/app_procs.h
index a900c723..ed54dcb8 100644
--- a/app/app_procs.h
+++ b/app/app_procs.h
@@ -15,28 +15,18 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifndef APP_PROCS_H
-#define APP_PROCS_H
-#include <glib.h>
-
-void app_init (int argc, char **argv);
+#pragma once
-/**
- * app_exit:
- *
- * Exit the application, but asking the user for confirmation
- * if there are changed diagrams.
- *
- * Returns: %TRUE if the application exits.
- *
- * Since: dawn-of-time
- */
-gboolean app_exit (void);
+#include <glib.h>
-void app_splash_init (const gchar* name);
-void app_splash_done (void);
+G_BEGIN_DECLS
+void app_init (int argc,
+ char **argv);
+gboolean app_exit (void);
+void app_splash_init (const char *name);
+void app_splash_done (void);
gboolean app_is_interactive (void);
-#endif /* APP_PROCS_H */
+G_END_DECLS
diff --git a/app/confirm.c b/app/confirm.c
index fb3482db..a3798e77 100644
--- a/app/confirm.c
+++ b/app/confirm.c
@@ -25,8 +25,18 @@
#include "confirm.h"
#include "intl.h"
-static gint
-confirm_respond (GtkWidget *widget, gint response_id, gpointer data)
+/**
+ * ConfirmationKind:
+ * @CONFIRM_PAGES: Confirm number of pages
+ * @CONFIRM_MEMORY: Confirm memory usage
+ * @CONFIRM_PRINT: This is for printing
+ *
+ * Since: dawn-of-time
+ */
+
+
+static int
+confirm_respond (GtkWidget *widget, int response_id, gpointer data)
{
/* just close it in any case */
gtk_widget_hide (widget);
@@ -42,7 +52,7 @@ confirm_export_size (Diagram *dia, GtkWindow *parent, guint flags)
GtkWidget *dialog;
int pages = 0;
gint64 bytes = 0;
- gchar *size, *msg;
+ char *size, *msg;
gboolean ret;
pages = ceil((dia->data->extents.right - dia->data->extents.left) / dia->data->paper.width)
diff --git a/app/confirm.h b/app/confirm.h
index c8b4a0c7..23a15d04 100644
--- a/app/confirm.h
+++ b/app/confirm.h
@@ -5,14 +5,6 @@
G_BEGIN_DECLS
-/**
- * ConfirmationKind:
- * @CONFIRM_PAGES: Confirm number of pages
- * @CONFIRM_MEMORY: Confirm memory usage
- * @CONFIRM_PRINT: This is for printing
- *
- * Since: dawn-of-time
- */
typedef enum {
CONFIRM_PAGES = (1<<0),
CONFIRM_MEMORY = (1<<1),
diff --git a/app/navigation.c b/app/navigation.c
index 4670555f..b7cdc8a8 100644
--- a/app/navigation.c
+++ b/app/navigation.c
@@ -31,6 +31,23 @@
#include "navigation.h"
+/**
+ * navigation_popup_new:
+ * @ddisp: the #DDisplay to navigate through.
+ *
+ * A button which triggers a popup navigation window.
+ *
+ * The popup window is created when the button is "pressed",
+ * and destroyed when the button is "released". In the meantime, the
+ * popup window grabs the pointer/focus. Moving the mouse adjust the
+ * scrollbars of the given #DDisplay accordingly.
+ *
+ * Returns: a new #GtkButton.
+ *
+ * Since: dawn-of-time
+ */
+
+
#define THUMBNAIL_MAX_SIZE 150 /*(pixels) this may be a preference*/
diff --git a/app/navigation.h b/app/navigation.h
index 4418d44a..11cba413 100644
--- a/app/navigation.h
+++ b/app/navigation.h
@@ -22,27 +22,13 @@
*
*/
-#ifndef NAVIGATION_H
-#define NAVIGATION_H
+#pragma once
#include <gtk/gtk.h>
#include "display.h"
-/**
- * navigation_popup_new:
- * @ddisp: the #DDisplay to navigate through.
- *
- * A button which triggers a popup navigation window.
- *
- * The popup window is created when the button is "pressed",
- * and destroyed when the button is "released". In the meantime, the
- * popup window grabs the pointer/focus. Moving the mouse adjust the
- * scrollbars of the given #DDisplay accordingly.
- *
- * Returns: a new #GtkButton.
- *
- * Since: dawn-of-time
- */
+G_BEGIN_DECLS
+
GtkWidget *navigation_popup_new (DDisplay *ddisp);
-#endif
+G_END_DECLS
diff --git a/lib/connpoint_line.c b/lib/connpoint_line.c
index 0b40abdc..0b77c856 100644
--- a/lib/connpoint_line.c
+++ b/lib/connpoint_line.c
@@ -27,6 +27,21 @@
#define DEBUG_PARENT 0
#define DEBUG_ORDER 0
+
+/**
+ * SECTION:connpoint_line
+ * @Title: ConnPointLine
+ *
+ * Connection point line is a helper struct, to hold a few connection points
+ * on a line segment. There can be a variable number of these connection
+ * points. The user should be made able to add or remove some connection
+ * points.
+ *
+ * #ConnPointLine can be used to implement dynamic #ConnectionPoints for
+ * a #DiaObject. It supports undo/redo, load/save to standard props
+ * and obviously connections to it.
+ */
+
static void cpl_reorder_connections(ConnPointLine *cpl);
diff --git a/lib/connpoint_line.h b/lib/connpoint_line.h
index 8bf972e6..030ea6bc 100644
--- a/lib/connpoint_line.h
+++ b/lib/connpoint_line.h
@@ -1,11 +1,6 @@
/* Dynamic container for connection points -*- c -*-
* Copyright(C) 2000 Cyrille Chepelov
*
- * Connection point line is a helper struct, to hold a few connection points
- * on a line segment. There can be a variable number of these connection
- * points. The user should be made able to add or remove some connection
- * points.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -21,9 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/*!
- \file connpoint_line.h - services for extra connection points
- */
#ifndef __CONNPOINT_LINE_H
#define __CONNPOINT_LINE_H
@@ -38,15 +30,7 @@
#include "object.h"
#include "dia_xml.h"
-/*!
- * \brief Helper class to have dynamic _ConnectionPoint on a line
- *
- * ConnPointLine can be used to implement dynamic conection points for
- * a _DiaObject. It supports unddo/redo, load/save to standard props
- * and obviously connections to it.
- *
- * \ingroup ObjectParts
- */
+
typedef struct _ConnPointLine {
/*! Placement of the line. */
Point start, end;
@@ -59,7 +43,7 @@ typedef struct _ConnPointLine {
} ConnPointLine;
-ConnPointLine *connpointline_create(DiaObject *parent,
+ConnPointLine *connpointline_create(DiaObject *parent,
int num_connections);
void connpointline_destroy(ConnPointLine *cpl);
void connpointline_update(ConnPointLine *cpl);
@@ -69,11 +53,11 @@ int connpointline_can_add_point(ConnPointLine *cpl,
int connpointline_can_remove_point(ConnPointLine *cpl,
Point *clicked);
-ObjectChange *connpointline_add_points(ConnPointLine *cpl,
- Point *clickedpoint,
+ObjectChange *connpointline_add_points(ConnPointLine *cpl,
+ Point *clickedpoint,
int count);
-ObjectChange *connpointline_remove_points(ConnPointLine *cpl,
- Point *clickedpoint,
+ObjectChange *connpointline_remove_points(ConnPointLine *cpl,
+ Point *clickedpoint,
int count);
ConnPointLine *connpointline_load(DiaObject *obj,ObjectNode obj_node,
const gchar *name, int default_nc,
diff --git a/lib/dia-handle.c b/lib/dia-handle.c
new file mode 100644
index 00000000..21ed33b1
--- /dev/null
+++ b/lib/dia-handle.c
@@ -0,0 +1,48 @@
+/* Dia -- an diagram creation/manipulation program
+ * Copyright (C) 1998 Alexander Larsson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * Copyright © 2020 Zander Brown <zbrown gnome org>
+ */
+
+#include "config.h"
+
+#include "handle.h"
+
+
+/**
+ * dia_handle_set_position:
+ * @self: the #Handle to move
+ * @point: the new position of @self
+ *
+ * Move a handle to a #graphene_point_t
+ *
+ * Stability: Stable
+ *
+ * Since: 0.98
+ */
+void
+dia_handle_set_position (Handle *self,
+ graphene_point_t *point)
+{
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (point != NULL);
+
+ self->pos.x = point->x;
+ self->pos.y = point->y;
+}
diff --git a/lib/diaarrowchooser.c b/lib/diaarrowchooser.c
index 340fd71b..2a7f8493 100644
--- a/lib/diaarrowchooser.c
+++ b/lib/diaarrowchooser.c
@@ -19,9 +19,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/** \file diaarrowchooser.c A widget to choose arrowhead. This only select arrowhead, not width and
height.
- * \ingroup diawidgets
- */
#include <config.h>
#include <gtk/gtk.h>
@@ -30,38 +27,45 @@
#include "diaarrowchooser.h"
#include "renderer/diacairo.h"
+/**
+ * SECTION:diaarrowchooser
+ *
+ * A widget to choose arrowhead. This only select arrowhead, not width and height.
+ */
+
static const char *button_menu_key = "dia-button-menu";
static const char *menuitem_enum_key = "dia-menuitem-value";
-static const gchar*
-_dia_translate (const gchar* term, gpointer data)
+static const char *
+_dia_translate (const char *term, gpointer data)
{
- const gchar* trans = term;
+ const char *trans = term;
if (term && *term) {
/* first try our own ... */
trans = dgettext (GETTEXT_PACKAGE, term);
/* ... than gtk */
- if (term == trans)
+ if (term == trans) {
trans = dgettext ("gtk20", term);
+ }
}
+
return trans;
}
/* --------------- DiaArrowPreview -------------------------------- */
-static void dia_arrow_preview_set(DiaArrowPreview *arrow,
- ArrowType atype, gboolean left);
+static void dia_arrow_preview_set (DiaArrowPreview *arrow,
+ ArrowType atype,
+ gboolean left);
static void dia_arrow_preview_class_init (DiaArrowPreviewClass *klass);
static void dia_arrow_preview_init (DiaArrowPreview *arrow);
-static gint dia_arrow_preview_expose (GtkWidget *widget,
- GdkEventExpose *event);
+static int dia_arrow_preview_expose (GtkWidget *widget,
+ GdkEventExpose *event);
+
-/** Get the class information for the arrow preview widget.
- * @return A type object (statically allocated) for the arrow preview object.
- */
GType
-dia_arrow_preview_get_type(void)
+dia_arrow_preview_get_type (void)
{
static GType type = 0;
@@ -78,17 +82,15 @@ dia_arrow_preview_get_type(void)
(GInstanceInitFunc) dia_arrow_preview_init
};
- type = g_type_register_static(GTK_TYPE_MISC, "DiaArrowPreview", &info, 0);
+ type = g_type_register_static (GTK_TYPE_MISC, "DiaArrowPreview", &info, 0);
}
return type;
}
-/** Initialize class information for the arrow preview class.
- * @param class The class object to initialize/
- */
+
static void
-dia_arrow_preview_class_init(DiaArrowPreviewClass *class)
+dia_arrow_preview_class_init (DiaArrowPreviewClass *class)
{
GtkWidgetClass *widget_class;
@@ -96,11 +98,9 @@ dia_arrow_preview_class_init(DiaArrowPreviewClass *class)
widget_class->expose_event = dia_arrow_preview_expose;
}
-/** Initialize an arrow preview widget.
- * @param arrow The widget to initialize.
- */
+
static void
-dia_arrow_preview_init(DiaArrowPreview *arrow)
+dia_arrow_preview_init (DiaArrowPreview *arrow)
{
int xpad, ypad;
@@ -116,55 +116,76 @@ dia_arrow_preview_init(DiaArrowPreview *arrow)
arrow->left = TRUE;
}
-/** Create a new arrow preview widget.
- * @param atype The type of arrow to start out selected with.
- * @param left If TRUE, this preview will point to the left.
- * @return A new widget.
+
+/**
+ * dia_arrow_preview_new:
+ * @atype: The type of arrow to start out selected with.
+ * @left: If %TRUE, this preview will point to the left.
+ *
+ * Create a new arrow preview widget.
+ *
+ * Returns: A new widget.
*/
GtkWidget *
-dia_arrow_preview_new(ArrowType atype, gboolean left)
+dia_arrow_preview_new (ArrowType atype, gboolean left)
{
- DiaArrowPreview *arrow = g_object_new(DIA_TYPE_ARROW_PREVIEW, NULL);
+ DiaArrowPreview *arrow = g_object_new (DIA_TYPE_ARROW_PREVIEW, NULL);
arrow->atype = atype;
arrow->left = left;
- return GTK_WIDGET(arrow);
+
+ return GTK_WIDGET (arrow);
}
-/** Set the values shown by an arrow preview widget.
- * @param arrow Preview widget to change.
- * @param atype New arrow type to use.
- * @param left If TRUE, the preview should point to the left.
+
+/**
+ * dia_arrow_preview_set:
+ * @arrow: Preview widget to change.
+ * @atype: New arrow type to use.
+ * @left: If %TRUE, the preview should point to the left.
+ *
+ * Set the values shown by an arrow preview widget.
+ *
+ * Since: dawn-of-time
*/
static void
-dia_arrow_preview_set(DiaArrowPreview *arrow, ArrowType atype, gboolean left)
+dia_arrow_preview_set (DiaArrowPreview *arrow, ArrowType atype, gboolean left)
{
if (arrow->atype != atype || arrow->left != left) {
arrow->atype = atype;
arrow->left = left;
- if (gtk_widget_is_drawable(GTK_WIDGET(arrow)))
- gtk_widget_queue_draw(GTK_WIDGET(arrow));
+ if (gtk_widget_is_drawable (GTK_WIDGET (arrow))) {
+ gtk_widget_queue_draw (GTK_WIDGET (arrow));
+ }
}
}
-/** Expose handle for the arrow preview widget.
- * @param widget The widget to display.
- * @param event The event that caused the call.
- * @return TRUE always.
+
+/**
+ * dia_arrow_preview_expose:
+ * @widget: The widget to display.
+ * @event: The event that caused the call.
+ *
+ * Expose handle for the arrow preview widget.
+ *
* The expose handler gets called when the Arrow needs to be drawn.
+ *
+ * Returns: %TRUE always.
+ *
+ * Since: dawn-of-time
*/
-static gint
-dia_arrow_preview_expose(GtkWidget *widget, GdkEventExpose *event)
+static int
+dia_arrow_preview_expose (GtkWidget *widget, GdkEventExpose *event)
{
- if (gtk_widget_is_drawable(widget)) {
+ if (gtk_widget_is_drawable (widget)) {
Point from, to;
Point move_arrow, move_line, arrow_head;
DiaCairoRenderer *renderer;
DiaArrowPreview *arrow = DIA_ARROW_PREVIEW(widget);
Arrow arrow_type;
GtkMisc *misc = GTK_MISC (widget);
- gint width, height;
- gint x, y;
+ int width, height;
+ int x, y;
GdkWindow *win;
int linewidth = 2;
cairo_surface_t *surface;
@@ -195,8 +216,8 @@ dia_arrow_preview_expose(GtkWidget *widget, GdkEventExpose *event)
* variable
*/
arrow_type.type = arrow->atype;
- arrow_type.length = .75*((real)height-linewidth);
- arrow_type.width = .75*((real)height-linewidth);
+ arrow_type.length = .75 * ((double) height-linewidth);
+ arrow_type.width = .75 * ((double) height-linewidth);
/* and here we calculate new arrow start and end of line points */
calculate_arrow_point(&arrow_type, &from, &to,
@@ -247,9 +268,7 @@ dia_arrow_preview_expose(GtkWidget *widget, GdkEventExpose *event)
static void dia_arrow_chooser_class_init (DiaArrowChooserClass *klass);
static void dia_arrow_chooser_init (DiaArrowChooser *arrow);
-/** Get the class info for the arrow chooser.
- * @return GType structure filled in for arrow chooser (statically allocated).
- */
+
GType
dia_arrow_chooser_get_type(void)
{
@@ -268,48 +287,52 @@ dia_arrow_chooser_get_type(void)
(GInstanceInitFunc) dia_arrow_chooser_init
};
- type = g_type_register_static(GTK_TYPE_BUTTON, "DiaArrowChooser", &info, 0);
+ type = g_type_register_static (GTK_TYPE_BUTTON, "DiaArrowChooser", &info, 0);
}
return type;
}
-/** Generic event handle for the arrow choose.
+
+/**
+ * dia_arrow_chooser_event:
+ * @widget: The arrow chooser widget.
+ * @event: An event affecting the arrow chooser.
+ *
+ * Generic event handle for the arrow choose.
+ *
* This just handles popping up the arrowhead menu when the button is clicked.
- * @param widget The arrow chooser widget.
- * @param event An event affecting the arrow chooser.
- * @return TRUE if we handled the event, FALSE otherwise.
+ *
+ * Returns: %TRUE if we handled the event, %FALSE otherwise.
+ *
+ * Since: 0.98
*/
-static gint
-dia_arrow_chooser_event(GtkWidget *widget, GdkEvent *event)
+static int
+dia_arrow_chooser_event (GtkWidget *widget, GdkEvent *event)
{
if (event->type == GDK_BUTTON_PRESS && event->button.button == 1) {
- GtkMenu *menu = g_object_get_data(G_OBJECT(widget), button_menu_key);
- gtk_menu_popup(menu, NULL, NULL, NULL, NULL,
- event->button.button, event->button.time);
+ GtkMenu *menu = g_object_get_data (G_OBJECT (widget), button_menu_key);
+ gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
+ event->button.button, event->button.time);
return TRUE;
}
return FALSE;
}
-/** Initialize class information for the arrow choose.
- * @param class Class structure to initialize private fields of.
- */
+
static void
dia_arrow_chooser_class_init(DiaArrowChooserClass *class)
{
GtkWidgetClass *widget_class;
- widget_class = GTK_WIDGET_CLASS(class);
+ widget_class = GTK_WIDGET_CLASS (class);
widget_class->event = dia_arrow_chooser_event;
}
-/** Initialize an arrow choose object.
- * @param arrow Newly allocated arrow choose object.
- */
+
static void
-dia_arrow_chooser_init(DiaArrowChooser *arrow)
+dia_arrow_chooser_init (DiaArrowChooser *arrow)
{
GtkWidget *wid;
@@ -318,45 +341,55 @@ dia_arrow_chooser_init(DiaArrowChooser *arrow)
arrow->arrow.length = DEFAULT_ARROW_LENGTH;
arrow->arrow.width = DEFAULT_ARROW_WIDTH;
- wid = dia_arrow_preview_new(ARROW_NONE, arrow->left);
- gtk_container_add(GTK_CONTAINER(arrow), wid);
- gtk_widget_show(wid);
- arrow->preview = DIA_ARROW_PREVIEW(wid);
+ wid = dia_arrow_preview_new (ARROW_NONE, arrow->left);
+ gtk_container_add(GTK_CONTAINER (arrow), wid);
+ gtk_widget_show (wid);
+ arrow->preview = DIA_ARROW_PREVIEW (wid);
arrow->dialog = NULL;
}
-/** Handle the "ressponse" event for the arrow chooser dialog.
- * @param dialog The dialog that got a response.
- * @param response_id The ID of the response (e.g. GTK_RESPONSE_OK)
- * @param chooser The arrowchooser widget (userdata)
+
+/**
+ * dia_arrow_chooser_dialog_response:
+ * @dialog: The dialog that got a response.
+ * @response_id: The ID of the response (e.g. %GTK_RESPONSE_OK)
+ * @chooser: The arrowchooser widget (userdata)
+ *
+ * Handle the "ressponse" event for the arrow chooser dialog.
*/
static void
-dia_arrow_chooser_dialog_response(GtkWidget *dialog,
- gint response_id,
- DiaArrowChooser *chooser)
+dia_arrow_chooser_dialog_response (GtkWidget *dialog,
+ int response_id,
+ DiaArrowChooser *chooser)
{
if (response_id == GTK_RESPONSE_OK) {
- Arrow new_arrow = dia_arrow_selector_get_arrow(chooser->selector);
+ Arrow new_arrow = dia_arrow_selector_get_arrow (chooser->selector);
if (new_arrow.type != chooser->arrow.type ||
new_arrow.length != chooser->arrow.length ||
new_arrow.width != chooser->arrow.width) {
chooser->arrow = new_arrow;
- dia_arrow_preview_set(chooser->preview, new_arrow.type, chooser->left);
- if (chooser->callback)
- (* chooser->callback)(chooser->arrow, chooser->user_data);
+ dia_arrow_preview_set (chooser->preview, new_arrow.type, chooser->left);
+ if (chooser->callback) {
+ (* chooser->callback) (chooser->arrow, chooser->user_data);
+ }
}
} else {
- dia_arrow_selector_set_arrow(chooser->selector, chooser->arrow);
+ dia_arrow_selector_set_arrow (chooser->selector, chooser->arrow);
}
- gtk_widget_hide(chooser->dialog);
+ gtk_widget_hide (chooser->dialog);
}
-/** Create a new arrow chooser dialog.
- * @param chooser The widget to attach a dialog to. The dialog will be placed
+/**
+ * dia_arrow_chooser_dialog_new:
+ * @chooser: The widget to attach a dialog to. The dialog will be placed
* in chooser->dialog.
+ *
+ * Create a new arrow chooser dialog.
+ *
+ * Since: 0.98
*/
static void
dia_arrow_chooser_dialog_new (DiaArrowChooser *chooser)
@@ -376,124 +409,174 @@ dia_arrow_chooser_dialog_new (DiaArrowChooser *chooser)
g_signal_connect (G_OBJECT (chooser->dialog), "destroy",
G_CALLBACK (gtk_widget_destroyed), &chooser->dialog);
- wid = dia_arrow_selector_new();
- gtk_container_set_border_width(GTK_CONTAINER(wid), 5);
- gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(chooser->dialog))), wid,
- TRUE, TRUE, 0);
- gtk_widget_show(wid);
- chooser->selector = DIA_ARROW_SELECTOR(wid);
+ wid = dia_arrow_selector_new ();
+ gtk_container_set_border_width (GTK_CONTAINER (wid), 5);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (chooser->dialog))),
+ wid,
+ TRUE,
+ TRUE,
+ 0);
+ gtk_widget_show (wid);
+ chooser->selector = DIA_ARROW_SELECTOR (wid);
}
-/** Display an arrow chooser dialog, creating one if necessary.
- * @param widget Ignored
- * @param chooser An arrowchooser widget to display in a dialog. This may
- * get the dialog field set as a sideeffect.
+
+/**
+ * dia_arrow_chooser_dialog_show:
+ * @widget: Ignored
+ * @chooser: An arrowchooser widget to display in a dialog. This may get the
+ * dialog field set as a sideeffect.
+ *
+ * Display an arrow chooser dialog, creating one if necessary.
+ *
+ * Since: dawn-of-time
*/
static void
-dia_arrow_chooser_dialog_show(GtkWidget *widget, DiaArrowChooser *chooser)
+dia_arrow_chooser_dialog_show (GtkWidget *widget, DiaArrowChooser *chooser)
{
if (chooser->dialog) {
- gtk_window_present(GTK_WINDOW(chooser->dialog));
+ gtk_window_present (GTK_WINDOW (chooser->dialog));
return;
}
- dia_arrow_chooser_dialog_new(chooser);
- dia_arrow_selector_set_arrow(chooser->selector, chooser->arrow);
- gtk_widget_show(chooser->dialog);
+ dia_arrow_chooser_dialog_new (chooser);
+ dia_arrow_selector_set_arrow (chooser->selector, chooser->arrow);
+ gtk_widget_show (chooser->dialog);
}
-/** Set a new arrow type for an arrow chooser, as selected from a menu.
- * @param mi The menu item currently selected in the arrow chooser menu.
- * @param chooser The arrow chooser to update.
+
+/**
+ * dia_arrow_chooser_change_arrow_type:
+ * @mi: The menu item currently selected in the arrow chooser menu.
+ * @chooser: The arrow chooser to update.
+ *
+ * Set a new arrow type for an arrow chooser, as selected from a menu.
+ *
+ * Since: dawn-of-time
*/
static void
-dia_arrow_chooser_change_arrow_type(GtkMenuItem *mi, DiaArrowChooser *chooser)
+dia_arrow_chooser_change_arrow_type (GtkMenuItem *mi,
+ DiaArrowChooser *chooser)
{
- ArrowType atype = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(mi),
- menuitem_enum_key));
+ ArrowType atype = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (mi),
+ menuitem_enum_key));
Arrow arrow;
arrow.width = chooser->arrow.width;
arrow.length = chooser->arrow.length;
arrow.type = atype;
- dia_arrow_chooser_set_arrow(chooser, &arrow);
+ dia_arrow_chooser_set_arrow (chooser, &arrow);
}
-/** Create a new arrow chooser object.
- * @param left If TRUE, this chooser will point its arrowheads to the left.
- * @param callback void (*callback)(Arrow *arrow, gpointer user_data) which
+
+/**
+ * dia_arrow_chooser_new:
+ * @left: If %TRUE, this chooser will point its arrowheads to the left.
+ * @callback: void (*callback)(Arrow *arrow, gpointer user_data) which
* will be called when the arrow type or dimensions change.
- * @param user_data Any user data. This will be stored in chooser->user_data.
- * @return A new DiaArrowChooser widget.
+ * @user_data: Any user data. This will be stored in chooser->user_data.
+ *
+ * Create a new arrow chooser object.
+ *
+ * Returns: A new DiaArrowChooser widget.
+ *
+ * Since: dawn-of-time
*/
GtkWidget *
-dia_arrow_chooser_new(gboolean left, DiaChangeArrowCallback callback,
- gpointer user_data)
+dia_arrow_chooser_new (gboolean left,
+ DiaChangeArrowCallback callback,
+ gpointer user_data)
{
DiaArrowChooser *chooser = g_object_new(DIA_TYPE_ARROW_CHOOSER, NULL);
GtkWidget *menu, *mi, *ar;
- gint i;
+ int i;
chooser->left = left;
- dia_arrow_preview_set(chooser->preview, chooser->preview->atype, left);
+ dia_arrow_preview_set (chooser->preview, chooser->preview->atype, left);
chooser->callback = callback;
chooser->user_data = user_data;
- menu = gtk_menu_new();
- g_object_ref_sink(menu);
- g_object_set_data_full(G_OBJECT(chooser), button_menu_key, menu,
- (GDestroyNotify)g_object_unref);
+ menu = gtk_menu_new ();
+ g_object_ref_sink (menu);
+ g_object_set_data_full (G_OBJECT (chooser),
+ button_menu_key,
+ menu,
+ (GDestroyNotify) g_object_unref);
+
/* although from ARROW_NONE to MAX_ARROW_TYPE-1 this is sorted by *index* to keep the order consistent
with earlier releases */
for (i = ARROW_NONE; i < MAX_ARROW_TYPE; ++i) {
- ArrowType arrow_type = arrow_type_from_index(i);
- mi = gtk_menu_item_new();
- g_object_set_data(G_OBJECT(mi), menuitem_enum_key,
- GINT_TO_POINTER(arrow_type));
- gtk_widget_set_tooltip_text(mi, _dia_translate(arrow_get_name_from_type(arrow_type), NULL));
- ar = dia_arrow_preview_new(arrow_type, left);
-
- gtk_container_add(GTK_CONTAINER(mi), ar);
- gtk_widget_show(ar);
- g_signal_connect(G_OBJECT(mi), "activate",
- G_CALLBACK(dia_arrow_chooser_change_arrow_type), chooser);
+ ArrowType arrow_type = arrow_type_from_index (i);
+ mi = gtk_menu_item_new ();
+ g_object_set_data (G_OBJECT (mi),
+ menuitem_enum_key,
+ GINT_TO_POINTER (arrow_type));
+ gtk_widget_set_tooltip_text (mi,
+ _dia_translate (arrow_get_name_from_type (arrow_type),
+ NULL));
+ ar = dia_arrow_preview_new (arrow_type, left);
+
+ gtk_container_add (GTK_CONTAINER (mi), ar);
+ gtk_widget_show (ar);
+ g_signal_connect (G_OBJECT (mi),
+ "activate",
+ G_CALLBACK (dia_arrow_chooser_change_arrow_type),
+ chooser);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
- gtk_widget_show(mi);
+ gtk_widget_show (mi);
}
- mi = gtk_menu_item_new_with_label(_dia_translate("Details…", NULL));
- g_signal_connect(G_OBJECT(mi), "activate",
- G_CALLBACK(dia_arrow_chooser_dialog_show), chooser);
+
+ mi = gtk_menu_item_new_with_label (_dia_translate ("Details…", NULL));
+ g_signal_connect (G_OBJECT (mi),
+ "activate",
+ G_CALLBACK (dia_arrow_chooser_dialog_show),
+ chooser);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
- gtk_widget_show(mi);
+ gtk_widget_show (mi);
- return GTK_WIDGET(chooser);
+ return GTK_WIDGET (chooser);
}
-/** Set the type of arrow shown by the arrow chooser. If the arrow type
- * changes, the callback function will be called.
- * @param chooser The chooser to update.
- * @param arrow The arrow type and dimensions the chooser will dispaly.
+
+/**
+ * dia_arrow_chooser_set_arrow:
+ * @chooser: The chooser to update.
+ * @arrow: The arrow type and dimensions the chooser will dispaly.
* Should it be called as well when the dimensions change?
+ *
+ * Set the type of arrow shown by the arrow chooser. If the arrow type
+ * changes, the callback function will be called.
+ *
+ * Since: dawn-of-time
*/
void
-dia_arrow_chooser_set_arrow(DiaArrowChooser *chooser, Arrow *arrow)
+dia_arrow_chooser_set_arrow (DiaArrowChooser *chooser, Arrow *arrow)
{
if (chooser->arrow.type != arrow->type) {
- dia_arrow_preview_set(chooser->preview, arrow->type, chooser->left);
+ dia_arrow_preview_set (chooser->preview, arrow->type, chooser->left);
chooser->arrow.type = arrow->type;
- if (chooser->dialog != NULL)
- dia_arrow_selector_set_arrow(chooser->selector, chooser->arrow);
- if (chooser->callback)
- (* chooser->callback)(chooser->arrow, chooser->user_data);
+ if (chooser->dialog != NULL) {
+ dia_arrow_selector_set_arrow (chooser->selector, chooser->arrow);
+ }
+ if (chooser->callback) {
+ (* chooser->callback) (chooser->arrow, chooser->user_data);
+ }
}
chooser->arrow.width = arrow->width;
chooser->arrow.length = arrow->length;
}
-/** Get the currently selected arrow type from an arrow chooser.
- * @param arrow An arrow chooser to query.
- * @return The arrow type that is currently selected in the chooser.
+
+/**
+ * dia_arrow_chooser_get_arrow_type:
+ * @arrow: An arrow chooser to query.
+ *
+ * Get the currently selected arrow type from an arrow chooser.
+ *
+ * Returns: The arrow type that is currently selected in the chooser.
+ *
+ * Since: dawn-of-time
*/
ArrowType
-dia_arrow_chooser_get_arrow_type(DiaArrowChooser *arrow)
+dia_arrow_chooser_get_arrow_type (DiaArrowChooser *arrow)
{
return arrow->arrow.type;
}
diff --git a/lib/diafontselector.c b/lib/diafontselector.c
index c5ecd6bb..9bf68d38 100644
--- a/lib/diafontselector.c
+++ b/lib/diafontselector.c
@@ -207,7 +207,7 @@ set_styles (DiaFontSelector *fs,
PangoFontDescription *pfd = pango_font_face_describe (faces[i]);
PangoStyle style = pango_font_description_get_style (pfd);
PangoWeight weight = pango_font_description_get_weight (pfd);
- /**
+ /*
* This is a quick and dirty way to pick the styles present,
* sort them and avoid duplicates.
* We set a bit for each style present, bit (weight*3+style)
@@ -234,7 +234,7 @@ set_styles (DiaFontSelector *fs,
for (i = DIA_FONT_NORMAL; i <= (DIA_FONT_HEAVY | DIA_FONT_ITALIC); i+=4) {
GtkTreeIter iter;
- /**
+ /*
* bad hack continued ...
*/
int weight = DIA_FONT_STYLE_GET_WEIGHT (i) >> 4;
diff --git a/lib/diagramdata.c b/lib/diagramdata.c
index e02e4543..9965898e 100644
--- a/lib/diagramdata.c
+++ b/lib/diagramdata.c
@@ -17,7 +17,7 @@
*/
/**
- * SECTION:diagramdata:
+ * SECTION:diagramdata
*
* This file defines the #DiagramData object, which holds (mostly) saveable
* data global to a diagram.
diff --git a/lib/focus.c b/lib/focus.c
index 7cc450e3..e3a3b01d 100644
--- a/lib/focus.c
+++ b/lib/focus.c
@@ -17,7 +17,7 @@
*/
/**
- * SECTION:focus:
+ * SECTION:focus
*
* This files handles which text elements are currently eligible to get
* the input focus, and moving back and forth between them. Objects can
diff --git a/lib/handle.h b/lib/handle.h
index f6d73fa5..9b50768d 100644
--- a/lib/handle.h
+++ b/lib/handle.h
@@ -16,34 +16,51 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/*!
- * \file handle.h - describing the different behavious of handles, used e.g. to resize objects
- * \ingroup ObjectConnects
- */
-#ifndef HANDLE_H
-#define HANDLE_H
+#pragma once
+
+#include <graphene.h>
#include "diatypes.h"
#include "geometry.h"
-/*!
- * \brief Some object resizing depends on the placement of the handle
- * \ingroup ObjectConnects
+
+/**
+ * HandleId:
+ * @HANDLE_RESIZE_NW: North/west or top/left
+ * @HANDLE_RESIZE_N: North or top
+ * @HANDLE_RESIZE_NE: North/east or top/right
+ * @HANDLE_RESIZE_W: West or left
+ * @HANDLE_RESIZE_E: East or right
+ * @HANDLE_RESIZE_SW: South/west or bottom/left
+ * @HANDLE_RESIZE_S: South or bottom
+ * @HANDLE_RESIZE_SE: South/east or bottom/right
+ * @HANDLE_MOVE_STARTPOINT: For lines: the beginning
+ * @HANDLE_MOVE_ENDPOINT: For lines: the ending
+ * @HANDLE_CUSTOM1: For custom use by objects
+ * @HANDLE_CUSTOM2: For custom use by objects
+ * @HANDLE_CUSTOM3: For custom use by objects
+ * @HANDLE_CUSTOM4: For custom use by objects
+ * @HANDLE_CUSTOM5: For custom use by objects
+ * @HANDLE_CUSTOM6: For custom use by objects
+ * @HANDLE_CUSTOM7: For custom use by objects
+ * @HANDLE_CUSTOM8: For custom use by objects
+ * @HANDLE_CUSTOM9: For custom use by objects
+ *
+ * Some object resizing depends on the placement of the handle
*/
typedef enum {
- HANDLE_RESIZE_NW, /*!< north/west or top/left */
- HANDLE_RESIZE_N, /*!< north or top */
- HANDLE_RESIZE_NE, /*!< north/east or top/right */
- HANDLE_RESIZE_W, /*!< west or left */
- HANDLE_RESIZE_E, /*!< east or right */
- HANDLE_RESIZE_SW, /*!< south/west or bottom/left */
- HANDLE_RESIZE_S, /*!< south or bottom */
- HANDLE_RESIZE_SE, /*!< south/east or bottom/right */
- HANDLE_MOVE_STARTPOINT, /*!< for lines: the beginning */
- HANDLE_MOVE_ENDPOINT, /*!< for lines: the ending */
-
- /*! These handles can be used privately by objects: */
- HANDLE_CUSTOM1=200,
+ HANDLE_RESIZE_NW,
+ HANDLE_RESIZE_N,
+ HANDLE_RESIZE_NE,
+ HANDLE_RESIZE_W,
+ HANDLE_RESIZE_E,
+ HANDLE_RESIZE_SW,
+ HANDLE_RESIZE_S,
+ HANDLE_RESIZE_SE,
+ HANDLE_MOVE_STARTPOINT,
+ HANDLE_MOVE_ENDPOINT,
+
+ HANDLE_CUSTOM1 = 200,
HANDLE_CUSTOM2,
HANDLE_CUSTOM3,
HANDLE_CUSTOM4,
@@ -51,55 +68,79 @@ typedef enum {
HANDLE_CUSTOM6,
HANDLE_CUSTOM7,
HANDLE_CUSTOM8,
- HANDLE_CUSTOM9
+ HANDLE_CUSTOM9,
} HandleId;
-/*!
- * \brief HandleType is used for color coding the different handles
- * \ingroup ObjectConnects
+
+/**
+ * HandleType:
+ * @HANDLE_NON_MOVABLE: ???
+ * @HANDLE_MAJOR_CONTROL: ???
+ * @HANDLE_MINOR_CONTROL: ???
+ * @NUM_HANDLE_TYPES: Must be last
+ *
+ * HandleType is used for color coding the different handles
*/
typedef enum {
HANDLE_NON_MOVABLE,
HANDLE_MAJOR_CONTROL,
HANDLE_MINOR_CONTROL,
+ NUM_HANDLE_TYPES,
+} HandleType;
- NUM_HANDLE_TYPES /* Must be last */
-} HandleType;
-/*!
- * \brief When an objects move_handle() function is called this is passed in
- * \ingroup ObjectConnects
+/**
+ * HandleMoveReason:
+ * @HANDLE_MOVE_USER: ???
+ * @HANDLE_MOVE_USER_FINAL: ???
+ * @HANDLE_MOVE_CONNECTED: ???
+ * @HANDLE_MOVE_CREATE: The initial drag during object placement
+ * @HANDLE_MOVE_CREATE_FINAL: Finish of initial drag
+ *
+ * When an objects dia_object_move_handle() function is called this is passed in
*/
typedef enum {
HANDLE_MOVE_USER,
HANDLE_MOVE_USER_FINAL,
HANDLE_MOVE_CONNECTED,
- HANDLE_MOVE_CREATE, /*!< the initial drag during object placement */
- HANDLE_MOVE_CREATE_FINAL /*!< finish of initial drag */
+ HANDLE_MOVE_CREATE,
+ HANDLE_MOVE_CREATE_FINAL,
} HandleMoveReason;
-/*!
- * \brief If the handle is connectable or not
- * \ingroup ObjectConnects
+
+/**
+ * HandleConnectType:
+ * @HANDLE_NONCONNECTABLE: Not connectable
+ * @HANDLE_CONNECTABLE: Connectable
+ * @HANDLE_CONNECTABLE_NOBREAK: (unused) Don't break connection on object move
+ *
+ * If the handle is connectable or not
*/
typedef enum {
- HANDLE_NONCONNECTABLE, /*!< not connectable */
- HANDLE_CONNECTABLE, /*!< connectable */
- HANDLE_CONNECTABLE_NOBREAK /*!< (unused) Don't break connection on object move */
+ HANDLE_NONCONNECTABLE,
+ HANDLE_CONNECTABLE,
+ HANDLE_CONNECTABLE_NOBREAK,
} HandleConnectType;
-/*!
- * \brief A handle is used to resize objects or to connet to them.
- * \ingroup ObjectConnects
+
+/**
+ * Handle:
+ * @id: Gives (mostly) the placement relative to the object
+ * @type: Colour coding
+ * @pos: Where the handle currently is in diagram coordinates
+ * @connect_type: How to connect if at all
+ * @connected_to: %NULL if not connected
+ *
+ * A handle is used to resize objects or to connet to them.
*/
struct _Handle {
- HandleId id; /*!< gives (mostly) the placement relative to the object */
- HandleType type; /*!< color coding */
- Point pos; /*! where the handle currently is in diagram coordinates */
-
- HandleConnectType connect_type; /*!< how to connect if at all */
- ConnectionPoint *connected_to; /*!< NULL if not connected */
+ HandleId id;
+ HandleType type;
+ Point pos;
+ HandleConnectType connect_type;
+ ConnectionPoint *connected_to;
};
-
-#endif /* HANDLE_H */
+
+void dia_handle_set_position (Handle *self,
+ graphene_point_t *point);
diff --git a/lib/meson.build b/lib/meson.build
index a9c40d36..66148aae 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -161,6 +161,8 @@ libdia_sources = stdprop_sources + [
'dia-simple-list.h',
'dia-autoptr.h',
'dia-graphene.h',
+ 'dia-handle.c',
+ 'handle.h',
]
gnome = import('gnome')
diff --git a/lib/object_defaults.c b/lib/object_defaults.c
index a98de2b3..7a6197e5 100644
--- a/lib/object_defaults.c
+++ b/lib/object_defaults.c
@@ -243,9 +243,9 @@ pdtpp_standard_or_defaults (const PropDescription *pdesc)
* dia_object_default_create:
* @type: The objects type
* @startpoint: The left upper corner
- * @user_data:
- * @handle1:
- * @handle2:
+ * @user_data: ???
+ * @handle1: ???
+ * @handle2: ???
*
* Create an object respecting defaults if available
*
diff --git a/lib/paper.c b/lib/paper.c
index 86cfdd5c..b4bf2480 100644
--- a/lib/paper.c
+++ b/lib/paper.c
@@ -24,6 +24,28 @@
#include "paper.h"
#include "diagramdata.h" /* for NewDiagramData */
+
+/**
+ * PaperInfo:
+ * @name: name of the paper
+ * @tmargin: margin widths in %DIA_UNIT_CENTIMETER
+ * @bmargin: "
+ * @lmargin: "
+ * @rmargin: "
+ * @is_portrait: page is in portrait orientation?
+ * @scaling: scaling factor for image on page
+ * @fitto: if we want to use the fitto mode for scaling
+ * @fitwidth: how many pages in each direction
+ * @fitheight: "
+ * @width: usable width/height -- calculated from paper type,
+ * margin widths and paper orientation; the real paper
+ * size is width*scaling, height*scaling
+ * @height: "
+ *
+ * Since: dawn-of-time
+ */
+
+
/* Paper definitions stolen from gnome-libs.
* All measurements are in centimetres. */
diff --git a/lib/paper.h b/lib/paper.h
index 5f141090..7ed87018 100644
--- a/lib/paper.h
+++ b/lib/paper.h
@@ -22,25 +22,9 @@
#include <diatypes.h>
-/**
- * PaperInfo:
- * @name: name of the paper
- * @tmargin: margin widths in %DIA_UNIT_CENTIMETER
- * @bmargin: "
- * @lmargin: "
- * @rmargin: "
- * @is_portrait: page is in portrait orientation?
- * @scaling: scaling factor for image on page
- * @fitto: if we want to use the fitto mode for scaling
- * @fitwidth: how many pages in each direction
- * @fitheight: "
- * @width: usable width/height -- calculated from paper type,
- * margin widths and paper orientation; the real paper
- * size is width*scaling, height*scaling
- * @height: "
- *
- * Since: dawn-of-time
- */
+G_BEGIN_DECLS
+
+
struct _PaperInfo {
char *name;
double tmargin;
@@ -70,3 +54,5 @@ double get_paper_lmargin (int i);
double get_paper_rmargin (int i);
double get_paper_bmargin (int i);
double get_paper_tmargin (int i);
+
+G_END_DECLS
diff --git a/lib/persistence.c b/lib/persistence.c
index fe60a1ad..61464bf6 100644
--- a/lib/persistence.c
+++ b/lib/persistence.c
@@ -238,8 +238,8 @@ static GHashTable *type_handlers;
/**
* persistence_load_type:
- * @node:
- * @ctx:
+ * @node: #xmlNodePtr to read from
+ * @ctx: current #DiaContext
*
* Load the named type of entries using the given function.
* func is a void (*func)(gchar *role, xmlNodePtr *node, DiaContext *ctx)
diff --git a/lib/prop_pixbuf.c b/lib/prop_pixbuf.c
index 301c58fa..ee8fd1d8 100644
--- a/lib/prop_pixbuf.c
+++ b/lib/prop_pixbuf.c
@@ -64,11 +64,15 @@ pixbufprop_copy(PixbufProperty *src)
return prop;
}
-/** Convert Base64 to pixbuf
- * @param b64 Base64 encoded data
+
+/**
+ * pixbuf_decode_base64:
+ * @b64: Base64 encoded data
+ *
+ * Convert Base64 to pixbuf
*/
GdkPixbuf *
-pixbuf_decode_base64 (const gchar *b64)
+pixbuf_decode_base64 (const char *b64)
{
/* see lib/prop_pixbuf.c(data_pixbuf) for a very similar implementation */
GdkPixbuf *pixbuf = NULL;
@@ -77,11 +81,11 @@ pixbuf_decode_base64 (const gchar *b64)
loader = gdk_pixbuf_loader_new ();
if (loader) {
- gint state = 0;
+ int state = 0;
guint save = 0;
# define BUF_SIZE 4096
guchar buf[BUF_SIZE];
- gchar *in = (gchar *)b64; /* direct access, not involving another xmlStrDup/xmlFree */
+ char *in = (gchar *)b64; /* direct access, not involving another xmlStrDup/xmlFree */
gssize len = strlen (b64);
do {
@@ -97,8 +101,8 @@ pixbuf_decode_base64 (const gchar *b64)
if (gdk_pixbuf_loader_close (loader, error ? NULL : &error)) {
GdkPixbufFormat *format = gdk_pixbuf_loader_get_format (loader);
- gchar *format_name = gdk_pixbuf_format_get_name (format);
- gchar **mime_types = gdk_pixbuf_format_get_mime_types (format);
+ char *format_name = gdk_pixbuf_format_get_name (format);
+ char **mime_types = gdk_pixbuf_format_get_mime_types (format);
dia_log_message ("Loaded pixbuf from '%s' with '%s'", format_name, mime_types[0]);
pixbuf = g_object_ref (gdk_pixbuf_loader_get_pixbuf (loader));
@@ -119,6 +123,7 @@ pixbuf_decode_base64 (const gchar *b64)
# undef BUF_SIZE
}
+
GdkPixbuf *
data_pixbuf (DataNode data, DiaContext *ctx)
{
@@ -199,19 +204,26 @@ _pixbuf_encode (const gchar *buf,
return TRUE;
}
-static const gchar *
+
+static const char *
_make_pixbuf_type_name (const char *p)
{
- if (p && strstr (p, "image/jpeg"))
+ if (p && strstr (p, "image/jpeg")) {
return "jpeg";
- if (p && strstr (p, "image/jp2"))
+ }
+ if (p && strstr (p, "image/jp2")) {
return "jpeg2000";
+ }
return "png";
}
-/** Reusable variant of pixbuf to base64 string conversion
+
+/**
+ * pixbuf_encode_base64:
+ *
+ * Reusable variant of pixbuf to base64 string conversion
*/
-gchar *
+char *
pixbuf_encode_base64 (const GdkPixbuf *pixbuf, const char *prefix)
{
GError *error = NULL;
diff --git a/lib/prop_sdarray_widget.c b/lib/prop_sdarray_widget.c
index a1ba443d..12df0b01 100644
--- a/lib/prop_sdarray_widget.c
+++ b/lib/prop_sdarray_widget.c
@@ -231,8 +231,14 @@ _find_type (const Property *prop)
return -1;
}
+
/**
- * Create an empty model (list store) with Dia types mapped to GType
+ * create_sdarray_model:
+ * @prop: the #ArrayProperty to model
+ *
+ * Create an empty model (list store) with Dia types mapped to #GType
+ *
+ * Since: dawn-of-time
*/
static GtkTreeStore *
create_sdarray_model (ArrayProperty *prop)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]