Skip to content

Commit

Permalink
Prepare documentation for release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny-bit committed Feb 7, 2021
1 parent 7f98779 commit 4f383ca
Show file tree
Hide file tree
Showing 16 changed files with 453 additions and 67 deletions.
4 changes: 2 additions & 2 deletions docs/reference/libosmgpsmap-docs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
<xi:include href="xml/osm-gps-map-track.xml"/>
<xi:include href="xml/osm-gps-map-point.xml"/>
</chapter>

<!--
<chapter id="api-reference-deprecated">
<title>Deprecated API</title>
<xi:include href="xml/osm-gps-map-deprecated.xml"/>
</chapter>

-->
<index id="api-index-full">
<title>Index of all symbols</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
Expand Down
20 changes: 0 additions & 20 deletions docs/reference/libosmgpsmap-sections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,10 @@ osm_gps_map_layer_remove
osm_gps_map_layer_remove_all
</SECTION>

<SECTION>
<FILE>osm-gps-map-deprecated</FILE>
<TITLE>OsmGpsMap Deprecated</TITLE>
osm_gps_map_draw_gps
osm_gps_map_clear_gps
osm_gps_map_add_track
osm_gps_map_replace_track
osm_gps_map_clear_tracks
osm_gps_map_add_image
osm_gps_map_add_image_with_alignment
osm_gps_map_remove_image
osm_gps_map_clear_images
osm_gps_map_add_layer
osm_gps_map_get_co_ordinates
osm_gps_map_screen_to_geographic
osm_gps_map_geographic_to_screen
osm_gps_map_set_mapcenter
</SECTION>

<SECTION>
<FILE>osm-gps-map-layer</FILE>
<TITLE>OsmGpsMapLayer</TITLE>
OsmGpsMapLayer
OsmGpsMapLayerClass
osm_gps_map_layer_render
osm_gps_map_layer_draw
osm_gps_map_layer_busy
Expand Down
4 changes: 2 additions & 2 deletions src/osm-gps-map-image.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down Expand Up @@ -240,7 +240,7 @@ osm_gps_map_image_draw (OsmGpsMapImage *object, cairo_t *cr, GdkRectangle *rect)
x = rect->x - xoffset;
y = rect->y - yoffset;

cairo_translate(cr, x+(priv->w/2), y+(priv->h/2));
cairo_translate(cr, x+(priv->w/2), y+(priv->h/2));
cairo_rotate(cr, deg2rad(priv->rotation));
cairo_translate(cr, -(x+(priv->w/2)), -(y+(priv->h/2)));

Expand Down
63 changes: 62 additions & 1 deletion src/osm-gps-map-image.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down Expand Up @@ -51,13 +51,74 @@ struct _OsmGpsMapImageClass
GObjectClass parent_class;
};

/**
* osm_gps_map_image_get_type:
*
* Get image type
*
* Return value: (element-type GType): The type of the image
* Since: 0.7.0
**/
GType osm_gps_map_image_get_type (void) G_GNUC_CONST;

/**
* osm_gps_map_image_new:
*
* Create new image
*
* Returns: (transfer full): New image
* Since: 0.7.0
**/
OsmGpsMapImage *osm_gps_map_image_new (void);
/**
* osm_gps_map_image_draw:
* @object: a #OsmGpsMapImage
* @cr: cairo context
* @rect: (inout): bounding rectangle
*
* Draw image to given cairo context
*
* Since: 0.7.0
**/
void osm_gps_map_image_draw (OsmGpsMapImage *object, cairo_t *cr, GdkRectangle *rect);
/**
* osm_gps_map_image_get_point:
* @object: a #OsmGpsMapImage
*
* Get image location point
*
* Returns: (transfer none): location point
* Since: 0.7.0
**/
const OsmGpsMapPoint *osm_gps_map_image_get_point(OsmGpsMapImage *object);
/**
* osm_gps_map_image_get_zorder:
* @object: a #OsmGpsMapImage
*
* Get image z-order
*
* Returns: z-order
* Since: 1.0.0
**/
gint osm_gps_map_image_get_zorder(OsmGpsMapImage *object);
/**
* osm_gps_map_image_get_rotation:
* @object: a #OsmGpsMapImage
*
* Get image rotation
*
* Returns: rotation
* Since: 1.1.0
**/
float osm_gps_map_image_get_rotation(OsmGpsMapImage* object);
/**
* osm_gps_map_image_set_rotation:
* @object: a #OsmGpsMapImage
* @rot: image rotation in degrees
*
* Set image rotation
* Since: 1.1.0
**/
void osm_gps_map_image_set_rotation(OsmGpsMapImage* object, float rot);

