Qt 4.8
Macros | Functions | Variables
qmotifstyle.cpp File Reference
#include "qmotifstyle.h"
#include "qcdestyle.h"
#include "qmenu.h"
#include "qapplication.h"
#include "qpainter.h"
#include "qdrawutil.h"
#include "qpixmap.h"
#include "qpalette.h"
#include "qwidget.h"
#include "qpushbutton.h"
#include "qscrollbar.h"
#include "qtabbar.h"
#include "qtabwidget.h"
#include "qlistview.h"
#include "qsplitter.h"
#include "qslider.h"
#include "qcombobox.h"
#include "qlineedit.h"
#include "qprogressbar.h"
#include "qimage.h"
#include "qfocusframe.h"
#include "qdebug.h"
#include "qpainterpath.h"
#include "qmotifstyle_p.h"
#include "qdialogbuttonbox.h"
#include "qformlayout.h"
#include <limits.h>
#include <QtGui/qgraphicsproxywidget.h>
#include <QtGui/qgraphicsview.h>
#include "qx11info_x11.h"

Go to the source code of this file.

Macros

#define CBOT   *cols[colspec & 0xf]
 
#define CLEFT   *cols[(colspec>>8) & 0xf]
 
#define CMID   *cols[(colspec>>12) & 0xf]
 
#define CTOP   *cols[(colspec>>4) & 0xf]
 
#define INTARRLEN(x)   sizeof(x)/(sizeof(int)*2)
 

Functions

static int get_combo_extra_width (int h, int w, int *return_awh=0)
 
static void get_combo_parameters (const QRect &r, int &ew, int &awh, int &ax, int &ay, int &sh, int &dh, int &sy)
 
static void rot (QPolygon &a, int n)
 

Variables

static const char *const critical_xpm []
 
static const char * dock_window_close_xpm []
 
static const char *const information_xpm []
 
static const int motifArrowHMargin = 6
 
static const int motifCheckMarkHMargin = 2
 
static const int motifCheckMarkSpace = 16
 
static const int motifItemFrame = 2
 
static const int motifItemHMargin = 3
 
static const int motifItemVMargin = 2
 
static const int motifSepHeight = 2
 
static const int motifTabSpacing = 12
 
static const char *const qt_close_xpm []
 
static const char *const qt_maximize_xpm []
 
static const char *const qt_menu_xpm []
 
static const char *const qt_minimize_xpm []
 
static const char *const qt_normalizeup_xpm []
 
static const char *const qt_shade_xpm []
 
static const char *const qt_unshade_xpm []
 
static const char *const question_xpm []
 
static const char *const warning_xpm []
 

Macro Definition Documentation

◆ CBOT

#define CBOT   *cols[colspec & 0xf]

◆ CLEFT

#define CLEFT   *cols[(colspec>>8) & 0xf]

◆ CMID

#define CMID   *cols[(colspec>>12) & 0xf]

◆ CTOP

#define CTOP   *cols[(colspec>>4) & 0xf]

◆ INTARRLEN

#define INTARRLEN (   x)    sizeof(x)/(sizeof(int)*2)

Function Documentation

◆ get_combo_extra_width()

static int get_combo_extra_width ( int  h,
int  w,
int *  return_awh = 0 
)
static

Definition at line 1394 of file qmotifstyle.cpp.

Referenced by get_combo_parameters(), and QMotifStyle::subControlRect().

1395 {
1396  int awh,
1397  tmp;
1398  if (h < 8) {
1399  awh = 6;
1400  } else if (h < 14) {
1401  awh = h - 2;
1402  } else {
1403  awh = h/2;
1404  }
1405  tmp = (awh * 3) / 2;
1406  if (tmp > w / 2) {
1407  awh = w / 2 - 3;
1408  tmp = w / 2 + 3;
1409  }
1410 
1411  if (return_awh)
1412  *return_awh = awh;
1413 
1414  return tmp;
1415 }

◆ get_combo_parameters()

static void get_combo_parameters ( const QRect r,
int &  ew,
int &  awh,
int &  ax,
int &  ay,
int &  sh,
int &  dh,
int &  sy 
)
static

Definition at line 1417 of file qmotifstyle.cpp.

Referenced by QMotifStyle::drawComplexControl(), QMotifStyle::subControlRect(), and QMotifStyle::subElementRect().

1421 {
1422  ew = get_combo_extra_width(r.height(), r.width(), &awh);
1423 
1424  sh = (awh+3)/4;
1425  if (sh < 3)
1426  sh = 3;
1427  dh = sh/2 + 1;
1428 
1429  ay = r.y() + (r.height()-awh-sh-dh)/2;
1430  if (ay < 0) {
1431  //panic mode
1432  ay = 0;
1433  sy = r.height();
1434  } else {
1435  sy = ay+awh+dh;
1436  }
1437  ax = r.x() + r.width() - ew;
1438  ax += (ew-awh)/2;
1439 }
static int get_combo_extra_width(int h, int w, int *return_awh=0)
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252

◆ rot()

static void rot ( QPolygon a,
int  n 
)
static

Definition at line 349 of file qmotifstyle.cpp.

Referenced by QMotifStyle::drawPrimitive().

350 {
351  QPolygon r(a.size());
352  for (int i = 0; i < (int)a.size(); i++) {
353  switch (n) {
354  case 1: r.setPoint(i,-a[i].y(),a[i].x()); break;
355  case 2: r.setPoint(i,-a[i].x(),-a[i].y()); break;
356  case 3: r.setPoint(i,a[i].y(),-a[i].x()); break;
357  }
358  }
359  a = r;
360 }
The QPolygon class provides a vector of points using integer precision.
Definition: qpolygon.h:60
void setPoint(int index, int x, int y)
Sets the point at the given index to the point specified by ({x}, {y}).
Definition: qpolygon.h:120
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

