aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-03-22 21:01:42 (GMT)
committerfluxgen <fluxgen>2004-03-22 21:01:42 (GMT)
commitb0af80ec1dacccde14ec9ff4019b3db3b58a162c (patch)
tree8c3c5b89a3cd939a6a28a62c9963805f4c338697 /src
parent9991ce9ff431e242b300403a89ee05a91f855433 (diff)
downloadfluxbox_pavel-b0af80ec1dacccde14ec9ff4019b3db3b58a162c.zip
fluxbox_pavel-b0af80ec1dacccde14ec9ff4019b3db3b58a162c.tar.bz2
added screen resource .overlay.lineWidth, .overlay.lineStyle and .overlay.capStyle which defines the line style for resize and move actions on windows, patch from Mathias Gumz
Diffstat (limited to 'src')
-rw-r--r--src/RootTheme.cc3
-rw-r--r--src/RootTheme.hh10
-rw-r--r--src/Screen.cc128
-rw-r--r--src/Screen.hh6
4 files changed, 142 insertions, 5 deletions
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index 03eb8b1..813d867 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: RootTheme.cc,v 1.7 2004/01/02 13:28:38 fluxgen Exp $ 22// $Id: RootTheme.cc,v 1.8 2004/03/22 21:01:42 fluxgen Exp $
23 23
24#include "RootTheme.hh" 24#include "RootTheme.hh"
25 25
@@ -37,6 +37,7 @@ RootTheme::RootTheme(int screen_num, std::string &screen_root_command):
37 m_opgc.setForeground(WhitePixel(disp, screen_num)^BlackPixel(disp, screen_num)); 37 m_opgc.setForeground(WhitePixel(disp, screen_num)^BlackPixel(disp, screen_num));
38 m_opgc.setFunction(GXxor); 38 m_opgc.setFunction(GXxor);
39 m_opgc.setSubwindowMode(IncludeInferiors); 39 m_opgc.setSubwindowMode(IncludeInferiors);
40 m_opgc.setLineAttributes(1, LineSolid, CapNotLast, JoinMiter);
40} 41}
41 42
42RootTheme::~RootTheme() { 43RootTheme::~RootTheme() {
diff --git a/src/RootTheme.hh b/src/RootTheme.hh
index 686a4ed..83ce2c8 100644
--- a/src/RootTheme.hh
+++ b/src/RootTheme.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: RootTheme.hh,v 1.6 2004/01/02 13:28:38 fluxgen Exp $ 22// $Id: RootTheme.hh,v 1.7 2004/03/22 21:01:42 fluxgen Exp $
23 23
24#ifndef ROOTTHEME_HH 24#ifndef ROOTTHEME_HH
25#define ROOTTHEME_HH 25#define ROOTTHEME_HH
@@ -44,6 +44,14 @@ public:
44 void reconfigTheme(); 44 void reconfigTheme();
45 45
46 GC opGC() const { return m_opgc.gc(); } 46 GC opGC() const { return m_opgc.gc(); }
47
48 void setLineAttributes(unsigned int width,
49 int line_style,
50 int cap_style,
51 int join_style) {
52 m_opgc.setLineAttributes(width, line_style, cap_style, join_style);
53 }
54
47 //!! TODO we should need this later 55 //!! TODO we should need this later
48 void lock(bool value) { m_lock = value; } 56 void lock(bool value) { m_lock = value; }
49private: 57private:
diff --git a/src/Screen.cc b/src/Screen.cc
index 8c01402..a1a6dbc 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.270 2004/03/21 09:00:24 rathnor Exp $ 25// $Id: Screen.cc,v 1.271 2004/03/22 21:01:10 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -306,6 +306,113 @@ setFromString(char const *strval) {
306 setDefaultValue(); 306 setDefaultValue();
307} 307}
308 308
309template<>
310void FbTk::Resource<FbTk::GContext::LineStyle>::setDefaultValue() {
311 *(*this) = FbTk::GContext::LINESOLID;
312}
313
314template<>
315std::string FbTk::Resource<FbTk::GContext::LineStyle>::getString() {
316 switch(m_value) {
317 case FbTk::GContext::LINESOLID:
318 return "LineSolid";
319 break;
320 case FbTk::GContext::LINEONOFFDASH:
321 return "LineOnOffDash";
322 break;
323 case FbTk::GContext::LINEDOUBLEDASH:
324 return "LineDoubleDash";
325 break;
326 };
327}
328
329template<>
330void FbTk::Resource<FbTk::GContext::LineStyle>
331::setFromString(char const *strval) {
332
333 if (strcasecmp(strval, "LineSolid") == 0 )
334 m_value = FbTk::GContext::LINESOLID;
335 else if (strcasecmp(strval, "LineOnOffDash") == 0 )
336 m_value = FbTk::GContext::LINEONOFFDASH;
337 else if (strcasecmp(strval, "LineDoubleDash") == 0)
338 m_value = FbTk::GContext::LINEDOUBLEDASH;
339 else
340 setDefaultValue();
341}
342
343template<>
344void FbTk::Resource<FbTk::GContext::JoinStyle>::setDefaultValue() {
345 *(*this) = FbTk::GContext::JOINMITER;
346}
347
348template<>
349std::string FbTk::Resource<FbTk::GContext::JoinStyle>::getString() {
350 switch(m_value) {
351 case FbTk::GContext::JOINMITER:
352 return "JoinMiter";
353 break;
354 case FbTk::GContext::JOINBEVEL:
355 return "JoinBevel";
356 break;
357 case FbTk::GContext::JOINROUND:
358 return "JoinRound";
359 break;
360 };
361}
362
363template<>
364void FbTk::Resource<FbTk::GContext::JoinStyle>
365::setFromString(char const *strval) {
366
367 if (strcasecmp(strval, "JoinRound") == 0 )
368 m_value = FbTk::GContext::JOINROUND;
369 else if (strcasecmp(strval, "JoinMiter") == 0 )
370 m_value = FbTk::GContext::JOINMITER;
371 else if (strcasecmp(strval, "JoinBevel") == 0)
372 m_value = FbTk::GContext::JOINBEVEL;
373 else
374 setDefaultValue();
375}
376
377template<>
378void FbTk::Resource<FbTk::GContext::CapStyle>::setDefaultValue() {
379 *(*this) = FbTk::GContext::CAPNOTLAST;
380}
381
382template<>
383std::string FbTk::Resource<FbTk::GContext::CapStyle>::getString() {
384 switch(m_value) {
385 case FbTk::GContext::CAPNOTLAST:
386 return "CapNotLast";
387 break;
388 case FbTk::GContext::CAPBUTT:
389 return "CapButt";
390 break;
391 case FbTk::GContext::CAPROUND:
392 return "CapRound";
393 break;
394 case FbTk::GContext::CAPPROJECTING:
395 return "CapProjecting";
396 break;
397 };
398}
399
400template<>
401void FbTk::Resource<FbTk::GContext::CapStyle>
402::setFromString(char const *strval) {
403
404 if (strcasecmp(strval, "CapNotLast") == 0 )
405 m_value = FbTk::GContext::CAPNOTLAST;
406 else if (strcasecmp(strval, "CapProjecting") == 0 )
407 m_value = FbTk::GContext::CAPPROJECTING;
408 else if (strcasecmp(strval, "CapRound") == 0)
409 m_value = FbTk::GContext::CAPROUND;
410 else if (strcasecmp(strval, "CapButt" ) == 0)
411 m_value = FbTk::GContext::CAPBUTT;
412 else
413 setDefaultValue();
414}
415
309namespace { 416namespace {
310 417
311class StyleMenuItem: public FbTk::MenuItem { 418class StyleMenuItem: public FbTk::MenuItem {
@@ -378,7 +485,20 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
378 menu_mode(rm, FbTk::MenuTheme::DELAY_OPEN, scrname+".menuMode", altscrname+".MenuMode"), 485 menu_mode(rm, FbTk::MenuTheme::DELAY_OPEN, scrname+".menuMode", altscrname+".MenuMode"),
379 placement_policy(rm, ROWSMARTPLACEMENT, scrname+".windowPlacement", altscrname+".WindowPlacement"), 486 placement_policy(rm, ROWSMARTPLACEMENT, scrname+".windowPlacement", altscrname+".WindowPlacement"),
380 row_direction(rm, LEFTRIGHT, scrname+".rowPlacementDirection", altscrname+".RowPlacementDirection"), 487 row_direction(rm, LEFTRIGHT, scrname+".rowPlacementDirection", altscrname+".RowPlacementDirection"),
381 col_direction(rm, TOPBOTTOM, scrname+".colPlacementDirection", altscrname+".ColPlacementDirection") { 488 col_direction(rm, TOPBOTTOM, scrname+".colPlacementDirection", altscrname+".ColPlacementDirection"),
489 gc_line_width(rm, 1, scrname+".overlay.lineWidth", altscrname+".Overlay.LineWidth"),
490 gc_line_style(rm,
491 FbTk::GContext::LINESOLID,
492 scrname+".overlay.lineStyle",
493 altscrname+".Overlay.LineStyle"),
494 gc_join_style(rm,
495 FbTk::GContext::JOINMITER,
496 scrname+".overlay.joinStyle",
497 altscrname+".Overlay.JoinStyle"),
498 gc_cap_style(rm,
499 FbTk::GContext::CAPNOTLAST,
500 scrname+".overlay.capStyle",
501 altscrname+".overlay.CapStyle") {
382 502
383} 503}
384 504
@@ -584,6 +704,10 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
584 m_root_theme->lock(true); 704 m_root_theme->lock(true);
585 FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename()); 705 FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename());
586 m_root_theme->lock(false); 706 m_root_theme->lock(false);
707 m_root_theme->setLineAttributes(*resource.gc_line_width,
708 *resource.gc_line_style,
709 *resource.gc_cap_style,
710 *resource.gc_join_style);
587 711
588 int i; 712 int i;
589 unsigned int nchild; 713 unsigned int nchild;
diff --git a/src/Screen.hh b/src/Screen.hh
index 070c45a..707f831 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.hh,v 1.135 2004/03/21 09:00:25 rathnor Exp $ 25// $Id: Screen.hh,v 1.136 2004/03/22 21:01:10 fluxgen Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -431,6 +431,10 @@ private:
431 FbTk::Resource<PlacementPolicy> placement_policy; 431 FbTk::Resource<PlacementPolicy> placement_policy;
432 FbTk::Resource<RowDirection> row_direction; 432 FbTk::Resource<RowDirection> row_direction;
433 FbTk::Resource<ColumnDirection> col_direction; 433 FbTk::Resource<ColumnDirection> col_direction;
434 FbTk::Resource<int> gc_line_width;
435 FbTk::Resource<FbTk::GContext::LineStyle> gc_line_style;
436 FbTk::Resource<FbTk::GContext::JoinStyle> gc_join_style;
437 FbTk::Resource<FbTk::GContext::CapStyle> gc_cap_style;
434 438
435 } resource; 439 } resource;
436 440