Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
a2716c35
Commit
a2716c35
authored
27 years ago
by
Marcus Comstedt
Browse files
Options
Downloads
Patches
Plain Diff
Fonts and basic text rendering.
Rev: lib/modules/Protocols.pmod/X.pmod/Types.pmod:1.19
parent
c285b73c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Protocols.pmod/X.pmod/Types.pmod
+86
-1
86 additions, 1 deletion
lib/modules/Protocols.pmod/X.pmod/Types.pmod
with
86 additions
and
1 deletion
lib/modules/Protocols.pmod/X.pmod/Types.pmod
+
86
−
1
View file @
a2716c35
...
@@ -18,6 +18,44 @@ class XResource
...
@@ -18,6 +18,44 @@ class XResource
}
}
}
}
class Font
{
inherit XResource;
object QueryTextExtents_req(string str)
{
object req = Requests.QueryTextExtents();
req->font = id;
req->str = str;
return req;
}
mapping(string:int) QueryTextExtents16(string str)
{
object req = QueryTextExtents_req(str);
return display->blocking_request(req)[1];
}
mapping(string:int) QueryTextExtents(string str)
{
return QueryTextExtents16("\0"+str/""*"\0");
}
object CloseFont_req()
{
object req = Requests.CloseFont();
req->id = id;
return req;
}
void CloseFont()
{
object req = CloseFont_req();
display->send_request(req);
}
}
class Visual
class Visual
{
{
inherit XResource;
inherit XResource;
...
@@ -36,6 +74,8 @@ class GC
...
@@ -36,6 +74,8 @@ class GC
{
{
inherit XResource;
inherit XResource;
mapping(string:mixed) values;
object ChangeGC_req(mapping attributes)
object ChangeGC_req(mapping attributes)
{
{
object req = Requests.ChangeGC();
object req = Requests.ChangeGC();
...
@@ -48,6 +88,20 @@ class GC
...
@@ -48,6 +88,20 @@ class GC
{
{
object req = ChangeGC_req(attributes);
object req = ChangeGC_req(attributes);
display->send_request(req);
display->send_request(req);
values |= attributes;
}
mapping(string:mixed) GetGCValues()
{
return values;
}
void create(mixed ... args)
{
::create(@args);
values = mkmapping(_Xlib.gc_attributes,
({ 3, -1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 4, 1 }));
}
}
}
}
...
@@ -196,7 +250,7 @@ class Drawable
...
@@ -196,7 +250,7 @@ class Drawable
object req = FillPoly_req(gc->id, shape, coordMode, points);
object req = FillPoly_req(gc->id, shape, coordMode, points);
display->send_request(req);
display->send_request(req);
}
}
object FillRectangles_req(int gc, array(object) r)
object FillRectangles_req(int gc, array(object) r)
{
{
object req = Requests.PolyFillRectangle();
object req = Requests.PolyFillRectangle();
...
@@ -251,6 +305,25 @@ class Drawable
...
@@ -251,6 +305,25 @@ class Drawable
req->format = format;
req->format = format;
display->send_request(req);
display->send_request(req);
}
}
object ImageText8_req(int gc, int x, int y, string str)
{
object req = Requests.ImageText8();
req->drawable = id;
req->gc = gc;
req->x = x;
req->y = y;
req->str = str;
return req;
}
void ImageText8(object gc, int x, int y, string str)
{
if(sizeof(str)>255)
error("ImageText8: string to long\n");
object req = ImageText8_req(gc->id, x, y, str);
display->send_request(req);
}
}
}
class Pixmap
class Pixmap
...
@@ -602,6 +675,18 @@ class Window
...
@@ -602,6 +675,18 @@ class Window
display->send_request(Map_req());
display->send_request(Map_req());
}
}
object Unmap_req()
{
object req = Requests.UnmapWindow();
req->id = id;
return req;
}
void Unmap()
{
display->send_request(Unmap_req());
}
object ListProperties_req()
object ListProperties_req()
{
{
object req = Requests.ListProperties();
object req = Requests.ListProperties();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment