[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19641] branches/blender2.5/blender/source /blender: 2.5

Ton Roosendaal ton at blender.org
Fri Apr 10 18:30:30 CEST 2009


Revision: 19641
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19641
Author:   ton
Date:     2009-04-10 18:30:28 +0200 (Fri, 10 Apr 2009)

Log Message:
-----------
2.5

Grand cleanup: 
- removal of FTF and ftfont dir
- removal of text.c which wrapped it
- wrapped old text drawing code temporarily, need to decide how 'style'
  will behave per editor when you draw strings outside interface code.... 
  wouldn't be very useful to set fonts locally all over?

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/CMakeLists.txt
    branches/blender2.5/blender/source/blender/Makefile
    branches/blender2.5/blender/source/blender/SConscript
    branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
    branches/blender2.5/blender/source/blender/editors/animation/anim_markers.c
    branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c
    branches/blender2.5/blender/source/blender/editors/include/UI_interface.h
    branches/blender2.5/blender/source/blender/editors/interface/interface.c
    branches/blender2.5/blender/source/blender/editors/interface/interface_draw.c
    branches/blender2.5/blender/source/blender/editors/interface/interface_handlers.c
    branches/blender2.5/blender/source/blender/editors/interface/interface_icons.c
    branches/blender2.5/blender/source/blender/editors/interface/interface_intern.h
    branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c
    branches/blender2.5/blender/source/blender/editors/interface/interface_regions.c
    branches/blender2.5/blender/source/blender/editors/interface/interface_style.c
    branches/blender2.5/blender/source/blender/editors/interface/view2d.c
    branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
    branches/blender2.5/blender/source/blender/editors/space_file/file_draw.c
    branches/blender2.5/blender/source/blender/editors/space_file/file_header.c
    branches/blender2.5/blender/source/blender/editors/space_file/filelist.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c
    branches/blender2.5/blender/source/blender/editors/space_image/image_draw.c
    branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c
    branches/blender2.5/blender/source/blender/editors/space_node/node_draw.c
    branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
    branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c
    branches/blender2.5/blender/source/blender/editors/space_text/text_header.c
    branches/blender2.5/blender/source/blender/editors/util/ed_util.c
    branches/blender2.5/blender/source/blender/windowmanager/intern/wm_init_exit.c

Removed Paths:
-------------
    branches/blender2.5/blender/source/blender/editors/include/UI_text.h
    branches/blender2.5/blender/source/blender/editors/interface/text.c
    branches/blender2.5/blender/source/blender/ftfont/

Modified: branches/blender2.5/blender/source/blender/CMakeLists.txt
===================================================================
--- branches/blender2.5/blender/source/blender/CMakeLists.txt	2009-04-10 14:33:52 UTC (rev 19640)
+++ branches/blender2.5/blender/source/blender/CMakeLists.txt	2009-04-10 16:30:28 UTC (rev 19641)
@@ -26,10 +26,6 @@
 
 SUBDIRS(windowmanager editors avi nodes blenkernel blenlib blenloader blenpluginapi imbuf imbuf/intern/cineon gpu makesdna makesrna radiosity readblenfile render blenfont)
 
-IF(WITH_INTERNATIONAL)
-  SUBDIRS(ftfont)
-ENDIF(WITH_INTERNATIONAL)
-
 IF(WITH_OPENEXR)
   SUBDIRS(imbuf/intern/openexr)
 ENDIF(WITH_OPENEXR)

Modified: branches/blender2.5/blender/source/blender/Makefile
===================================================================
--- branches/blender2.5/blender/source/blender/Makefile	2009-04-10 14:33:52 UTC (rev 19640)
+++ branches/blender2.5/blender/source/blender/Makefile	2009-04-10 16:30:28 UTC (rev 19641)
@@ -36,10 +36,6 @@
 DIRS += python nodes gpu
 DIRS += blenfont
 
-ifeq ($(WITH_FREETYPE2), true)
-	DIRS += ftfont
-endif
-
 ifeq ($(WITH_QUICKTIME), true)
 	DIRS += quicktime
 endif

Modified: branches/blender2.5/blender/source/blender/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/SConscript	2009-04-10 14:33:52 UTC (rev 19640)
+++ branches/blender2.5/blender/source/blender/SConscript	2009-04-10 16:30:28 UTC (rev 19641)
@@ -28,9 +28,6 @@
 if env['WITH_BF_YAFRAY']:
     SConscript(['yafray/SConscript'])
 
