-
Notifications
You must be signed in to change notification settings - Fork 2
/
gsoc _ Elvis Stansvik.html
379 lines (296 loc) · 37 KB
/
gsoc _ Elvis Stansvik.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<!DOCTYPE html>
<!-- saved from url=(0074)http://web.archive.org/web/20110811234905/http://estan.dose.se:80/tag/gsoc -->
<html dir="ltr" lang="en-US"><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script type="text/javascript" src="http://web.archive.org/static/js/analytics.js?v=1494891701.0" charset="utf-8"></script>
<script type="text/javascript">archive_analytics.values.service='wb';archive_analytics.values.server_name='wwwb-app36.us.archive.org';archive_analytics.values.server_ms=469;</script>
<script type="text/javascript" src="./gsoc _ Elvis Stansvik cleaned_files/wbhack.js" charset="utf-8"></script>
<script type="text/javascript">
__wbhack.init('');
</script>
<link rel="stylesheet" type="text/css" href="./gsoc _ Elvis Stansvik cleaned_files/banner-styles.css">
<link rel="stylesheet" type="text/css" href="./gsoc _ Elvis Stansvik cleaned_files/iconochive.css">
<!-- End Wayback Rewrite JS Include -->
<meta name="viewport" content="width=device-width">
<title>gsoc | Elvis Stansvik</title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="stylesheet" type="text/css" media="all" href="./gsoc _ Elvis Stansvik cleaned_files/style.css">
<link rel="pingback" href="http://estan.dose.se/xmlrpc.php">
<!--[if lt IE 9]>
<script src="http://estan.dose.se/wp-content/themes/twentyeleven/js/html5.js" type="text/javascript"></script>
<![endif]-->
<link rel="alternate" type="application/rss+xml" title="Elvis Stansvik » Feed" href="http://web.archive.org/web/20110811234905/http://estan.dose.se/feed">
<link rel="alternate" type="application/rss+xml" title="Elvis Stansvik » Comments Feed" href="http://web.archive.org/web/20110811234905/http://estan.dose.se/comments/feed">
<link rel="alternate" type="application/rss+xml" title="Elvis Stansvik » gsoc Tag Feed" href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/gsoc/feed">
<link rel="stylesheet" id="mediaelementjs-styles-css" href="./gsoc _ Elvis Stansvik cleaned_files/mediaelementplayer.css" type="text/css" media="all">
<script type="text/javascript" src="./gsoc _ Elvis Stansvik cleaned_files/l10n.js"></script>
<script type="text/javascript" src="./gsoc _ Elvis Stansvik cleaned_files/jquery.js"></script>
<script type="text/javascript" src="./gsoc _ Elvis Stansvik cleaned_files/mediaelement-and-player.min.js"></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://estan.dose.se/xmlrpc.php?rsd">
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://estan.dose.se/wp-includes/wlwmanifest.xml">
<link rel="index" title="Elvis Stansvik" href="http://estan.dose.se/">
<meta name="generator" content="WordPress 3.2">
</head>
<body class="archive tag tag-gsoc tag-20 single-author two-column right-sidebar" tcap-name="mainman"><div id="wm-ipp" lang="en" style="display: block; direction: ltr;" class="">
</div><!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="./gsoc _ Elvis Stansvik cleaned_files/timestamp.js" charset="utf-8"></script>
<script type="text/javascript" src="./gsoc _ Elvis Stansvik cleaned_files/graph-calc.js" charset="utf-8"></script>
<script type="text/javascript" src="./gsoc _ Elvis Stansvik cleaned_files/auto-complete.js" charset="utf-8"></script>
<script type="text/javascript" src="./gsoc _ Elvis Stansvik cleaned_files/toolbar.js" charset="utf-8"></script>
<style type="text/css">
body {
margin-top:0 !important;
padding-top:0 !important;
min-width:800px !important;
}
.wb-autocomplete-suggestions {
text-align: left; cursor: default; border: 1px solid #ccc; border-top: 0; background: #fff; box-shadow: -1px 1px 3px rgba(0,0,0,.1);
position: absolute; display: none; z-index: 2147483647; max-height: 254px; overflow: hidden; overflow-y: auto; box-sizing: border-box;
}
.wb-autocomplete-suggestion { position: relative; padding: 0 .6em; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02em; color: #333; }
.wb-autocomplete-suggestion b { font-weight: bold; }
.wb-autocomplete-suggestion.selected { background: #f0f0f0; }
</style>
<script type="text/javascript">
__wm.bt(550,27,25,2,"web","http://estan.dose.se:80/tag/gsoc","2011-08-11",1996);
</script><div class="wb-autocomplete-suggestions " style="left: 249px; top: 710px; width: 404px;"></div>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="page" class="hfeed">
<header id="branding" role="banner">
<hgroup>
<h1 id="site-title"><span><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/" title="Elvis Stansvik" rel="home">Elvis Stansvik</a></span></h1>
<h2 id="site-description">Random stuff on my mind, or reports from my trips</h2>
</hgroup>
</header><!-- #branding -->
<div id="main">
<section id="primary">
<div id="content" role="main">
<header class="page-header">
<h1 class="page-title">Tag Archives: <span>gsoc</span></h1>
</header>
<nav id="nav-above">
<h3 class="assistive-text">Post navigation</h3>
<div class="nav-previous"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/gsoc/page/2"><span class="meta-nav">←</span> Older posts</a></div>
<div class="nav-next"></div>
</nav><!-- #nav-above -->
<article id="post-254" class="post-254 post type-post status-publish format-standard hentry category-technology tag-gsoc tag-planetkde tag-scribus tag-tables">
<header class="entry-header">
<h1 class="entry-title"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/08/brief-gsoc-update-interactive-table-resizing-and-cell-selections" title="Permalink to Brief GSoC Update — Interactive Table Resizing and Cell Selections" rel="bookmark">Brief GSoC Update — Interactive Table Resizing and Cell Selections</a></h1>
<div class="entry-meta">
<span class="sep">Posted on </span><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/08/brief-gsoc-update-interactive-table-resizing-and-cell-selections" title="17:49" rel="bookmark"><time class="entry-date" datetime="2011-08-05T17:49:37+00:00" pubdate="">17:08 on August 5, 2011</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="http://web.archive.org/web/20110811234905/http://estan.dose.se/author/estan" title="View all posts by estan" rel="author">estan</a></span></span> </div><!-- .entry-meta -->
<div class="comments-link">
<a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/08/brief-gsoc-update-interactive-table-resizing-and-cell-selections#comments" title="Comment on Brief GSoC Update — Interactive Table Resizing and Cell Selections">4</a> </div>
</header><!-- .entry-header -->
<div class="entry-content">
<p>Hi everybody,</p>
<p>In the coming days, Ill try to write a longer post with more technical details about my recent work on the project. Until then, heres a short screencast showing some of the new features; interactive table resizing and cell selections. This time it includes me speaking a bit (!). And the format is now WebM/VP8 instead of Ogg/Theora. White areas in the capture got some weird tinting, but thats a screencasting problem and not my code :)</p>
<div id="mep_0" class="mejs-container" style="width: 512px; height: 384px;"><div class="mejs-inner"><div class="mejs-mediaelement"><video id="wp_mep_1" width="512" height="384" preload="true">
<source src="resizing_and_selections.webm" type="video/webm">
<object width="512" height="384" type="application/x-shockwave-flash" data="./gsoc _ Elvis Stansvik cleaned_files/flashmediaelement.swf.téléchargement">
<param name="movie" value="http://estan.dose.se/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf">
<param name="flashvars" value="controls=true&file=">
</object>
</video></div><div class="mejs-layers"><div class="mejs-overlay mejs-layer" style="width: 512px; height: 384px;"><div class="mejs-overlay-loading"><span></span></div></div><div class="mejs-overlay mejs-layer" style="display: none; width: 512px; height: 384px;"><div class="mejs-overlay-error"></div></div><div class="mejs-overlay mejs-layer mejs-overlay-play" style="width: 512px; height: 384px;"><div class="mejs-overlay-button"></div></div></div><div class="mejs-controls" style="visibility: visible;"><div class="mejs-button mejs-playpause-button mejs-play" type="button"><button type="button"></button></div><div class="mejs-time mejs-currenttime-container"><span class="mejs-currenttime">00:00</span></div><div class="mejs-time-rail" style="width: 362px;"><span class="mejs-time-total" style="width: 352px;"><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div><div class="mejs-time mejs-duration-container"><span class="mejs-duration">00:00</span></div><div class="mejs-button mejs-volume-button mejs-mute"><button type="button"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current" style="height: 88px; top: 20px;"></div><div class="mejs-volume-handle" style="top: 17px;"></div></div></div><div class="mejs-button mejs-fullscreen-button"><button type="button"></button></div></div><div class="mejs-clear"></div></div></div>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#wp_mep_1').mediaelementplayer({
m:1
,features: ['playpause','current','progress','duration','volume','tracks','fullscreen']
});
});
</script>
<p><a href="resizing_and_selections.webm">REALLY, DOWNLOAD VIDEO ! (~12 MB WebM)</a></p>
<p>Bye til next time!</p>
</div><!-- .entry-content -->
<footer class="entry-meta">
<span class="cat-links">
<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/category/technology" title="View all posts in Technology" rel="category tag">Technology</a> </span>
<span class="sep"> | </span>
<span class="tag-links">
<span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/gsoc" rel="tag">gsoc</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/planetkde" rel="tag">planetkde</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/scribus" rel="tag">scribus</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/tables" rel="tag">tables</a> </span>
<span class="sep"> | </span>
<span class="comments-link"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/08/brief-gsoc-update-interactive-table-resizing-and-cell-selections#comments" title="Comment on Brief GSoC Update — Interactive Table Resizing and Cell Selections"><b>4</b> Replies</a></span>
</footer><!-- #entry-meta -->
</article><!-- #post-254 -->
<article id="post-204" class="post-204 post type-post status-publish format-standard hentry category-uncategorized tag-gsoc tag-planetkde tag-scribus tag-tables">
<header class="entry-header">
<h1 class="entry-title"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/07/a-story-with-a-happy-ending" title="Permalink to A Story with a Happy Ending" rel="bookmark">A Story with a Happy Ending</a></h1>
<div class="entry-meta">
<span class="sep">Posted on </span><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/07/a-story-with-a-happy-ending" title="14:18" rel="bookmark"><time class="entry-date" datetime="2011-07-08T14:18:44+00:00" pubdate="">14:07 on July 8, 2011</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="http://web.archive.org/web/20110811234905/http://estan.dose.se/author/estan" title="View all posts by estan" rel="author">estan</a></span></span> </div><!-- .entry-meta -->
<div class="comments-link">
<a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/07/a-story-with-a-happy-ending#comments" title="Comment on A Story with a Happy Ending">7</a> </div>
</header><!-- .entry-header -->
<div class="entry-content">
<p>Hi again,</p>
<p>Just a quick follow-up post to give a happy end to my <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/07/bordering-on-the-insane-a-story-of-a-near-collapse">previous woes</a>. Without further ado, I give you Scribus rendering all 43 cases of border joins mentioned in the previous post (I had forgot two of them before):</p>
<p><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/wp-content/uploads/2011/07/43_cases.png"><img src="./gsoc _ Elvis Stansvik cleaned_files/43_cases-331x300.png" alt="The 43 Cases of Border Joins in Scribus" title="The 43 Cases of Border Joins in Scribus" width="331" height="300" class="aligncenter size-medium wp-image-217"></a></p>
<p>Cheers.</p>
</div><!-- .entry-content -->
<footer class="entry-meta">
<span class="cat-links">
<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/category/uncategorized" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a> </span>
<span class="sep"> | </span>
<span class="tag-links">
<span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/gsoc" rel="tag">gsoc</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/planetkde" rel="tag">planetkde</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/scribus" rel="tag">scribus</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/tables" rel="tag">tables</a> </span>
<span class="sep"> | </span>
<span class="comments-link"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/07/a-story-with-a-happy-ending#comments" title="Comment on A Story with a Happy Ending"><b>7</b> Replies</a></span>
</footer><!-- #entry-meta -->
</article><!-- #post-204 -->
<article id="post-193" class="post-193 post type-post status-publish format-standard hentry category-technology tag-gsoc tag-planetkde tag-scribus tag-tables">
<header class="entry-header">
<h1 class="entry-title"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/07/bordering-on-the-insane-a-story-of-a-near-collapse" title="Permalink to Bordering on the Insane — A Story of a Near Collapse" rel="bookmark">Bordering on the Insane — A Story of a Near Collapse</a></h1>
<div class="entry-meta">
<span class="sep">Posted on </span><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/07/bordering-on-the-insane-a-story-of-a-near-collapse" title="14:58" rel="bookmark"><time class="entry-date" datetime="2011-07-05T14:58:04+00:00" pubdate="">14:07 on July 5, 2011</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="http://web.archive.org/web/20110811234905/http://estan.dose.se/author/estan" title="View all posts by estan" rel="author">estan</a></span></span> </div><!-- .entry-meta -->
<div class="comments-link">
<a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/07/bordering-on-the-insane-a-story-of-a-near-collapse#comments" title="Comment on Bordering on the Insane — A Story of a Near Collapse">10</a> </div>
</header><!-- .entry-header -->
<div class="entry-content">
<p>Youll have to excuse the witty title, but Ive been working on table borders. Specifically collapsed multi-line borders, properly joined at intersections. It is hard work I tell you. No, really, its downright ridiculous.</p>
<h2>Some Background</h2>
<p>Since a table cell may span multiple rows or columns, along each side of the cell, it may share its border on that side with N neighboring cells, or with the table border. Along each such shared border segment, the neighboring border along that segment must be identified and collapsed with the cell border according to certain rules. The most commonly used rules are those specified in the CSS collapsing border model, sometimes with slight modifications. This is also what Im aiming for in my implementation.</p>
<p>Lines in Scribus can traditionally be represented by an arbitrary number of lines, each with its own color, width and style, drawn on top of each other, thin over thick. Like this:</p>
<div id="attachment_194" class="wp-caption aligncenter" style="width: 496px"><img src="./gsoc _ Elvis Stansvik cleaned_files/scribus_multi_line.png" alt="A multi-line in Scribus" title="A multi-line in Scribus" width="486" height="118" class="size-full wp-image-194"><p class="wp-caption-text">A multi-line in Scribus</p></div>
<p>In trying to keep in style, Id of course like to support these types of lines in my implementation of table borders. This is also supported by competing products such as InDesign.</p>
<p>Borders from different cells, or from the table itself, meeting at an intersection in the table should optionally be joined. Joining is the process of adjusting the start and end points of the border, as well as adjusting the start and end points of the individual lines constituting the border, in order to make a best effort join with any other borders meeting at the intersection.</p>
<p>This is where the fun begins. Ive identified at least these 41 possible cases of joins:</p>
<div id="attachment_195" class="wp-caption aligncenter" style="width: 510px"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/wp-content/uploads/2011/07/table_border_join_cases.png"><img src="./gsoc _ Elvis Stansvik cleaned_files/table_border_join_cases.png" alt="Table Border Join Cases" title="Table Border Join Cases" width="500" height="3127" class="size-full wp-image-195"></a><p class="wp-caption-text">Table Border Join Cases</p></div>
<h2>The Past ~Two Weeks</h2>
<p>In the past two weeks most of my work has been trying to find a joining/painting algorithm that correctly identifies all the cases above and performs the necessary adjustments.</p>
<p>To paint an entire table, the painting algorithm must iterate over all cell edges in the table, and for each edge, iterate over all shared border segments. For each segment, the segment is collapsed with the correct neighboring border. Next, each of the, possibly six, other border segments meeting the segment at its start and end point must also be identified. This means identifying all the cells surrounding the segment and collapsing the appropriate shared border segments between them.</p>
<p>Lets take a simple case as an example. In the example below we want to paint the top border of the green-tinted cell, which spans two columns. The thin red dotted line represents the underlying table grid.</p>
<div id="attachment_196" class="wp-caption aligncenter" style="width: 510px"><img src="./gsoc _ Elvis Stansvik cleaned_files/painting_a_top_border.png" alt="Painting a Top Border" title="Painting a Top Border" width="500" height="652" class="size-full wp-image-196"><p class="wp-caption-text">Painting a Top Border</p></div>
<p>In the first iteration above, in addition to collapsing the shared border segment between the cell itself and the cell above it, the five border segments coming in to meet it at the two intersections must be identified and collapsed correctly. After that, adjustments for joining can be made to the segment start and end, before the segment is finally painted.</p>
<p>Similarly, in the second iteration, there are four additional collapses that needs to be done before joining adjustments and finally painting can be done.</p>
<p>Needless to say, its been quite a chore trying to get this to work. Especially the joining algorithm has been a tough nut to crack. Ive used up numerous sketch pads trying to figure it out. When working on something like this, pen and paper is invaluable. But, although there are some cases it cant quite handle in a pleasing way, I think I finally have an approach that will work. Ive intentionally made the code for collapsing and joining strictly separated from the rest of the code, to ease unit testing.</p>
<p>To not get too complicated the algorithm Ive settled on imposes a strict painting order horizontal borders must be painted on top of vertical ones. This means two iteration across the table. Iteration is quite fast though, and besides, Id rather spend my time optimizing cell accesses on the table than convoluting the joining algorithm with added complexity.</p>
<p>So without further ado, heres a screenshot of some collapsed joined and non-joined borders on a table in Scribus:</p>
<div id="attachment_198" class="wp-caption aligncenter" style="width: 310px"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/wp-content/uploads/2011/07/scribus_table_joins.png"><img src="./gsoc _ Elvis Stansvik cleaned_files/scribus_table_joins-300x205.png" alt="Joined Borders in Scribus" title="Joined Borders in Scribus" width="300" height="205" class="size-medium wp-image-198"></a><p class="wp-caption-text">Joined Borders in Scribus</p></div>
<p>Although there are some bugs in there, I have other fish to fry at the moment, so Im going to leave painting for a while. And if theres anyone out there who, after looking at that picture with the 41 join cases Ive identified, get a brilliant idea for an algorithm that covers them all with a minimal amount of code, then contact me! Please!</p>
<p>Thats all for now. Bye til next time!</p>
</div><!-- .entry-content -->
<footer class="entry-meta">
<span class="cat-links">
<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/category/technology" title="View all posts in Technology" rel="category tag">Technology</a> </span>
<span class="sep"> | </span>
<span class="tag-links">
<span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/gsoc" rel="tag">gsoc</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/planetkde" rel="tag">planetkde</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/scribus" rel="tag">scribus</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/tables" rel="tag">tables</a> </span>
<span class="sep"> | </span>
<span class="comments-link"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/07/bordering-on-the-insane-a-story-of-a-near-collapse#comments" title="Comment on Bordering on the Insane — A Story of a Near Collapse"><b>10</b> Replies</a></span>
</footer><!-- #entry-meta -->
</article><!-- #post-193 -->
<article id="post-180" class="post-180 post type-post status-publish format-standard hentry category-technology tag-gsoc tag-planetkde tag-scribus tag-tables">
<header class="entry-header">
<h1 class="entry-title"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/06/scribus-tables-gsoc-first-steps" title="Permalink to Scribus Tables GSoC — First Steps" rel="bookmark">Scribus Tables GSoC — First Steps</a></h1>
<div class="entry-meta">
<span class="sep">Posted on </span><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/06/scribus-tables-gsoc-first-steps" title="11:07" rel="bookmark"><time class="entry-date" datetime="2011-06-07T11:07:24+00:00" pubdate="">11:06 on June 7, 2011</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="http://web.archive.org/web/20110811234905/http://estan.dose.se/author/estan" title="View all posts by estan" rel="author">estan</a></span></span> </div><!-- .entry-meta -->
<div class="comments-link">
<a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/06/scribus-tables-gsoc-first-steps#respond" title="Comment on Scribus Tables GSoC — First Steps"><span class="leave-reply">Reply</span></a> </div>
</header><!-- .entry-header -->
<div class="entry-content">
<p>Hi all,<br>
This is the first in a series of blog posts detailing my work with bringing proper support for tables to Scribus as part of Summer of Code 2011. Ill try to keep the posts in roughly the same format as the reports Im sending off to my mentor Craig each week. This will make it easier for me to reuse some of the material, saving hacking time :) Each post will be divided into the following sections:</p>
<ul>
<li><b>Work Report</b>, a report on what Ive been up to since my last report.</li>
<li><b>Project Status</b>, how Im standing with regard to the schedule in my <a href="http://web.archive.org/web/20110811234905/http://wiki.scribus.net/canvas/GSoC_2011_Tables_Proposal">project proposal</a>.</li>
<li><b>Upcoming Work</b>, a rough outline of my next steps.</li>
</ul>
<p>As this is the very first blog post about my project, Ill start with a little introduction with general information about my project.</p>
<h2>Introduction</h2>
<p>Tables provide a compact way of representing tabular information in a page layout, and is a common design element in books, magazines and advertisements. Scribus currently has a shortcut for creating an automatically grouped table-like array of text frames. These are not proper tables. To stay competitive, Scribus needs better support for tables. Support that enables the user to create and edit tables as distinct items with their own set of properties as commonly found in other table implementations. This is the rationale for my Summer of Code project, in which Ill add a new table page item to Scribus.</p>
<div id="attachment_182" class="wp-caption aligncenter" style="width: 279px"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/wp-content/uploads/2011/06/scribus_tables_first_glimpse.png"><img src="./gsoc _ Elvis Stansvik cleaned_files/scribus_tables_first_glimpse-269x300.png" alt="First glimpse of new tables" title="First glimpse of new tables" width="269" height="300" class="size-medium wp-image-182"></a><p class="wp-caption-text">First glimpse of new tables</p></div>
<p>The user should be able to perform common table operations such as inserting rows and columns, merging and splitting cells, formatting borders and backgrounds as well as editing the text of the table. The table will represent the text of the cells using standard Scribus text frames.</p>
<p>More information can be found in my <a href="http://web.archive.org/web/20110811234905/http://wiki.scribus.net/canvas/GSoC_2011_Tables_Proposal">project proposal</a>.</p>
<p>So without further ado, here follows my first report.</p>
<h2>Work Report</h2>
<ul>
<li><b>Bootstrapping</b>: Drafted an initial <a href="http://web.archive.org/web/20110811234905/http://wiki.scribus.net/canvas/GSoC_2011_Tables_Design">design document</a> including some mockups on the Scribus wiki and <a href="http://web.archive.org/web/20110811234905/http://lists.scribus.net/pipermail/scribus-dev/2011-May/000917.html">discussed</a> the ideas in detail on the scribus-dev mailing list. Also set up a development environment (using Qt Creator this time even though Im a die-hard Vim junkie).</li>
<li><b>Added</b> a skeleton of a <b>table style</b>. This was way back in April, just to see what work is involved in creating a new type of style. The style is the most basic one imaginable. At the moment I think it has a single property for background color. Instances of the new table style can be managed in the Style Manager. It doesnt do style inheritance yet, though that should be relatively easy to fix.</li>
<li><b>Added</b> class <code>PageItem_Table</code>, a new page item for tables. The class represents a grid of table cells by keeping a few lists with row / column geometries.</li>
<li><b>Added</b> ability to insert a new <code>PageItem_Table</code> from <b>toolbar</b> or <b>Insert</b> menu followed by mouse dragging. Just like the current tables.</li>
<li><b>Added API</b> to <code>PageItem_Table</code> for the basic table operations
<ul>
<li>insert and remove rows and columns,</li>
<li>resize rows and column.</li>
</ul>
</li>
<li><b>Added</b> support for <b>merging cells</b> to <code>PageItem_Table</code> as well as an accompanying helper class <code>CellArea</code> used when keeping track of areas of merged cells. The <code>CellArea</code> class also comes with what I think is the very first unit tests in Scribus. The tests are in <code>tests/</code> and can be runned using <code>make test</code>.</li>
<li><b>Added</b> some rudimentary <b>painting</b> to <code>PageItem_Table</code>, just to be able to see the cells. Still a long way to go for proper table / cell painting, which is kind of non-trivial.</li>
<li>As <b>scriptability</b> allows me to experiment with tables before any UI is done, Ive added the following new scripting methods. These have been added to the old scripter, but should be easy enough to port to ScripterNG later on.
<ul>
<li><code>createTable(x, y, width, height, numRows, numColumns, ["name"])</code></li>
<li><code>getTableRows(["name"])</code></li>
<li><code>getTableColumns(["name"])</code></li>
<li><code>insertTableRows(index, numRows, ["name"])</code></li>
<li><code>removeTableRows(index, numRows, ["name"])</code></li>
<li><code>getTableRowHeight(row, ["name"])</code></li>
<li><code>setTableRowHeight(row, height, ["name"])</code></li>
<li><code>insertTableColumns(index, numColumns, ["name"])</code></li>
<li><code>removeTableColumns(index, numColumns, ["name"])</code></li>
<li><code>getTableColumnWidth(column, ["name"])</code></li>
<li><code>setTableColumnWidth(column, width, ["name"])</code></li>
<li><code>mergeTableCells(row, column, numRows, numColumns, ["name"])</code></li>
</ul>
</li>
</ul>
<h2>Project Status</h2>
<p>The goal in the schedule for this first week was simply <em>Data structures for tables</em>. Intentionally a quite moderate goal, as I didnt know how long it would take to get up to speed. So unsurprisingly, I think Im a little ahead of schedule. Worth noting though is that the tables are currently only skeletal in their nature; they hold no content and are simply a grid of empty cells. This is all according to plan though, and integration with text frames is scheduled for later.</p>
<h2>Upcoming Work</h2>
<p>The goals for next week according to the schedule is</p>
<ul>
<li>Basic table layout with fixed column widths and mock content in cells.</li>
<li>Insertion/removal of rows/columns.</li>
<li>Basic drawing of table.</li>
</ul>
<p>but as at least some of this has already been done, I think Ill start looking at other things as well. Right now Im looking at proper table / cell border painting, as well as fixing a couple of bugs in the code I have so far.</p>
<p>I have an installation of Adobe InDesign CS5.5 running in VirtualBox and Ive been looking at what border model theyre using and how theyre doing border conflict resolution. It seems to be a variant of the CSS2 collapsing border model, which is probably what Ill try to go for initially in Scribus as well.</p>
<p>Thats all for now folks! Ill conclude with a little screencast showing me playing around with a table using the new scripting methods. I highly recommend you download the <a href="http://web.archive.org/web/20110811234905/http://blip.tv/file/get/Estan-FirstGlimpseOfNewTables863.ogv">source OGV</a> instead of watching it here, as the quality turned out quite bad in the blip.tv conversion.</p>
<div style="text-align: center;">
<embed src="http://web.archive.org/web/20110811234905oe_/http://blip.tv/play/AYLAtUMA" type="application/x-shockwave-flash" width="320" height="270" wmode="transparent" allowscriptaccess="always" allowfullscreen="true"></div>
</div><!-- .entry-content -->
<footer class="entry-meta">
<span class="cat-links">
<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/category/technology" title="View all posts in Technology" rel="category tag">Technology</a> </span>
<span class="sep"> | </span>
<span class="tag-links">
<span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/gsoc" rel="tag">gsoc</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/planetkde" rel="tag">planetkde</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/scribus" rel="tag">scribus</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/tables" rel="tag">tables</a> </span>
<span class="sep"> | </span>
<span class="comments-link"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/06/scribus-tables-gsoc-first-steps#respond" title="Comment on Scribus Tables GSoC — First Steps"><span class="leave-reply">Leave a reply</span></a></span>
</footer><!-- #entry-meta -->
</article><!-- #post-180 -->
<article id="post-178" class="post-178 post type-post status-publish format-standard hentry category-technology tag-gsoc tag-planetkde tag-scribus">
<header class="entry-header">
<h1 class="entry-title"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/04/so-it-seems-my" title="Permalink to So it seems my…" rel="bookmark">So it seems my</a></h1>
<div class="entry-meta">
<span class="sep">Posted on </span><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/04/so-it-seems-my" title="21:00" rel="bookmark"><time class="entry-date" datetime="2011-04-25T21:00:12+00:00" pubdate="">21:04 on April 25, 2011</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="http://web.archive.org/web/20110811234905/http://estan.dose.se/author/estan" title="View all posts by estan" rel="author">estan</a></span></span> </div><!-- .entry-meta -->
<div class="comments-link">
<a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/04/so-it-seems-my#respond" title="Comment on So it seems my…"><span class="leave-reply">Reply</span></a> </div>
</header><!-- .entry-header -->
<div class="entry-content">
<p><a href="http://web.archive.org/web/20110811234905/http://wiki.scribus.net/canvas/Blog:Scribus_Times_and_Gazette/Scribus_Team's_Google_Summer_of_Code_2011_Students_and_Projects_announced">summer of 2011</a> will come in a distinct <a href="http://web.archive.org/web/20110811234905/http://techbase.kde.org/Projects/Summer_of_Code/2009/Projects/Basic_tables_support_for_KWord">2009 flavor</a>. Cant wait to get started ;)</p>
<p>
Ill probably blog my progress here. What do you guys think; OK for me to have it aggregated on p.k.o? Scribus KDE-ish enough for you?
</p>
<p>
<em><br>
PS. For those of you who didnt understand or cant be bothered to click the links; Ive been accepted into GSoC this year to improve the tables support of Scribus. You might remember me doing the same for KWord as part of GSoC back in 2009. DS.<br>
</em></p>
</div><!-- .entry-content -->
<footer class="entry-meta">
<span class="cat-links">
<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/category/technology" title="View all posts in Technology" rel="category tag">Technology</a> </span>
<span class="sep"> | </span>
<span class="tag-links">
<span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/gsoc" rel="tag">gsoc</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/planetkde" rel="tag">planetkde</a>, <a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/scribus" rel="tag">scribus</a> </span>
<span class="sep"> | </span>
<span class="comments-link"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/2011/04/so-it-seems-my#respond" title="Comment on So it seems my…"><span class="leave-reply">Leave a reply</span></a></span>
</footer><!-- #entry-meta -->
</article><!-- #post-178 -->
<nav id="nav-below">
<h3 class="assistive-text">Post navigation</h3>
<div class="nav-previous"><a href="http://web.archive.org/web/20110811234905/http://estan.dose.se/tag/gsoc/page/2"><span class="meta-nav">←</span> Older posts</a></div>
<div class="nav-next"></div>
</nav><!-- #nav-above -->
</div><!-- #content -->
</section><!-- #primary -->
<!-- #secondary .widget-area -->
</div><!-- #main -->
</div><!-- #page -->
</body></html>