* Re: [3/4] [PATCH] start angle (option of circular_progress)
@ 2013-03-20 7:41 Vladimir Testov
2013-04-03 7:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Testov @ 2013-03-20 7:41 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 157 bytes --]
new option: start_angle_degrees
maybe like that? :)
--
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru
[-- Attachment #2: grub-2.00-parrots-to-degrees.patch --]
[-- Type: text/x-patch, Size: 657 bytes --]
diff -Naur grub-2.00/grub-core/gfxmenu/gui_circular_progress.c grub-new2/grub-core/gfxmenu/gui_circular_progress.c
--- grub-2.00/grub-core/gfxmenu/gui_circular_progress.c 2010-12-01 17:45:43.000000000 +0300
+++ grub-new2/grub-core/gfxmenu/gui_circular_progress.c 2013-03-20 09:38:55.919520096 +0400
@@ -235,6 +235,10 @@
{
self->start_angle = grub_strtol (value, 0, 10);
}
+ else if (grub_strcmp (name, "start_angle_degrees") == 0)
+ {
+ self->start_angle = grub_strtol (value, 0, 10) * 64 / 90;
+ }
else if (grub_strcmp (name, "ticks_disappear") == 0)
{
self->ticks_disappear = grub_strcmp (value, "false") != 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [3/4] [PATCH] start angle (option of circular_progress)
2013-03-20 7:41 [3/4] [PATCH] start angle (option of circular_progress) Vladimir Testov
@ 2013-04-03 7:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2013-04-03 7:25 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 556 bytes --]
On 20.03.2013 08:41, Vladimir Testov wrote:
> new option: start_angle_degrees
>
> maybe like that? :)
>
Using a different option for the same thing just expressed in different
units isn't good or natural. It's more natural to use unit modifiers like
start_angle = "90°" or start_angle = "90 deg"
Compare:
buy one littre of milk
rather than
buy littre one of milk.
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [3/4] [PATCH] start angle (option of circular_progress)
@ 2013-04-11 14:32 Vladimir Testov
0 siblings, 0 replies; 3+ messages in thread
From: Vladimir Testov @ 2013-04-11 14:32 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 342 bytes --]
Like that? :)
Use
start_angle = "XXX degree"
start_angle = "XXX degrees"
for setting angle in degrees
start_angle = "XXX rad"
start_angle = "XXX rads"
for setting angle in rads
or use
start_angle = XXX
for usual behaviour (in parrots)
--
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru
[-- Attachment #2: grub-2.00-angle-translation.patch --]
[-- Type: text/x-patch, Size: 1400 bytes --]
diff -Naur grub-2.00/grub-core/gfxmenu/gui_circular_progress.c grub-new/grub-core/gfxmenu/gui_circular_progress.c
--- grub-2.00/grub-core/gfxmenu/gui_circular_progress.c 2010-12-01 17:45:43.000000000 +0300
+++ grub-new/grub-core/gfxmenu/gui_circular_progress.c 2013-04-11 17:51:33.242196806 +0400
@@ -223,6 +223,32 @@
self->end = end;
}
+static int
+parse_angle (const char *value)
+{
+ int pos = 0;
+ int len = grub_strlen (value);
+ int angle = grub_strtol (value, 0, 10);
+ /* Find space symbol */
+ while (pos < len && value[pos] != ' ')
+ pos++;
+ /* Skip spaces */
+ while (pos < len && value[pos] == ' ')
+ pos++;
+ if (pos < len)
+ {
+ char *unit = grub_new_substring (value, pos, len);
+ if ((grub_strcmp (unit, "degree") == 0)
+ || (grub_strcmp (unit, "degrees") == 0))
+ angle = angle * 64 / 90;
+ else if ((grub_strcmp (unit, "rad") == 0)
+ || grub_strcmp (unit, "rads") == 0)
+ angle = angle * 64 / 100;
+ grub_free (unit);
+ }
+ return angle;
+}
+
static grub_err_t
circprog_set_property (void *vself, const char *name, const char *value)
{
@@ -233,7 +259,7 @@
}
else if (grub_strcmp (name, "start_angle") == 0)
{
- self->start_angle = grub_strtol (value, 0, 10);
+ self->start_angle = parse_angle(value);
}
else if (grub_strcmp (name, "ticks_disappear") == 0)
{
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-11 14:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 7:41 [3/4] [PATCH] start angle (option of circular_progress) Vladimir Testov
2013-04-03 7:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
-- strict thread matches above, loose matches on Subject: below --
2013-04-11 14:32 Vladimir Testov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).