Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
58cfde68
Commit
58cfde68
authored
Apr 04, 2013
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: cosmetic
parent
4490c867
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
106 deletions
+104
-106
modules/gui/skins2/controls/ctrl_slider.cpp
modules/gui/skins2/controls/ctrl_slider.cpp
+0
-1
modules/gui/skins2/controls/ctrl_slider.hpp
modules/gui/skins2/controls/ctrl_slider.hpp
+1
-0
modules/gui/skins2/utils/pointer.hpp
modules/gui/skins2/utils/pointer.hpp
+0
-105
modules/gui/skins2/utils/position.hpp
modules/gui/skins2/utils/position.hpp
+103
-0
No files found.
modules/gui/skins2/controls/ctrl_slider.cpp
View file @
58cfde68
...
...
@@ -31,7 +31,6 @@
#include "../src/top_window.hpp"
#include "../src/os_factory.hpp"
#include "../src/os_graphics.hpp"
#include "../utils/position.hpp"
#include "../utils/var_percent.hpp"
...
...
modules/gui/skins2/controls/ctrl_slider.hpp
View file @
58cfde68
...
...
@@ -29,6 +29,7 @@
#include "../utils/bezier.hpp"
#include "../utils/fsm.hpp"
#include "../utils/observer.hpp"
#include "../utils/position.hpp"
class
GenericBitmap
;
...
...
modules/gui/skins2/utils/pointer.hpp
View file @
58cfde68
...
...
@@ -92,109 +92,4 @@ private:
}
};
class
rect
{
public:
rect
(
int
v_x
=
0
,
int
v_y
=
0
,
int
v_width
=
0
,
int
v_height
=
0
)
:
x
(
v_x
),
y
(
v_y
),
width
(
v_width
),
height
(
v_height
)
{
}
~
rect
()
{
}
int
x
;
int
y
;
int
width
;
int
height
;
// rect2 fully included in rect1
static
bool
isIncluded
(
const
rect
&
rect2
,
const
rect
&
rect1
)
{
int
x1
=
rect1
.
x
;
int
y1
=
rect1
.
y
;
int
w1
=
rect1
.
width
;
int
h1
=
rect1
.
height
;
int
x2
=
rect2
.
x
;
int
y2
=
rect2
.
y
;
int
w2
=
rect2
.
width
;
int
h2
=
rect2
.
height
;
return
x2
>=
x1
&&
x2
+
w2
<=
x1
+
w1
&&
y2
>=
y1
&&
y2
+
h2
<=
y1
+
h1
;
}
static
bool
areDisjunct
(
const
rect
&
rect2
,
const
rect
&
rect1
)
{
int
x1
=
rect1
.
x
;
int
y1
=
rect1
.
y
;
int
w1
=
rect1
.
width
;
int
h1
=
rect1
.
height
;
int
x2
=
rect2
.
x
;
int
y2
=
rect2
.
y
;
int
w2
=
rect2
.
width
;
int
h2
=
rect2
.
height
;
return
y2
+
h2
-
1
<
y1
// rect2 above rect1
||
y2
>
y1
+
h1
-
1
// rect2 under rect1
||
x2
>
x1
+
w1
-
1
// rect2 right of rect1
||
x2
+
w2
-
1
<
x1
;
// rect2 left of rect1
}
static
bool
intersect
(
const
rect
&
rect1
,
const
rect
&
rect2
,
rect
*
pRect
)
{
int
x1
=
rect1
.
x
;
int
y1
=
rect1
.
y
;
int
w1
=
rect1
.
width
;
int
h1
=
rect1
.
height
;
int
x2
=
rect2
.
x
;
int
y2
=
rect2
.
y
;
int
w2
=
rect2
.
width
;
int
h2
=
rect2
.
height
;
if
(
areDisjunct
(
rect1
,
rect2
)
)
return
false
;
else
{
int
left
=
max
(
x1
,
x2
);
int
right
=
min
(
x1
+
w1
-
1
,
x2
+
w2
-
1
);
int
top
=
max
(
y1
,
y2
);
int
bottom
=
min
(
y1
+
h1
-
1
,
y2
+
h2
-
1
);
pRect
->
x
=
left
;
pRect
->
y
=
top
;
pRect
->
width
=
right
-
left
+
1
;
pRect
->
height
=
bottom
-
top
+
1
;
return
pRect
->
width
>
0
&&
pRect
->
height
>
0
;
}
}
static
bool
join
(
const
rect
&
rect1
,
const
rect
&
rect2
,
rect
*
pRect
)
{
int
x1
=
rect1
.
x
;
int
y1
=
rect1
.
y
;
int
w1
=
rect1
.
width
;
int
h1
=
rect1
.
height
;
int
x2
=
rect2
.
x
;
int
y2
=
rect2
.
y
;
int
w2
=
rect2
.
width
;
int
h2
=
rect2
.
height
;
int
left
=
min
(
x1
,
x2
);
int
right
=
max
(
x1
+
w1
-
1
,
x2
+
w2
-
1
);
int
top
=
min
(
y1
,
y2
);
int
bottom
=
max
(
y1
+
h1
-
1
,
y2
+
h2
-
1
);
pRect
->
x
=
left
;
pRect
->
y
=
top
;
pRect
->
width
=
right
-
left
+
1
;
pRect
->
height
=
bottom
-
top
+
1
;
return
pRect
->
width
>
0
&&
pRect
->
height
>
0
;
}
static
int
min
(
int
x
,
int
y
)
{
return
x
<
y
?
x
:
y
;
}
static
int
max
(
int
x
,
int
y
)
{
return
x
<
y
?
y
:
x
;
}
};
#endif
modules/gui/skins2/utils/position.hpp
View file @
58cfde68
...
...
@@ -162,4 +162,107 @@ private:
};
class
rect
{
public:
rect
(
int
v_x
=
0
,
int
v_y
=
0
,
int
v_width
=
0
,
int
v_height
=
0
)
:
x
(
v_x
),
y
(
v_y
),
width
(
v_width
),
height
(
v_height
)
{
}
~
rect
()
{
}
int
x
;
int
y
;
int
width
;
int
height
;
// rect2 fully included in rect1
static
bool
isIncluded
(
const
rect
&
rect2
,
const
rect
&
rect1
)
{
int
x1
=
rect1
.
x
;
int
y1
=
rect1
.
y
;
int
w1
=
rect1
.
width
;
int
h1
=
rect1
.
height
;
int
x2
=
rect2
.
x
;
int
y2
=
rect2
.
y
;
int
w2
=
rect2
.
width
;
int
h2
=
rect2
.
height
;
return
x2
>=
x1
&&
x2
+
w2
<=
x1
+
w1
&&
y2
>=
y1
&&
y2
+
h2
<=
y1
+
h1
;
}
static
bool
areDisjunct
(
const
rect
&
rect2
,
const
rect
&
rect1
)
{
int
x1
=
rect1
.
x
;
int
y1
=
rect1
.
y
;
int
w1
=
rect1
.
width
;
int
h1
=
rect1
.
height
;
int
x2
=
rect2
.
x
;
int
y2
=
rect2
.
y
;
int
w2
=
rect2
.
width
;
int
h2
=
rect2
.
height
;
return
y2
+
h2
-
1
<
y1
// rect2 above rect1
||
y2
>
y1
+
h1
-
1
// rect2 under rect1
||
x2
>
x1
+
w1
-
1
// rect2 right of rect1
||
x2
+
w2
-
1
<
x1
;
// rect2 left of rect1
}
static
bool
intersect
(
const
rect
&
rect1
,
const
rect
&
rect2
,
rect
*
pRect
)
{
int
x1
=
rect1
.
x
;
int
y1
=
rect1
.
y
;
int
w1
=
rect1
.
width
;
int
h1
=
rect1
.
height
;
int
x2
=
rect2
.
x
;
int
y2
=
rect2
.
y
;
int
w2
=
rect2
.
width
;
int
h2
=
rect2
.
height
;
if
(
areDisjunct
(
rect1
,
rect2
)
)
return
false
;
else
{
int
left
=
max
(
x1
,
x2
);
int
right
=
min
(
x1
+
w1
-
1
,
x2
+
w2
-
1
);
int
top
=
max
(
y1
,
y2
);
int
bottom
=
min
(
y1
+
h1
-
1
,
y2
+
h2
-
1
);
pRect
->
x
=
left
;
pRect
->
y
=
top
;
pRect
->
width
=
right
-
left
+
1
;
pRect
->
height
=
bottom
-
top
+
1
;
return
pRect
->
width
>
0
&&
pRect
->
height
>
0
;
}
}
static
bool
join
(
const
rect
&
rect1
,
const
rect
&
rect2
,
rect
*
pRect
)
{
int
x1
=
rect1
.
x
;
int
y1
=
rect1
.
y
;
int
w1
=
rect1
.
width
;
int
h1
=
rect1
.
height
;
int
x2
=
rect2
.
x
;
int
y2
=
rect2
.
y
;
int
w2
=
rect2
.
width
;
int
h2
=
rect2
.
height
;
int
left
=
min
(
x1
,
x2
);
int
right
=
max
(
x1
+
w1
-
1
,
x2
+
w2
-
1
);
int
top
=
min
(
y1
,
y2
);
int
bottom
=
max
(
y1
+
h1
-
1
,
y2
+
h2
-
1
);
pRect
->
x
=
left
;
pRect
->
y
=
top
;
pRect
->
width
=
right
-
left
+
1
;
pRect
->
height
=
bottom
-
top
+
1
;
return
pRect
->
width
>
0
&&
pRect
->
height
>
0
;
}
static
int
min
(
int
x
,
int
y
)
{
return
x
<
y
?
x
:
y
;
}
static
int
max
(
int
x
,
int
y
)
{
return
x
<
y
?
y
:
x
;
}
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment