Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Spider Monkey Panel (foo_spider_monkey_panel) (Read 341886 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #150
Hi everybody,
So this may be the successor of the excellent JScript Panel ! Great news !
Is there an updated list of the already-compatible scripts, with the corresponding codes ? That would help a lot.
I'm thinking about marc2003 scripts... Plus WilB's Biography View... etc..
Thanks.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #151
Is there an updated list of the already-compatible scripts, with the corresponding codes ?
There is no such list (yet?).
All WilB's script are SMP compatible though.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #152
@davideleo , @WilB , thanks for your kind words and support, really appreciated =)

That's disappointing news & hopefully not too restrictive in the future.
It was not anything really huge (like DMCA), but rather the state of the current and the future support of Mozilla SpiderMonkey embeddings...

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #153
Version: 1.2.0
Link: https://github.com/TheQwertiest/foo_spider_monkey_panel/releases/tag/v1.2.0
Changelog:
Spoiler (click to show/hide)
Detailed description of API changes: https://github.com/TheQwertiest/foo_spider_monkey_panel/wiki/API-Changes#v120



Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #156
Hello TheQwertiest, and everybody else, off course..

I have very simple question:

Is there a way to port WSH Coverflow  to an SMP Script?

I mean, I know Chronial's Coverflow or even Bubble Coverflow are more advanced components, but my PC doesn't support them as
I get the pixelformat error because of my old Intel HD graphics chip.. I tried everything possible to fix this issue (from drivers to installing open EL/GL solutions)..
If it isn't possible, no need to tell me why, I don't know much about scripting and I must say that: I admire a lot Your work and think it's awesome!!

Anyway, Thanks in Advance.

Peace



Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #159
How safe is it to add custom methods and properties to default SMP objects?

I'm late

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #160
Never tried, but should be probably safe (if it works :D), since all SMP objects are proper JS objects. Obviously there are some limitations - e.g. you can't make a deep copy of (most) SMP objects (unless it's stated explicitly otherwise in docs).

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #161
Tried to migrate to Spider Monkey. Added volume bar from https://github.com/timonwong/foo_uie_wsh_panel_mod/blob/master/samples/Volbar%20with%20GdiDrawText.txt
Got this on gr.FillGradRect(  0, 0, pos , wh, 90, RGB(240,240,240), RGB(46,48,63));

Code: [Select]
Error: Spider Monkey Panel v1.2.1 (MyScript v1.2.3 by Me)
FillGradRect failed:
GdiPlus error: SetBlendTriangularShape failed with error (0X2): InvalidParameter

File: <main>
Line: 45, Column: 2

Stack trace:
  on_paint@<main>:45:2

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #162
Tried to migrate to Spider Monkey. Added volume bar from https://github.com/timonwong/foo_uie_wsh_panel_mod/blob/master/samples/Volbar%20with%20GdiDrawText.txt
Got this on gr.FillGradRect(  0, 0, pos , wh, 90, RGB(240,240,240), RGB(46,48,63));


I think the error is generated when the width argument is equal to 0, that is when "pos" is equal to "ww". I guess you have to manage that eventuality with something like:
Code: [Select]
line 51         if (pos != ww) gr.FillGradRect(pos, 0, ww - pos, wh, 90, RGB(240, 240, 240), RGB(190, 190, 190));


P.S.
I just realized you got the error on the previous FillGradRect function, on line 50. Obviously the same applies to both:

Code: [Select]
    if (pos != 0) gr.FillGradRect(0, 0, pos, wh, 90, RGB(240, 240, 240), RGB(100, 230, 100));
    if (pos != ww) gr.FillGradRect(pos, 0, ww - pos, wh, 90, RGB(240, 240, 240), RGB(190, 190, 190));

I'm late

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #163
@acmodeu, there is no need to update this sample manually - it's available as part of SMP package (samples/basic/Volbar with GdiDrawText.js).

PS: @davideleo, your reasoning is correct =)



Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #166
Big thanks TheQuertiest for your work on this component!

I released a theme based on this, you can get it there if you want to try it:
   https://github.com/Ottodix/Eole-foobar-theme

