382
382
if(active) BIF_ThemeColor(TH_HEADER);
383
383
else BIF_ThemeColor(TH_HEADERDESEL);
385
/* weird values here... is because of window matrix that centres buttons */
385
/* weird values here... is because of window matrix that centers buttons */
386
386
if(area->headertype==HEADERTOP) {
387
387
uiSetRoundBox(3);
388
388
uiRoundBoxEmboss(-0.5+area->headbutofs, -10.0, width-1.5+area->headbutofs, HEADERY-2.0, SCR_ROUND, active);
745
745
static void moveareas(ScrEdge *edge);
746
746
static void joinarea_interactive(ScrArea *area, ScrEdge *onedge);
747
747
static void splitarea_interactive(ScrArea *area, ScrEdge *onedge);
748
static ScrArea *test_edge_area(ScrArea *sa, ScrEdge *se);
749
static ScrEdge *screen_findedge(bScreen *sc, ScrVert *v1, ScrVert *v2);
751
static int isjoinable(ScrArea *area, ScrEdge *onedge)
753
struct ScrArea *sa1 = area, *sa2;
756
sa1 = test_edge_area(sa1, onedge);
759
/* find directions with same edge */
760
sa2= G.curscreen->areabase.first;
763
se= screen_findedge(G.curscreen, sa2->v1, sa2->v2);
764
if(onedge==se) return 1;
765
se= screen_findedge(G.curscreen, sa2->v2, sa2->v3);
766
if(onedge==se) return 1;
767
se= screen_findedge(G.curscreen, sa2->v3, sa2->v4);
768
if(onedge==se) return 1;
769
se= screen_findedge(G.curscreen, sa2->v4, sa2->v1);
770
if(onedge==se) return 1;
749
778
static void screen_edge_edit_event(ScrArea *actarea, ScrEdge *actedge, short evt, short val)
752
781
// don't allow users to edit full screens
753
if (actarea && actarea->full) {
782
if (actarea && actarea->full)
757
785
if (evt==LEFTMOUSE) {
758
786
moveareas(actedge);
759
787
} else if (evt==MIDDLEMOUSE || evt==RIGHTMOUSE) {
762
if (!actarea->headertype) {
763
edgeop= pupmenu("Split Area|Join Areas|Add Header");
765
edgeop= pupmenu("Split Area|Join Areas|No Header");
769
splitarea_interactive(actarea, actedge);
770
} else if (edgeop==2) {
771
joinarea_interactive(actarea, actedge);
772
} else if (edgeop==3) {
773
scrarea_change_headertype(actarea, actarea->headertype?0:HEADERDOWN);
789
char str[64] = "Split Area%x1|";
791
if(isjoinable(actarea, actedge)) strcat(str, "Join Areas%x2|");
792
if (actarea->headertype) strcat(str, "No Header%x3");
793
else strcat(str, "Add Header%x3");
795
edgeop= pupmenu(str);
796
if (edgeop==1) splitarea_interactive(actarea, actedge);
797
else if (edgeop==2) joinarea_interactive(actarea, actedge);
798
else if (edgeop==3) scrarea_change_headertype(actarea,
799
actarea->headertype?0:HEADERDOWN);
776
801
else blenderqread(evt, val); // global hotkeys
1373
else if(ELEM(event, LEFTARROWKEY, RIGHTARROWKEY)) {
1374
if(textediting==0 && val && (G.qual & LR_CTRLKEY)) {
1375
bScreen *sc= (event==LEFTARROWKEY)?G.curscreen->id.prev:G.curscreen->id.next;
1376
if(is_allowed_to_change_screen(sc)) setscreen(sc);
1398
else if (event==RIGHTARROWKEY) {
1399
if(textediting==0 && val && (G.qual & LR_CTRLKEY)) {
1400
bScreen *sc= G.curscreen->id.next;
1402
/* if screen is last, set it to first */
1404
sc= G.main->screen.first;
1411
else if (event==LEFTARROWKEY) {
1412
if(textediting==0 && val && (G.qual & LR_CTRLKEY)) {
1413
bScreen *sc= G.curscreen->id.prev;
1415
/* if screen is first, set it to last */
1417
sc= G.main->screen.last;
1377
1420
g_activearea= NULL;
2101
2144
winlay_process_events(0);
2102
2145
return window_get_mbut(mainwin);
2104
const GHOST_TabletData* get_tablet_data()
2106
winlay_process_events(0);
2107
return window_get_tablet_data(mainwin);
2148
/* return values of tablet data related functions are documented
2149
* in the Window struct, ghostwinlay.c */
2150
float get_pressure(void)
2152
winlay_process_events(0);
2153
return window_get_pressure(mainwin);
2155
void get_tilt(float *xtilt, float *ytilt)
2157
winlay_process_events(0);
2158
window_get_tilt(mainwin, xtilt, ytilt);
2160
short get_activedevice(void)
2162
winlay_process_events(0);
2163
return window_get_activedevice(mainwin);
2110
2166
void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char ascii)
2160
2216
sc->scene= G.scene;
2162
2218
if (!mainwin) {
2164
//#ifdef _WIN32 // FULLSCREEN
2165
2219
if (G.windowstate == G_WINDOWSTATE_FULLSCREEN)
2166
2220
mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, G_WINDOWSTATE_FULLSCREEN);
2168
2222
mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, start_maximized);
2170
mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, start_maximized);
2173
2224
if (!mainwin) {
2174
2225
printf("ERROR: Unable to open Blender window\n");
3681
/* Simple hack to make sure round corners arntdrawn with the minimal theme,
3682
* Nothing wrong with it IMHO, but just be aware its used so the following
3683
* if's never compare true with HEADERTOP or HEADERDOWN */
3684
if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL)
3685
sa->headertype = -sa->headertype;
3630
3687
/* right border area */
3631
3688
if(sa->headertype==HEADERTOP) sdrawline(x2, y1, x2, y2-SCR_ROUND+1);
3632
3689
else if(sa->headertype==HEADERDOWN) sdrawline(x2, y1+SCR_ROUND-1, x2, y2);
3646
3703
if(sa->headertype==HEADERDOWN) sdrawline(x1+SCR_ROUND-3, y1, x2-SCR_ROUND+3, y1);
3647
3704
else sdrawline(x1, y1, x2, y1);
3706
/* restore real header type */
3707
if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL)
3708
sa->headertype = -sa->headertype;
3651
3711
/* ********************************* */