Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
5ee03109
Commit
5ee03109
authored
Apr 19, 2003
by
Emmanuel Puig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed wrapping for texts
* Filling GTK2Graphics and GTK2Region destructors
parent
25ebbc9d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
50 deletions
+62
-50
modules/gui/skins/gtk2/gtk2_font.cpp
modules/gui/skins/gtk2/gtk2_font.cpp
+25
-2
modules/gui/skins/gtk2/gtk2_graphics.cpp
modules/gui/skins/gtk2/gtk2_graphics.cpp
+16
-29
modules/gui/skins/gtk2/gtk2_graphics.h
modules/gui/skins/gtk2/gtk2_graphics.h
+4
-4
modules/gui/skins/src/graphics.h
modules/gui/skins/src/graphics.h
+5
-2
modules/gui/skins/win32/win32_graphics.cpp
modules/gui/skins/win32/win32_graphics.cpp
+8
-9
modules/gui/skins/win32/win32_graphics.h
modules/gui/skins/win32/win32_graphics.h
+4
-4
No files found.
modules/gui/skins/gtk2/gtk2_font.cpp
View file @
5ee03109
...
...
@@ -2,7 +2,7 @@
* gtk2_font.cpp: GTK2 implementation of the Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_font.cpp,v 1.
9 2003/04/17 17:45:38 asmax
Exp $
* $Id: gtk2_font.cpp,v 1.
10 2003/04/19 02:34:47 karibu
Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -92,7 +92,30 @@ void GTK2Font::GenericPrint( Graphics *dest, string text, int x, int y,
// Set text
pango_layout_set_text
(
Layout
,
text
.
c_str
(),
text
.
length
()
);
pango_layout_set_width
(
Layout
,
w
*
PANGO_SCALE
);
// Set size
int
real_w
,
real_h
;
GetSize
(
text
,
real_w
,
real_h
);
if
(
real_w
>
w
)
{
// Change clipping region
Region
*
TextClipRgn
=
(
Region
*
)
new
OSRegion
(
x
,
y
,
w
,
h
);
dest
->
SetClipRegion
(
TextClipRgn
);
delete
TextClipRgn
;
w
=
real_w
;
if
(
align
==
VLC_FONT_ALIGN_RIGHT
)
x
+=
w
-
real_w
;
else
if
(
align
==
VLC_FONT_ALIGN_CENTER
)
x
+=
(
w
-
real_w
)
/
2
;
// Put old clip region
dest
->
ResetClipRegion
();
}
else
{
pango_layout_set_width
(
Layout
,
w
*
PANGO_SCALE
);
}
// Set attributes
pango_layout_set_alignment
(
Layout
,
(
PangoAlignment
)
align
);
...
...
modules/gui/skins/gtk2/gtk2_graphics.cpp
View file @
5ee03109
...
...
@@ -2,7 +2,7 @@
* gtk2_graphics.cpp: GTK2 implementation of the Graphics and Region classes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_graphics.cpp,v 1.1
2 2003/04/17 17:45:38 asmax
Exp $
* $Id: gtk2_graphics.cpp,v 1.1
3 2003/04/19 02:34:47 karibu
Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -42,21 +42,6 @@
//---------------------------------------------------------------------------
GTK2Graphics
::
GTK2Graphics
(
int
w
,
int
h
,
Window
*
from
)
:
Graphics
(
w
,
h
)
{
/* HBITMAP HImage ;
Image = CreateCompatibleDC( NULL );
if( from != NULL )
{
HDC DC = GetWindowDC( ( (GTK2Window *)from )->GetHandle() );
HImage = CreateCompatibleBitmap( DC, w, h );
ReleaseDC( ( (GTK2Window *)from )->GetHandle(), DC );
}
else
{
HImage = CreateCompatibleBitmap( Image, w, h );
}
SelectObject( Image, HImage );
DeleteObject( HImage );*/
if
(
from
!=
NULL
)
{
GdkWindow
*
fromWnd
=
(
(
GTK2Window
*
)
from
)
->
GetHandle
();
...
...
@@ -69,32 +54,23 @@ GTK2Graphics::GTK2Graphics( int w, int h, Window *from ) : Graphics( w, h )
gdk_drawable_set_colormap
(
Image
,
gdk_colormap_get_system
()
);
Gc
=
gdk_gc_new
(
Image
);
}
// Set the background color to black
gdk_draw_rectangle
(
Image
,
Gc
,
TRUE
,
0
,
0
,
w
,
h
);
}
//---------------------------------------------------------------------------
GTK2Graphics
::~
GTK2Graphics
()
{
/* DeleteDC( Image );*/
g_object_unref
(
Gc
);
g_object_unref
(
Image
);
}
//---------------------------------------------------------------------------
void
GTK2Graphics
::
CopyFrom
(
int
dx
,
int
dy
,
int
dw
,
int
dh
,
Graphics
*
Src
,
int
sx
,
int
sy
,
int
Flag
)
{
/* BitBlt( Image, dx, dy, dw, dh, ( (GTK2Graphics *)Src )->GetImageHandle(),
sx, sy, Flag );*/
gdk_draw_drawable
(
Image
,
Gc
,
((
GTK2Graphics
*
)
Src
)
->
GetImage
(),
sx
,
sy
,
dx
,
dy
,
dw
,
dh
);
}
//---------------------------------------------------------------------------
/*void GTK2Graphics::CopyTo( Graphics *Dest, int dx, int dy, int dw, int dh,
int sx, int sy, int Flag )
{
BitBlt( ( (GTK2Graphics *)Dest )->GetImageHandle(), dx, dy, dw, dh, Image,
sx, sy, Flag );
}*/
//---------------------------------------------------------------------------
void
GTK2Graphics
::
DrawRect
(
int
x
,
int
y
,
int
w
,
int
h
,
int
color
)
{
...
...
@@ -106,7 +82,18 @@ void GTK2Graphics::SetClipRegion( Region *rgn )
gdk_gc_set_clip_region
(
Gc
,
(
(
GTK2Region
*
)
rgn
)
->
GetHandle
()
);
}
//---------------------------------------------------------------------------
void
GTK2Graphics
::
ResetClipRegion
()
{
GdkRectangle
rect
;
rect
.
x
=
0
;
rect
.
y
=
0
;
rect
.
width
=
Width
;
rect
.
height
=
Height
;
GdkRegion
*
rgn
=
gdk_region_rectangle
(
&
rect
);
gdk_gc_set_clip_region
(
Gc
,
rgn
);
gdk_region_destroy
(
rgn
);
}
//---------------------------------------------------------------------------
...
...
modules/gui/skins/gtk2/gtk2_graphics.h
View file @
5ee03109
...
...
@@ -2,7 +2,7 @@
* gtk2_graphics.h: GTK2 implementation of the Graphics and Region classes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_graphics.h,v 1.
3 2003/04/14 20:07:49 asmax
Exp $
* $Id: gtk2_graphics.h,v 1.
4 2003/04/19 02:34:47 karibu
Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -37,11 +37,10 @@ class Window;
//---------------------------------------------------------------------------
class
GTK2Graphics
:
public
Graphics
{
private:
int
Width
;
int
Height
;
protected:
GdkDrawable
*
Image
;
GdkGC
*
Gc
;
public:
// Constructor
GTK2Graphics
(
int
w
,
int
h
,
Window
*
from
=
NULL
);
...
...
@@ -56,6 +55,7 @@ class GTK2Graphics : public Graphics
// Clipping methods
virtual
void
SetClipRegion
(
Region
*
rgn
);
virtual
void
ResetClipRegion
();
// Specific GTK2 methods
GdkDrawable
*
GetImage
()
{
return
Image
;
};
...
...
modules/gui/skins/src/graphics.h
View file @
5ee03109
...
...
@@ -2,7 +2,7 @@
* graphics.h: Graphics and Region classes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: graphics.h,v 1.
1 2003/03/18 02:21:47 ipkiss
Exp $
* $Id: graphics.h,v 1.
2 2003/04/19 02:34:47 karibu
Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -33,9 +33,10 @@ class Region;
//---------------------------------------------------------------------------
class
Graphics
{
pr
ivate
:
pr
otected
:
int
Width
;
int
Height
;
public:
// Constructor
Graphics
(
int
w
,
int
h
);
...
...
@@ -50,6 +51,8 @@ class Graphics
// Clipping methods
virtual
void
SetClipRegion
(
Region
*
rgn
)
=
0
;
virtual
void
ResetClipRegion
()
=
0
;
};
//---------------------------------------------------------------------------
class
Region
...
...
modules/gui/skins/win32/win32_graphics.cpp
View file @
5ee03109
...
...
@@ -2,7 +2,7 @@
* win32_graphics.cpp: Win32 implementation of the Graphics and Region classes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_graphics.cpp,v 1.
3 2003/04/16 21:40:07 ipkiss
Exp $
* $Id: win32_graphics.cpp,v 1.
4 2003/04/19 02:34:47 karibu
Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -69,13 +69,6 @@ void Win32Graphics::CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src,
sx
,
sy
,
Flag
);
}
//---------------------------------------------------------------------------
/*void Win32Graphics::CopyTo( Graphics *Dest, int dx, int dy, int dw, int dh,
int sx, int sy, int Flag )
{
BitBlt( ( (Win32Graphics *)Dest )->GetImageHandle(), dx, dy, dw, dh, Image,
sx, sy, Flag );
}*/
//---------------------------------------------------------------------------
void
Win32Graphics
::
DrawRect
(
int
x
,
int
y
,
int
w
,
int
h
,
int
color
)
{
LPRECT
r
=
new
RECT
;
...
...
@@ -94,7 +87,13 @@ void Win32Graphics::SetClipRegion( Region *rgn )
SelectClipRgn
(
Image
,
(
(
Win32Region
*
)
rgn
)
->
GetHandle
()
);
}
//---------------------------------------------------------------------------
void
Win32Graphics
::
ResetClipRegion
()
{
HRGN
rgn
=
CreateRectRgn
(
0
,
0
,
Width
,
Height
);
SelectClipRgn
(
Image
,
rgn
);
DeleteObject
(
rgn
);
}
//---------------------------------------------------------------------------
...
...
modules/gui/skins/win32/win32_graphics.h
View file @
5ee03109
...
...
@@ -2,7 +2,7 @@
* win32_graphics.h: Win32 implementation of the Graphics and Region classes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_graphics.h,v 1.
2 2003/04/12 21:43:27 asmax
Exp $
* $Id: win32_graphics.h,v 1.
3 2003/04/19 02:34:47 karibu
Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
...
...
@@ -35,10 +35,9 @@ class Window;
//---------------------------------------------------------------------------
class
Win32Graphics
:
public
Graphics
{
private:
int
Width
;
int
Height
;
protected:
HDC
Image
;
public:
// Constructor
Win32Graphics
(
int
w
,
int
h
,
Window
*
from
=
NULL
);
...
...
@@ -53,6 +52,7 @@ class Win32Graphics : public Graphics
// Clipping methods
virtual
void
SetClipRegion
(
Region
*
rgn
);
virtual
void
ResetClipRegion
();
// Specific win32 methods
HDC
GetImageHandle
()
{
return
Image
;
};
...
...
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