Most of this theme is made possible by SMP

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #167
Looks awesome! Guess it's time to make that script showcase page :D
It might be a good idea to create a separate thread for your theme though, otherwise it might get lost in this thread and not get the attention it deserves...

 

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #168
Conceptual question: what is the use of setting to null the variable that holds the graphics object, after using the GetGraphics() and thereon the ReleaseGraphics() methods?
I'm late

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #169
Conceptual question: what is the use of setting to null the variable that holds the graphics object, after using the GetGraphics() and thereon the ReleaseGraphics() methods?
Making sure that the GC collect and free up the allocated memory for this graphic object, if you declared it as a global variable ? That's my guess

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #170
...if you declared it as a global variable...

In the sample scripts I've seen, it is always declared locally and nevertheless set to null at closure. But isn't it redundant after the ReleaseGraphics() method, given how spider monkey GC works?

P.S.
I noticed the StackBlur (text).js sample script does not bother to set the graphics object variable to null, after running the ReleaseGraphics() method. It's the only exception, though. What is the difference, for example, with the thumbs.js sample script? Why is setting the graphics object variable to null required in the latter and not in the first?
I'm late

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #171
@TheQwertiest: many thanks for your Spider Monkey Panel!

@TheQwertiest and other other developers:

Would it be possible to have a simple code for a simple volume control with 2 images: a dot and a knob with your panel?

(I've both images)

Thanks in advance.

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #172
Well,, I swtched to WSH panel mod and the "DarkOne Volume Knob Panel  v3.1" vworks fine now  with my Foobar v1.4.3 (DUI).  :)

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #173
I'm working on a one-panel theme and so I turned some of my stand-alone scripts to objects. With stand-alone scripts, though, we are able to draw portions of graphic elements by placing the drawing coordinates virtually outside of the window, relying on the fact that only the pixels inside the window will be painted. This is especially helpful (at least it helped me) in animating a scrolling motion.
Obviously this trick is not available in a one-panel script, where coordinates outside of the target area (the area I actually want to paint) are nevertheless inside the main window, and will be painted anyway.
So, is there a general way to mask or clip the portion of a graphic element that falls outside of a given area?
Let's say I have an object with x, y, width and height properties which define a region of the window, and than a draw() method which executes a few GdiGraphics methods. I want to make sure that when the draw() method is called, only the region defined by the object x, y, width and height properties is painted. How can I achieve that?
I'm late

Re: Spider Monkey Panel (foo_spider_monkey_panel)

Reply #174
For the record, I actually managed to get the above mentioned effect, but I cannot stress enough how much I dislike my solution:

Code: [Select]
var repainting = false;
var repaint_done = false;
var myObj = new PaintRegion(700, 400, 500, 300)


function on_paint(gr){
    myObj.paint(gr);
}


function PaintRegion(x, y, w, h){
    this.x = x;
    this.y = y;
    this.w = w;
    this.h = h;
    this.paint = (gr) => {
        if (repainting) // some GdiGraphics method...
        repainting = !repainting ;
        if (!repaint_done) window.RepaintRect(this.x, this.y, this.w, this.h);
        repaint_done = true
    }
}

I'm not comfortable triggering a RepaintRect method with the on_paint() callback and I have to pay attention that whenever the on_paint event is called, the repainting and repaint_done global variables are set to the proper value. If this is the right direction I can work on it to make it safe, but I reckon there must be a better way.


P.S.
After some tests with multiple objects I settled on the following version which seems to be pretty fluent:
Code: [Select]
function PaintRegion(x, y, w, h){
    this.x = x;
    this.y = y;
    this.w = w;
    this.h = h;
    this.repainting = false;
    this.repaint_done = false;
    this.paint = (gr) => {
        if (this.repainting) //draw something...;
        this.repainting = !this.repainting;
        if (!this.repaint_done) window.RepaintRect(this.x, this.y, this.w, this.h);
        this.repaint_done = !this.repaint_done
    }
}

Still looking forward to insights from skilled coders.
I'm late