-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into uiSliderSetRange
- Loading branch information
Showing
57 changed files
with
6,412 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// 20 june 2016 | ||
// kept in a separate file for now | ||
|
||
typedef struct uiImage uiImage; | ||
|
||
// TODO use const void * for const correctness | ||
_UI_EXTERN uiImage *uiNewImage(double width, double height); | ||
_UI_EXTERN void uiFreeImage(uiImage *i); | ||
_UI_EXTERN void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, int pixelStride); | ||
|
||
typedef struct uiTableModel uiTableModel; | ||
typedef struct uiTableModelHandler uiTableModelHandler; | ||
|
||
// TODO actually validate these | ||
_UI_ENUM(uiTableModelColumnType) { | ||
uiTableModelColumnString, | ||
uiTableModelColumnImage, | ||
uiTableModelColumnInt, | ||
uiTableModelColumnColor, | ||
}; | ||
|
||
// TODO validate ranges; validate types on each getter/setter call (? table columns only?) | ||
struct uiTableModelHandler { | ||
int (*NumColumns)(uiTableModelHandler *, uiTableModel *); | ||
uiTableModelColumnType (*ColumnType)(uiTableModelHandler *, uiTableModel *, int); | ||
int (*NumRows)(uiTableModelHandler *, uiTableModel *); | ||
void *(*CellValue)(uiTableModelHandler *, uiTableModel *, int, int); | ||
void (*SetCellValue)(uiTableModelHandler *, uiTableModel *, int, int, const void *); | ||
}; | ||
|
||
_UI_EXTERN void *uiTableModelStrdup(const char *str); | ||
// TODO rename the strdup one to this too | ||
_UI_EXTERN void *uiTableModelGiveColor(double r, double g, double b, double a); | ||
_UI_EXTERN void *uiTableModelGiveInt(int i); | ||
// TODO TakeString | ||
// TODO add const | ||
_UI_EXTERN int uiTableModelTakeInt(void *v); | ||
|
||
_UI_EXTERN uiTableModel *uiNewTableModel(uiTableModelHandler *mh); | ||
_UI_EXTERN void uiFreeTableModel(uiTableModel *m); | ||
_UI_EXTERN void uiTableModelRowInserted(uiTableModel *m, int newIndex); | ||
_UI_EXTERN void uiTableModelRowChanged(uiTableModel *m, int index); | ||
_UI_EXTERN void uiTableModelRowDeleted(uiTableModel *m, int oldIndex); | ||
// TODO reordering/moving | ||
|
||
typedef struct uiTableColumn uiTableColumn; | ||
|
||
_UI_EXTERN void uiTableColumnAppendTextPart(uiTableColumn *c, int modelColumn, int expand); | ||
// TODO images shouldn't expand... | ||
_UI_EXTERN void uiTableColumnAppendImagePart(uiTableColumn *c, int modelColumn, int expand); | ||
_UI_EXTERN void uiTableColumnAppendButtonPart(uiTableColumn *c, int modelColumn, int expand); | ||
// TODO should these have labels? | ||
_UI_EXTERN void uiTableColumnAppendCheckboxPart(uiTableColumn *c, int modelColumn, int expand); | ||
_UI_EXTERN void uiTableColumnAppendProgressBarPart(uiTableColumn *c, int modelColumn, int expand); | ||
// TODO Editable? | ||
_UI_EXTERN void uiTableColumnPartSetEditable(uiTableColumn *c, int part, int editable); | ||
_UI_EXTERN void uiTableColumnPartSetTextColor(uiTableColumn *c, int part, int modelColumn); | ||
|
||
typedef struct uiTable uiTable; | ||
#define uiTable(this) ((uiTable *) (this)) | ||
_UI_EXTERN uiTableColumn *uiTableAppendColumn(uiTable *t, const char *name); | ||
_UI_EXTERN uiTableColumn *uiTableAppendTextColumn(uiTable *t, const char *name, int modelColumn); | ||
// TODO getter? | ||
_UI_EXTERN void uiTableSetRowBackgroundColorModelColumn(uiTable *t, int modelColumn); | ||
_UI_EXTERN uiTable *uiNewTable(uiTableModel *model); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
https://github.com/kusti8/proton-native/issues/47#issuecomment-373068947 | ||
https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
High DPI Displays | Qt 5.5 http://doc.qt.io/qt-5/highdpi.html bottom of page(?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
https://msdn.microsoft.com/en-us/library/windows/desktop/dd319079(v=vs.85).aspx | ||
https://msdn.microsoft.com/en-us/library/windows/desktop/dd318103(v=vs.85).aspx | ||
https://stackoverflow.com/questions/4663855/is-there-a-repository-for-localized-common-text-in-winforms | ||
https://stackoverflow.com/questions/2502375/find-localized-windows-strings | ||
https://docs.microsoft.com/en-us/windows-hardware/customize/mobile/mcsf/create-a-resource-only-dll-for-localized-strings | ||
https://msdn.microsoft.com/en-us/library/windows/desktop/ee845043(v=vs.85).aspx | ||
https://msdn.microsoft.com/en-us/library/cc194807.aspx | ||
https://www.codeproject.com/Articles/10542/Easily-Load-and-Format-Strings-from-the-String-Tab | ||
https://www.codeproject.com/Tips/431045/The-inner-working-of-FindResource-and-LoadString-W | ||
https://mihai-nita.net/2007/05/03/how-to-localize-an-rc-file/ | ||
https://www.microsoft.com/en-us/language | ||
https://www.microsoft.com/en-us/language/Terminology | ||
https://www.microsoft.com/en-us/language/LicenseAgreement | ||
https://www.microsoft.com/en-us/language/Translations | ||
http://www.ttt.org/oscarstandards/tbx/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// 21 june 2016 | ||
#include "../ui.h" | ||
#include "uipriv.h" | ||
|
||
void *uiTableModelGiveInt(int i) | ||
{ | ||
return (void *) ((intptr_t) i); | ||
} | ||
|
||
int uiTableModelTakeInt(void *v) | ||
{ | ||
return (int) ((intptr_t) v); | ||
} | ||
|
||
uiTableColumn *uiTableAppendTextColumn(uiTable *t, const char *name, int modelColumn) | ||
{ | ||
uiTableColumn *tc; | ||
|
||
tc = uiTableAppendColumn(t, name); | ||
uiTableColumnAppendTextPart(tc, modelColumn, 1); | ||
return tc; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 23 june 2018 | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
// tablemodel.c | ||
extern uiTableModelHandler *uiprivTableModelHandler(uiTableModel *m); | ||
extern int uiprivTableModelNumColumns(uiTableModel *m); | ||
extern uiTableValueType uiprivTableModelColumnType(uiTableModel *m, int column); | ||
extern int uiprivTableModelNumRows(uiTableModel *m); | ||
extern uiTableValue *uiprivTableModelCellValue(uiTableModel *m, int row, int column); | ||
extern void uiprivTableModelSetCellValue(uiTableModel *m, int row, int column, const uiTableValue *value); | ||
extern const uiTableTextColumnOptionalParams uiprivDefaultTextColumnOptionalParams; | ||
extern int uiprivTableModelCellEditable(uiTableModel *m, int row, int column); | ||
extern int uiprivTableModelColorIfProvided(uiTableModel *m, int row, int column, double *r, double *g, double *b, double *a); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// 23 june 2018 | ||
#include "../ui.h" | ||
#include "uipriv.h" | ||
#include "table.h" | ||
|
||
int uiprivTableModelNumColumns(uiTableModel *m) | ||
{ | ||
uiTableModelHandler *mh; | ||
|
||
mh = uiprivTableModelHandler(m); | ||
return (*(mh->NumColumns))(mh, m); | ||
} | ||
|
||
uiTableValueType uiprivTableModelColumnType(uiTableModel *m, int column) | ||
{ | ||
uiTableModelHandler *mh; | ||
|
||
mh = uiprivTableModelHandler(m); | ||
return (*(mh->ColumnType))(mh, m, column); | ||
} | ||
|
||
int uiprivTableModelNumRows(uiTableModel *m) | ||
{ | ||
uiTableModelHandler *mh; | ||
|
||
mh = uiprivTableModelHandler(m); | ||
return (*(mh->NumRows))(mh, m); | ||
} | ||
|
||
uiTableValue *uiprivTableModelCellValue(uiTableModel *m, int row, int column) | ||
{ | ||
uiTableModelHandler *mh; | ||
|
||
mh = uiprivTableModelHandler(m); | ||
return (*(mh->CellValue))(mh, m, row, column); | ||
} | ||
|
||
void uiprivTableModelSetCellValue(uiTableModel *m, int row, int column, const uiTableValue *value) | ||
{ | ||
uiTableModelHandler *mh; | ||
|
||
mh = uiprivTableModelHandler(m); | ||
(*(mh->SetCellValue))(mh, m, row, column, value); | ||
} | ||
|
||
const uiTableTextColumnOptionalParams uiprivDefaultTextColumnOptionalParams = { | ||
.ColorModelColumn = -1, | ||
}; | ||
|
||
int uiprivTableModelCellEditable(uiTableModel *m, int row, int column) | ||
{ | ||
uiTableValue *value; | ||
int editable; | ||
|
||
switch (column) { | ||
case uiTableModelColumnNeverEditable: | ||
return 0; | ||
case uiTableModelColumnAlwaysEditable: | ||
return 1; | ||
} | ||
value = uiprivTableModelCellValue(m, row, column); | ||
editable = uiTableValueInt(value); | ||
uiFreeTableValue(value); | ||
return editable; | ||
} | ||
|
||
int uiprivTableModelColorIfProvided(uiTableModel *m, int row, int column, double *r, double *g, double *b, double *a) | ||
{ | ||
uiTableValue *value; | ||
|
||
if (column == -1) | ||
return 0; | ||
value = uiprivTableModelCellValue(m, row, column); | ||
if (value == NULL) | ||
return 0; | ||
uiTableValueColor(value, r, g, b, a); | ||
uiFreeTableValue(value); | ||
return 1; | ||
} |
Oops, something went wrong.