G_END_DECLS
Expand Down
52 changes: 51 additions & 1 deletion src/osm-gps-map-layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* 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
Expand Down Expand Up @@ -51,11 +51,61 @@ struct _OsmGpsMapLayerIface {
gboolean (*button_press) (OsmGpsMapLayer *self, OsmGpsMap *map, GdkEventButton *event);
};

/**
* osm_gps_map_layer_get_type:
*
* Get layer type
*
* Return value: (element-type GType): The type of the layer
* Since: 0.6.0
**/
GType osm_gps_map_layer_get_type (void);

/**
* osm_gps_map_layer_render:
* @self: (in): a #OsmGpsMapLayer object
* @map: (in): a #OsmGpsMap widget
*
* Render layer on map
*
* Since: 0.6.0
**/
void osm_gps_map_layer_render (OsmGpsMapLayer *self, OsmGpsMap *map);

/**
* osm_gps_map_layer_draw:
* @self: (in): a #OsmGpsMapLayer object
* @map: (in): a #OsmGpsMap widget
* @cr: (in): a cairo context to draw to
*
* Draw layer on map
*
* Since: 0.6.0
**/
void osm_gps_map_layer_draw (OsmGpsMapLayer *self, OsmGpsMap *map, cairo_t *cr);

/**
* osm_gps_map_layer_busy:
* @self: (in): a #OsmGpsMapLayer object
*
* Check whether layer is busy (eg drawing an animation)
*
* Returns: layer busy state
* Since: 0.6.0
**/
gboolean osm_gps_map_layer_busy (OsmGpsMapLayer *self);

/**
* osm_gps_map_layer_button_press:
* @self: (in): a #OsmGpsMapLayer object
* @map: (in): a #OsmGpsMap widget
* @event: (in): a #GdkEventButton event
*
* Handle button event
*
* Returns: whether even had been handled
* Since: 0.6.0
**/
gboolean osm_gps_map_layer_button_press (OsmGpsMapLayer *self, OsmGpsMap *map, GdkEventButton *event);

G_END_DECLS
Expand Down
9 changes: 5 additions & 4 deletions src/osm-gps-map-osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down Expand Up @@ -459,6 +459,7 @@ osm_gps_map_osd_class_init (OsmGpsMapOsdClass *klass)
* OsmGpsMapOsd:show-copyright:
*
* The show copyright property.
* Since: 1.2.0
*/
g_object_class_install_property (object_class,
PROP_SHOW_COPYRIGHT,
Expand Down Expand Up @@ -560,7 +561,7 @@ osm_gps_map_osd_button_press (OsmGpsMapLayer *osd,

if(priv->osd_x < 0)
mx -= (allocation.width - priv->osd_w);

if(priv->osd_y < 0)
my -= (allocation.height - priv->osd_h);

Expand Down Expand Up @@ -815,11 +816,11 @@ coordinates_render(OsmGpsMapOsd *self, OsmGpsMap *map)

char *latitude = osd_latitude_str(lat);
char *longitude = osd_longitude_str(lon);

int y = OSD_COORDINATES_OFFSET;
y = osd_render_centered_text(cr, y, OSD_COORDINATES_W, OSD_COORDINATES_FONT_SIZE, latitude);
y = osd_render_centered_text(cr, y, OSD_COORDINATES_W, OSD_COORDINATES_FONT_SIZE, longitude);

g_free(latitude);
g_free(longitude);

Expand Down
4 changes: 2 additions & 2 deletions src/osm-gps-map-osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* 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
Expand Down Expand Up @@ -48,7 +48,7 @@ struct _OsmGpsMapOsdClass
GObjectClass parent_class;

/* vtable */

};

GType osm_gps_map_osd_get_type (void);
Expand Down
Loading

0 comments on commit 4f383ca

Please sign in to comment.