-if env['WITH_BF_INTERNATIONAL']:
-    SConscript (['ftfont/SConscript'])
-
 if env['WITH_BF_DDS']:
     SConscript (['imbuf/intern/dds/SConscript'])
 

Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c	2009-04-10 14:33:52 UTC (rev 19640)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c	2009-04-10 16:30:28 UTC (rev 19641)
@@ -62,7 +62,6 @@
 
 #include "UI_interface.h"
 #include "UI_resources.h"
-#include "UI_text.h"
 #include "UI_view2d.h"
 
 /* XXX */
@@ -86,7 +85,7 @@
 		sprintf(str, "   %.2f", FRA2TIME(CFRA));
 	else 
 		sprintf(str, "   %d", CFRA);
-	slen= (short)UI_GetStringWidth(G.font, str, 0) - 1;
+	slen= (short)UI_GetStringWidth(str) - 1;
 	
 	/* get starting coordinates for drawing */
 	x= cfra * xscale;
@@ -98,8 +97,7 @@
 	
 	/* draw current frame number - black text */
 	UI_ThemeColor(TH_TEXT);
-	ui_rasterpos_safe(x-5, y+3, 1.0f);
-	UI_DrawString(G.fonts, str, 0); // XXX may need to be updated for font stuff
+	UI_DrawString(x-5, y+3, str); // XXX may need to be updated for font stuff
 	
 	/* restore view transform */
 	glScalef(xscale, 1.0, 1.0);

Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_markers.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_markers.c	2009-04-10 14:33:52 UTC (rev 19640)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_markers.c	2009-04-10 16:30:28 UTC (rev 19641)
@@ -57,7 +57,6 @@
 #include "UI_interface_icons.h"
 #include "UI_view2d.h"
 #include "UI_resources.h"
-#include "UI_text.h"
 
 #include "ED_markers.h"
 #include "ED_screen.h"
@@ -85,9 +84,6 @@
 
 /* ************* Marker Drawing ************ */
 
-/* XXX */
-extern void ui_rasterpos_safe(float x, float y, float aspect);
-
 /* function to draw markers */
 static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
 {
@@ -140,18 +136,25 @@
 	
 	/* and the marker name too, shifted slightly to the top-right */
 	if (marker->name && marker->name[0]) {
+		float x, y;
+		
 		if(marker->flag & SELECT) {
 			UI_ThemeColor(TH_TEXT_HI);
-			ui_rasterpos_safe(xpos*xscale+4.0, (ypixels<=39.0)?(ypixels-10.0):29.0, 1.0);
+			x= xpos*xscale+4.0;
+			y= (ypixels<=39.0)?(ypixels-10.0):29.0;
 		}
 		else {
 			UI_ThemeColor(TH_TEXT);
-			if((marker->frame <= cfra) && (marker->frame+5 > cfra))
-				ui_rasterpos_safe(xpos*xscale+4.0, (ypixels<=39.0)?(ypixels-10.0):29.0, 1.0);
-			else
-				ui_rasterpos_safe(xpos*xscale+4.0, 17.0, 1.0);
+			if((marker->frame <= cfra) && (marker->frame+5 > cfra)) {
+				x= xpos*xscale+4.0;
+				y= (ypixels<=39.0)?(ypixels-10.0):29.0;
+			}
+			else {
+				x= xpos*xscale+4.0;
+				y= 17.0;
+			}
 		}
-		UI_DrawString(G.font, marker->name, 0);
+		UI_DrawString(x, y, marker->name);
 	}
 	glScalef(xscale, 1.0, 1.0);
 }

Modified: branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c	2009-04-10 14:33:52 UTC (rev 19640)
+++ branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c	2009-04-10 16:30:28 UTC (rev 19641)
@@ -83,7 +83,6 @@
 #include "UI_interface.h"
 #include "UI_interface_icons.h"
 #include "UI_resources.h"
-#include "UI_text.h"
 #include "UI_view2d.h"
 
 #include "ED_anim_api.h"

Modified: branches/blender2.5/blender/source/blender/editors/include/UI_interface.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/UI_interface.h	2009-04-10 14:33:52 UTC (rev 19640)
+++ branches/blender2.5/blender/source/blender/editors/include/UI_interface.h	2009-04-10 16:30:28 UTC (rev 19641)
@@ -292,17 +292,6 @@
 void uiBlockSetButLock(uiBlock *block, int val, char *lockstr);
 void uiBlockClearButLock(uiBlock *block);
 
