[dia] general: various cleanups
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] general: various cleanups
- Date: Thu, 23 Apr 2020 11:45:27 +0000 (UTC)
commit 6333e6fed2cc9c77886a72db9e8a96d455bc7a4c
Author: Zander Brown <zbrown gnome org>
Date: Wed Apr 22 10:48:07 2020 +0100
general: various cleanups
- Fix various gtk-doc annotations
- Some whitespace cleanups
app/app_procs.c | 4 +-
app/commands.c | 9 +-
app/filedlg.c | 29 +--
app/recent_files.c | 8 +-
app/sheet-editor/sheets_dialog_callbacks.c | 6 +-
lib/arrows.h | 2 +-
lib/attributes.c | 286 ++++++++++++++++++++---------
lib/attributes.h | 44 +++--
lib/connectionpoint.c | 2 +-
lib/create.c | 2 +-
lib/diainteractiverenderer.c | 2 +-
lib/dialib.c | 3 +-
lib/dialib.h | 4 +-
lib/element.c | 49 +++--
lib/focus.c | 134 ++++++++++----
lib/font.c | 56 ++++--
lib/message.c | 93 ++++++----
lib/object.c | 181 ++++++++++--------
lib/widgets.c | 7 +-
19 files changed, 601 insertions(+), 320 deletions(-)
---
diff --git a/app/app_procs.c b/app/app_procs.c
index 11c8f64a..8ff07620 100644
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -336,11 +336,11 @@ do_convert (const char *infname,
/* Apply --show-layers */
if (show_layers) {
- handle_show_layers(diagdata, show_layers);
+ handle_show_layers (diagdata, show_layers);
}
/* recalculate before export */
- data_update_extents (diagdata);
+ data_update_extents (diagdata);
/* Do our best in providing the size to the filter, but don't abuse user_data
* too much for it. It _must not_ be changed after initialization and there
diff --git a/app/commands.c b/app/commands.c
index 7c6e33f4..cac69822 100644
--- a/app/commands.c
+++ b/app/commands.c
@@ -1112,12 +1112,13 @@ activate_url (GtkWidget *parent,
#endif
}
+
void
help_about_callback (GtkAction *action)
{
- const gchar *translators = _("translator_credits-PLEASE_ADD_YOURSELF_HERE");
+ const char *translators = _("translator_credits-PLEASE_ADD_YOURSELF_HERE");
// TODO: Gtk3 has license-type
- const gchar *license = _(
+ const char *license = _(
"This program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n"
"the Free Software Foundation; either version 2 of the License, or\n"
@@ -1136,11 +1137,11 @@ help_about_callback (GtkAction *action)
gtk_show_about_dialog (NULL,
"logo", logo,
- "program-name", "Dia",
+ "program-name", _("Dia Diagram Editor"),
"version", VERSION,
"comments", _("A program for drawing structured diagrams."),
"copyright", "(C) 1998-2011 The Free Software Foundation and the authors\n"
- "© 2018-2020 Zander Brown et al\n",
+ "© 2018-2021 Zander Brown et al\n",
"website", "https://wiki.gnome.org/Apps/Dia/",
"authors", authors,
"documenters", documentors,
diff --git a/app/filedlg.c b/app/filedlg.c
index fa2ad4a8..fca3caf0 100644
--- a/app/filedlg.c
+++ b/app/filedlg.c
@@ -288,12 +288,14 @@ file_open_callback(GtkAction *action)
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER(opendlg), FALSE);
gtk_dialog_set_default_response(GTK_DIALOG(opendlg), GTK_RESPONSE_ACCEPT);
gtk_window_set_role(GTK_WINDOW(opendlg), "open_diagram");
- if (dia && dia->filename)
- filename = g_filename_from_utf8(dia->filename, -1, NULL, NULL, NULL);
+ if (dia && dia->filename) {
+ filename = g_filename_from_utf8 (dia->filename, -1, NULL, NULL, NULL);
+ }
if (filename != NULL) {
- char* fnabs = dia_get_absolute_filename (filename);
- if (fnabs)
- gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(opendlg), fnabs);
+ char *fnabs = g_canonicalize_filename (filename, NULL);
+ if (fnabs) {
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (opendlg), fnabs);
+ }
g_clear_pointer (&fnabs, g_free);
g_clear_pointer (&filename, g_free);
}
@@ -528,16 +530,19 @@ file_save_as_dialog_prepare (Diagram *dia, DDisplay *ddisp)
return savedlg;
}
}
- if (dia && dia->filename)
- filename = g_filename_from_utf8(dia->filename, -1, NULL, NULL, NULL);
+
+ if (dia && dia->filename) {
+ filename = g_filename_from_utf8 (dia->filename, -1, NULL, NULL, NULL);
+ }
+
if (filename != NULL) {
- char* fnabs = dia_get_absolute_filename (filename);
+ char *fnabs = g_canonicalize_filename (filename, NULL);
if (fnabs) {
- gchar *base = g_path_get_basename(dia->filename);
- gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(savedlg), fnabs);
+ char *base = g_path_get_basename (dia->filename);
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (savedlg), fnabs);
/* FileChooser api insist on exiting files for set_filename */
/* ... and does not use filename encoding on this one. */
- gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(savedlg), base);
+ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (savedlg), base);
g_clear_pointer (&base, g_free);
}
g_clear_pointer (&fnabs, g_free);
@@ -836,7 +841,7 @@ file_export_callback(GtkAction *action)
}
if (filename != NULL) {
- char* fnabs = dia_get_absolute_filename (filename);
+ char* fnabs = g_canonicalize_filename (filename, NULL);
if (fnabs) {
char *folder = g_path_get_dirname (fnabs);
diff --git a/app/recent_files.c b/app/recent_files.c
index 8f366ce9..e90b3006 100644
--- a/app/recent_files.c
+++ b/app/recent_files.c
@@ -112,7 +112,7 @@ recent_file_history_make_menu (void)
void
recent_file_history_add (const char *fname)
{
- char *absname = dia_get_absolute_filename (fname);
+ char *absname = g_canonicalize_filename (fname, NULL);
char *filename = g_filename_to_utf8 (absname, -1, NULL, NULL, NULL);
recent_file_history_clear_menu ();
@@ -150,12 +150,12 @@ recent_file_history_init (void)
void
recent_file_history_remove (const char *fname)
{
- char *absname = dia_get_absolute_filename (fname);
+ char *absname = g_canonicalize_filename (fname, NULL);
char *filename = g_filename_to_utf8 (absname, -1, NULL, NULL, NULL);
- recent_file_history_clear_menu();
+ recent_file_history_clear_menu ();
- persistent_list_remove("recent-files", filename);
+ persistent_list_remove ("recent-files", filename);
g_clear_pointer (&absname, g_free);
g_clear_pointer (&filename, g_free);
diff --git a/app/sheet-editor/sheets_dialog_callbacks.c b/app/sheet-editor/sheets_dialog_callbacks.c
index 2791eeab..913276c8 100644
--- a/app/sheet-editor/sheets_dialog_callbacks.c
+++ b/app/sheet-editor/sheets_dialog_callbacks.c
@@ -1683,10 +1683,10 @@ write_user_sheet (Sheet *sheet)
xmlAddChild (object_node, xmlNewText ((const xmlChar *) "\n"));
icon_node = xmlNewChild (object_node, NULL, (const xmlChar *) "icon", NULL);
- canonical_icon = dia_get_canonical_path (sheetobject->pixmap_file);
+ canonical_icon = g_canonicalize_filename (sheetobject->pixmap_file, NULL);
icon = canonical_icon;
- canonical_user_sheets = dia_get_canonical_path (dir_user_sheets);
- canonical_sheets = dia_get_canonical_path (dia_get_data_directory ("sheets"));
+ canonical_user_sheets = g_canonicalize_filename (dir_user_sheets, NULL);
+ canonical_sheets = g_canonicalize_filename (dia_get_data_directory ("sheets"), NULL);
if (g_str_has_prefix (icon, canonical_user_sheets)) {
icon += strlen (canonical_user_sheets) + 1;
}
diff --git a/lib/arrows.h b/lib/arrows.h
index 6e268f0c..8f6b7431 100644
--- a/lib/arrows.h
+++ b/lib/arrows.h
@@ -124,7 +124,7 @@ typedef enum {
* MIN_ARROW_DIMENSION:
*
* The minimum width or length of an arrowhead. This to avoid borderline
- * cases that break trig functions, as seen in bug #144394
+ * cases that break trig functions, as seen in bug # 144394
*/
#define MIN_ARROW_DIMENSION 0.001
diff --git a/lib/attributes.c b/lib/attributes.c
index f697e350..30863ede 100644
--- a/lib/attributes.c
+++ b/lib/attributes.c
@@ -21,208 +21,318 @@
#include "intl.h"
#include "persistence.h"
+
static Color attributes_foreground = { 0.0f, 0.0f, 0.0f, 1.0f };
static Color attributes_background = { 1.0f, 1.0f, 1.0f, 1.0f };
-static real attributes_default_linewidth = 0.1;
+static double attributes_default_linewidth = 0.1;
+
+static Arrow attributes_start_arrow = {
+ ARROW_NONE,
+ DEFAULT_ARROW_SIZE,
+ DEFAULT_ARROW_SIZE
+};
-static Arrow attributes_start_arrow = { ARROW_NONE,
- DEFAULT_ARROW_SIZE,
- DEFAULT_ARROW_SIZE };
-static Arrow attributes_end_arrow = { ARROW_NONE,
- DEFAULT_ARROW_SIZE,
- DEFAULT_ARROW_SIZE };
+static Arrow attributes_end_arrow = {
+ ARROW_NONE,
+ DEFAULT_ARROW_SIZE,
+ DEFAULT_ARROW_SIZE
+};
static LineStyle attributes_linestyle = LINESTYLE_SOLID;
-static real attributes_dash_length = 1.0;
+static double attributes_dash_length = 1.0;
static DiaFont *attributes_font = NULL;
-static real attributes_font_height = 0.8;
+static double attributes_font_height = 0.8;
-/** Get the foreground color attribute (lines and text)
- * @returns The current foreground color as set in the toolbox.
+
+/**
+ * attributes_get_foreground:
+ *
+ * Get the foreground color attribute (lines and text)
+ *
+ * Returns: The current foreground color as set in the toolbox.
+ *
+ * Since: dawn-of-time
*/
Color
-attributes_get_foreground(void)
+attributes_get_foreground (void)
{
return attributes_foreground;
}
-/** Get the background color attribute (for box background and such)
- * @returns The current background color as set in the toolbox.
+
+/**
+ * attributes_get_background:
+ *
+ * Get the background color attribute (for box background and such)
+ *
+ * Returns: The current background color as set in the toolbox.
+ *
+ * Since: dawn-of-time
*/
Color
-attributes_get_background(void)
+attributes_get_background (void)
{
return attributes_background;
}
-/** Set the default foreground color for new objects.
- * @param color A color object to use for foreground color. This object is
- * not stored by ths function and can be freed afterwards.
+
+/**
+ * attributes_set_foreground:
+ * @color: A color object to use for foreground color. This object is
+ * not stored by ths function and can be freed afterwards.
+ *
+ * Set the default foreground color for new objects.
+ *
+ * Since: dawn-of-time
*/
void
-attributes_set_foreground(Color *color)
+attributes_set_foreground (Color *color)
{
attributes_foreground = *color;
- persistence_set_color("fg_color", color);
+ persistence_set_color ("fg_color", color);
}
-/** Set the default background color for new objects.
- * @param color A color object to use for background color. This object is
- * not stored by ths function and can be freed afterwards.
+
+/**
+ * attributes_set_background:
+ * @color: A color object to use for background color. This object is
+ * not stored by ths function and can be freed afterwards.
+ *
+ * Set the default background color for new objects.
+ *
+ * Since: dawn-of-time
*/
void
-attributes_set_background(Color *color)
+attributes_set_background (Color *color)
{
attributes_background = *color;
- persistence_set_color("bg_color", color);
+ persistence_set_color ("bg_color", color);
}
-/** Swap the current foreground and background colors
+
+/**
+ * attributes_swap_fgbg:
+ *
+ * Swap the current foreground and background colors
+ *
+ * Since: dawn-of-time
*/
void
-attributes_swap_fgbg(void)
+attributes_swap_fgbg (void)
{
Color temp;
temp = attributes_foreground;
- attributes_set_foreground(&attributes_background);
- attributes_set_background(&temp);
+ attributes_set_foreground (&attributes_background);
+ attributes_set_background (&temp);
}
-/** Set the default foreground and background colors to black and white.
+
+/**
+ * attributes_default_fgbg:
+ *
+ * Set the default foreground and background colors to black and white.
+ *
+ * Since: dawn-of-time
*/
void
-attributes_default_fgbg(void)
+attributes_default_fgbg (void)
{
- attributes_set_foreground(&color_black);
- attributes_set_background(&color_white);
+ attributes_set_foreground (&color_black);
+ attributes_set_background (&color_white);
}
-/** Get the default line width as defined by the toolbox.
- * @returns A linewidth (0.0 < linewidth < 10.0) that should be used as default
+
+/**
+ * attributes_get_default_linewidth:
+ *
+ * Get the default line width as defined by the toolbox.
+ *
+ * Returns: A linewidth (0.0 < linewidth < 10.0) that should be used as default
* for new objects.
+ *
+ * Since: dawn-of-time
*/
-real
-attributes_get_default_linewidth(void)
+double
+attributes_get_default_linewidth (void)
{
return attributes_default_linewidth;
}
-/** Set the default line width.
- * @param width The line width (0.0 < linewidth < 10.0) to use for new objects.
+
+/**
+ * attributes_set_default_linewidth:
+ * @width: The line width (0.0 < linewidth < 10.0) to use for new objects.
+ *
+ * Set the default line width.
+ *
+ * Since: dawn-of-time
*/
void
-attributes_set_default_linewidth(real width)
+attributes_set_default_linewidth (double width)
{
attributes_default_linewidth = width;
- persistence_set_real("linewidth", width);
+ persistence_set_real ("linewidth", width);
}
-/** Get the default arrow type to put at the start (origin) of a connector.
- * @returns An arrow object for the arrow type defined in the toolbox.
+
+/**
+ * attributes_get_default_start_arrow:
+ *
+ * Get the default arrow type to put at the start (origin) of a connector.
+ *
+ * Returns: An arrow object for the arrow type defined in the toolbox.
+ *
+ * Since: dawn-of-time
*/
Arrow
-attributes_get_default_start_arrow(void)
+attributes_get_default_start_arrow (void)
{
return attributes_start_arrow;
}
-/** Set the default arrow type that the toolbox will supply for new objects.
- * @param arrow An arrow object to be used for the start of new connectors.
+
+/**
+ * attributes_set_default_start_arrow:
+ * @arrow: An arrow object to be used for the start of new connectors.
+ *
+ * Set the default arrow type that the toolbox will supply for new objects.
+ *
+ * Since: dawn-of-time
*/
void
-attributes_set_default_start_arrow(Arrow arrow)
+attributes_set_default_start_arrow (Arrow arrow)
{
attributes_start_arrow = arrow;
- persistence_set_string("start-arrow-type",
- arrow_get_name_from_type(arrow.type));
- persistence_set_real("start-arrow-width", arrow.width);
- persistence_set_real("start-arrow-length", arrow.length);
+ persistence_set_string ("start-arrow-type",
+ arrow_get_name_from_type (arrow.type));
+ persistence_set_real ("start-arrow-width", arrow.width);
+ persistence_set_real ("start-arrow-length", arrow.length);
}
-/** Get the default arrow type to put at the end (target) of a connector.
- * @returns An arrow object for the arrow type defined in the toolbox.
+
+/**
+ * attributes_get_default_end_arrow:
+ *
+ * Get the default arrow type to put at the end (target) of a connector.
+ *
+ * Returns: An arrow object for the arrow type defined in the toolbox.
+ *
+ * Since: dawn-of-time
*/
Arrow
-attributes_get_default_end_arrow(void)
+attributes_get_default_end_arrow (void)
{
return attributes_end_arrow;
}
-/** Set the default arrow type that the toolbox will supply for new objects.
- * @param arrow An arrow object to be used for the end of new connectors.
+
+/**
+ * attributes_set_default_end_arrow:
+ * @arrow: An arrow object to be used for the end of new connectors.
+ *
+ * Set the default arrow type that the toolbox will supply for new objects.
+ *
+ * Since: dawn-of-time
*/
void
-attributes_set_default_end_arrow(Arrow arrow)
+attributes_set_default_end_arrow (Arrow arrow)
{
attributes_end_arrow = arrow;
- persistence_set_string("end-arrow-type",
- arrow_get_name_from_type(arrow.type));
- persistence_set_real("end-arrow-width", arrow.width);
- persistence_set_real("end-arrow-length", arrow.length);
+ persistence_set_string ("end-arrow-type",
+ arrow_get_name_from_type (arrow.type));
+ persistence_set_real ("end-arrow-width", arrow.width);
+ persistence_set_real ("end-arrow-length", arrow.length);
}
-/** Get the default line style (dashes, dots etc)
- * @param style A place to return the style (number of dots and dashes)
- * @param dash_length A place to return how long a dash is
- * (0.0 < dash_length < ???)
- * @see dia-enums.h for possible values for style.
+
+/**
+ * attributes_get_default_line_style:
+ * @style: (out): A place to return the style (number of dots and dashes)
+ * @dash_length: (out): A place to return how long a dash is
+ * (0.0 < dash_length < ???)
+ *
+ * Get the default line style (dashes, dots etc)
+ *
+ * Since: dawn-of-time
*/
void
-attributes_get_default_line_style(LineStyle *style, real *dash_length)
+attributes_get_default_line_style (LineStyle *style, double *dash_length)
{
- if (style)
+ if (style) {
*style = attributes_linestyle;
- if (dash_length)
+ }
+ if (dash_length) {
*dash_length = attributes_dash_length;
+ }
}
-/** Set the default line style (dashes, dots etc)
- * @param style The style (number of dots and dashes)
- * @param dash_length The length of a dash (0.0 < dash_length < ???)
- * @see dia-enums.h for possible values for style.
+
+/**
+ * attributes_set_default_line_style:
+ * @style: The style (number of dots and dashes)
+ * @dash_length: The length of a dash (0.0 < dash_length < ???)
+ *
+ * Set the default line style (dashes, dots etc)
+ *
+ * Since: dawn-of-time
*/
void
-attributes_set_default_line_style(LineStyle style, real dash_length)
+attributes_set_default_line_style (LineStyle style, double dash_length)
{
attributes_linestyle = style;
attributes_dash_length = dash_length;
- persistence_set_integer("line-style", style);
- persistence_set_real("dash-length", dash_length);
+ persistence_set_integer ("line-style", style);
+ persistence_set_real ("dash-length", dash_length);
}
-/** Get the default font.
+
+/**
+ * attributes_get_default_font:
+ * @font: (out): A place to return the default font description set by the user
+ * @font_height: (out): A place to return the default font height set by the user
+ *
+ * Get the default font.
+ *
* Note that there is currently no way for the user to set these.
- * @param font A place to return the default font description set by the user
- * @param font_height A place to return the default font height set by the user
+ *
+ * Since: dawn-of-time
*/
void
-attributes_get_default_font (DiaFont **font, real *font_height)
+attributes_get_default_font (DiaFont **font, double *font_height)
{
if (!attributes_font) {
attributes_font = dia_font_new_from_style (DIA_FONT_SANS,
attributes_font_height);
}
- if (font)
+ if (font) {
*font = g_object_ref (attributes_font);
+ }
- if (font_height)
+ if (font_height) {
*font_height = attributes_font_height;
+ }
}
-/** Set the default font.
+
+/**
+ * attributes_set_default_font:
+ * @font: The font to set as the new default. This object will be ref'd by
+ * this call.
+ * @font_height: The font height to set as the new default.
+ *
+ * Set the default font.
+ *
* Note that this is not currently stored persistently.
- * @param font The font to set as the new default.
- * This object will be ref'd by this call.
- * @param font_height The font height to set as the new default.
+ *
+ * Since: dawn-of-time
*/
void
attributes_set_default_font (DiaFont *font, real font_height)
{
- g_clear_object (&attributes_font);
+ g_set_object (&attributes_font, font);
- attributes_font = g_object_ref (font);
attributes_font_height = font_height;
}
diff --git a/lib/attributes.h b/lib/attributes.h
index d918a8e8..1c654cf8 100644
--- a/lib/attributes.h
+++ b/lib/attributes.h
@@ -19,33 +19,31 @@
#pragma once
#include "dia-enums.h"
-#include "geometry.h"
#include "color.h"
#include "arrows.h"
-#include "diatypes.h"
+#include "font.h"
G_BEGIN_DECLS
-Color attributes_get_foreground(void);
-Color attributes_get_background(void);
-void attributes_set_foreground(Color *color);
-void attributes_set_background(Color *color);
-void attributes_swap_fgbg(void);
-void attributes_default_fgbg(void);
-
-real attributes_get_default_linewidth(void);
-void attributes_set_default_linewidth(real width);
-
-Arrow attributes_get_default_start_arrow(void);
-void attributes_set_default_start_arrow(Arrow arrow);
-
-Arrow attributes_get_default_end_arrow(void);
-void attributes_set_default_end_arrow(Arrow arrow);
-
-void attributes_get_default_line_style(LineStyle *style, real *dash_length);
-void attributes_set_default_line_style(LineStyle style, real dash_length);
-
-void attributes_get_default_font(DiaFont **font, real *font_height);
-void attributes_set_default_font(DiaFont *font, real font_height);
+Color attributes_get_foreground (void);
+Color attributes_get_background (void);
+void attributes_set_foreground (Color *color);
+void attributes_set_background (Color *color);
+void attributes_swap_fgbg (void);
+void attributes_default_fgbg (void);
+double attributes_get_default_linewidth (void);
+void attributes_set_default_linewidth (double width);
+Arrow attributes_get_default_start_arrow (void);
+void attributes_set_default_start_arrow (Arrow arrow);
+Arrow attributes_get_default_end_arrow (void);
+void attributes_set_default_end_arrow (Arrow arrow);
+void attributes_get_default_line_style (LineStyle *style,
+ double *dash_length);
+void attributes_set_default_line_style (LineStyle style,
+ double dash_length);
+void attributes_get_default_font (DiaFont **font,
+ double *font_height);
+void attributes_set_default_font (DiaFont *font,
+ double font_height);
G_END_DECLS
diff --git a/lib/connectionpoint.c b/lib/connectionpoint.c
index d4347330..878909ce 100644
--- a/lib/connectionpoint.c
+++ b/lib/connectionpoint.c
@@ -20,7 +20,7 @@
#include "connectionpoint.h"
/**
- * SECTION:dia-connectionpoint
+ * SECTION:connectionpoint
* @title: ConnectionPoint
* @short_description: Connections between #DiaObjects
*
diff --git a/lib/create.c b/lib/create.c
index 9b96838b..c339ff73 100644
--- a/lib/create.c
+++ b/lib/create.c
@@ -17,7 +17,7 @@
*/
/**
- * SECTION:dia-create
+ * SECTION:create
* @title: Create
* @short_description: Construct objects
*
diff --git a/lib/diainteractiverenderer.c b/lib/diainteractiverenderer.c
index 13aa4f2d..0bd6a3b8 100644
--- a/lib/diainteractiverenderer.c
+++ b/lib/diainteractiverenderer.c
@@ -26,7 +26,7 @@
G_DEFINE_INTERFACE (DiaInteractiveRenderer, dia_interactive_renderer, DIA_TYPE_RENDERER)
/**
- * SECTION:dia-interactive-renderer
+ * SECTION:diainteractiverenderer
* @title: DiaInteractiveRenderer
* @short_description: #DiaRenderer for displays
*
diff --git a/lib/dialib.c b/lib/dialib.c
index a312c9c1..a66807fa 100644
--- a/lib/dialib.c
+++ b/lib/dialib.c
@@ -79,9 +79,10 @@ myXmlErrorReporting (void *ctx, const char* msg, ...)
}
#endif
+
/**
* libdia_init:
- * @flags: a set of %DIA_INTERACTIVE, %DIA_MESSAGE_STDERR
+ * @flags: a set of #DiaInitFlags
*
* Basic (i.e. minimal) initialization of libdia.
*
diff --git a/lib/dialib.h b/lib/dialib.h
index 4ddd1e8b..a76f94e6 100644
--- a/lib/dialib.h
+++ b/lib/dialib.h
@@ -5,8 +5,8 @@
G_BEGIN_DECLS
-enum DiaInitFlags
-{
+
+enum DiaInitFlags {
DIA_INTERACTIVE = (1<<0),
DIA_MESSAGE_STDERR = (1<<1),
DIA_VERBOSE = (1<<2)
diff --git a/lib/element.c b/lib/element.c
index 35fb6b42..dba889f0 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -16,10 +16,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/** The Element object type is a rectangular box that has
- * non-connectable handles on its corners and on the midsts of the
- * edges. It also has connectionpoints in the same places as the
- * handles as well as a mainpoint in the middle.
+/**
+ * SECTION:element:
+ * @title: Element
+ *
+ * The Element object type is a rectangular box that has
+ * non-connectable handles on its corners and on the midsts of the
+ * edges. It also has connectionpoints in the same places as the
+ * handles as well as a mainpoint in the middle.
*/
#include <config.h>
@@ -38,11 +42,18 @@
PropNumData width_range = { -G_MAXFLOAT, G_MAXFLOAT, 0.1};
#endif
-/** Update the boundingbox information for this element.
- * @param An object to update bounding box on.
+
+/**
+ * element_update_boundingbox:
+ * @elem: An object to update bounding box on.
+ *
+ * Update the boundingbox information for this element.
+ *
+ * Since: dawn-of-time
*/
void
-element_update_boundingbox (Element *elem) {
+element_update_boundingbox (Element *elem)
+{
DiaRectangle bb;
Point *corner;
ElementBBExtras *extra = &elem->extra_spacing;
@@ -58,19 +69,23 @@ element_update_boundingbox (Element *elem) {
rectangle_bbox(&bb,extra,&elem->object.bounding_box);
}
-/** Update the 9 connections of this element to form a rectangle and
+
+/**
+ * element_update_connections_rectangle:
+ * @elem: The element to update
+ * @cps: The list of connectionpoints to update, in the order described.
+ * Usually, this will be the same list as elem->connectionpoints.
+ *
+ * Update the 9 connections of this element to form a rectangle and
* point in the center.
* The connections go left-to-right, first top row, then middle row, then
* bottom row, then center. Do not blindly use this in old objects where
* the order is different, as it will mess with the saved files. If an
* object uses element_update_handles, it can use this.
- * @param elem The element to update
- * @param cps The list of connectionpoints to update, in the order described.
- * Usually, this will be the same list as elem->connectionpoints.
*/
void
-element_update_connections_rectangle(Element *elem,
- ConnectionPoint* cps)
+element_update_connections_rectangle (Element *elem,
+ ConnectionPoint *cps)
{
cps[0].pos = elem->corner;
cps[1].pos.x = elem->corner.x + elem->width / 2.0;
@@ -105,11 +120,15 @@ element_update_connections_rectangle(Element *elem,
/**
* element_update_connections_directions:
+ * @elem: the #Element
+ * @cps: list of #ConnectionPoint
*
* More elaborate variant to calculate connection point directions
*
* It works for any number of connection points.
* It calculates them based on qudrants, so works best for symmetric elements.
+ *
+ * Since: dawn-of-time
*/
void
element_update_connections_directions (Element *elem,
@@ -416,7 +435,7 @@ element_move_handle_aspect (Element *elem,
* @num_handles: The number of handles to set up (>= 8). The handles
* will be initialized by this function.
* @num_connections: The number of connectionpoints to set up (>= 9).
- * The connectionpoints will <em>not</em> be
+ * The connectionpoints will _not_ be
* initialized by this function.
*
* Initialization function for element objects.
@@ -482,7 +501,7 @@ element_copy (Element *from, Element *to)
/**
* element_destroy:
- * @elem: The element to destroy. It will <em>not</em> be deallocated
+ * @elem: The element to destroy. It will _not_ be deallocated
* by this call, but will not be valid afterwards.
*
* Destroy an elements private information.
diff --git a/lib/focus.c b/lib/focus.c
index 4b4bec43..7cc450e3 100644
--- a/lib/focus.c
+++ b/lib/focus.c
@@ -16,7 +16,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/** This files handles which text elements are currently eligible to get
+/**
+ * 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
* add their texts to the list with request_focus (more than one can be
* added), which doesn't give them focus outright, but makes them part of
@@ -38,20 +41,35 @@ get_text_foci(DiagramData *dia)
return dia->text_edits;
}
-/** Get the currently active focus for the given diagram, if any */
+
+/**
+ * get_active_focus:
+ * @dia: the #DiagramData
+ *
+ * Get the currently active focus for the given diagram, if any
+ *
+ * Since: dawn-of-time
+ */
Focus *
-get_active_focus(DiagramData *dia)
+get_active_focus (DiagramData *dia)
{
return dia->active_text_edit;
}
-/** Set which focus is active for the given diagram.
- * @param dia Diagram to set active focus for.
- * @param focus Focus to be active, or null if no focus should be active.
+
+/**
+ * set_active_focus:
+ * @dia: #DiagramData to set active focus for.
+ * @focus: #Focus to be active, or %NULL if no focus should be active.
+ *
+ * Set which focus is active for the given diagram.
+ *
* The focus should be on the get_text_foci list.
+ *
+ * Since: dawn-of-time
*/
static void
-set_active_focus(DiagramData *dia, Focus *focus)
+set_active_focus (DiagramData *dia, Focus *focus)
{
if (dia->active_text_edit != NULL) {
dia->active_text_edit->has_focus = FALSE;
@@ -62,40 +80,66 @@ set_active_focus(DiagramData *dia, Focus *focus)
}
}
-/** Add a focus to the list of foci that can be activated for the given
- * diagram. */
+
+/**
+ * add_text_focus:
+ * @dia: #DiagramData to add #Focus to
+ * @focus: #Focus to add
+ *
+ * Add a focus to the list of foci that can be activated for the given
+ * diagram.
+ *
+ * Since: dawn-of-time
+ */
static void
-add_text_focus(DiagramData *dia, Focus *focus)
+add_text_focus (DiagramData *dia, Focus *focus)
{
- dia->text_edits = g_list_append(dia->text_edits, focus);
+ dia->text_edits = g_list_append (dia->text_edits, focus);
}
-/** Set the list of foci for a diagram. The old list, if any, will be
+
+/**
+ * set_text_foci:
+ * @dia: #DiagramData to set list for
+ * @foci: the new list
+ *
+ * Set the list of foci for a diagram. The old list, if any, will be
* returned, not freed.
+ *
+ * Since: dawn-of-time
*/
static GList *
-set_text_foci(DiagramData *dia, GList *foci)
+set_text_foci (DiagramData *dia, GList *foci)
{
- GList *old_foci = get_text_foci(dia);
+ GList *old_foci = get_text_foci (dia);
dia->text_edits = NULL;
return old_foci;
}
-/** Request that the give focus become active.
+
+/**
+ * request_focus:
+ * @focus: the #Focus to make active
+ *
+ * Request that the give focus become active.
* Also adds the focus to the list of available foci.
- * Eventually, this will only add the focus to the list. */
+ * Eventually, this will only add the focus to the list.
+ *
+ * Since: dawn-of-time
+ */
void
request_focus(Focus *focus)
{
DiagramData *dia = dia_layer_get_parent_diagram (focus->obj->parent_layer);
- GList *text_foci = get_text_foci(dia);
+ GList *text_foci = get_text_foci (dia);
/* Only add to focus list if not already there, and don't snatch focus. */
- if (!g_list_find(text_foci, focus)) {
- add_text_focus(dia, focus);
+ if (!g_list_find (text_foci, focus)) {
+ add_text_focus (dia, focus);
}
return;
}
+
void
give_focus(Focus *focus)
{
@@ -124,16 +168,24 @@ focus_get_first_on_object(DiaObject *obj)
return NULL;
}
-/** Return the object that this focus belongs to. Note that each
- * object may have more than one Text associated with it, the
+
+/**
+ * focus_get_object:
+ * @focus: the #Focus
+ *
+ * Return the object that this focus belongs to. Note that each
+ * object may have more than one #Text associated with it, the
* focus will be on one of those.
+ *
+ * Since: dawn-of-time
*/
DiaObject*
-focus_get_object(Focus *focus)
+focus_get_object (Focus *focus)
{
return focus->obj;
}
+
Focus *
focus_next_on_diagram(DiagramData *dia)
{
@@ -178,37 +230,45 @@ reset_foci_on_diagram(DiagramData *dia)
g_list_free(old_foci);
}
-/** Removes all foci owned by the object.
- * Returns TRUE if the object had the active focus for its diagram.
+
+/**
+ * remove_focus_object:
+ * @obj: the #DiaObject
+ *
+ * Removes all foci owned by the object.
+ *
+ * Returns: %TRUE if the object had the active focus for its diagram.
*/
gboolean
-remove_focus_object(DiaObject *obj)
+remove_focus_object (DiaObject *obj)
{
DiagramData *dia = dia_layer_get_parent_diagram (obj->parent_layer);
- GList *tmplist = get_text_foci(dia);
+ GList *tmplist = get_text_foci (dia);
gboolean active = FALSE;
Focus *next_focus = NULL;
- Focus *active_focus = get_active_focus(dia);
+ Focus *active_focus = get_active_focus (dia);
for (; tmplist != NULL; ) {
- Focus *focus = (Focus*)tmplist->data;
+ Focus *focus = (Focus*) tmplist->data;
GList *link = tmplist;
- tmplist = g_list_next(tmplist);
- if (focus_get_object(focus) == obj) {
+ tmplist = g_list_next (tmplist);
+ if (focus_get_object (focus) == obj) {
if (focus == active_focus) {
- next_focus = focus_next_on_diagram(dia);
- active = TRUE;
+ next_focus = focus_next_on_diagram (dia);
+ active = TRUE;
}
- set_text_foci(dia, g_list_delete_link(get_text_foci(dia), link));
+ set_text_foci (dia, g_list_delete_link (get_text_foci (dia), link));
}
}
- if (next_focus != NULL && get_text_foci(dia) != NULL) {
- give_focus(next_focus);
+
+ if (next_focus != NULL && get_text_foci (dia) != NULL) {
+ give_focus (next_focus);
} else {
- if (get_text_foci(dia) == NULL) {
- set_active_focus(dia, NULL);
+ if (get_text_foci (dia) == NULL) {
+ set_active_focus (dia, NULL);
}
}
+
return active;
}
diff --git a/lib/font.c b/lib/font.c
index 16b42158..5e406bcb 100644
--- a/lib/font.c
+++ b/lib/font.c
@@ -692,12 +692,17 @@ dia_font_build_layout(const char* string, DiaFont* font, real height)
return layout;
}
-/** Find the offsets of the individual letters in the iter and place them
+
+/**
+ * get_string_offsets:
+ * @iter: The #PangoLayoutIter to count characters in.
+ * @offsets: The place to return the offsets
+ * @n_offsets: The place to return the number of offsets
+ *
+ * Find the offsets of the individual letters in the iter and place them
* in an array.
+ *
* This currently assumes only one run per iter, which is all we can input.
- * @param iter The PangoLayoutIter to count characters in.
- * @param offsets The place to return the offsets
- * @param n_offsets The place to return the number of offsets
*/
static void
get_string_offsets(PangoLayoutIter *iter, real** offsets, int* n_offsets)
@@ -725,7 +730,8 @@ get_string_offsets(PangoLayoutIter *iter, real** offsets, int* n_offsets)
}
}
-/** Copy the offsets into a storage object, adjusting for exaggerated size.
+/*
+ * Copy the offsets into a storage object, adjusting for exaggerated size.
*/
static void
get_layout_offsets(PangoLayoutLine *line, PangoLayoutLine **layout_line)
@@ -768,14 +774,33 @@ get_layout_offsets(PangoLayoutLine *line, PangoLayoutLine **layout_line)
(*layout_line)->runs = layout_runs;
}
-/** Get size information for the given string, font and height.
+
+/**
+ * dia_font_get_sizes:
+ * @string: text to measure
+ * @font: the font to use
+ * @height: the font height to use
+ * @width: (out): width of @string
+ * @ascent: (out): width of @ascent
+ * @descent: (out): width of @descent
+ * @n_offsets: (out): number of @layout_offsets
+ * @layout_offsets: (out): offsets of @string
*
- * @returns an array of offsets of the individual glyphs in the layout.
+ * Get size information for the given string, font and height.
+ *
+ * Returns: an array of offsets of the individual glyphs in the layout.
+ *
+ * Since: dawn-of-time
*/
-real*
-dia_font_get_sizes(const char* string, DiaFont *font, real height,
- real *width, real *ascent, real *descent, int *n_offsets,
- PangoLayoutLine **layout_offsets)
+double *
+dia_font_get_sizes (const char *string,
+ DiaFont *font,
+ double height,
+ double *width,
+ double *ascent,
+ double *descent,
+ int *n_offsets,
+ PangoLayoutLine **layout_offsets)
{
PangoLayout* layout;
PangoLayoutIter* iter;
@@ -834,7 +859,7 @@ dia_font_get_sizes(const char* string, DiaFont *font, real height,
}
-/**
+/*
* Compatibility with older files out of pre Pango Time.
* Make old files look as similar as possible
* List should be kept alphabetically sorted by oldname, in case of
@@ -919,11 +944,16 @@ static struct _legacy_font {
/**
+ * dia_font_new_from_legacy_name:
+ * @name: the legacy name
+ *
* Given a legacy name as stored until Dia-0.90 construct
* a new DiaFont which is as similar as possible
+ *
+ * Since: dawn-of-time
*/
DiaFont*
-dia_font_new_from_legacy_name(const char* name)
+dia_font_new_from_legacy_name (const char* name)
{
/* do NOT translate anything here !!! */
DiaFont* retval;
diff --git a/lib/message.c b/lib/message.c
index 10de552c..f68f2f6e 100644
--- a/lib/message.c
+++ b/lib/message.c
@@ -75,7 +75,9 @@ message_dialog_destroyed(GtkWidget *widget, gpointer userdata)
msginfo->no_show_again = NULL;
}
-/** Set up a dialog for these messages.
+
+/*
+ * Set up a dialog for these messages.
* Msginfo may contain repeats, and should be filled out
*/
static void
@@ -93,13 +95,17 @@ message_create_dialog(const gchar *title, DiaMessageInfo *msginfo, gchar *buf)
else if (0 == strcmp (title, _("Warning")))
type = GTK_MESSAGE_WARNING;
}
- if (msginfo->repeats != NULL)
- buf = (gchar *)msginfo->repeats->data;
+
+ if (msginfo->repeats != NULL) {
+ buf = (char *) msginfo->repeats->data;
+ }
+
dialog = gtk_message_dialog_new (NULL, /* no parent window */
- 0, /* GtkDialogFlags */
- type,
- GTK_BUTTONS_CLOSE,
- "%s", buf);
+ 0, /* GtkDialogFlags */
+ type,
+ GTK_BUTTONS_CLOSE,
+ "%s", buf);
+ gtk_window_set_keep_above (GTK_WINDOW (dialog), TRUE);
if (title) {
char *real_title;
@@ -110,23 +116,23 @@ message_create_dialog(const gchar *title, DiaMessageInfo *msginfo, gchar *buf)
}
gtk_widget_show (dialog);
g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (gtk_widget_hide),
- NULL);
+ G_CALLBACK (gtk_widget_hide),
+ NULL);
msginfo->dialog = dialog;
g_signal_connect (G_OBJECT (dialog), "destroy",
- G_CALLBACK (message_dialog_destroyed),
- msginfo);
+ G_CALLBACK (message_dialog_destroyed),
+ msginfo);
- msginfo->repeat_label = gtk_label_new(_("There is one similar message."));
- gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(msginfo->dialog))),
- msginfo->repeat_label);
+ msginfo->repeat_label = gtk_label_new (_("There is one similar message."));
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (msginfo->dialog))),
+ msginfo->repeat_label);
msginfo->show_repeats =
- gtk_check_button_new_with_label(_("Show repeated messages"));
- gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(msginfo->dialog))),
- msginfo->show_repeats);
- g_signal_connect(G_OBJECT(msginfo->show_repeats), "toggled",
- G_CALLBACK(gtk_message_toggle_repeats), msginfo);
+ gtk_check_button_new_with_label (_("Show repeated messages"));
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (msginfo->dialog))),
+ msginfo->show_repeats);
+ g_signal_connect (G_OBJECT (msginfo->show_repeats), "toggled",
+ G_CALLBACK (gtk_message_toggle_repeats), msginfo);
msginfo->repeat_view = gtk_text_view_new();
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(msginfo->dialog))),
@@ -258,49 +264,70 @@ message(const char *title, const char *format, ...)
va_end (args2);
}
-/** Emit a message about something the user should be aware of.
- * In the default GTK message system, this message will by default only
- * be shown once.
+
+/**
+ * message_notice:
+ * @format: the message
+ *
+ * Emit a message about something the user should be aware of.
+ * In the default GTK message system, this message will by default only
+ * be shown once.
+ *
+ * Since: dawn-of-time
*/
void
-message_notice(const char *format, ...)
+message_notice (const char *format, ...)
{
va_list args, args2;
va_start (args, format);
va_start (args2, format);
- message_internal(_("Notice"), SUGGEST_NO_SHOW_AGAIN, format, args, args2);
+ message_internal (_("Notice"), SUGGEST_NO_SHOW_AGAIN, format, args, args2);
va_end (args);
va_end (args2);
}
-/** Emit a message about a possible danger.
- * In the default GTK message system, this message can be made to only be
- * shown once, but is by default shown every time it is invoked.
+
+/**
+ * message_warning:
+ * @format: the message
+ *
+ * Emit a message about a possible danger.
+ * In the default GTK message system, this message can be made to only be
+ * shown once, but is by default shown every time it is invoked.
+ *
+ * Since: dawn-of-time
*/
void
-message_warning(const char *format, ...)
+message_warning (const char *format, ...)
{
va_list args, args2;
va_start (args, format);
va_start (args2, format);
- message_internal(_("Warning"), SUGGEST_SHOW_AGAIN, format, args, args2);
+ message_internal (_("Warning"), SUGGEST_SHOW_AGAIN, format, args, args2);
va_end (args);
va_end (args2);
}
-/** Emit a message about an error.
- * In the default GTK message system, this message is always shown.
+
+/**
+ * message_error:
+ * @format: the message
+ *
+ * Emit a message about an error.
+ * In the default GTK message system, this message is always shown.
+ *
+ * Since: dawn-of-time
*/
void
-message_error(const char *format, ...)
+message_error (const char *format, ...)
{
va_list args, args2;
va_start (args, format);
va_start (args2, format);
- message_internal(_("Error"), ALWAYS_SHOW, format, args, args2);
+ message_internal (_("Error"), ALWAYS_SHOW, format, args, args2);
va_end (args);
va_end (args2);
}
diff --git a/lib/object.c b/lib/object.c
index fb8a2581..b57b4905 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -952,58 +952,46 @@ dia_object_is_selectable (DiaObject *obj)
/****** DiaObject register: **********/
-static guint hash(gpointer key)
-{
- char *string = (char *)key;
- int sum;
-
- sum = 0;
- while (*string) {
- sum += (*string);
- string++;
- }
-
- return sum;
-}
-
-static gint compare(gpointer a, gpointer b)
-{
- return strcmp((char *)a, (char *)b)==0;
-}
static GHashTable *object_type_table = NULL;
-/** Initialize the object registry. */
+/* Initialize the object registry. */
void
-object_registry_init(void)
+object_registry_init (void)
{
- object_type_table = g_hash_table_new( (GHashFunc) hash, (GCompareFunc) compare );
+ object_type_table = g_hash_table_new (g_str_hash, g_str_equal);
}
-/** Register the type of an object.
- * This should be called as part of dia_plugin_init calls in modules that
- * define objects for sheets. If an object type with the given name is
- * already registered (typically due to a user saving a local copy), a
- * warning is display to the user.
- * @param type The type information.
+
+/**
+ * Register the type of an object.
+ * @type: The type information.
+ *
+ * This should be called as part of dia_plugin_init calls in modules that
+ * define objects for sheets. If an object type with the given name is
+ * already registered (typically due to a user saving a local copy), a
+ * warning is display to the user.
*/
void
-object_register_type(DiaObjectType *type)
+object_register_type (DiaObjectType *type)
{
- if (g_hash_table_lookup(object_type_table, type->name) != NULL) {
- message_warning("Several object-types were named %s.\n"
- "Only first one will be used.\n"
- "Some things might not work as expected.\n",
- type->name);
+ if (g_hash_table_lookup (object_type_table, type->name) != NULL) {
+ message_warning ("Several object-types were named %s.\n"
+ "Only first one will be used.\n"
+ "Some things might not work as expected.\n",
+ type->name);
return;
}
- g_hash_table_insert(object_type_table, type->name, type);
+ g_hash_table_insert (object_type_table, type->name, type);
}
-/** Performs a function on each registered object type.
- * @param func A function foo(DiaObjectType, gpointer) to call.
- * @param user_data Data passed through to the functions.
+/**
+ * object_registry_foreach:
+ * @func: A function foo(DiaObjectType, gpointer) to call.
+ * @user_data: Data passed through to the functions.
+ *
+ * Performs a function on each registered object type.
*/
void
object_registry_foreach (GHFunc func, gpointer user_data)
@@ -1011,78 +999,116 @@ object_registry_foreach (GHFunc func, gpointer user_data)
g_hash_table_foreach (object_type_table, func, user_data);
}
-/** Get the object type information associated with a name.
- * @param name A type name.
- * @return A DiaObjectType for an object type with the given name, or
- * NULL if no such type is registered.
+
+/**
+ * object_get_type:
+ * @name: A type name.
+ *
+ * Get the object type information associated with a name.
+ *
+ * Returns: A #DiaObjectType for an object type with the given name, or
+ * %NULL if no such type is registered.
+ *
+ * Since: dawn-of-time
*/
DiaObjectType *
-object_get_type(char *name)
+object_get_type (char *name)
{
/* FIXME: this was added here to get some visibility. Idealy we should have a common way
* of ensuring g_hash_table_lookup return a non-NULL. */
- DiaObjectType *type = (DiaObjectType *)g_hash_table_lookup(object_type_table, name);
+ DiaObjectType *type = (DiaObjectType *) g_hash_table_lookup (object_type_table, name);
if (type == NULL) {
- g_warning("Unable to find object type: %s", name);
+ g_warning ("Unable to find object type: %s", name);
}
return type;
}
-/** True if all the given flags are set, false otherwise.
- * @param obj An object to test.
- * @param flags Flags to check if they are set. See definitions in object.h
- * @return TRUE if all the flags given are set on the object.
+
+/**
+ * object_flags_set:
+ * @obj: An object to test.
+ * @flags: Flags to check if they are set. See definitions in object.h
+ *
+ * True if all the given flags are set, false otherwise.
+ *
+ * Returns: %TRUE if all the flags given are set on the object.
+ *
+ * Since: dawn-of-time
*/
gboolean
-object_flags_set(DiaObject *obj, gint flags)
+object_flags_set (DiaObject *obj, int flags)
{
return (obj->type->flags & flags) == flags;
}
-/** Load an object from XML based on its properties.
- * This function is suitable for implementing the object load function
- * for an object with normal attributes. Any version-dependent handling
- * should be done after calling this function.
- * @param type The type of the object, used for creation.
- * @param obj_node The XML node defining the object.
- * @param version The version of the object found in the XML structure.
- * @param ctx The context in which this function is called
- * @return A newly created object with properties loaded.
+
+/**
+ * object_load_using_properties:
+ * @type: The type of the object, used for creation.
+ * @obj_node: The XML node defining the object.
+ * @version: The version of the object found in the XML structure.
+ * @ctx: The context in which this function is called
+ *
+ * Load an object from XML based on its properties.
+ *
+ * This function is suitable for implementing the object load function
+ * for an object with normal attributes. Any version-dependent handling
+ * should be done after calling this function.
+ *
+ * Returns: A newly created object with properties loaded.
+ *
+ * Since: dawn-of-time
*/
DiaObject *
-object_load_using_properties(const DiaObjectType *type,
- ObjectNode obj_node, int version,
- DiaContext *ctx)
+object_load_using_properties (const DiaObjectType *type,
+ ObjectNode obj_node,
+ int version,
+ DiaContext *ctx)
{
DiaObject *obj;
Point startpoint = {0.0,0.0};
Handle *handle1,*handle2;
- obj = type->ops->create(&startpoint,NULL, &handle1,&handle2);
- object_load_props(obj,obj_node,ctx);
+ obj = type->ops->create (&startpoint,NULL, &handle1, &handle2);
+ object_load_props (obj,obj_node,ctx);
return obj;
}
-/** Save an object into an XML structure based on its properties.
- * This function is suitable for implementing the object save function
- * for an object with normal attributes.
- * @param obj The object to save.
- * @param obj_node The XML structure to save into.
- * @param ctx The context to transport error information.
+
+/**
+ * object_save_using_properties:
+ * @obj: The object to save.
+ * @obj_node: The XML structure to save into.
+ * @ctx: The context to transport error information.
+ *
+ * Save an object into an XML structure based on its properties.
+ * This function is suitable for implementing the object save function
+ * for an object with normal attributes.
+ *
+ * Since: dawn-of-time
*/
void
-object_save_using_properties(DiaObject *obj, ObjectNode obj_node,
- DiaContext *ctx)
+object_save_using_properties (DiaObject *obj,
+ ObjectNode obj_node,
+ DiaContext *ctx)
{
object_save_props (obj, obj_node, ctx);
}
-/** Copy an object based solely on its properties.
- * This function is suitable for implementing the object save function
- * for an object with normal attributes.
- * @param obj An object to copy.
+
+/**
+ * object_copy_using_properties:
+ * @obj: An object to copy.
+ *
+ * Copy an object based solely on its properties.
+ *
+ * This function is suitable for implementing the object save function
+ * for an object with normal attributes.
+ *
+ * Since: dawn-of-time
*/
-DiaObject *object_copy_using_properties(DiaObject *obj)
+DiaObject *
+object_copy_using_properties (DiaObject *obj)
{
Point startpoint = {0.0,0.0};
Handle *handle1,*handle2;
@@ -1104,7 +1130,8 @@ DiaObject *object_copy_using_properties(DiaObject *obj)
* be freed after use, as it belongs to the object.
*/
const DiaRectangle *
-dia_object_get_bounding_box (const DiaObject *obj) {
+dia_object_get_bounding_box (const DiaObject *obj)
+{
return &obj->bounding_box;
}
diff --git a/lib/widgets.c b/lib/widgets.c
index fcf86eec..68f036e4 100644
--- a/lib/widgets.c
+++ b/lib/widgets.c
@@ -119,7 +119,8 @@ dia_size_selector_ratio_callback(GtkAdjustment *limits, gpointer userdata)
}
-/** Update the ratio of this DSS to be the ratio of width to height.
+/*
+ * Update the ratio of this DSS to be the ratio of width to height.
* If height is 0, ratio becomes 0.0.
*/
static void
@@ -768,7 +769,9 @@ dia_toggle_button_new(GtkWidget *on_widget, GtkWidget *off_widget)
return button;
}
-/** Create a toggle button with two icons (created with gdk-pixbuf-csource,
+
+/*
+ * Create a toggle button with two icons (created with gdk-pixbuf-csource,
* for instance). The icons represent on and off.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]