Variable Documentation

◆ critical_xpm

const char* const critical_xpm[]
static

Definition at line 2445 of file qmotifstyle.cpp.

Referenced by QMotifStyle::standardPixmap().

◆ dock_window_close_xpm

const char* dock_window_close_xpm[]
static
Initial value:
= {
"8 8 2 1",
"# c #000000",
". c None",
"##....##",
".##..##.",
"..####..",
"...##...",
"..####..",
".##..##.",
"##....##",
"........"}

Definition at line 2347 of file qmotifstyle.cpp.

◆ information_xpm

const char* const information_xpm[]
static

Definition at line 2366 of file qmotifstyle.cpp.

Referenced by QMotifStyle::standardPixmap().

◆ motifArrowHMargin

const int motifArrowHMargin = 6
static

Definition at line 86 of file qmotifstyle.cpp.

Referenced by QMotifStyle::drawControl(), and QMotifStyle::sizeFromContents().

◆ motifCheckMarkHMargin

const int motifCheckMarkHMargin = 2
static

Definition at line 88 of file qmotifstyle.cpp.

Referenced by QMotifStyle::sizeFromContents().

◆ motifCheckMarkSpace

const int motifCheckMarkSpace = 16
static

Definition at line 89 of file qmotifstyle.cpp.

Referenced by QMotifStyle::drawControl(), and QMotifStyle::sizeFromContents().

◆ motifItemFrame

const int motifItemFrame = 2
static

◆ motifItemHMargin

const int motifItemHMargin = 3
static

Definition at line 84 of file qmotifstyle.cpp.

Referenced by QMotifStyle::drawControl(), and QMotifStyle::sizeFromContents().

◆ motifItemVMargin

const int motifItemVMargin = 2
static

Definition at line 85 of file qmotifstyle.cpp.

Referenced by QMotifStyle::drawControl(), and QMotifStyle::sizeFromContents().

◆ motifSepHeight

const int motifSepHeight = 2
static

Definition at line 83 of file qmotifstyle.cpp.

Referenced by QMotifStyle::sizeFromContents().

◆ motifTabSpacing

const int motifTabSpacing = 12
static

Definition at line 87 of file qmotifstyle.cpp.

Referenced by QMotifStyle::sizeFromContents().

◆ qt_close_xpm

const char* const qt_close_xpm[]
static
Initial value:
= {
"12 12 2 1",
" s None c None",
". c black",
" ",
" ",
" . . ",
" ... ... ",
" ...... ",
" .... ",
" .... ",
" ...... ",
" ... ... ",
" . . ",
" ",
" "}

Definition at line 2225 of file qmotifstyle.cpp.

◆ qt_maximize_xpm

const char* const qt_maximize_xpm[]
static
Initial value:
= {
"12 12 2 1",
" s None c None",
". c black",
" ",
" ",
" ",
" . ",
" ... ",
" ..... ",
" ....... ",
" ......... ",
" ",
" ",
" ",
" "}

Definition at line 2242 of file qmotifstyle.cpp.

◆ qt_menu_xpm

const char* const qt_menu_xpm[]
static
Initial value:
= {
"16 16 11 1",
" c #000000",
", c #336600",
". c #99CC00",
"X c #666600",
"o c #999933",
"+ c #333300",
"@ c #669900",
"# c #999900",
"$ c #336633",
"% c #666633",
"& c #99CC33",
"................",
"................",
".....#,++X#.....",
"....X X....",
"...X Xo#% X&..",
"..# o..&@o o..",
".., X..#+ @X X..",
"..+ o.o+ +o# +..",
"..+ #o+ +## +..",
".., %@ ++ +, X..",
"..# o@oo+ #..",
"...X X##$ o..",
"....X X..",
"....&oX++X#oX...",
"................",
"................"}

Definition at line 2194 of file qmotifstyle.cpp.

◆ qt_minimize_xpm

const char* const qt_minimize_xpm[]
static
Initial value:
= {
"12 12 2 1",
" s None c None",
". c black",
" ",
" ",
" ",
" ",
" ......... ",
" ....... ",
" ..... ",
" ... ",
" . ",
" ",
" ",
" "}

Definition at line 2259 of file qmotifstyle.cpp.

◆ qt_normalizeup_xpm

const char* const qt_normalizeup_xpm[]
static
Initial value:
= {
"12 12 2 1",
" s None c None",
". c black",
" ",
" ",
" ",
" ....... ",
" ...... ",
" ..... ",
" .... ",
" ... ",
" .. ",
" . ",
" ",
" "}

Definition at line 2295 of file qmotifstyle.cpp.

◆ qt_shade_xpm

const char* const qt_shade_xpm[]
static
Initial value:
= {
"12 12 2 1", "# c #000000",
". c None",
"............",
"............",
".#########..",
".#########..",
"............",
"............",
"............",
"............",
"............",
"............",
"............",
"............"}

Definition at line 2312 of file qmotifstyle.cpp.

◆ qt_unshade_xpm

const char* const qt_unshade_xpm[]
static
Initial value:
= {
"12 12 2 1",
"# c #000000",
". c None",
"............",
"............",
".#########..",
".#########..",
".#.......#..",
".#.......#..",
".#.......#..",
".#.......#..",
".#.......#..",
".#########..",
"............",
"............"}

Definition at line 2329 of file qmotifstyle.cpp.

◆ question_xpm

const char* const question_xpm[]
static

Definition at line 2484 of file qmotifstyle.cpp.

Referenced by QMotifStyle::standardPixmap().

◆ warning_xpm

const char* const warning_xpm[]
static

Definition at line 2406 of file qmotifstyle.cpp.

Referenced by QMotifStyle::standardPixmap().