-/* Appearance/Cruft
- *
- * These functions should mostly dissappear ideally, or become internal.
- * Font handling could move to blenfont/, and appearance could be dictated
- * better by high level information instead of spread out all over. */
-
-void uiSetCurFont(uiBlock *block, int index);
-void *uiSetCurFont_ext(float aspect);
-void uiDefFont(unsigned int index, void *xl, void *large, void *medium, void *small);
-void *uiBlockGetCurFont	(uiBlock *block);
-
 /* automatic aligning, horiz or verical */
 void uiBlockBeginAlign(uiBlock *block);
 void uiBlockEndAlign(uiBlock *block);
@@ -638,7 +627,8 @@
 void uiStyleFontSet(struct uiFontStyle *fs);
 void uiStyleFontDraw(struct uiFontStyle *fs, struct rcti *rect, char *str);
 
+int UI_GetStringWidth(char *str); // XXX temp
+void UI_DrawString(float x, float y, char *str); // XXX temp
 
-
 #endif /*  UI_INTERFACE_H */
 

Deleted: branches/blender2.5/blender/source/blender/editors/include/UI_text.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/UI_text.h	2009-04-10 14:33:52 UTC (rev 19640)
+++ branches/blender2.5/blender/source/blender/editors/include/UI_text.h	2009-04-10 16:30:28 UTC (rev 19641)
@@ -1,53 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef UI_TEXT_H
-#define UI_TEXT_H
-
-struct BMF_Font;
-
-void set_interface_font(char *str); /* headerbuttons.c */
-void start_interface_font(void);	/* headerbuttons.c */
-
-char *fontsize_pup(void);
-
-int UI_DrawString(struct BMF_Font* font, char *str, int translate);
-float UI_GetStringWidth(struct BMF_Font* font, char *str, int translate);
-void UI_GetBoundingBox(struct BMF_Font* font, char* str, int translate, rctf* bbox);
-
-void UI_set_international(int international);
-int UI_get_international(void);
-
-void UI_RasterPos(float x, float y);
-void UI_SetScale(float aspect);
-void ui_text_init_userdef(void);
-
-
-#endif /* UI_TEXT_H */
-

Modified: branches/blender2.5/blender/source/blender/editors/interface/interface.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface.c	2009-04-10 14:33:52 UTC (rev 19640)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface.c	2009-04-10 16:30:28 UTC (rev 19641)
@@ -55,13 +55,7 @@
 #include "BLF_api.h"
 
 #include "UI_interface.h"
-#include "UI_text.h"
 
-#include "BMF_Api.h"
-#ifdef INTERNATIONAL
-#include "FTF_Api.h"
-#endif
-
 #include "ED_screen.h"
 
 #include "WM_api.h"
@@ -88,10 +82,6 @@
 static void ui_free_but(const bContext *C, uiBut *but);
 static void ui_rna_ID_autocomplete(bContext *C, char *str, void *arg_but);
 
-/* ************ GLOBALS ************* */
-
-static uiFontOld UIfont[UI_ARRAY];  // no init needed
-
 /* ************* translation ************** */
 
 int ui_translate_buttons()
@@ -1718,82 +1708,6 @@
 	}
 }
 
-/* ******************* Font ********************/
-
-static void ui_set_ftf_font(float aspect)
-{
-#ifdef INTERNATIONAL
-	if(aspect<1.15) {
-		FTF_SetFontSize('l');
-	}
-	else if(aspect<1.59) {
-		FTF_SetFontSize('m');
-	}
-	else {
-		FTF_SetFontSize('s');
-	}
-#endif
-}
-
-void uiSetCurFont(uiBlock *block, int index)
-{
-	ui_set_ftf_font(block->aspect);
-	
-	if(block->aspect<0.60) {
-		block->curfont= UIfont[index].xl;
-	}
-	else if(block->aspect<1.15) {
-		block->curfont= UIfont[index].large;
-	}
-	else if(block->aspect<1.59) {
-		block->curfont= UIfont[index].medium;		
-	}
-	else {
-		block->curfont= UIfont[index].small;		
-	}
-
-	if(block->curfont==NULL) block->curfont= UIfont[index].large;	
-	if(block->curfont==NULL) block->curfont= UIfont[index].medium;	
-	if(block->curfont==NULL) printf("error block no font %s\n", block->name);
-	
-}
-
-/* called by node editor */
-void *uiSetCurFont_ext(float aspect)
-{
-	void *curfont;
-	

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list