Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
a8283ef6
Commit
a8283ef6
authored
Mar 22, 2004
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all : skeleton of a future bitmap font support
* skin.dtd : new BitmapFont element
parent
7965c4dd
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
184 additions
and
11 deletions
+184
-11
modules/gui/skins2/Modules.am
modules/gui/skins2/Modules.am
+3
-0
modules/gui/skins2/src/bitmap_font.cpp
modules/gui/skins2/src/bitmap_font.cpp
+39
-0
modules/gui/skins2/src/bitmap_font.hpp
modules/gui/skins2/src/bitmap_font.hpp
+54
-0
modules/gui/skins2/src/ft2_font.hpp
modules/gui/skins2/src/ft2_font.hpp
+1
-4
modules/gui/skins2/src/generic_bitmap.cpp
modules/gui/skins2/src/generic_bitmap.cpp
+50
-0
modules/gui/skins2/src/generic_bitmap.hpp
modules/gui/skins2/src/generic_bitmap.hpp
+29
-2
modules/gui/skins2/src/generic_font.hpp
modules/gui/skins2/src/generic_font.hpp
+2
-5
share/skins2/default/skin.dtd
share/skins2/default/skin.dtd
+6
-0
No files found.
modules/gui/skins2/Modules.am
View file @
a8283ef6
...
...
@@ -79,12 +79,15 @@ SOURCES_skins2 = \
\
src/anchor.cpp \
src/anchor.hpp \
src/bitmap_font.cpp \
src/bitmap_font.hpp \
src/dialogs.cpp \
src/dialogs.hpp \
src/ft2_bitmap.cpp \
src/ft2_bitmap.hpp \
src/ft2_font.cpp \
src/ft2_font.hpp \
src/generic_bitmap.cpp \
src/generic_bitmap.hpp \
src/generic_font.hpp \
src/generic_layout.cpp \
...
...
modules/gui/skins2/src/bitmap_font.cpp
0 → 100644
View file @
a8283ef6
/*****************************************************************************
* bitmap_font.cpp
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "bitmap_font.hpp"
#include "generic_bitmap.hpp"
BitmapFont
::
BitmapFont
(
intf_thread_t
*
pIntf
,
const
GenericBitmap
&
rBitmap
)
:
GenericFont
(
pIntf
),
m_rBitmap
(
rBitmap
)
{
}
GenericBitmap
*
BitmapFont
::
drawString
(
const
UString
&
rString
,
uint32_t
color
,
int
maxWidth
)
const
{
return
NULL
;
}
modules/gui/skins2/src/bitmap_font.hpp
0 → 100644
View file @
a8283ef6
/*****************************************************************************
* bitmap_font.hpp
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef BITMAP_FONT_HPP
#define BITMAP_FONT_HPP
#include "generic_font.hpp"
class
GenericBitmap
;
/// Class to handle bitmap fonts
class
BitmapFont
:
public
GenericFont
{
public:
BitmapFont
(
intf_thread_t
*
pIntf
,
const
GenericBitmap
&
rBitmap
);
virtual
~
BitmapFont
()
{}
virtual
bool
init
()
{
return
true
;
}
/// Render a string on a bitmap.
/// If maxWidth != -1, the text is truncated with '...'
virtual
GenericBitmap
*
drawString
(
const
UString
&
rString
,
uint32_t
color
,
int
maxWidth
=
-
1
)
const
;
/// Get the font size
virtual
int
getSize
()
const
{
return
12
;
}
private:
/// Bitmap
const
GenericBitmap
&
m_rBitmap
;
};
#endif
modules/gui/skins2/src/ft2_font.hpp
View file @
a8283ef6
...
...
@@ -2,7 +2,7 @@
* ft2_font.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: ft2_font.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
...
...
@@ -47,9 +47,6 @@ class FT2Font: public GenericFont
/// Render a string on a bitmap.
/// If maxWidth != -1, the text is truncated with '...'
/// rAscent is filled with the maximum ascent of the glyphs in
/// the string (for explanations, see:
/// http://www.freetype.org/freetype2/docs/tutorial/step2.html)
virtual
GenericBitmap
*
drawString
(
const
UString
&
rString
,
uint32_t
color
,
int
maxWidth
=
-
1
)
const
;
...
...
modules/gui/skins2/src/generic_bitmap.cpp
0 → 100644
View file @
a8283ef6
/*****************************************************************************
* generic_bitmap.cpp
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "generic_bitmap.hpp"
SubBitmap
::
SubBitmap
(
intf_thread_t
*
pIntf
,
const
GenericBitmap
&
rSource
,
int
left
,
int
top
,
int
width
,
int
height
)
:
GenericBitmap
(
pIntf
),
m_width
(
width
),
m_height
(
height
),
m_pData
(
NULL
)
{
m_pData
=
new
uint8_t
[
width
*
height
*
4
];
uint32_t
*
pSrc
=
(
uint32_t
*
)
rSource
.
getData
();
uint32_t
*
pDest
=
(
uint32_t
*
)
m_pData
;
int
srcWidth
=
rSource
.
getWidth
();
for
(
int
y
=
top
;
y
<
top
+
height
;
y
++
)
{
memcpy
(
pDest
,
pSrc
,
4
*
width
);
pSrc
+=
srcWidth
;
pDest
+=
width
;
}
}
SubBitmap
::~
SubBitmap
()
{
delete
[]
m_pData
;
}
modules/gui/skins2/src/generic_bitmap.hpp
View file @
a8283ef6
...
...
@@ -2,7 +2,7 @@
* generic_bitmap.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: generic_bitmap.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
...
...
@@ -29,7 +29,7 @@
#include "../utils/pointer.hpp"
///
b
ase class for bitmaps
///
B
ase class for bitmaps
class
GenericBitmap
:
public
SkinObject
{
public:
...
...
@@ -49,6 +49,33 @@ class GenericBitmap: public SkinObject
GenericBitmap
(
intf_thread_t
*
pIntf
)
:
SkinObject
(
pIntf
)
{}
};
/// Bitmap created from a region of another bitmap
class
SubBitmap
:
public
GenericBitmap
{
public:
SubBitmap
(
intf_thread_t
*
pIntf
,
const
GenericBitmap
&
rSource
,
int
left
,
int
top
,
int
width
,
int
height
);
~
SubBitmap
();
/// Get the width of the bitmap
virtual
int
getWidth
()
const
{
return
m_width
;
}
/// Get the heighth of the bitmap
virtual
int
getHeight
()
const
{
return
m_height
;
}
/// Get a linear buffer containing the image data.
/// Each pixel is stored in 4 bytes in the order B,G,R,A
virtual
uint8_t
*
getData
()
const
{
return
m_pData
;
}
private:
/// Size of the bitmap.
int
m_width
,
m_height
;
/// Buffer containing the image data.
uint8_t
*
m_pData
;
};
typedef
CountedPtr
<
GenericBitmap
>
GenericBitmapPtr
;
#endif
modules/gui/skins2/src/generic_font.hpp
View file @
a8283ef6
...
...
@@ -2,7 +2,7 @@
* generic_font.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: generic_font.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr>
...
...
@@ -41,13 +41,10 @@ class GenericFont: public SkinObject
/// Render a string on a bitmap.
/// If maxWidth != -1, the text is truncated with '...'
/// rAscent is filled with the maximum ascent of the glyphs in
/// the string (for explanations, see:
/// http://www.freetype.org/freetype2/docs/tutorial/step2.html)
/// The Bitmap is _not_ owned by this object
virtual
GenericBitmap
*
drawString
(
const
UString
&
rString
,
uint32_t
color
,
int
maxWidth
=
-
1
)
const
=
0
;
/// Get the font size
virtual
int
getSize
()
const
=
0
;
...
...
share/skins2/default/skin.dtd
View file @
a8283ef6
...
...
@@ -28,6 +28,12 @@
italic CDATA "false"
underline CDATA "false"
>
<!ELEMENT BitmapFont EMPTY>
<!ATTLIST Font
id CDATA #REQUIRED
file CDATA #REQUIRED
type CDATA "digits"
>
<!ELEMENT ThemeInfo EMPTY>
<!ATTLIST ThemeInfo
name CDATA #IMPLIED
...
...
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